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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# StuRents API Helper

_Master branch is for v2.0 which is not available yet; please check releases for previous versions. For outbound data check 1.3.*, for inbound use 1.2.*_
_Master branch is for v2.0.

Install using composer:

Expand Down
59 changes: 59 additions & 0 deletions src/Models/ContractWithRooms.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ class ContractWithRooms extends ContractAbstract
*/
protected $book_now_url = '';

/**
* A URL where you are able to book a viewing online.
* Will be blank if the property is not set up for this feature
*
* @var string
*/
protected $viewing_url = '';

/**
* Is true if the availability is restricted
*
* @var bool
*/
protected $restricted = false;

/**
* A list of 1 or more prices with optional room name. It may
* be the case that all the price values are equal but still
Expand Down Expand Up @@ -53,6 +68,50 @@ public function setBookNowUrl($book_now_url)
}


/**
* @return string
*/
public function getViewingUrl()
{
return $this->viewing_url;
}


/**
* @param string $viewing_url
*
* @return $this
*/
public function setViewingUrl($viewing_url)
{
$this->viewing_url = $viewing_url;

return $this;
}


/**
* @return bool
*/
public function getRestricted()
{
return $this->restricted;
}


/**
* @param bool $restricted
*
* @return $this
*/
public function setRestricted($restricted)
{
$this->restricted = $restricted;

return $this;
}


/**
* @return PriceOutbound[]
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Media extends SwaggerModel
/**
* Zero or more video embed URLs. Any video source can be
* supplied but at present only videos from YouTube will
* be rendered as embeded videos on the property profile pages
* be rendered as embedded videos on the property profile pages
*
* @var string[]
*/
Expand Down
18 changes: 9 additions & 9 deletions src/Models/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Price extends SwaggerModel
* will be used to calculate total and scheduled payments when
* creating a tenancy and/or rent collection for the property.
*
* @var float
* @var string
* @required
*/
protected $price_per_person_per_week;
Expand All @@ -29,9 +29,9 @@ class Price extends SwaggerModel
* A monetary value indicating the deposit each tenant will be
* expected to pay upon signing a contract to rent the property
*
* @var float
* @var string
*/
protected $deposit_per_person = 0.0;
protected $deposit_per_person = '';

Choose a reason for hiding this comment

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

should this be '0.0' (as a string) to keep default the same while typing correctly?


/**
* A monetary value indicating the fee to the property manager which
Expand All @@ -40,11 +40,11 @@ class Price extends SwaggerModel
*
* @var float
*/
protected $fee_per_person = 0.0;
protected $fee_per_person;
Copy link

@johnjoey johnjoey Sep 29, 2025

Choose a reason for hiding this comment

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

Do we want to remove this default?



/**
* @return float
* @return string
*/
public function getPricePerPersonPerWeek()
{
Expand All @@ -53,7 +53,7 @@ public function getPricePerPersonPerWeek()


/**
* @param float $price_per_person_per_week
* @param string $price_per_person_per_week
*
* @return $this
*/
Expand All @@ -66,7 +66,7 @@ public function setPricePerPersonPerWeek($price_per_person_per_week)


/**
* @return float
* @return string
*/
public function getDepositPerPerson()
{
Expand All @@ -75,7 +75,7 @@ public function getDepositPerPerson()


/**
* @param float $deposit_per_person
* @param string $deposit_per_person
*
* @return $this
*/
Expand All @@ -101,7 +101,7 @@ public function getFeePerPerson()
*
* @return $this
*/
public function setFeePerPerson($fee_per_person)
public function setFeePerPerson(float $fee_per_person)
{
$this->fee_per_person = $fee_per_person;

Expand Down
7 changes: 4 additions & 3 deletions src/Models/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Property extends SwaggerModel

/**
* When designation is set to "pbsa" this describes the total
* number of identical rooms (including those currrently let).
* number of identical rooms (including those currently let).
* If designation is "house" then this should be set to 0
*
* @var int
Expand All @@ -67,7 +67,8 @@ class Property extends SwaggerModel
/**
* When designation is set to “pbsa” this describes the number
* of identical rooms still available. If designation is "house"
* then this should be set to 0
* then this should be set to 0. Please note this field manually
* updated by the property manager so is not live data.
*
* @var int
*/
Expand Down Expand Up @@ -118,7 +119,7 @@ class Property extends SwaggerModel
/**
* The unique ID for a bank account where it is intended that
* the rent for this property will be paid to. This ID can be
* retrived from the /bank-accounts endpoint. Note that this ID
* retrieved from the /bank-accounts endpoint. Note that this ID
* will not contain sensitive information, e.g. account number
* or sort code - that information cannot be retrieved
*
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Room.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class Room extends SwaggerModel
{
/**
* Can be precise, e.g. 1a, or descrptive e.g. "downstairs front"
* Can be precise, e.g. 1a, or descriptive e.g. "downstairs front"
*
* @var string
*/
Expand Down
26 changes: 18 additions & 8 deletions swagger/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -799,14 +799,15 @@ definitions:
type: integer
description: |
When designation is set to "pbsa" this describes the total
number of identical rooms (including those currrently let).
number of identical rooms (including those currently let).
If designation is "house" then this should be set to 0
quantity_available:
type: integer
description: |
When designation is set to “pbsa” this describes the number
of identical rooms still available. If designation is "house"
then this should be set to 0
then this should be set to 0. Please note this field manually
updated by the property manager so is not live data.
room_type:
type: string
description: |
Expand Down Expand Up @@ -839,7 +840,7 @@ definitions:
description: |
The unique ID for a bank account where it is intended that
the rent for this property will be paid to. This ID can be
retrived from the /bank-accounts endpoint. Note that this ID
retrieved from the /bank-accounts endpoint. Note that this ID
will not contain sensitive information, e.g. account number
or sort code - that information cannot be retrieved
accreditations:
Expand Down Expand Up @@ -1006,7 +1007,7 @@ definitions:
description: |
Zero or more video embed URLs. Any video source can be
supplied but at present only videos from YouTube will
be rendered as embeded videos on the property profile pages
be rendered as embedded videos on the property profile pages
items:
type: string
floorplans:
Expand Down Expand Up @@ -1187,6 +1188,15 @@ definitions:
description: |
A URL where the property may be booked online using this contract.
Will be blank if the property is not set up for this feature
viewing_url:
type: string
description: |
A URL where you are able to book a viewing online.
Will be blank if the property is not set up for this feature
restricted:
type: boolean
description: |
Is true if the availability is restricted
prices:
type: array
description: |
Expand Down Expand Up @@ -1316,7 +1326,7 @@ definitions:
- price_per_person_per_week
properties:
price_per_person_per_week:
type: number
type: string
description: |
A monetary value indicating the weekly rent each tenant will
be expected to pay during their tenancy in the property.
Expand All @@ -1326,12 +1336,12 @@ definitions:
will be used to calculate total and scheduled payments when
creating a tenancy and/or rent collection for the property.
deposit_per_person:
type: number
type: string
description: |
A monetary value indicating the deposit each tenant will be
expected to pay upon signing a contract to rent the property
fee_per_person:
type: number
type: float
description: |
A monetary value indicating the fee to the property manager which
each tenant will be expected to pay upon signing a contract to
Expand Down Expand Up @@ -1384,7 +1394,7 @@ definitions:
room_name:
type: string
description: |
Can be precise, e.g. 1a, or descrptive e.g. "downstairs front"
Can be precise, e.g. 1a, or descriptive e.g. "downstairs front"
floor:
type: string
description: |
Expand Down