regis

<back to all web services

TermStatementRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/TermStatements/{uuid}/{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 TermStatementRegistrationResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $course_name=null,
        /** @var string|null */
        public ?string $title=null,
        /** @var string|null */
        public ?string $section_code=null,
        /** @var float */
        public float $amount=0.0,
        /** @var bool|null */
        public ?bool $is_audit=null,
        /** @var string|null */
        public ?string $meeting_days=null,
        /** @var string|null */
        public ?string $times=null,
        /** @var string|null */
        public ?string $room=null,
        /** @var string|null */
        public ?string $instructor=null,
        /** @var string|null */
        public ?string $status=null,
        /** @var float */
        public float $cost=0.0,
        /** @var DateTime|null */
        public ?DateTime $start_date=null,
        /** @var DateTime|null */
        public ?DateTime $end_date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['course_name'])) $this->course_name = $o['course_name'];
        if (isset($o['title'])) $this->title = $o['title'];
        if (isset($o['section_code'])) $this->section_code = $o['section_code'];
        if (isset($o['amount'])) $this->amount = $o['amount'];
        if (isset($o['is_audit'])) $this->is_audit = $o['is_audit'];
        if (isset($o['meeting_days'])) $this->meeting_days = $o['meeting_days'];
        if (isset($o['times'])) $this->times = $o['times'];
        if (isset($o['room'])) $this->room = $o['room'];
        if (isset($o['instructor'])) $this->instructor = $o['instructor'];
        if (isset($o['status'])) $this->status = $o['status'];
        if (isset($o['cost'])) $this->cost = $o['cost'];
        if (isset($o['start_date'])) $this->start_date = JsonConverters::from('DateTime', $o['start_date']);
        if (isset($o['end_date'])) $this->end_date = JsonConverters::from('DateTime', $o['end_date']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->course_name)) $o['course_name'] = $this->course_name;
        if (isset($this->title)) $o['title'] = $this->title;
        if (isset($this->section_code)) $o['section_code'] = $this->section_code;
        if (isset($this->amount)) $o['amount'] = $this->amount;
        if (isset($this->is_audit)) $o['is_audit'] = $this->is_audit;
        if (isset($this->meeting_days)) $o['meeting_days'] = $this->meeting_days;
        if (isset($this->times)) $o['times'] = $this->times;
        if (isset($this->room)) $o['room'] = $this->room;
        if (isset($this->instructor)) $o['instructor'] = $this->instructor;
        if (isset($this->status)) $o['status'] = $this->status;
        if (isset($this->cost)) $o['cost'] = $this->cost;
        if (isset($this->start_date)) $o['start_date'] = JsonConverters::to('DateTime', $this->start_date);
        if (isset($this->end_date)) $o['end_date'] = JsonConverters::to('DateTime', $this->end_date);
        return empty($o) ? new class(){} : $o;
    }
}

class TermStatementChargesResponse implements JsonSerializable
{
    public function __construct(
        /** @var DateTime */
        public DateTime $date=new DateTime(),
        /** @var string|null */
        public ?string $code=null,
        /** @var string|null */
        public ?string $description=null,
        /** @var bool|null */
        public ?bool $is_financial_aid=null,
        /** @var float */
        public float $charge=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['date'])) $this->date = JsonConverters::from('DateTime', $o['date']);
        if (isset($o['code'])) $this->code = $o['code'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['is_financial_aid'])) $this->is_financial_aid = $o['is_financial_aid'];
        if (isset($o['charge'])) $this->charge = $o['charge'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->date)) $o['date'] = JsonConverters::to('DateTime', $this->date);
        if (isset($this->code)) $o['code'] = $this->code;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->is_financial_aid)) $o['is_financial_aid'] = $this->is_financial_aid;
        if (isset($this->charge)) $o['charge'] = $this->charge;
        return empty($o) ? new class(){} : $o;
    }
}

class TermStatementResponse 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 $name=null,
        /** @var string|null */
        public ?string $addr1=null,
        /** @var string|null */
        public ?string $addr2=null,
        /** @var string|null */
        public ?string $city=null,
        /** @var string|null */
        public ?string $state=null,
        /** @var string|null */
        public ?string $country=null,
        /** @var string|null */
        public ?string $code=null,
        /** @var string|null */
        public ?string $reporting_term=null,
        /** @var DateTime */
        public DateTime $reporting_term_start_date=new DateTime(),
        /** @var DateTime */
        public DateTime $reporting_term_end_date=new DateTime(),
        /** @var string|null */
        public ?string $academic_program=null,
        /** @var float */
        public float $total_term_payments=0.0,
        /** @var float */
        public float $total_term_charges=0.0,
        /** @var float */
        public float $total_term_taxes=0.0,
        /** @var array<TermStatementRegistrationResponse>|null */
        public ?array $registrations=null,
        /** @var array<TermStatementChargesResponse>|null */
        public ?array $charges=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['name'])) $this->name = $o['name'];
        if (isset($o['addr1'])) $this->addr1 = $o['addr1'];
        if (isset($o['addr2'])) $this->addr2 = $o['addr2'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['state'])) $this->state = $o['state'];
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['code'])) $this->code = $o['code'];
        if (isset($o['reporting_term'])) $this->reporting_term = $o['reporting_term'];
        if (isset($o['reporting_term_start_date'])) $this->reporting_term_start_date = JsonConverters::from('DateTime', $o['reporting_term_start_date']);
        if (isset($o['reporting_term_end_date'])) $this->reporting_term_end_date = JsonConverters::from('DateTime', $o['reporting_term_end_date']);
        if (isset($o['academic_program'])) $this->academic_program = $o['academic_program'];
        if (isset($o['total_term_payments'])) $this->total_term_payments = $o['total_term_payments'];
        if (isset($o['total_term_charges'])) $this->total_term_charges = $o['total_term_charges'];
        if (isset($o['total_term_taxes'])) $this->total_term_taxes = $o['total_term_taxes'];
        if (isset($o['registrations'])) $this->registrations = JsonConverters::fromArray('TermStatementRegistrationResponse', $o['registrations']);
        if (isset($o['charges'])) $this->charges = JsonConverters::fromArray('TermStatementChargesResponse', $o['charges']);
    }
    
    /** @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->name)) $o['name'] = $this->name;
        if (isset($this->addr1)) $o['addr1'] = $this->addr1;
        if (isset($this->addr2)) $o['addr2'] = $this->addr2;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->state)) $o['state'] = $this->state;
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->code)) $o['code'] = $this->code;
        if (isset($this->reporting_term)) $o['reporting_term'] = $this->reporting_term;
        if (isset($this->reporting_term_start_date)) $o['reporting_term_start_date'] = JsonConverters::to('DateTime', $this->reporting_term_start_date);
        if (isset($this->reporting_term_end_date)) $o['reporting_term_end_date'] = JsonConverters::to('DateTime', $this->reporting_term_end_date);
        if (isset($this->academic_program)) $o['academic_program'] = $this->academic_program;
        if (isset($this->total_term_payments)) $o['total_term_payments'] = $this->total_term_payments;
        if (isset($this->total_term_charges)) $o['total_term_charges'] = $this->total_term_charges;
        if (isset($this->total_term_taxes)) $o['total_term_taxes'] = $this->total_term_taxes;
        if (isset($this->registrations)) $o['registrations'] = JsonConverters::toArray('TermStatementRegistrationResponse', $this->registrations);
        if (isset($this->charges)) $o['charges'] = JsonConverters::toArray('TermStatementChargesResponse', $this->charges);
        return empty($o) ? new class(){} : $o;
    }
}

class TermStatementRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $uuid=null,
        /** @var string|null */
        public ?string $reporting_term=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['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->authorizing_uuid)) $o['authorizing_uuid'] = $this->authorizing_uuid;
        return empty($o) ? new class(){} : $o;
    }
}

PHP TermStatementRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /TermStatements/{uuid}/{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,
	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,
	name: String,
	addr1: String,
	addr2: String,
	city: String,
	state: String,
	country: String,
	code: String,
	reporting_term: String,
	reporting_term_start_date: 0001-01-01,
	reporting_term_end_date: 0001-01-01,
	academic_program: String,
	total_term_payments: 0,
	total_term_charges: 0,
	total_term_taxes: 0,
	registrations: 
	[
		{
			course_name: String,
			title: String,
			section_code: String,
			amount: 0,
			is_audit: False,
			meeting_days: String,
			times: String,
			room: String,
			instructor: String,
			status: String,
			cost: 0,
			start_date: 0001-01-01,
			end_date: 0001-01-01
		}
	],
	charges: 
	[
		{
			date: 0001-01-01,
			code: String,
			description: String,
			is_financial_aid: False,
			charge: 0
		}
	]
}