Skip to content

Lifecycle Functions Overview

INFO

The following table shows only collection types which have a lifecylce and the lifecycles types which are implemented

CollectionTriggerFunctionality
Alternative DirectionsbeforeCreate- add runsite_name for better readbility
ApplicantsafterCreate- if status draft: send out confirmation email to applicant
- if status draft: send out information email to reviewer
- if status published: create a memberentry
Cash ExpensesbeforeCreate- enforce that for expense_type= Free Text free_text_item_content is filled
- enforce amount_spent is not null
Event BannerbeforeCreate- validate start_date and end_date are properly set to enforce only one Event Banner at a time
beforeUpdate- validate start_date and end_date are properly set to enforce only one Event Banner at a time
GuestrecordsbeforeDelete- read the state of the record to be used in afterDelete
afterCreate- lookup all runs for the guest and update last_run_date in guest
GuestsbeforeCreate- enforce contact_no has minimum 8 digits
- allow contact_no to be any number if starts with +00
- enforce contact_no duplicate check on last 10 digits
Guests Sign-inbeforeCreate- enforce duplicate check on entry
beforeDelete- read the state of the record to be used in afterDelete
afterCreate- create the related guest-record
afterUpdate- find the related guest-record and update payment_type and guest_fee there
afterDelete- delete the related guest-record
HarelinebeforeCreate- set run_no and run_date
- enforce the hare member to be active and not exempted from setting runs
beforeUpdate- enforce the hare member to be active and not exempted from setting runs
afterCreate- create and set the run_summary for the run record
LocationsbeforeCreate- prune latitude and longitude to max 4 decimal places
- create the navigation links for Google, Waze and OSM
- enforce duplicate check for existing locations closer than 500m
beforeUpdate- prune latitude and longitude to max 4 decimal places
- create the navigation links for Google, Waze and OSM
MembersbeforeCreate- enforce waist_sizeto be an even number between 24 and 60
- enforce duplicate check based on dob
- set member_id to next id
- set date_joined to today
- set alias to first_name last_name if no aliasprovided
beforeUpdate- enforce waist_sizeto be an even number between 24 and 60
- toogle resigned_date and rejoined_date based on activestatus before and after
Members Sign-InbeforeCreate- enforce duplicate check on entry
beforeDelete- read the state of the record to be used in afterDelete
afterCreate- create the related runrecord
afterDelete- delete the related runrecord
Onsite SalesbeforeCreate'- enforce either member or guest are filled (must have one but not both)
- enforce that sales_item is filled
- enforce that sales_item is not outdated
- enforce that only members can purchase subscriptions
- enforce that Beer Members can only purchase Beer Type subscriptions
- enforce that Non-Beer Members can only purchase Non-Beer Type subscriptions
RunrecordsbeforeCreate- create and set run_summary and member_alias fields
beforeUpdate- enforce no updates on runrecords
beforeDelete- call /members/actualruns and update members actual_runs field
afterCreate- call /members/actualruns and update members actual_runs field
Sales ItemsbeforeUpdate- enforce no updates for item_price, item_type, item_subtype

Released under the MIT License.