Required role: | REGISUserRole |
POST | /Finance/{uuid}/Adjustment/{reporting_term} |
---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class InvoiceItemBalanceResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null,
/** @var int */
public int $rate_id=0,
/** @var string|null */
public ?string $rate_code=null,
/** @var string|null */
public ?string $rate_description=null,
/** @var float */
public float $balance_amount=0.0,
/** @var float */
public float $charge_amount=0.0,
/** @var float */
public float $credit_amount=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
if (isset($o['rate_id'])) $this->rate_id = $o['rate_id'];
if (isset($o['rate_code'])) $this->rate_code = $o['rate_code'];
if (isset($o['rate_description'])) $this->rate_description = $o['rate_description'];
if (isset($o['balance_amount'])) $this->balance_amount = $o['balance_amount'];
if (isset($o['charge_amount'])) $this->charge_amount = $o['charge_amount'];
if (isset($o['credit_amount'])) $this->credit_amount = $o['credit_amount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
if (isset($this->rate_id)) $o['rate_id'] = $this->rate_id;
if (isset($this->rate_code)) $o['rate_code'] = $this->rate_code;
if (isset($this->rate_description)) $o['rate_description'] = $this->rate_description;
if (isset($this->balance_amount)) $o['balance_amount'] = $this->balance_amount;
if (isset($this->charge_amount)) $o['charge_amount'] = $this->charge_amount;
if (isset($this->credit_amount)) $o['credit_amount'] = $this->credit_amount;
return empty($o) ? new class(){} : $o;
}
}
class InvoiceItemAdminResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null,
/** @var string|null */
public ?string $invoiceItemUUID=null,
/** @var int */
public int $rate_id=0,
/** @var string|null */
public ?string $rate_code=null,
/** @var string|null */
public ?string $rate_description=null,
/** @var bool|null */
public ?bool $is_required=null,
/** @var bool|null */
public ?bool $is_optional=null,
/** @var float|null */
public ?float $charge=null,
/** @var float|null */
public ?float $credit=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
if (isset($o['invoiceItemUUID'])) $this->invoiceItemUUID = $o['invoiceItemUUID'];
if (isset($o['rate_id'])) $this->rate_id = $o['rate_id'];
if (isset($o['rate_code'])) $this->rate_code = $o['rate_code'];
if (isset($o['rate_description'])) $this->rate_description = $o['rate_description'];
if (isset($o['is_required'])) $this->is_required = $o['is_required'];
if (isset($o['is_optional'])) $this->is_optional = $o['is_optional'];
if (isset($o['charge'])) $this->charge = $o['charge'];
if (isset($o['credit'])) $this->credit = $o['credit'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
if (isset($this->invoiceItemUUID)) $o['invoiceItemUUID'] = $this->invoiceItemUUID;
if (isset($this->rate_id)) $o['rate_id'] = $this->rate_id;
if (isset($this->rate_code)) $o['rate_code'] = $this->rate_code;
if (isset($this->rate_description)) $o['rate_description'] = $this->rate_description;
if (isset($this->is_required)) $o['is_required'] = $this->is_required;
if (isset($this->is_optional)) $o['is_optional'] = $this->is_optional;
if (isset($this->charge)) $o['charge'] = $this->charge;
if (isset($this->credit)) $o['credit'] = $this->credit;
return empty($o) ? new class(){} : $o;
}
}
class FinanceAdjustmentResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null,
/** @var int */
public int $regent_id=0,
/** @var string|null */
public ?string $uuid=null,
/** @var string|null */
public ?string $reporting_term=null,
/** @var DateTime|null */
public ?DateTime $openFiscalDate=null,
/** @var array<InvoiceItemBalanceResponse>|null */
public ?array $invoiceItemBalances=null,
/** @var array<InvoiceItemAdminResponse>|null */
public ?array $availableInvoiceItems=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
if (isset($o['regent_id'])) $this->regent_id = $o['regent_id'];
if (isset($o['uuid'])) $this->uuid = $o['uuid'];
if (isset($o['reporting_term'])) $this->reporting_term = $o['reporting_term'];
if (isset($o['openFiscalDate'])) $this->openFiscalDate = JsonConverters::from('DateTime', $o['openFiscalDate']);
if (isset($o['invoiceItemBalances'])) $this->invoiceItemBalances = JsonConverters::fromArray('InvoiceItemBalanceResponse', $o['invoiceItemBalances']);
if (isset($o['availableInvoiceItems'])) $this->availableInvoiceItems = JsonConverters::fromArray('InvoiceItemAdminResponse', $o['availableInvoiceItems']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
if (isset($this->regent_id)) $o['regent_id'] = $this->regent_id;
if (isset($this->uuid)) $o['uuid'] = $this->uuid;
if (isset($this->reporting_term)) $o['reporting_term'] = $this->reporting_term;
if (isset($this->openFiscalDate)) $o['openFiscalDate'] = JsonConverters::to('DateTime', $this->openFiscalDate);
if (isset($this->invoiceItemBalances)) $o['invoiceItemBalances'] = JsonConverters::toArray('InvoiceItemBalanceResponse', $this->invoiceItemBalances);
if (isset($this->availableInvoiceItems)) $o['availableInvoiceItems'] = JsonConverters::toArray('InvoiceItemAdminResponse', $this->availableInvoiceItems);
return empty($o) ? new class(){} : $o;
}
}
class FinanceAdjustmentRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $uuid=null,
/** @var string|null */
public ?string $reporting_term=null,
/** @var bool|null */
public ?bool $is_financial_aid=null,
/** @var string|null */
public ?string $authorizing_uuid=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['uuid'])) $this->uuid = $o['uuid'];
if (isset($o['reporting_term'])) $this->reporting_term = $o['reporting_term'];
if (isset($o['is_financial_aid'])) $this->is_financial_aid = $o['is_financial_aid'];
if (isset($o['authorizing_uuid'])) $this->authorizing_uuid = $o['authorizing_uuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->uuid)) $o['uuid'] = $this->uuid;
if (isset($this->reporting_term)) $o['reporting_term'] = $this->reporting_term;
if (isset($this->is_financial_aid)) $o['is_financial_aid'] = $this->is_financial_aid;
if (isset($this->authorizing_uuid)) $o['authorizing_uuid'] = $this->authorizing_uuid;
return empty($o) ? new class(){} : $o;
}
}
PHP FinanceAdjustmentRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Finance/{uuid}/Adjustment/{reporting_term} HTTP/1.1
Host: data.regent-college.edu
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
uuid: String,
reporting_term: String,
is_financial_aid: False,
authorizing_uuid: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }, regent_id: 0, uuid: String, reporting_term: String, openFiscalDate: 0001-01-01, invoiceItemBalances: [ { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }, rate_id: 0, rate_code: String, rate_description: String, balance_amount: 0, charge_amount: 0, credit_amount: 0 } ], availableInvoiceItems: [ { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }, invoiceItemUUID: String, rate_id: 0, rate_code: String, rate_description: String, is_required: False, is_optional: False, charge: 0, credit: 0 } ] }