Guests Sign-in
singularName: guest-sign-inpluralName: guests-sign-ins
Assigns a guest record to a particular run and adds the payment information like guest_fee and payment type
Schema
| Name | Type | Details |
|---|---|---|
| run | relation | manyToOne → Hareline |
| guest | relation | manyToOne → Guests |
| sign_in | boolean | |
| guest_fee | integer | |
| payment_type | enumeration | one of [Not Paid, Cash, DuitNow] |
| idem_guestsignin | relation | oneToOne → Idem-guestsignin |
Lifecycles
beforeCreate (async)
This lifecycle method is triggered before creating a new guest sign-in entry. It checks whether a guest is already signed in for a specific run to prevent duplicate entries. If an entry already exists for the given guest and run, it throws an ApplicationError.
Parameters:
event: - The event object containing the parameters for the new guest sign-in entry.
afterCreate (async)
This lifecycle method is triggered after creating a new guest sign-in entry. It creates a new guest record with the payment information.
Parameters:
event: - The event object containing the newly created guest sign-in entry.
beforeDelete (async)
This lifecycle method is triggered before deleting a guest sign-in entry. It retrieves the associated guest and run details and stores the entity state for use in subsequent lifecycle events.
Parameters:
event: - The event object containing parameters and state.
afterDelete (async)
This lifecycle method is triggered after deleting a guest sign-in entry. It removes the associated guest record from the guest records collection.
Parameters:
event: - The event object containing parameters and state from the deletion process. It includes the entity that was deleted, which contains references to the guest and run.
afterUpdate (async)
This lifecycle method is triggered after updating a guest sign-in entry. It updates the corresponding guest record in the guest records collection with the new payment amount and type.
Parameters:
event: - The event object containing parameters and state from the update process. It includes the updated entity that was modified, which contains the new payment amount and type.
