Skip to content

Commit 63aadf2

Browse files
Merge pull request #7 from foundersandcoders/feature/ap-11-attendance-event-link
feat: add Event link to Attendance table
2 parents 30f70ef + af4fcb5 commit 63aadf2

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

docs/schema.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Schema mapping for Apprentice Pulse. Includes table and field IDs for API integr
99
```
1010
Apprentices (tbl0HJM700Jmd5Oob) - primary learner record
1111
├── Attendace - Apprentice Pulse (tblkDbhJcuT9TTwFc)
12+
│ └── Event → Events - Apprentice Pulse
1213
├── Weekly learning log (tblL2y5NRjyml8XU8)
1314
├── Progress Reviews (Apprentices) (tblXMWiU6DmrrBAZ7)
1415
├── Support log (tblWINmz4JDtVUucD)
@@ -53,15 +54,17 @@ Primary learner record for apprenticeship programme.
5354

5455
**Table ID:** `tblkDbhJcuT9TTwFc`
5556

56-
Attendance tracking using a junction table pattern (one record per apprentice per date).
57+
Attendance tracking using a junction table pattern (one record per apprentice per event).
5758

5859
| Field | ID | Type | Purpose |
5960
|-------|-----|------|---------|
6061
| Id | `fldGdpuw6SoHkQbOs` | autoNumber | Record ID |
6162
| Apprentice | `fldOyo3hlj9Ht0rfZ` | multipleRecordLinks | Links to Apprentices |
62-
| Cohort | `fldn53kWDE8GHg2Yy` | multipleLookupValues | Cohort lookup |
63-
| Date | `fldvXHPmoLlEA8EuN` | date | Session date |
63+
| Event | `fldiHd75LYtopwyN9` | multipleRecordLinks | Links to Events |
64+
| Checkin Time | `fldvXHPmoLlEA8EuN` | dateTime | When student checked in |
6465
| Status | `fldew45fDGpgl1aRr` | singleSelect | Attendance status |
66+
| Date Time (from Event) | `fldokfSk68MhJGlm6` | multipleLookupValues | Event date/time lookup |
67+
| FAC Cohort (from Event) | `fldkc9zLJe7NZVAz1` | multipleLookupValues | Cohort lookup from Event |
6568

6669
---
6770

@@ -216,6 +219,8 @@ Scheduled events/sessions for attendance tracking.
216219
| Date Time | `fld8AkM3EanzZa5QX` | dateTime | Event start date and time |
217220
| Event Type | `fldo7fwAsFhkA1icC` | singleSelect | Regular class, Workshop, Hackathon |
218221
| Survey | `fld9XBHnCWBtZiZah` | url | Optional survey form URL |
222+
| Attendance | `fldcPf53fVfStFZsa` | multipleRecordLinks | Linked attendance records |
223+
| Name - Date | `fld7POykodV0LGsg1` | formula | Display name with date |
219224

220225
---
221226

src/lib/airtable/config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const TABLES = {
99
APPRENTICES: 'tbl0HJM700Jmd5Oob',
1010
STAFF: 'tblJjn62ExE1LVjmx',
1111
EVENTS: 'tblkbskw4fuTq0E9p',
12+
ATTENDANCE: 'tblkDbhJcuT9TTwFc',
1213
} as const;
1314

1415
// Fields - Cohorts
@@ -36,4 +37,15 @@ export const EVENT_FIELDS = {
3637
DATE_TIME: 'fld8AkM3EanzZa5QX', // dateTime (combined date and time)
3738
EVENT_TYPE: 'fldo7fwAsFhkA1icC', // singleSelect (Regular class, Workshop, Hackathon)
3839
SURVEY: 'fld9XBHnCWBtZiZah', // url (optional survey form)
40+
ATTENDANCE: 'fldcPf53fVfStFZsa', // multipleRecordLinks to Attendance (reverse link)
41+
NAME_DATE: 'fld7POykodV0LGsg1', // formula (display name)
42+
} as const;
43+
44+
// Fields - Attendance
45+
export const ATTENDANCE_FIELDS = {
46+
ID: 'fldGdpuw6SoHkQbOs', // autoNumber
47+
APPRENTICE: 'fldOyo3hlj9Ht0rfZ', // multipleRecordLinks to Apprentices
48+
EVENT: 'fldiHd75LYtopwyN9', // multipleRecordLinks to Events
49+
CHECKIN_TIME: 'fldvXHPmoLlEA8EuN', // dateTime
50+
STATUS: 'fldew45fDGpgl1aRr', // singleSelect (Present/Absent/Late)
3951
} as const;

0 commit comments

Comments
 (0)