@epztickets/common 1.85.0 → 1.87.0
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.
- package/build/events/class-category.d.ts +5 -0
- package/build/events/class-category.js +32 -0
- package/build/events/order-created-event.d.ts +1 -0
- package/build/events/orientation-scheduled-event.d.ts +30 -1
- package/build/events/orientation-scheduled-event.js +17 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CLASS_CATEGORIES } from "./orientation-scheduled-event";
|
|
2
|
+
export type ClassCategory = (typeof CLASS_CATEGORIES)[number]["value"];
|
|
3
|
+
export declare const CLASS_CATEGORY_VALUES: string[];
|
|
4
|
+
export declare const isClassCategory: (v: unknown) => v is ClassCategory;
|
|
5
|
+
export declare function inferClassCategory(title?: string | null): ClassCategory | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isClassCategory = exports.CLASS_CATEGORY_VALUES = void 0;
|
|
4
|
+
exports.inferClassCategory = inferClassCategory;
|
|
5
|
+
const orientation_scheduled_event_1 = require("./orientation-scheduled-event");
|
|
6
|
+
exports.CLASS_CATEGORY_VALUES = orientation_scheduled_event_1.CLASS_CATEGORIES.map((c) => c.value);
|
|
7
|
+
const isClassCategory = (v) => typeof v === "string" && exports.CLASS_CATEGORY_VALUES.includes(v);
|
|
8
|
+
exports.isClassCategory = isClassCategory;
|
|
9
|
+
// Best-effort guess of a category from a free-text class name
|
|
10
|
+
// ("Salsa basics" → dance, "BJJ open mat" → martial_arts). Used when a
|
|
11
|
+
// booking arrives without a category (AI chat agent, older clients)
|
|
12
|
+
// and to estimate categories for bookings made before categories
|
|
13
|
+
// existed. Returns undefined when nothing matches.
|
|
14
|
+
const KEYWORDS = [
|
|
15
|
+
["martial_arts", /\b(karate|judo|jiu[- ]?jitsu|bjj|taekwondo|tae kwon do|kung fu|boxing|kickbox\w*|mma|muay thai|self[- ]defen[cs]e|aikido|capoeira|krav maga|wrestling)\b/],
|
|
16
|
+
["yoga", /\b(yoga|pilates|meditat\w*|mindful\w*|stretch\w*|wellness|breathwork|sound bath|tai chi)\b/],
|
|
17
|
+
["dance", /\b(danc\w*|salsa|bachata|ballet|hip[- ]?hop|tango|merengue|cumbia|contemporary|choreo\w*|tap|jazz funk|k-?pop|twerk|ballroom|swing|flamenco|folklorico|breakdanc\w*|heels)\b/],
|
|
18
|
+
["fitness", /\b(fitness|hiit|boot ?camp|crossfit|zumba|workout|strength|spin(ning)?|cardio|barre|conditioning|circuit|bootcamp|personal training|training session)\b/],
|
|
19
|
+
["singing", /\b(sing\w*|vocal\w*|voice|choir|chorus|karaoke|a cappella)\b/],
|
|
20
|
+
["instrumental", /\b(guitar|piano|drum\w*|violin|viola|cello|bass|band|ukulele|sax\w*|trumpet|flute|clarinet|keyboard|instrument\w*|orchestra|jam session|dj)\b/],
|
|
21
|
+
["theater", /\b(theat(er|re)|acting|actor\w*|drama|improv|audition\w*|scene study|monologue|musical theat(er|re)|stage combat)\b/],
|
|
22
|
+
["workshop", /\b(workshop|lecture|seminar|talk|course|training|meeting|info session|q&a|panel)\b/],
|
|
23
|
+
];
|
|
24
|
+
function inferClassCategory(title) {
|
|
25
|
+
if (!title)
|
|
26
|
+
return undefined;
|
|
27
|
+
const t = title.toLowerCase();
|
|
28
|
+
for (const [cat, rx] of KEYWORDS)
|
|
29
|
+
if (rx.test(t))
|
|
30
|
+
return cat;
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
import { Subjects } from "./subjects";
|
|
2
2
|
export type OrientationStatus = "scheduled" | "approved" | "no_show" | "declined" | "cancelled";
|
|
3
|
+
export declare const CLASS_CATEGORIES: readonly [{
|
|
4
|
+
readonly value: "singing";
|
|
5
|
+
readonly label: "Singing / vocal";
|
|
6
|
+
}, {
|
|
7
|
+
readonly value: "instrumental";
|
|
8
|
+
readonly label: "Instrumental";
|
|
9
|
+
}, {
|
|
10
|
+
readonly value: "dance";
|
|
11
|
+
readonly label: "Dance";
|
|
12
|
+
}, {
|
|
13
|
+
readonly value: "fitness";
|
|
14
|
+
readonly label: "Fitness";
|
|
15
|
+
}, {
|
|
16
|
+
readonly value: "theater";
|
|
17
|
+
readonly label: "Theater / acting";
|
|
18
|
+
}, {
|
|
19
|
+
readonly value: "yoga";
|
|
20
|
+
readonly label: "Yoga / Pilates / wellness";
|
|
21
|
+
}, {
|
|
22
|
+
readonly value: "martial_arts";
|
|
23
|
+
readonly label: "Martial arts";
|
|
24
|
+
}, {
|
|
25
|
+
readonly value: "workshop";
|
|
26
|
+
readonly label: "Workshop / lecture";
|
|
27
|
+
}, {
|
|
28
|
+
readonly value: "other";
|
|
29
|
+
readonly label: "Other";
|
|
30
|
+
}];
|
|
31
|
+
export declare const classCategoryLabel: (v?: string) => string | undefined;
|
|
3
32
|
export interface OrientationSnapshot {
|
|
4
33
|
id: string;
|
|
5
34
|
ownerUserId: string;
|
|
@@ -15,7 +44,7 @@ export interface OrientationSnapshot {
|
|
|
15
44
|
status: OrientationStatus;
|
|
16
45
|
sequence: number;
|
|
17
46
|
intendedUse?: string;
|
|
18
|
-
|
|
47
|
+
classCategory?: string;
|
|
19
48
|
notes?: string;
|
|
20
49
|
}
|
|
21
50
|
export interface OrientationScheduledEvent {
|
|
@@ -1,2 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.classCategoryLabel = exports.CLASS_CATEGORIES = void 0;
|
|
4
|
+
// "Category of class" the renter picks on the orientation form.
|
|
5
|
+
// Shared by rooms (validation), notifications (email labels); the
|
|
6
|
+
// frontend keeps a matching copy in lib/orientations.ts.
|
|
7
|
+
exports.CLASS_CATEGORIES = [
|
|
8
|
+
{ value: "singing", label: "Singing / vocal" },
|
|
9
|
+
{ value: "instrumental", label: "Instrumental" },
|
|
10
|
+
{ value: "dance", label: "Dance" },
|
|
11
|
+
{ value: "fitness", label: "Fitness" },
|
|
12
|
+
{ value: "theater", label: "Theater / acting" },
|
|
13
|
+
{ value: "yoga", label: "Yoga / Pilates / wellness" },
|
|
14
|
+
{ value: "martial_arts", label: "Martial arts" },
|
|
15
|
+
{ value: "workshop", label: "Workshop / lecture" },
|
|
16
|
+
{ value: "other", label: "Other" },
|
|
17
|
+
];
|
|
18
|
+
const classCategoryLabel = (v) => { var _a, _b; return (_b = (_a = exports.CLASS_CATEGORIES.find((c) => c.value === v)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : v; };
|
|
19
|
+
exports.classCategoryLabel = classCategoryLabel;
|
package/build/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export * from "./events/orientation-settings-updated-event";
|
|
|
37
37
|
export * from "./events/renter-approval-changed-event";
|
|
38
38
|
export * from "./events/orientation-scheduled-event";
|
|
39
39
|
export * from "./events/orientation-updated-event";
|
|
40
|
+
export * from "./events/class-category";
|
|
40
41
|
export * from "./events/order-cancelled-event";
|
|
41
42
|
export * from "./events/order-completed-event";
|
|
42
43
|
export * from "./events/order-created-event";
|
package/build/index.js
CHANGED
|
@@ -57,6 +57,7 @@ __exportStar(require("./events/orientation-settings-updated-event"), exports);
|
|
|
57
57
|
__exportStar(require("./events/renter-approval-changed-event"), exports);
|
|
58
58
|
__exportStar(require("./events/orientation-scheduled-event"), exports);
|
|
59
59
|
__exportStar(require("./events/orientation-updated-event"), exports);
|
|
60
|
+
__exportStar(require("./events/class-category"), exports);
|
|
60
61
|
__exportStar(require("./events/order-cancelled-event"), exports);
|
|
61
62
|
__exportStar(require("./events/order-completed-event"), exports);
|
|
62
63
|
__exportStar(require("./events/order-created-event"), exports);
|