Class: Availability

Availability

new Availability()

Availability represents the unavailability of an Item between two dates Each of these unavailable timeslots have a reference to an Order or a Reservation for which it's or will be booked

Properties:
Name Type Description
planning string

the planning primary key

item string

the item primary key

from Moment

the from date

to Moment

the to date

order string

the order primary key (if any)

reservation string

the reservation primary key (if any)

Extends

Methods

canDelete(){promise}

Checks via the api if we can delete the Availability document

inherited create(skipRead){promise}

Creates an object by the default api.create

Name Type Description
skipRead

skips reading the response via _fromJson (false)

inherited delete(){promise}

Deletes an object by the default api.delete

inherited discardChanges(){promise}

Discards any changes made to the object from the previously loaded raw response or resets it when no old raw response was found

inherited existsInDb(){boolean}

Checks if the document exists in the database

inherited get(_fields){promise}

Gets an object by the default api.get

Name Type Description
_fields

inherited isDirty(){boolean}

Checks if the object needs to be saved We don't check any of the keyvalues (or comments, attachments) here

isEmpty(){boolean}

Checks if the object is empty, it never is

inherited isValid(){boolean}

Checks if the object is valid

inherited reload(_fields){promise}

Reloads the object from db

Name Type Description
_fields

inherited reset(){promise}

Resets the object

inherited update(skipRead){promise}

Updates an object by the default api.update

Name Type Description
skipRead

skips reading the response via _fromJson (false)