UoaWDCC / uasc-web

Project with the University of Auckland Snowsports Club Website & Booking System. Established in 2023.
https://uasc.co.nz
6 stars 2 forks source link

[BACKEND] Add a signup timestamp to the EventReservation Type #782

Closed bcho892 closed 1 month ago

bcho892 commented 1 month ago

Is your feature request related to a problem? Please describe.

Firebase is unhelpful and doesn't automatically provide a creation timestamp for documents. This Ticket requires us to extend the EventReservation interface to allow us to track when the signup was made.

This timestamp should be omitted from the /events/signup body.

For an example of how this can be implemented see this example from server/src/service-layer/controllers/AdminController.ts

 /**
       * Log that there was a positive change in availability for a date range
       */
      await new BookingHistoryService().addAvailibilityChangeEvent({
        timestamp: Timestamp.now(),
        start_date: startDate,
        end_date: endDate,
        event_type: "changed_date_availability",
        change: slots || DEFAULT_BOOKING_MAX_SLOTS
      })

where Timestamp.now() is used.

BEFORE MERGING