Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 92 additions & 5 deletions src/Models/ContractAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down
50 changes: 46 additions & 4 deletions src/Models/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion src/Requests/DeleteContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct($property_id, $contract_id)
public function sendWith(SwaggerClient $client)
{
return $client->make($this, [
'204' => null,
'204' => '',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure whats caused this change. The 204 response type was added to the api schema in 2018...

'401' => \SturentsLib\Api\Models\AuthError::class,
'404' => \SturentsLib\Api\Models\Error::class,
'default' => \SturentsLib\Api\Models\Error::class
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/DeleteMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/DeleteRoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/GetFacilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GetFacilities extends SwaggerRequest
public function sendWith(SwaggerClient $client)
{
return $client->make($this, [
'200' => null
'200' => ''
]);
}
}
2 changes: 1 addition & 1 deletion src/Requests/PatchContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion src/Requests/PatchProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion src/Requests/PatchRoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion src/Requests/PutContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion src/Requests/PutMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion src/Requests/PutProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion src/Requests/PutRoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion src/Requests/SwaggerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface SwaggerClient {
/**
* @template T of SwaggerModel
*
* @param array<array-key, class-string<T>|null> $response_models
* @param array<array-key, class-string<T>|''> $response_models
* @return T|list<T>
*/
public function make(SwaggerRequest $swagger, array $response_models);
Expand Down
Loading