wedance-shared 1.0.176 → 1.0.178

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.
@@ -12,5 +12,6 @@ export * from "./coupons.js";
12
12
  export * from "./checkin.js";
13
13
  export * from "./pass.js";
14
14
  export * from "./poll.js";
15
+ export * from "./privateClass.js";
15
16
  export * from "./revenue.js";
16
17
  export * from "./festivals/index.js";
@@ -13,6 +13,7 @@ export * from "./coupons.js";
13
13
  export * from "./checkin.js";
14
14
  export * from "./pass.js";
15
15
  export * from "./poll.js";
16
+ export * from "./privateClass.js";
16
17
  export * from "./revenue.js";
17
18
  // Re-export from subdirectories
18
19
  export * from "./festivals/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAE7B,gCAAgC;AAChC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAE7B,gCAAgC;AAChC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,99 @@
1
+ import { CityName, CountryCode } from "./city.js";
2
+ import { DanceTag } from "./event.js";
3
+ import { UserSummary } from "./user.js";
4
+ /**
5
+ * `published` is visible to everyone; `hidden` is suppressed by an admin. A
6
+ * listing is published when first saved, and re-saving never changes the
7
+ * status — a teacher cannot undo an admin having hidden their listing.
8
+ */
9
+ export type PrivateClassStatus = "published" | "hidden";
10
+ /**
11
+ * A known {@link DanceTag}, or any free-text style the teacher typed. The
12
+ * `string & {}` keeps autocomplete on the known tags.
13
+ */
14
+ export type PrivateClassDanceTag = DanceTag | (string & {});
15
+ /** What the teacher charges for: one hour, or one session of any length. */
16
+ export type PrivateClassPriceUnit = "hour" | "session";
17
+ export type PrivateClassPrice = {
18
+ /** MINOR units (cents), like ticket prices. */
19
+ amount: number;
20
+ currency: string;
21
+ unit: PrivateClassPriceUnit;
22
+ };
23
+ /**
24
+ * Row shape for `public.private_classes`: a teacher advertising one-to-one
25
+ * lessons. One listing per teacher, enforced by a unique constraint on
26
+ * `userId`.
27
+ */
28
+ export type PrivateClass = {
29
+ id: string;
30
+ /** Firebase uid of the teacher who owns the listing. */
31
+ userId: string;
32
+ headline: string;
33
+ description: string | null;
34
+ danceTags: PrivateClassDanceTag[];
35
+ /** Languages the teacher can teach in, free text. */
36
+ languages: string[];
37
+ /** School or venue names the teacher also teaches at, free text. */
38
+ teacherAt: string[] | null;
39
+ city: CityName;
40
+ countryCode: CountryCode;
41
+ /** null when the teacher gives no price ("on request"). */
42
+ price: PrivateClassPrice | null;
43
+ contactEmail: string | null;
44
+ contactPhone: string | null;
45
+ linkInstagram: string | null;
46
+ linkWebsite: string | null;
47
+ imageUrl: string | null;
48
+ status: PrivateClassStatus;
49
+ createdAt: string;
50
+ updatedAt: string;
51
+ /**
52
+ * Populated by the server from the Firestore `dancers` collection. Not a
53
+ * column on the private_classes table; null when that document is gone.
54
+ */
55
+ teacher: UserSummary | null;
56
+ };
57
+ /**
58
+ * `PUT /private-classes` — creates or replaces the caller's own listing. A full
59
+ * replace, not a merge: an omitted optional field is cleared, so always send
60
+ * the whole form.
61
+ *
62
+ * `countryCode` is derived server-side from `city` and is not accepted here.
63
+ * Unknown `danceTags` are dropped and at least one must survive.
64
+ */
65
+ export type UpsertPrivateClassInput = {
66
+ /** Max 120 characters. */
67
+ headline: string;
68
+ city: CityName;
69
+ danceTags: PrivateClassDanceTag[];
70
+ /** Free text, cleared when omitted. */
71
+ languages?: string[];
72
+ /** Free text, cleared when omitted. */
73
+ teacherAt?: string[] | null;
74
+ /** Max 2000 characters. */
75
+ description?: string | null;
76
+ /** MINOR units. Requires `priceUnit`; omit for "price on request". */
77
+ priceAmount?: number | null;
78
+ /** Defaults to "eur". */
79
+ priceCurrency?: string | null;
80
+ priceUnit?: PrivateClassPriceUnit | null;
81
+ contactEmail?: string | null;
82
+ contactPhone?: string | null;
83
+ linkInstagram?: string | null;
84
+ linkWebsite?: string | null;
85
+ imageUrl?: string | null;
86
+ };
87
+ /** `GET /private-classes` — every filter is optional. */
88
+ export type ListPrivateClassesQuery = {
89
+ city?: CityName;
90
+ danceTag?: PrivateClassDanceTag;
91
+ /** Admin only, ignored for everyone else. */
92
+ status?: PrivateClassStatus | "all";
93
+ /** Clamped to 1–100. */
94
+ limit?: number;
95
+ };
96
+ /** `PATCH /private-classes/:id/status` — admin only. */
97
+ export type UpdatePrivateClassStatusInput = {
98
+ status: PrivateClassStatus;
99
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=privateClass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"privateClass.js","sourceRoot":"","sources":["../../src/types/privateClass.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wedance-shared",
3
- "version": "1.0.176",
3
+ "version": "1.0.178",
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",