Skip to content

Features

nehars17 edited this page Mar 25, 2021 · 26 revisions

Project Features

Database: AIRTABLE- SAC information and SAC Time Sheet

SAC Information

to record new SACs Admin Card Id to AIRTABLE, go to the SAC information database, scan their cards onto the card reader and then fill up their names and admin numbers

Clocking In

On tapping a card on the card reader, the system will check for the SAC card id in the SAC information AIRTABLE database if the card doesn't exist in the database an error message will pop up, if the id exist, the system will check to see if the date the card is tapped equals to the present date and if the 'Check Out Date-Time' is not already recorded in the AIRTABLE for that user, a successful clocked in message will appear. The check in time and date will then be recorded into AIRTABLE and the status will be 'on-shift'.
The following information will appear in the SAC Time Sheet database:

  • Card Id
  • SAC name
  • Admin number
  • Check in date and time

Clocking Out

If the card is tapped again when the SAC shift ends, the clock out timing will be recorded in AIRTABLE (SAC Time Sheet database), the total time clocked will be automatically calculated in (hh:mm) format and the status will be 'shift ends'

Error Catching:

  1. if the card is tapped again within a minute after the user clocks out, it will trigger the function statusFailAlreadyOut() and an error message will appear
  2. if the card is tapped again one minute after the SAC clocks in, it will trigger the function statusFailAlreadyIn() and an error message will appear

Mailing

After the user clocks out, an email will be sent to the user(school email) with the following information:
subject: "MakerSpaceNYP - Your shift receipt"

  • SAC name
  • Card id
  • Admin number
  • Clock in date and time
  • Clock out date and time

Forget To Clock Out

we have used CronJob to check the AIRTABLE database for SAC who have not clock out aka if the 'Check Out Date-Time' is empty. The 'job' will run everyday at midnight to check for SACs who have not clocked out and change the status to 'Pending' and then send an email using SendGrid to Ms. Winnie and the SAC school account to let them know that the SAC has not clocked out yet

Callback

Brief Definition: A callback is a function passed as an argument to another function. This technique allows a function to call another function. A callback function can run after another function has finished

References for callback:


Note:
AIRTABLE API uses callback
in the project code, we have used callback basically nested callback (callback hell)
Clone this wiki locally