From 112a71daa38580564a680b9668571d8adaa8912d Mon Sep 17 00:00:00 2001 From: johncroker Date: Mon, 26 Jan 2026 16:16:17 +0000 Subject: [PATCH 1/3] update schema to v3 --- src/Requests/DeleteContract.php | 2 +- src/Requests/DeleteMedia.php | 2 +- src/Requests/DeleteRoom.php | 2 +- src/Requests/GetFacilities.php | 2 +- src/Requests/PatchContract.php | 2 +- src/Requests/PatchProperty.php | 2 +- src/Requests/PatchRoom.php | 2 +- src/Requests/PutContract.php | 2 +- src/Requests/PutMedia.php | 2 +- src/Requests/PutProperty.php | 2 +- src/Requests/PutRoom.php | 2 +- src/Requests/SwaggerClient.php | 2 +- swagger/api-upload.yml | 42 +++++++++++++++++++++++++++------ 13 files changed, 47 insertions(+), 19 deletions(-) diff --git a/src/Requests/DeleteContract.php b/src/Requests/DeleteContract.php index 2117317..47d748a 100644 --- a/src/Requests/DeleteContract.php +++ b/src/Requests/DeleteContract.php @@ -44,7 +44,7 @@ public function __construct($property_id, $contract_id) public function sendWith(SwaggerClient $client) { return $client->make($this, [ - '204' => null, + '204' => '', '401' => \SturentsLib\Api\Models\AuthError::class, '404' => \SturentsLib\Api\Models\Error::class, 'default' => \SturentsLib\Api\Models\Error::class diff --git a/src/Requests/DeleteMedia.php b/src/Requests/DeleteMedia.php index 6970a6f..8dbdf7c 100644 --- a/src/Requests/DeleteMedia.php +++ b/src/Requests/DeleteMedia.php @@ -42,7 +42,7 @@ public function __construct($property_id, $media_id) public function sendWith(SwaggerClient $client) { return $client->make($this, [ - '204' => null, + '204' => '', '401' => \SturentsLib\Api\Models\AuthError::class, '404' => \SturentsLib\Api\Models\Error::class, 'default' => \SturentsLib\Api\Models\Error::class diff --git a/src/Requests/DeleteRoom.php b/src/Requests/DeleteRoom.php index 9fcbaad..50bdad6 100644 --- a/src/Requests/DeleteRoom.php +++ b/src/Requests/DeleteRoom.php @@ -43,7 +43,7 @@ public function __construct($property_id, $room_id) public function sendWith(SwaggerClient $client) { return $client->make($this, [ - '204' => null, + '204' => '', '401' => \SturentsLib\Api\Models\AuthError::class, '404' => \SturentsLib\Api\Models\Error::class, 'default' => \SturentsLib\Api\Models\Error::class diff --git a/src/Requests/GetFacilities.php b/src/Requests/GetFacilities.php index 100d8b4..6a50675 100644 --- a/src/Requests/GetFacilities.php +++ b/src/Requests/GetFacilities.php @@ -17,7 +17,7 @@ class GetFacilities extends SwaggerRequest public function sendWith(SwaggerClient $client) { return $client->make($this, [ - '200' => null + '200' => '' ]); } } diff --git a/src/Requests/PatchContract.php b/src/Requests/PatchContract.php index 864ff10..5d8de19 100644 --- a/src/Requests/PatchContract.php +++ b/src/Requests/PatchContract.php @@ -35,7 +35,7 @@ class PatchContract extends SwaggerRequest */ public function setBody(\SturentsLib\Api\Models\ContractCreation $contract) { - $this->body = json_encode($contract, JSON_THROW_ON_ERROR); + $this->body = json_encode($contract); } diff --git a/src/Requests/PatchProperty.php b/src/Requests/PatchProperty.php index 09aac31..4149627 100644 --- a/src/Requests/PatchProperty.php +++ b/src/Requests/PatchProperty.php @@ -26,7 +26,7 @@ class PatchProperty extends SwaggerRequest */ public function setBody(\SturentsLib\Api\Models\Property $property) { - $this->body = json_encode($property, JSON_THROW_ON_ERROR); + $this->body = json_encode($property); } diff --git a/src/Requests/PatchRoom.php b/src/Requests/PatchRoom.php index 3ce1538..a16a63c 100644 --- a/src/Requests/PatchRoom.php +++ b/src/Requests/PatchRoom.php @@ -35,7 +35,7 @@ class PatchRoom extends SwaggerRequest */ public function setBody(\SturentsLib\Api\Models\Room $room) { - $this->body = json_encode($room, JSON_THROW_ON_ERROR); + $this->body = json_encode($room); } diff --git a/src/Requests/PutContract.php b/src/Requests/PutContract.php index 33ee430..04f4318 100644 --- a/src/Requests/PutContract.php +++ b/src/Requests/PutContract.php @@ -26,7 +26,7 @@ class PutContract extends SwaggerRequest */ public function setBody(\SturentsLib\Api\Models\ContractCreation $contract) { - $this->body = json_encode($contract, JSON_THROW_ON_ERROR); + $this->body = json_encode($contract); } diff --git a/src/Requests/PutMedia.php b/src/Requests/PutMedia.php index 3e1d6ef..6840e47 100644 --- a/src/Requests/PutMedia.php +++ b/src/Requests/PutMedia.php @@ -26,7 +26,7 @@ class PutMedia extends SwaggerRequest */ public function setBody(\SturentsLib\Api\Models\MediaUpload $mediaupload) { - $this->body = json_encode($mediaupload, JSON_THROW_ON_ERROR); + $this->body = json_encode($mediaupload); } diff --git a/src/Requests/PutProperty.php b/src/Requests/PutProperty.php index 634ca55..a17c735 100644 --- a/src/Requests/PutProperty.php +++ b/src/Requests/PutProperty.php @@ -15,7 +15,7 @@ class PutProperty extends SwaggerRequest */ public function setBody(\SturentsLib\Api\Models\PropertyCreation $property) { - $this->body = json_encode($property, JSON_THROW_ON_ERROR); + $this->body = json_encode($property); } diff --git a/src/Requests/PutRoom.php b/src/Requests/PutRoom.php index 89ff917..55b536a 100644 --- a/src/Requests/PutRoom.php +++ b/src/Requests/PutRoom.php @@ -26,7 +26,7 @@ class PutRoom extends SwaggerRequest */ public function setBody(\SturentsLib\Api\Models\Room $room) { - $this->body = json_encode($room, JSON_THROW_ON_ERROR); + $this->body = json_encode($room); } diff --git a/src/Requests/SwaggerClient.php b/src/Requests/SwaggerClient.php index 0782892..83fc8f6 100644 --- a/src/Requests/SwaggerClient.php +++ b/src/Requests/SwaggerClient.php @@ -9,7 +9,7 @@ interface SwaggerClient { /** * @template T of SwaggerModel * - * @param array|null> $response_models + * @param array|''> $response_models * @return T|list */ public function make(SwaggerRequest $swagger, array $response_models); diff --git a/swagger/api-upload.yml b/swagger/api-upload.yml index 1c23908..edf4773 100644 --- a/swagger/api-upload.yml +++ b/swagger/api-upload.yml @@ -1070,26 +1070,37 @@ definitions: required: - title - start_date - - end_date - - min_contract_days + - is_fixed_term properties: title: type: string description: The name given to this contract + is_fixed_term: + type: boolean + description: | + Describes whether this contract is fixed term or rolling start_date: type: string description: | The earliest date at which it is possible to move in to the property in yyyy-mm-dd format + latest_start_date: + type: string + description: | + The latest date at which it is possible to move in to the property for a rolling contract. This is required if is_fixed_term is false. end_date: type: string description: | The latest date at which it is possible to vacate the property - in yyyy-mm-dd format + in yyyy-mm-dd format for a fixed term contract. This is required if is_fixed_term is true. min_contract_days: type: integer description: | - The minimum time a tenant may rent the property for in days + The minimum time a tenant may rent the property for in days for a fixed term contract. This is required if is_fixed_term is true. + monthly_payment_day: + type: integer + description: | + The day of the month that rent is due for rolling contracts. Valid day values are 1 to 28. This is required if is_fixed_term is false. utilities: $ref: '#/definitions/Utilities' restrictions: @@ -1243,10 +1254,17 @@ definitions: price_per_person_per_week: type: number description: | - A monetary value indicating the weekly rent each tenant will - be expected to pay during their tenancy in the property. + For fixed term contracts, this is the monetary value indicating + the weekly rent each tenant will be expected to pay during their + tenancy in the property. + + For rolling contracts, this is the monetary value indicating the + daily rent each tenant will pay for the first payment period. + The first payment period covers the rent from the start date to + the day before the first rolling monthly payment day. The first payment rent + is calculated based on the number of days in the period multiplied by the per day rate. - This does not mean the rent is paid weekly - the StuRents + Whether fixed or rolling, this does not mean the rent is paid weekly or daily - the StuRents search and profiles display all rents as a weekly amount and this will be used to calculate total and scheduled payments when creating a tenancy and/or rent collection for the property @@ -1261,6 +1279,16 @@ definitions: A monetary value indicating the fee to the property manager which each tenant will be expected to pay upon signing a contract to rent the property + rolling_price_per_person_per_month: + type: number + description: | + A monetary value indicating the monthly rent each tenant will + be expected to pay during their rolling tenancy in the property. + This is required if is_fixed_term is false + + The StuRents search and profiles display all rents as a weekly amount and this + will be used to calculate total and scheduled payments when + creating a tenancy and/or rent collection for the property PriceOutbound: description: | When fetching property details this describes a Price attached From 789e2d5edff6b127e84da47807e638b4d9c658c4 Mon Sep 17 00:00:00 2001 From: johncroker Date: Tue, 27 Jan 2026 11:20:53 +0000 Subject: [PATCH 2/3] update schema to v3 --- src/Models/ContractAbstract.php | 97 +++++++++++++++++++++++++++++++-- src/Models/Price.php | 50 +++++++++++++++-- swagger/api-upload.yml | 3 +- swagger/api.yml | 45 ++++++++++++--- 4 files changed, 177 insertions(+), 18 deletions(-) diff --git a/src/Models/ContractAbstract.php b/src/Models/ContractAbstract.php index 5c32e50..b20195a 100644 --- a/src/Models/ContractAbstract.php +++ b/src/Models/ContractAbstract.php @@ -16,6 +16,14 @@ class ContractAbstract extends SwaggerModel */ protected $title; + /** + * Describes whether this contract is fixed term or rolling + * + * @var bool + * @required + */ + protected $is_fixed_term; + /** * The earliest date at which it is possible to move in to the property * in yyyy-mm-dd format @@ -25,22 +33,35 @@ class ContractAbstract extends SwaggerModel */ protected $start_date; + /** + * The latest date at which it is possible to move in to the property for a rolling contract. This is required if is_fixed_term is false. + * + * @var string + */ + protected $latest_start_date = ''; + /** * The latest date at which it is possible to vacate the property - * in yyyy-mm-dd format + * in yyyy-mm-dd format for a fixed term contract. This is required if is_fixed_term is true. * * @var string - * @required */ - protected $end_date; + protected $end_date = ''; /** * The minimum time a tenant may rent the property for in days + * for a fixed term contract. This is required if is_fixed_term is true. + * + * @var int + */ + protected $min_contract_days = 0; + + /** + * The day of the month that rent is due for rolling contracts. Valid day values are 1 to 28. This is required if is_fixed_term is false. * * @var int - * @required */ - protected $min_contract_days; + protected $monthly_payment_day = 0; /** * @var Utilities @@ -76,6 +97,28 @@ public function setTitle($title) } + /** + * @return bool + */ + public function getIsFixedTerm() + { + return $this->is_fixed_term; + } + + + /** + * @param bool $is_fixed_term + * + * @return $this + */ + public function setIsFixedTerm($is_fixed_term) + { + $this->is_fixed_term = $is_fixed_term; + + return $this; + } + + /** * @return string */ @@ -98,6 +141,28 @@ public function setStartDate($start_date) } + /** + * @return string + */ + public function getLatestStartDate() + { + return $this->latest_start_date; + } + + + /** + * @param string $latest_start_date + * + * @return $this + */ + public function setLatestStartDate($latest_start_date) + { + $this->latest_start_date = $latest_start_date; + + return $this; + } + + /** * @return string */ @@ -142,6 +207,28 @@ public function setMinContractDays($min_contract_days) } + /** + * @return int + */ + public function getMonthlyPaymentDay() + { + return $this->monthly_payment_day; + } + + + /** + * @param int $monthly_payment_day + * + * @return $this + */ + public function setMonthlyPaymentDay($monthly_payment_day) + { + $this->monthly_payment_day = $monthly_payment_day; + + return $this; + } + + /** * @return Utilities */ diff --git a/src/Models/Price.php b/src/Models/Price.php index 78f84fb..69cb315 100644 --- a/src/Models/Price.php +++ b/src/Models/Price.php @@ -12,13 +12,20 @@ class Price extends SwaggerModel { /** - * A monetary value indicating the weekly rent each tenant will - * be expected to pay during their tenancy in the property. + * For fixed term contracts, this is the monetary value indicating + * the weekly rent each tenant will be expected to pay during their + * tenancy in the property. * - * This does not mean the rent is paid weekly - the StuRents + * For rolling contracts, this is the monetary value indicating the + * daily rent each tenant will pay for the first payment period. + * The first payment period covers the rent from the start date to + * the day before the first rolling monthly payment day. The first payment rent + * is calculated based on the number of days in the period multiplied by the per day rate. + * + * Whether fixed or rolling, this does not mean the rent is paid weekly or daily - the StuRents * search and profiles display all rents as a weekly amount and this * will be used to calculate total and scheduled payments when - * creating a tenancy and/or rent collection for the property. + * creating a tenancy and/or rent collection for the property * * @var float * @required @@ -42,6 +49,19 @@ class Price extends SwaggerModel */ protected $fee_per_person = 0.0; + /** + * A monetary value indicating the monthly rent each tenant will + * be expected to pay during their rolling tenancy in the property. + * This is required if is_fixed_term is false + * + * The StuRents search and profiles display all rents as a weekly amount and this + * will be used to calculate total and scheduled payments when + * creating a tenancy and/or rent collection for the property + * + * @var float + */ + protected $rolling_price_per_person_per_month = 0.0; + /** * @return float @@ -107,4 +127,26 @@ public function setFeePerPerson($fee_per_person) return $this; } + + + /** + * @return float + */ + public function getRollingPricePerPersonPerMonth() + { + return $this->rolling_price_per_person_per_month; + } + + + /** + * @param float $rolling_price_per_person_per_month + * + * @return $this + */ + public function setRollingPricePerPersonPerMonth($rolling_price_per_person_per_month) + { + $this->rolling_price_per_person_per_month = $rolling_price_per_person_per_month; + + return $this; + } } diff --git a/swagger/api-upload.yml b/swagger/api-upload.yml index edf4773..51fbd23 100644 --- a/swagger/api-upload.yml +++ b/swagger/api-upload.yml @@ -1096,7 +1096,8 @@ definitions: min_contract_days: type: integer description: | - The minimum time a tenant may rent the property for in days for a fixed term contract. This is required if is_fixed_term is true. + The minimum time a tenant may rent the property for in days + for a fixed term contract. This is required if is_fixed_term is true. monthly_payment_day: type: integer description: | diff --git a/swagger/api.yml b/swagger/api.yml index c59b242..b59afc3 100644 --- a/swagger/api.yml +++ b/swagger/api.yml @@ -1134,26 +1134,38 @@ definitions: required: - title - start_date - - end_date - - min_contract_days + - is_fixed_term properties: title: type: string description: The name given to this contract + is_fixed_term: + type: boolean + description: | + Describes whether this contract is fixed term or rolling start_date: type: string description: | The earliest date at which it is possible to move in to the property in yyyy-mm-dd format + latest_start_date: + type: string + description: | + The latest date at which it is possible to move in to the property for a rolling contract. This is required if is_fixed_term is false. end_date: type: string description: | The latest date at which it is possible to vacate the property - in yyyy-mm-dd format + in yyyy-mm-dd format for a fixed term contract. This is required if is_fixed_term is true. min_contract_days: type: integer description: | - The minimum time a tenant may rent the property for in days + The minimum time a tenant may rent the property for in days + for a fixed term contract. This is required if is_fixed_term is true. + monthly_payment_day: + type: integer + description: | + The day of the month that rent is due for rolling contracts. Valid day values are 1 to 28. This is required if is_fixed_term is false. utilities: $ref: '#/definitions/Utilities' restrictions: @@ -1320,13 +1332,20 @@ definitions: price_per_person_per_week: type: number description: | - A monetary value indicating the weekly rent each tenant will - be expected to pay during their tenancy in the property. + For fixed term contracts, this is the monetary value indicating + the weekly rent each tenant will be expected to pay during their + tenancy in the property. + + For rolling contracts, this is the monetary value indicating the + daily rent each tenant will pay for the first payment period. + The first payment period covers the rent from the start date to + the day before the first rolling monthly payment day. The first payment rent + is calculated based on the number of days in the period multiplied by the per day rate. - This does not mean the rent is paid weekly - the StuRents + Whether fixed or rolling, this does not mean the rent is paid weekly or daily - the StuRents search and profiles display all rents as a weekly amount and this will be used to calculate total and scheduled payments when - creating a tenancy and/or rent collection for the property. + creating a tenancy and/or rent collection for the property deposit_per_person: type: number description: | @@ -1338,6 +1357,16 @@ definitions: A monetary value indicating the fee to the property manager which each tenant will be expected to pay upon signing a contract to rent the property + rolling_price_per_person_per_month: + type: number + description: | + A monetary value indicating the monthly rent each tenant will + be expected to pay during their rolling tenancy in the property. + This is required if is_fixed_term is false + + The StuRents search and profiles display all rents as a weekly amount and this + will be used to calculate total and scheduled payments when + creating a tenancy and/or rent collection for the property PriceOutbound: description: | When fetching property details this describes a Price attached From 3eb6568e826df31f040272d981966cf7aed03365 Mon Sep 17 00:00:00 2001 From: johncroker Date: Tue, 27 Jan 2026 11:29:28 +0000 Subject: [PATCH 3/3] full stop --- swagger/api-upload.yml | 2 +- swagger/api.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/swagger/api-upload.yml b/swagger/api-upload.yml index 51fbd23..73bf6a0 100644 --- a/swagger/api-upload.yml +++ b/swagger/api-upload.yml @@ -1268,7 +1268,7 @@ definitions: Whether fixed or rolling, this does not mean the rent is paid weekly or daily - the StuRents search and profiles display all rents as a weekly amount and this will be used to calculate total and scheduled payments when - creating a tenancy and/or rent collection for the property + creating a tenancy and/or rent collection for the property. deposit_per_person: type: number description: | diff --git a/swagger/api.yml b/swagger/api.yml index b59afc3..4c39e64 100644 --- a/swagger/api.yml +++ b/swagger/api.yml @@ -1366,7 +1366,7 @@ definitions: The StuRents search and profiles display all rents as a weekly amount and this will be used to calculate total and scheduled payments when - creating a tenancy and/or rent collection for the property + creating a tenancy and/or rent collection for the property. PriceOutbound: description: | When fetching property details this describes a Price attached