corporateacademy-rent

Methods

(static) abortRent(rent, itemId, newStatusType, statusNote, token) → {Rent}

Abort a rent request.

Parameters:
Name Type Description
rent Rent

Required by the action: The rent object with alla relevant data set

itemId string

Required by the action: The itemId of the Item linked to the rent

newStatusType string

Required by the action: The new status to add

statusNote string

Optional by the action: The additional note

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/abort-rent
Returns:

The updated rent object

Type
Rent

(static) countRentsByAny(searchedText, openedOnly, expiredOnly, referenceId, onlyForMe, token) → {number}

Count the result list of rentable items

Parameters:
Name Type Description
searchedText string

Optional by the action: The text provided by the user to start the search

openedOnly boolean

Optional for the action: Limit the check to the rentable items not returned

expiredOnly boolean

Optional for the action: Limit the check to the rentable items that have passed the expectedEndDate

referenceId string

Optional by the action: Specify the referenceId of the linked entity

onlyForMe boolean

Optional for the action: Limit the check to the user that made the request

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/count-rents-by-any
Returns:

The number of Items that match the search criteria

Type
number

(static) createRent(rent, itemId, token) → {Rent}

Create a new rent

Parameters:
Name Type Description
rent Rent

Required by the action: The rent object with alla relevant data set

itemId string

Required by the action: The itemId of the Item linked to the rent

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-rent
Returns:

The new created rent object

Type
Rent

(static) getRentsByAny(searchedText, fromRecord, numRecords, allData, openedOnly, expiredOnly, referenceId, onlyForMe, token) → {Array.<Item>}

Search items in the external search engine

Parameters:
Name Type Description
searchedText string

Optional by the action: The text provided by the user to start the search

fromRecord number

Required by the action: The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required by the action: The number of records to load

allData boolean | string

Optional for the action: If passed with true value, all data will be returned (fromRecord and numRecords are not required)

openedOnly boolean

Optional for the action: Limit the check to the rentable items not returned

expiredOnly boolean

Optional for the action: Limit the check to the rentable items that have passed the expectedEndDate

referenceId string

Optional by the action: Specify the referenceId of the linked entity

onlyForMe boolean

Optional for the action: Limit the check to the user that made the request

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-rents-by-any
Returns:

The Items list that match the search criteria

Type
Array.<Item>

(static) hasReferenceOpenRents(referenceId, onlyForMe, token) → {boolean}

Indicates if an object has at least one non closed rent

Parameters:
Name Type Description
referenceId string

Required by the action: Specify the referenceId of the linked entity

onlyForMe boolean | string

Optional for the action: Limit the check to the user that made the request

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/has-reference-open-rents
Returns:

True if there is at least one open rent

Type
boolean

(static) listRentsByAny(fromRecord, numRecords, allData, originApplicationName, rentType, referenceType, withSyllabusItemLoaded, withUserLoaded, statusTypeToFilter, attributeTypes, attributeValues, withRentAttributeLangsLoaded, searchedText, rentYear, groupId, getOldRentStatusForConflictRows, token) → {Array.<Rent>}

Retrieve the Rent that math filters

Parameters:
Name Type Description
fromRecord number

Required: The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required: The number of records to load

allData boolean

Optional: If true, all records will be retrieved

originApplicationName string | Array.<string>

Required: Origin application name(s) used to search rents

rentType string | Array.<string>

Required: Type of the rents to retireve

referenceType string | Array.<string>

Optional: References types used to search on the rents

withSyllabusItemLoaded boolean

Optional: If true, retrieve the syllabus too

withUserLoaded boolean

Optional: If true, retrieve the user associated to the rent

statusTypeToFilter string | Array.<string>

Optional: status types of the rents

attributeTypes string | Array.<string>

Optional: Specify the names of attributes the rent must has

attributeValues string | Array.<string>

Optional: Specify the values of attributes the rent must has

withRentAttributeLangsLoaded boolean

Optional: If true, retrieve the attribute langs with the langCode of the user

searchedText string

Optional: The searched text that will be matched in cid, forename and surname fields

rentYear string

Optional: The year of the rent to filter

groupId string

Optional: Id of the group from where the userIds will be retrieved

getOldRentStatusForConflictRows boolean

Optional: If true, will be retrieved the last-1 rent status if the rent is in current status: conflict

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/list-rents-by-any
Returns:

An array with all rents

Type
Array.<Rent>

(static) updateRent(rent, itemId, newStatusType, statusNote, token) → {Rent}

Update an rent so the whole structure must be passed with the atrtibute.

Parameters:
Name Type Description
rent Rent

Required by the action: The rent object with alla relevant data set

itemId string

Required by the action: The itemId of the Item linked to the rent

newStatusType string

Optional by the action: The new status to add

statusNote string

Optional by the action: The additional note

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/update-rent
Returns:

The updated rent object

Type
Rent