wedance-shared 1.0.198 → 1.0.202

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.
@@ -45,6 +45,13 @@ export interface Pass {
45
45
  paymentMethod: PaymentMethod;
46
46
  issuedBy: string | null | undefined;
47
47
  }
48
+ /**
49
+ * Lightweight pass projection for student profiles, enrollments, and session access.
50
+ * Populated server-side via a join.
51
+ */
52
+ export type PassSummary = Pick<Pass, "id" | "productType" | "creditsTotal" | "creditsRemaining" | "validFrom" | "validUntil" | "status"> & {
53
+ ticketType: TicketTypeSummary;
54
+ };
48
55
  export interface SchoolPass extends Pass {
49
56
  studentId: string;
50
57
  }
@@ -1,3 +1,4 @@
1
+ import type { PassSummary } from "./pass.js";
1
2
  export type SchoolStudentStatus = "active" | "inactive";
2
3
  export type SchoolStaffRole = "owner" | "admin" | "instructor";
3
4
  export type SchoolStaffAccessLevel = "full" | "limited" | "invited" | "none";
@@ -20,6 +21,14 @@ export interface SchoolStudent {
20
21
  phone: string | null;
21
22
  status: SchoolStudentStatus;
22
23
  notes: string | null;
24
+ /**
25
+ * Populated by the server with a join. Not a column on the school_students table.
26
+ */
27
+ passes?: PassSummary[];
28
+ /**
29
+ * Populated by the server with a join. Not a column on the school_students table.
30
+ */
31
+ enrollments?: ClassEnrollmentSummary[];
23
32
  createdAt: string;
24
33
  updatedAt: string;
25
34
  }
@@ -187,6 +196,49 @@ export type ClassSessionSummary = Pick<ClassSession, "id" | "classId" | "startsA
187
196
  instructor?: SchoolStaffSummary | null;
188
197
  secondaryInstructor?: SchoolStaffSummary | null;
189
198
  };
199
+ /**
200
+ * The dancer-facing projections, served unauthenticated by `/school/public/*`.
201
+ *
202
+ * Deliberately narrower than the SchoolXSummary types above rather than reusing them:
203
+ * SchoolStaffSummary carries `email`, `roles`, `status` and `userId`, and publishing an
204
+ * instructor's address and Firebase uid on an open endpoint is exactly what these avoid.
205
+ */
206
+ export type PublicStaffSummary = Pick<SchoolStaff, "id" | "firstName" | "lastName">;
207
+ export type PublicRoomSummary = Pick<SchoolRoom, "id" | "name" | "color">;
208
+ /**
209
+ * SchoolClassSummary minus `status` — a public list only ever contains active classes, so
210
+ * the field would carry no information — and plus `description`, which the class detail
211
+ * screen needs and which a second public route just for it would not be worth.
212
+ */
213
+ export type PublicClassSummary = Pick<SchoolClass, "id" | "name" | "description" | "level" | "danceTags" | "format" | "capacity" | "capacityLead" | "capacityFollow" | "defaultClassDurationMinutes">;
214
+ /**
215
+ * One occurrence of a class as an unauthenticated caller sees it. Every capacity is already
216
+ * resolved server side, so a client never reads a raw override.
217
+ */
218
+ export interface PublicClassSession {
219
+ id: string;
220
+ classId: string;
221
+ startsAt: string;
222
+ endsAt: string;
223
+ status: ClassSessionStatus;
224
+ locationName: string | null;
225
+ locationAddress: string | null;
226
+ /** capacityOverride ?? the class capacity. Null means unlimited. */
227
+ effectiveCapacity: number | null;
228
+ /** Null unless the class is partnered: only a partnered class has role pools. */
229
+ effectiveCapacityLead: number | null;
230
+ effectiveCapacityFollow: number | null;
231
+ /** Bookings holding a seat. Waitlisted rows hold none and are counted separately. */
232
+ bookedCount: number;
233
+ bookedLeadCount: number;
234
+ bookedFollowCount: number;
235
+ waitlistCount: number;
236
+ class: PublicClassSummary;
237
+ /** The session's own room, with no fallback to the class default. */
238
+ room: PublicRoomSummary | null;
239
+ instructor: PublicStaffSummary | null;
240
+ secondaryInstructor: PublicStaffSummary | null;
241
+ }
190
242
  /** Row shape for `public.class_enrollments`. */
191
243
  export interface ClassEnrollment {
192
244
  id: string;
@@ -217,10 +269,10 @@ export type ClassEnrollmentListItem = ClassEnrollment & {
217
269
  class: SchoolClassSummary;
218
270
  };
219
271
  /**
220
- * Lightweight enrollment projection for course-based session access.
272
+ * Lightweight enrollment projection for student profiles and session access.
221
273
  * Populated server-side via a join.
222
274
  */
223
- export type ClassEnrollmentSummary = Pick<ClassEnrollment, "id" | "status" | "danceRole" | "enrolledAt" | "sourceType">;
275
+ export type ClassEnrollmentSummary = Pick<ClassEnrollment, "id" | "classId" | "status" | "danceRole" | "enrolledAt" | "sourceType">;
224
276
  /** Row shape for `public.class_session_registrations`. */
225
277
  export interface ClassSessionRegistration {
226
278
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wedance-shared",
3
- "version": "1.0.198",
3
+ "version": "1.0.202",
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",