wedance-shared 1.0.199 → 1.0.203

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.
@@ -1,4 +1,5 @@
1
1
  import type { PassSummary } from "./pass.js";
2
+ import type { ProductType } from "./ticket.js";
2
3
  export type SchoolStudentStatus = "active" | "inactive";
3
4
  export type SchoolStaffRole = "owner" | "admin" | "instructor";
4
5
  export type SchoolStaffAccessLevel = "full" | "limited" | "invited" | "none";
@@ -8,7 +9,8 @@ export type ClassSessionStatus = "scheduled" | "completed" | "cancelled";
8
9
  export type ClassEnrollmentStatus = "active" | "cancelled" | "completed";
9
10
  export type ClassEnrollmentSourceType = "manual" | "purchase";
10
11
  export type ClassSessionRegistrationStatus = "booked" | "waitlisted" | "attended" | "absent" | "no_show" | "cancelled";
11
- export type ClassSessionAccessType = "course" | "pass" | "drop_in" | "membership" | "free" | "manual";
12
+ /** How a student gained access to a session — sellable products plus non-purchase paths. */
13
+ export type ClassSessionAccessType = Exclude<ProductType, "event"> | "free" | "manual";
12
14
  export type DancerRole = "lead" | "follow";
13
15
  /** Row shape for `public.school_students`. */
14
16
  export interface SchoolStudent {
@@ -196,6 +198,49 @@ export type ClassSessionSummary = Pick<ClassSession, "id" | "classId" | "startsA
196
198
  instructor?: SchoolStaffSummary | null;
197
199
  secondaryInstructor?: SchoolStaffSummary | null;
198
200
  };
201
+ /**
202
+ * The dancer-facing projections, served unauthenticated by `/school/public/*`.
203
+ *
204
+ * Deliberately narrower than the SchoolXSummary types above rather than reusing them:
205
+ * SchoolStaffSummary carries `email`, `roles`, `status` and `userId`, and publishing an
206
+ * instructor's address and Firebase uid on an open endpoint is exactly what these avoid.
207
+ */
208
+ export type PublicStaffSummary = Pick<SchoolStaff, "id" | "firstName" | "lastName">;
209
+ export type PublicRoomSummary = Pick<SchoolRoom, "id" | "name" | "color">;
210
+ /**
211
+ * SchoolClassSummary minus `status` — a public list only ever contains active classes, so
212
+ * the field would carry no information — and plus `description`, which the class detail
213
+ * screen needs and which a second public route just for it would not be worth.
214
+ */
215
+ export type PublicClassSummary = Pick<SchoolClass, "id" | "name" | "description" | "level" | "danceTags" | "format" | "capacity" | "capacityLead" | "capacityFollow" | "defaultClassDurationMinutes">;
216
+ /**
217
+ * One occurrence of a class as an unauthenticated caller sees it. Every capacity is already
218
+ * resolved server side, so a client never reads a raw override.
219
+ */
220
+ export interface PublicClassSession {
221
+ id: string;
222
+ classId: string;
223
+ startsAt: string;
224
+ endsAt: string;
225
+ status: ClassSessionStatus;
226
+ locationName: string | null;
227
+ locationAddress: string | null;
228
+ /** capacityOverride ?? the class capacity. Null means unlimited. */
229
+ effectiveCapacity: number | null;
230
+ /** Null unless the class is partnered: only a partnered class has role pools. */
231
+ effectiveCapacityLead: number | null;
232
+ effectiveCapacityFollow: number | null;
233
+ /** Bookings holding a seat. Waitlisted rows hold none and are counted separately. */
234
+ bookedCount: number;
235
+ bookedLeadCount: number;
236
+ bookedFollowCount: number;
237
+ waitlistCount: number;
238
+ class: PublicClassSummary;
239
+ /** The session's own room, with no fallback to the class default. */
240
+ room: PublicRoomSummary | null;
241
+ instructor: PublicStaffSummary | null;
242
+ secondaryInstructor: PublicStaffSummary | null;
243
+ }
199
244
  /** Row shape for `public.class_enrollments`. */
200
245
  export interface ClassEnrollment {
201
246
  id: string;
@@ -1,6 +1,5 @@
1
1
  import { City } from "./city.js";
2
2
  import { DanceTag } from "./event.js";
3
- import { Ticket } from "./ticket.js";
4
3
  import { LanguageCode } from "./other.js";
5
4
  export type Role = "admin" | "manager" | "organiser" | "user" | "checkin";
6
5
  export type User = {
@@ -16,8 +15,6 @@ export type User = {
16
15
  createdAt: string;
17
16
  lastUpdated?: string;
18
17
  lastConnected?: string;
19
- savedEvents: string[];
20
- goingEvents: string[];
21
18
  role: Role;
22
19
  city: City | null;
23
20
  favoriteDance?: DanceTag;
@@ -28,7 +25,6 @@ export type User = {
28
25
  appVersion?: string;
29
26
  deviceModel?: string;
30
27
  platform?: string;
31
- tickets?: Ticket[];
32
28
  emailVerified: boolean;
33
29
  stripeId?: string;
34
30
  profilePicture?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wedance-shared",
3
- "version": "1.0.199",
3
+ "version": "1.0.203",
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",