wedance-shared 1.0.188 → 1.0.190

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,11 @@ export interface SchoolStudent {
23
23
  createdAt: string;
24
24
  updatedAt: string;
25
25
  }
26
+ /**
27
+ * Lightweight student projection for rosters, attendance, and check-in.
28
+ * Populated server-side via a join.
29
+ */
30
+ export type SchoolStudentSummary = Pick<SchoolStudent, "id" | "firstName" | "lastName" | "email" | "phone" | "status" | "userId">;
26
31
  /** Row shape for `public.school_staff`. */
27
32
  export interface SchoolStaff {
28
33
  id: string;
@@ -42,6 +47,30 @@ export interface SchoolStaff {
42
47
  createdAt: string;
43
48
  updatedAt: string;
44
49
  }
50
+ /**
51
+ * Lightweight staff projection for schedule and class display.
52
+ * Populated server-side via a join.
53
+ */
54
+ export type SchoolStaffSummary = Pick<SchoolStaff, "id" | "firstName" | "lastName" | "email" | "roles" | "status" | "userId">;
55
+ export type SchoolRoomStatus = "active" | "inactive";
56
+ /** Row shape for `public.school_rooms`. */
57
+ export interface SchoolRoom {
58
+ id: string;
59
+ organizerId: string;
60
+ name: string;
61
+ location: string | null;
62
+ capacity: number | null;
63
+ color: string | null;
64
+ position: number;
65
+ status: SchoolRoomStatus;
66
+ createdAt: string;
67
+ updatedAt: string;
68
+ }
69
+ /**
70
+ * Lightweight room projection for schedule and session display.
71
+ * Populated server-side via a join.
72
+ */
73
+ export type SchoolRoomSummary = Pick<SchoolRoom, "id" | "name" | "location" | "color" | "capacity">;
45
74
  /** Row shape for `public.school_classes`. */
46
75
  export interface SchoolClass {
47
76
  id: string;
@@ -51,14 +80,48 @@ export interface SchoolClass {
51
80
  danceTags: string[];
52
81
  level: string | null;
53
82
  capacity: number | null;
83
+ capacityLead: number | null;
84
+ capacityFollow: number | null;
54
85
  instructorStaffId: string | null;
55
86
  secondaryInstructorStaffId: string | null;
87
+ roomId: string | null;
88
+ /** Class booking format (e.g. open vs lead/follow). */
89
+ format: string;
90
+ /** Recurrence rule for generating sessions. */
91
+ recurrence: string;
92
+ /** Weekdays to repeat on (0 = Sunday … 6 = Saturday). Empty when not recurring. */
93
+ repeatWeekdays: number[];
94
+ /** Default session start time (`HH:MM:SS` / `HH:MM`). */
95
+ defaultStartTime: string | null;
96
+ seriesStartsOn: string | null;
97
+ seriesEndsOn: string | null;
56
98
  /** Fallback session length when a session has no explicit endsAt override. */
57
99
  defaultClassDurationMinutes: number | null;
58
100
  status: SchoolClassStatus;
101
+ /**
102
+ * Populated by the server with a join. Not a column on the school_classes table.
103
+ */
104
+ room?: SchoolRoomSummary;
105
+ /**
106
+ * Populated by the server with a join. Not a column on the school_classes table.
107
+ */
108
+ instructor?: SchoolStaffSummary | null;
109
+ /**
110
+ * Populated by the server with a join. Not a column on the school_classes table.
111
+ */
112
+ secondaryInstructor?: SchoolStaffSummary | null;
59
113
  createdAt: string;
60
114
  updatedAt: string;
61
115
  }
116
+ /**
117
+ * Lightweight class projection with the info needed when a class is
118
+ * attached to a session or enrollment. Populated server-side via a join.
119
+ */
120
+ export type SchoolClassSummary = Pick<SchoolClass, "id" | "name" | "level" | "danceTags" | "format" | "status" | "capacity" | "capacityLead" | "capacityFollow" | "instructorStaffId" | "secondaryInstructorStaffId" | "defaultClassDurationMinutes"> & {
121
+ room?: SchoolRoomSummary;
122
+ instructor?: SchoolStaffSummary | null;
123
+ secondaryInstructor?: SchoolStaffSummary | null;
124
+ };
62
125
  /** Row shape for `public.class_sessions`. */
63
126
  export interface ClassSession {
64
127
  id: string;
@@ -70,10 +133,50 @@ export interface ClassSession {
70
133
  locationName: string | null;
71
134
  locationAddress: string | null;
72
135
  roomId: string | null;
136
+ /** Overrides the parent class capacity for this session only. */
137
+ capacityOverride: number | null;
73
138
  status: ClassSessionStatus;
139
+ cancellationReason: string | null;
140
+ cancelledAt: string | null;
141
+ notifiedAt: string | null;
142
+ /** capacityOverride ?? the parent class capacity, resolved server side. */
143
+ effectiveCapacity: number | null;
144
+ /** Bookings holding a seat. Counts exactly what the capacity check counts.
145
+ * They must be read-only. They are calculated by the server. Never set them. */
146
+ bookedCount: number;
147
+ bookedLeadCount: number;
148
+ bookedFollowCount: number;
149
+ /** Separate by design: waitlisted rows hold no seat and never count towards capacity. */
150
+ waitlistCount: number;
151
+ /**
152
+ * Populated by the server with a join. Not a column on the class_sessions table.
153
+ */
154
+ class?: SchoolClassSummary;
155
+ /**
156
+ * Populated by the server with a join. Not a column on the class_sessions table.
157
+ */
158
+ room?: SchoolRoomSummary;
159
+ /**
160
+ * Populated by the server with a join. Not a column on the class_sessions table.
161
+ */
162
+ instructor?: SchoolStaffSummary | null;
163
+ /**
164
+ * Populated by the server with a join. Not a column on the class_sessions table.
165
+ */
166
+ secondaryInstructor?: SchoolStaffSummary | null;
74
167
  createdAt: string;
75
168
  updatedAt: string;
76
169
  }
170
+ /**
171
+ * Lightweight session projection for registration lists and attendance.
172
+ * Populated server-side via a join.
173
+ */
174
+ export type ClassSessionSummary = Pick<ClassSession, "id" | "classId" | "startsAt" | "endsAt" | "status" | "locationName" | "locationAddress" | "roomId" | "instructorStaffId" | "secondaryInstructorStaffId"> & {
175
+ class?: SchoolClassSummary;
176
+ room?: SchoolRoomSummary;
177
+ instructor?: SchoolStaffSummary | null;
178
+ secondaryInstructor?: SchoolStaffSummary | null;
179
+ };
77
180
  /** Row shape for `public.class_enrollments`. */
78
181
  export interface ClassEnrollment {
79
182
  id: string;
@@ -82,11 +185,26 @@ export interface ClassEnrollment {
82
185
  status: ClassEnrollmentStatus;
83
186
  sourceType: ClassEnrollmentSourceType;
84
187
  sourcePassId: string | null;
188
+ role: DancerRole | null;
85
189
  enrolledAt: string;
190
+ waitlistedAt: string | null;
86
191
  cancelledAt: string | null;
192
+ /**
193
+ * Populated by the server with a join. Not a column on the class_enrollments table.
194
+ */
195
+ class?: SchoolClassSummary;
196
+ /**
197
+ * Populated by the server with a join. Not a column on the class_enrollments table.
198
+ */
199
+ student?: SchoolStudentSummary;
87
200
  createdAt: string;
88
201
  updatedAt: string;
89
202
  }
203
+ /**
204
+ * Lightweight enrollment projection for course-based session access.
205
+ * Populated server-side via a join.
206
+ */
207
+ export type ClassEnrollmentSummary = Pick<ClassEnrollment, "id" | "status" | "role" | "enrolledAt" | "sourceType">;
90
208
  /** Row shape for `public.class_session_registrations`. */
91
209
  export interface ClassSessionRegistration {
92
210
  id: string;
@@ -97,23 +215,28 @@ export interface ClassSessionRegistration {
97
215
  passId: string | null;
98
216
  passRedemptionId: string | null;
99
217
  bookedAt: string;
218
+ waitlistedAt: string | null;
100
219
  checkedInAt: string | null;
220
+ attendanceMarkedAt: string | null;
101
221
  cancelledAt: string | null;
102
- createdAt: string;
103
- updatedAt: string;
104
222
  role: DancerRole | null;
105
- }
106
- export type SchoolRoomStatus = "active" | "inactive";
107
- /** Row shape for `public.school_rooms`. */
108
- export interface SchoolRoom {
109
- id: string;
110
- organizerId: string;
111
- name: string;
112
- location: string | null;
113
- capacity: number | null;
114
- color: string | null;
115
- position: number;
116
- status: SchoolRoomStatus;
223
+ /**
224
+ * Populated by the server with a join. Not a column on the class_session_registrations table.
225
+ */
226
+ session?: ClassSessionSummary;
227
+ /**
228
+ * Populated by the server with a join. Not a column on the class_session_registrations table.
229
+ */
230
+ student?: SchoolStudentSummary;
231
+ /**
232
+ * Populated by the server with a join. Not a column on the class_session_registrations table.
233
+ */
234
+ class?: SchoolClassSummary;
235
+ /**
236
+ * Populated by the server with a join when access is course-based.
237
+ * Not a column on the class_session_registrations table.
238
+ */
239
+ enrollment?: ClassEnrollmentSummary;
117
240
  createdAt: string;
118
241
  updatedAt: string;
119
242
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wedance-shared",
3
- "version": "1.0.188",
3
+ "version": "1.0.190",
4
4
  "description": "This repository contains shared TypeScript types and interfaces used across multiple WeDance applications:",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",