Required role: | REGISUserRole |
POST | /Registration/{uuid}/Drop/{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 DropRegistrationResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $student_section_uuid=null,
/** @var string|null */
public ?string $course_name=null,
/** @var string|null */
public ?string $section_code=null,
/** @var string|null */
public ?string $title=null,
/** @var string|null */
public ?string $term=null,
/** @var float */
public float $amount=0.0,
/** @var bool|null */
public ?bool $is_audit=null,
/** @var bool|null */
public ?bool $is_grade_final=null,
/** @var bool|null */
public ?bool $is_provisional=null,
/** @var bool|null */
public ?bool $is_selected_to_drop=null,
/** @var float */
public float $suggested_refund_percentage=0.0,
/** @var float */
public float $suggested_refund_amount=0.0,
/** @var float */
public float $balance_amount=0.0,
/** @var float */
public float $charge_amount=0.0,
/** @var float */
public float $credit_amount=0.0,
/** @var string|null */
public ?string $description=null,
/** @var string|null */
public ?string $additional_rate_description=null,
/** @var int|null */
public ?int $additional_rate_id=null,
/** @var float|null */
public ?float $additional_rate_amount=null,
/** @var float|null */
public ?float $additional_rate_suggested_refund_percentage=null,
/** @var float|null */
public ?float $additional_rate_suggested_refund_amount=null,
/** @var string|null */
public ?string $benefit_description=null,
/** @var string|null */
public ?string $second_benefit_description=null,
/** @var int|null */
public ?int $benefit_rate_id=null,
/** @var float|null */
public ?float $benefit_amount=null,
/** @var float|null */
public ?float $second_benefit_amount=null,
/** @var int|null */
public ?int $second_benefit_rate_id=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['student_section_uuid'])) $this->student_section_uuid = $o['student_section_uuid'];
if (isset($o['course_name'])) $this->course_name = $o['course_name'];
if (isset($o['section_code'])) $this->section_code = $o['section_code'];
if (isset($o['title'])) $this->title = $o['title'];
if (isset($o['term'])) $this->term = $o['term'];
if (isset($o['amount'])) $this->amount = $o['amount'];
if (isset($o['is_audit'])) $this->is_audit = $o['is_audit'];
if (isset($o['is_grade_final'])) $this->is_grade_final = $o['is_grade_final'];
if (isset($o['is_provisional'])) $this->is_provisional = $o['is_provisional'];
if (isset($o['is_selected_to_drop'])) $this->is_selected_to_drop = $o['is_selected_to_drop'];
if (isset($o['suggested_refund_percentage'])) $this->suggested_refund_percentage = $o['suggested_refund_percentage'];
if (isset($o['suggested_refund_amount'])) $this->suggested_refund_amount = $o['suggested_refund_amount'];
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'];
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['additional_rate_description'])) $this->additional_rate_description = $o['additional_rate_description'];
if (isset($o['additional_rate_id'])) $this->additional_rate_id = $o['additional_rate_id'];
if (isset($o['additional_rate_amount'])) $this->additional_rate_amount = $o['additional_rate_amount'];
if (isset($o['additional_rate_suggested_refund_percentage'])) $this->additional_rate_suggested_refund_percentage = $o['additional_rate_suggested_refund_percentage'];
if (isset($o['additional_rate_suggested_refund_amount'])) $this->additional_rate_suggested_refund_amount = $o['additional_rate_suggested_refund_amount'];
if (isset($o['benefit_description'])) $this->benefit_description = $o['benefit_description'];
if (isset($o['second_benefit_description'])) $this->second_benefit_description = $o['second_benefit_description'];
if (isset($o['benefit_rate_id'])) $this->benefit_rate_id = $o['benefit_rate_id'];
if (isset($o['benefit_amount'])) $this->benefit_amount = $o['benefit_amount'];
if (isset($o['second_benefit_amount'])) $this->second_benefit_amount = $o['second_benefit_amount'];
if (isset($o['second_benefit_rate_id'])) $this->second_benefit_rate_id = $o['second_benefit_rate_id'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->student_section_uuid)) $o['student_section_uuid'] = $this->student_section_uuid;
if (isset($this->course_name)) $o['course_name'] = $this->course_name;
if (isset($this->section_code)) $o['section_code'] = $this->section_code;
if (isset($this->title)) $o['title'] = $this->title;
if (isset($this->term)) $o['term'] = $this->term;
if (isset($this->amount)) $o['amount'] = $this->amount;
if (isset($this->is_audit)) $o['is_audit'] = $this->is_audit;
if (isset($this->is_grade_final)) $o['is_grade_final'] = $this->is_grade_final;
if (isset($this->is_provisional)) $o['is_provisional'] = $this->is_provisional;
if (isset($this->is_selected_to_drop)) $o['is_selected_to_drop'] = $this->is_selected_to_drop;
if (isset($this->suggested_refund_percentage)) $o['suggested_refund_percentage'] = $this->suggested_refund_percentage;
if (isset($this->suggested_refund_amount)) $o['suggested_refund_amount'] = $this->suggested_refund_amount;
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;
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->additional_rate_description)) $o['additional_rate_description'] = $this->additional_rate_description;
if (isset($this->additional_rate_id)) $o['additional_rate_id'] = $this->additional_rate_id;
if (isset($this->additional_rate_amount)) $o['additional_rate_amount'] = $this->additional_rate_amount;
if (isset($this->additional_rate_suggested_refund_percentage)) $o['additional_rate_suggested_refund_percentage'] = $this->additional_rate_suggested_refund_percentage;
if (isset($this->additional_rate_suggested_refund_amount)) $o['additional_rate_suggested_refund_amount'] = $this->additional_rate_suggested_refund_amount;
if (isset($this->benefit_description)) $o['benefit_description'] = $this->benefit_description;
if (isset($this->second_benefit_description)) $o['second_benefit_description'] = $this->second_benefit_description;
if (isset($this->benefit_rate_id)) $o['benefit_rate_id'] = $this->benefit_rate_id;
if (isset($this->benefit_amount)) $o['benefit_amount'] = $this->benefit_amount;
if (isset($this->second_benefit_amount)) $o['second_benefit_amount'] = $this->second_benefit_amount;
if (isset($this->second_benefit_rate_id)) $o['second_benefit_rate_id'] = $this->second_benefit_rate_id;
return empty($o) ? new class(){} : $o;
}
}
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 DropRegistrationsResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null,
/** @var string|null */
public ?string $transaction_uuid=null,
/** @var int */
public int $regent_id=0,
/** @var string|null */
public ?string $uuid=null,
/** @var string|null */
public ?string $reporting_term=null,
/** @var float */
public float $suggested_drop_fee=0.0,
/** @var bool|null */
public ?bool $suggested_full_student_fee_refund=null,
/** @var array<string>|null */
public ?array $messages=null,
/** @var array<DropRegistrationResponse>|null */
public ?array $registrations=null,
/** @var array<InvoiceItemBalanceResponse>|null */
public ?array $invoiceItemBalances=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
if (isset($o['transaction_uuid'])) $this->transaction_uuid = $o['transaction_uuid'];
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['suggested_drop_fee'])) $this->suggested_drop_fee = $o['suggested_drop_fee'];
if (isset($o['suggested_full_student_fee_refund'])) $this->suggested_full_student_fee_refund = $o['suggested_full_student_fee_refund'];
if (isset($o['messages'])) $this->messages = JsonConverters::fromArray('string', $o['messages']);
if (isset($o['registrations'])) $this->registrations = JsonConverters::fromArray('DropRegistrationResponse', $o['registrations']);
if (isset($o['invoiceItemBalances'])) $this->invoiceItemBalances = JsonConverters::fromArray('InvoiceItemBalanceResponse', $o['invoiceItemBalances']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
if (isset($this->transaction_uuid)) $o['transaction_uuid'] = $this->transaction_uuid;
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->suggested_drop_fee)) $o['suggested_drop_fee'] = $this->suggested_drop_fee;
if (isset($this->suggested_full_student_fee_refund)) $o['suggested_full_student_fee_refund'] = $this->suggested_full_student_fee_refund;
if (isset($this->messages)) $o['messages'] = JsonConverters::toArray('string', $this->messages);
if (isset($this->registrations)) $o['registrations'] = JsonConverters::toArray('DropRegistrationResponse', $this->registrations);
if (isset($this->invoiceItemBalances)) $o['invoiceItemBalances'] = JsonConverters::toArray('InvoiceItemBalanceResponse', $this->invoiceItemBalances);
return empty($o) ? new class(){} : $o;
}
}
class DropRegistrationsRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $uuid=null,
/** @var string|null */
public ?string $reporting_term=null,
/** @var array<DropRegistrationResponse>|null */
public ?array $registrations=null,
/** @var DateTime|null */
public ?DateTime $override_drop_date=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['registrations'])) $this->registrations = JsonConverters::fromArray('DropRegistrationResponse', $o['registrations']);
if (isset($o['override_drop_date'])) $this->override_drop_date = JsonConverters::from('DateTime', $o['override_drop_date']);
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->registrations)) $o['registrations'] = JsonConverters::toArray('DropRegistrationResponse', $this->registrations);
if (isset($this->override_drop_date)) $o['override_drop_date'] = JsonConverters::to('DateTime', $this->override_drop_date);
if (isset($this->authorizing_uuid)) $o['authorizing_uuid'] = $this->authorizing_uuid;
return empty($o) ? new class(){} : $o;
}
}
PHP DropRegistrationsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Registration/{uuid}/Drop/{reporting_term} HTTP/1.1
Host: data.regent-college.edu
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"uuid":"String","reporting_term":"String","registrations":[{"student_section_uuid":"String","course_name":"String","section_code":"String","title":"String","term":"String","amount":0,"is_audit":false,"is_grade_final":false,"is_provisional":false,"is_selected_to_drop":false,"suggested_refund_percentage":0,"suggested_refund_amount":0,"balance_amount":0,"charge_amount":0,"credit_amount":0,"description":"String","additional_rate_description":"String","additional_rate_id":0,"additional_rate_amount":0,"additional_rate_suggested_refund_percentage":0,"additional_rate_suggested_refund_amount":0,"benefit_description":"String","second_benefit_description":"String","benefit_rate_id":0,"benefit_amount":0,"second_benefit_amount":0,"second_benefit_rate_id":0}],"override_drop_date":"0001-01-01T00:00:00.0000000","authorizing_uuid":"String"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"transaction_uuid":"String","regent_id":0,"uuid":"String","reporting_term":"String","suggested_drop_fee":0,"suggested_full_student_fee_refund":false,"messages":["String"],"registrations":[{"student_section_uuid":"String","course_name":"String","section_code":"String","title":"String","term":"String","amount":0,"is_audit":false,"is_grade_final":false,"is_provisional":false,"is_selected_to_drop":false,"suggested_refund_percentage":0,"suggested_refund_amount":0,"balance_amount":0,"charge_amount":0,"credit_amount":0,"description":"String","additional_rate_description":"String","additional_rate_id":0,"additional_rate_amount":0,"additional_rate_suggested_refund_percentage":0,"additional_rate_suggested_refund_amount":0,"benefit_description":"String","second_benefit_description":"String","benefit_rate_id":0,"benefit_amount":0,"second_benefit_amount":0,"second_benefit_rate_id":0}],"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}]}