@nimee/shared-types 1.0.329 → 1.0.332
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/dist/account/account.d.ts +2 -0
- package/dist/account/account.js.map +1 -1
- package/dist/crm/calendarEvent.d.ts +9 -1
- package/dist/crm/calendarEvent.js +3 -0
- package/dist/crm/calendarEvent.js.map +1 -1
- package/dist/crm/groupOrder.d.ts +71 -0
- package/dist/crm/groupOrder.js +35 -0
- package/dist/crm/groupOrder.js.map +1 -0
- package/dist/crm/index.d.ts +1 -0
- package/dist/crm/index.js +1 -0
- package/dist/crm/index.js.map +1 -1
- package/dist/event/ticket.d.ts +10 -1
- package/dist/event/ticket.js +9 -0
- package/dist/event/ticket.js.map +1 -1
- package/dist/send-notification/sqs.d.ts +4 -2
- package/dist/send-notification/sqs.js +4 -0
- package/dist/send-notification/sqs.js.map +1 -1
- package/package.json +1 -1
- package/src/account/account.ts +2 -0
- package/src/crm/calendarEvent.ts +10 -0
- package/src/crm/groupOrder.ts +68 -0
- package/src/crm/index.ts +1 -0
- package/src/event/ticket.ts +9 -0
- package/src/send-notification/sqs.ts +4 -0
|
@@ -247,6 +247,8 @@ export interface IAccountModel {
|
|
|
247
247
|
isBookable?: boolean;
|
|
248
248
|
isBookableWithTickets?: boolean;
|
|
249
249
|
hasCashier?: boolean;
|
|
250
|
+
/** Dashboard "הזמנות קבוצות" (CRM group orders) enabled — lives on the top-level seller account */
|
|
251
|
+
hasGroupOrders?: boolean;
|
|
250
252
|
origin?: string;
|
|
251
253
|
shouldSendInvoice?: boolean;
|
|
252
254
|
invoiceProvider?: InvoiceProviderType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/account/account.ts"],"names":[],"mappings":";;;AAMA,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,iEAAW,CAAA;IACX,iEAAW,CAAA;IACX,iEAAW,CAAA;IACX,mEAAY,CAAA;IACZ,+DAAU,CAAA;IACV,+DAAU,CAAA;IACV,iEAAW,CAAA;IACX,6DAAS,CAAA;IACT,6DAAS,CAAA;AACX,CAAC,EAVW,kBAAkB,kCAAlB,kBAAkB,QAU7B;AACD,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;IACjB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,sCAAqB,CAAA;AACvB,CAAC,EAVW,aAAa,6BAAb,aAAa,QAUxB;AACD,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,kDAA6B,CAAA;IAC7B,kDAA6B,CAAA;IAC7B,sCAAiB,CAAA;IACjB,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,0CAAqB,CAAA;AACvB,CAAC,EARW,iBAAiB,iCAAjB,iBAAiB,QAQ5B;AAgBD,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,8CAAqB,CAAA;AACvB,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC;AAMD,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,wEAAwE;IACxE,oCAAa,CAAA;AACf,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAED,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,gDAA0B,CAAA;IAC1B,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,gGAAgG;IAChG,uDAAiC,CAAA;AACnC,CAAC,EANW,kBAAkB,kCAAlB,kBAAkB,QAM7B;
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/account/account.ts"],"names":[],"mappings":";;;AAMA,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,iEAAW,CAAA;IACX,iEAAW,CAAA;IACX,iEAAW,CAAA;IACX,mEAAY,CAAA;IACZ,+DAAU,CAAA;IACV,+DAAU,CAAA;IACV,iEAAW,CAAA;IACX,6DAAS,CAAA;IACT,6DAAS,CAAA;AACX,CAAC,EAVW,kBAAkB,kCAAlB,kBAAkB,QAU7B;AACD,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;IACjB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,sCAAqB,CAAA;AACvB,CAAC,EAVW,aAAa,6BAAb,aAAa,QAUxB;AACD,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,kDAA6B,CAAA;IAC7B,kDAA6B,CAAA;IAC7B,sCAAiB,CAAA;IACjB,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,0CAAqB,CAAA;AACvB,CAAC,EARW,iBAAiB,iCAAjB,iBAAiB,QAQ5B;AAgBD,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,8CAAqB,CAAA;AACvB,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC;AAMD,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,wEAAwE;IACxE,oCAAa,CAAA;AACf,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAED,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,gDAA0B,CAAA;IAC1B,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,gGAAgG;IAChG,uDAAiC,CAAA;AACnC,CAAC,EANW,kBAAkB,kCAAlB,kBAAkB,QAM7B;AA6QD,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,6CAAuB,CAAA;IACvB,yCAAmB,CAAA;AACrB,CAAC,EANW,kBAAkB,kCAAlB,kBAAkB,QAM7B"}
|
|
@@ -24,12 +24,14 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
26
|
import mongoose from "mongoose";
|
|
27
|
+
import { IGroupOrderStatus } from "./groupOrder";
|
|
27
28
|
export declare enum ICalendarEventType {
|
|
28
29
|
TABLE_RESERVATION = "TABLE_RESERVATION",
|
|
29
30
|
TOUR = "TOUR",
|
|
30
31
|
TASK = "TASK",
|
|
31
32
|
REGULAR = "REGULAR",
|
|
32
|
-
WELLNESS = "WELLNESS"
|
|
33
|
+
WELLNESS = "WELLNESS",
|
|
34
|
+
GROUP_VISIT = "GROUP_VISIT"
|
|
33
35
|
}
|
|
34
36
|
export declare enum TaskStatus {
|
|
35
37
|
PENDING = "pending",
|
|
@@ -95,6 +97,12 @@ export interface ICalendarEventModel {
|
|
|
95
97
|
createdAt: Date;
|
|
96
98
|
}[];
|
|
97
99
|
};
|
|
100
|
+
/** GROUP_VISIT only — the calendar `status` stays "scheduled"; the order status lives here */
|
|
101
|
+
groupVisit?: {
|
|
102
|
+
groupOrderId: string | mongoose.Types.ObjectId;
|
|
103
|
+
status: IGroupOrderStatus;
|
|
104
|
+
headcount: number;
|
|
105
|
+
};
|
|
98
106
|
metadata?: Record<string, any>;
|
|
99
107
|
createdAt?: Date;
|
|
100
108
|
updatedAt?: Date;
|
|
@@ -8,6 +8,9 @@ var ICalendarEventType;
|
|
|
8
8
|
ICalendarEventType["TASK"] = "TASK";
|
|
9
9
|
ICalendarEventType["REGULAR"] = "REGULAR";
|
|
10
10
|
ICalendarEventType["WELLNESS"] = "WELLNESS";
|
|
11
|
+
// Mirror of a CRM group order slot (הזמנות קבוצות, #989): one calendar-event per order slot so
|
|
12
|
+
// the dashboard Calendar tab shows group visits with the order status.
|
|
13
|
+
ICalendarEventType["GROUP_VISIT"] = "GROUP_VISIT";
|
|
11
14
|
})(ICalendarEventType || (exports.ICalendarEventType = ICalendarEventType = {}));
|
|
12
15
|
var TaskStatus;
|
|
13
16
|
(function (TaskStatus) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendarEvent.js","sourceRoot":"","sources":["../../src/crm/calendarEvent.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"calendarEvent.js","sourceRoot":"","sources":["../../src/crm/calendarEvent.ts"],"names":[],"mappings":";;;AAGA,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,6DAAuC,CAAA;IACvC,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,yCAAmB,CAAA;IACnB,2CAAqB,CAAA;IACrB,+FAA+F;IAC/F,uEAAuE;IACvE,iDAA2B,CAAA;AAC7B,CAAC,EATW,kBAAkB,kCAAlB,kBAAkB,QAS7B;AAED,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,yCAA2B,CAAA;IAC3B,qCAAuB,CAAA;AACzB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;AACrB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,+CAAuB,CAAA;IACvB,+CAAuB,CAAA;AACzB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AACD,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,sCAAe,CAAA;IACf,oCAAa,CAAA;IACb,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,oCAAa,CAAA;IACb,oCAAa,CAAA;IACb,sCAAe,CAAA;AACjB,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { IMarketPlace } from "../account/marketPlace";
|
|
2
|
+
/**
|
|
3
|
+
* Group orders (הזמנות קבוצות) — CRM-owned vertical for visiting groups (schools, companies)
|
|
4
|
+
* booked by back-office staff. Issue nimi-events/nimi-backend#989 (Phase 1), #990 (Phase 2).
|
|
5
|
+
* Only the cross-service shapes live here; the CRM models are service-local.
|
|
6
|
+
*/
|
|
7
|
+
/** Status flow: open → sent (for signature) → signed (external or manual) → active */
|
|
8
|
+
export declare enum IGroupOrderStatus {
|
|
9
|
+
OPEN = "open",
|
|
10
|
+
SENT = "sent",
|
|
11
|
+
SIGNED = "signed",
|
|
12
|
+
ACTIVE = "active"
|
|
13
|
+
}
|
|
14
|
+
export declare enum IGroupOrderHistoryType {
|
|
15
|
+
CREATED = "created",
|
|
16
|
+
EDITED = "edited",
|
|
17
|
+
STATUS = "status",
|
|
18
|
+
DEBT_DOC = "debt_doc",
|
|
19
|
+
DEBT_DOC_FAILED = "debt_doc_failed",
|
|
20
|
+
DEBT_DOC_SKIPPED = "debt_doc_skipped",
|
|
21
|
+
CAPTURE = "capture",
|
|
22
|
+
CAPTURE_RELEASED = "capture_released",
|
|
23
|
+
CAPTURE_FAILED = "capture_failed",
|
|
24
|
+
/** A slot was captured beyond its remaining capacity — recorded for a human, never refused (#1002 §6). */
|
|
25
|
+
CAPTURE_OVER_CAPACITY = "capture_over_capacity",
|
|
26
|
+
/** `resend` amend: the admin chose to keep the old seats until the new signature lands (#1002 §4). */
|
|
27
|
+
CAPTURE_RETAINED = "capture_retained"
|
|
28
|
+
}
|
|
29
|
+
export interface IGroupOrderEmailContact {
|
|
30
|
+
email: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* SQS body for IPostSQSType.GROUP_ORDER_SEND_FOR_SIGNATURE (CRM → send-notification).
|
|
35
|
+
* send-notification never fetches the marketplace — the producer ships it whole, as every other
|
|
36
|
+
* mail type does. Dates/times are pre-formatted display strings; money is in shekels.
|
|
37
|
+
*/
|
|
38
|
+
export interface IGroupOrderSignatureEmailPayload {
|
|
39
|
+
marketplace: IMarketPlace;
|
|
40
|
+
to: IGroupOrderEmailContact;
|
|
41
|
+
cc: IGroupOrderEmailContact[];
|
|
42
|
+
sellerName: string;
|
|
43
|
+
sellerContactEmail?: string;
|
|
44
|
+
sellerContactPhone?: string;
|
|
45
|
+
order: {
|
|
46
|
+
id: string;
|
|
47
|
+
number: number;
|
|
48
|
+
groupName: string;
|
|
49
|
+
orgName: string;
|
|
50
|
+
visitDate: string;
|
|
51
|
+
slots: Array<{
|
|
52
|
+
eventName: string;
|
|
53
|
+
startTime: string;
|
|
54
|
+
}>;
|
|
55
|
+
headcount: {
|
|
56
|
+
adults: number;
|
|
57
|
+
children: number;
|
|
58
|
+
chaperones: number;
|
|
59
|
+
};
|
|
60
|
+
total: number;
|
|
61
|
+
};
|
|
62
|
+
/** Public signing page: `${baseAppURL}/group-order/:orderId?t=<token>` */
|
|
63
|
+
signUrl: string;
|
|
64
|
+
linkValidDays: number;
|
|
65
|
+
notesToGroup?: string;
|
|
66
|
+
/** Presigned URL of the unsigned document; send-notification fetches and attaches it */
|
|
67
|
+
pdf?: {
|
|
68
|
+
url: string;
|
|
69
|
+
filename: string;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IGroupOrderHistoryType = exports.IGroupOrderStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Group orders (הזמנות קבוצות) — CRM-owned vertical for visiting groups (schools, companies)
|
|
6
|
+
* booked by back-office staff. Issue nimi-events/nimi-backend#989 (Phase 1), #990 (Phase 2).
|
|
7
|
+
* Only the cross-service shapes live here; the CRM models are service-local.
|
|
8
|
+
*/
|
|
9
|
+
/** Status flow: open → sent (for signature) → signed (external or manual) → active */
|
|
10
|
+
var IGroupOrderStatus;
|
|
11
|
+
(function (IGroupOrderStatus) {
|
|
12
|
+
IGroupOrderStatus["OPEN"] = "open";
|
|
13
|
+
IGroupOrderStatus["SENT"] = "sent";
|
|
14
|
+
IGroupOrderStatus["SIGNED"] = "signed";
|
|
15
|
+
IGroupOrderStatus["ACTIVE"] = "active";
|
|
16
|
+
})(IGroupOrderStatus || (exports.IGroupOrderStatus = IGroupOrderStatus = {}));
|
|
17
|
+
var IGroupOrderHistoryType;
|
|
18
|
+
(function (IGroupOrderHistoryType) {
|
|
19
|
+
IGroupOrderHistoryType["CREATED"] = "created";
|
|
20
|
+
IGroupOrderHistoryType["EDITED"] = "edited";
|
|
21
|
+
IGroupOrderHistoryType["STATUS"] = "status";
|
|
22
|
+
IGroupOrderHistoryType["DEBT_DOC"] = "debt_doc";
|
|
23
|
+
IGroupOrderHistoryType["DEBT_DOC_FAILED"] = "debt_doc_failed";
|
|
24
|
+
IGroupOrderHistoryType["DEBT_DOC_SKIPPED"] = "debt_doc_skipped";
|
|
25
|
+
// #1002 — seat capture. `capture_failed` is recorded rather than thrown: capture runs on the public
|
|
26
|
+
// signing route and must never fail a signature.
|
|
27
|
+
IGroupOrderHistoryType["CAPTURE"] = "capture";
|
|
28
|
+
IGroupOrderHistoryType["CAPTURE_RELEASED"] = "capture_released";
|
|
29
|
+
IGroupOrderHistoryType["CAPTURE_FAILED"] = "capture_failed";
|
|
30
|
+
/** A slot was captured beyond its remaining capacity — recorded for a human, never refused (#1002 §6). */
|
|
31
|
+
IGroupOrderHistoryType["CAPTURE_OVER_CAPACITY"] = "capture_over_capacity";
|
|
32
|
+
/** `resend` amend: the admin chose to keep the old seats until the new signature lands (#1002 §4). */
|
|
33
|
+
IGroupOrderHistoryType["CAPTURE_RETAINED"] = "capture_retained";
|
|
34
|
+
})(IGroupOrderHistoryType || (exports.IGroupOrderHistoryType = IGroupOrderHistoryType = {}));
|
|
35
|
+
//# sourceMappingURL=groupOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupOrder.js","sourceRoot":"","sources":["../../src/crm/groupOrder.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AAEH,sFAAsF;AACtF,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,sCAAiB,CAAA;AACnB,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B;AAED,IAAY,sBAgBX;AAhBD,WAAY,sBAAsB;IAChC,6CAAmB,CAAA;IACnB,2CAAiB,CAAA;IACjB,2CAAiB,CAAA;IACjB,+CAAqB,CAAA;IACrB,6DAAmC,CAAA;IACnC,+DAAqC,CAAA;IACrC,oGAAoG;IACpG,iDAAiD;IACjD,6CAAmB,CAAA;IACnB,+DAAqC,CAAA;IACrC,2DAAiC,CAAA;IACjC,0GAA0G;IAC1G,yEAA+C,CAAA;IAC/C,sGAAsG;IACtG,+DAAqC,CAAA;AACvC,CAAC,EAhBW,sBAAsB,sCAAtB,sBAAsB,QAgBjC"}
|
package/dist/crm/index.d.ts
CHANGED
package/dist/crm/index.js
CHANGED
|
@@ -24,4 +24,5 @@ __exportStar(require("./endUserComment"), exports);
|
|
|
24
24
|
__exportStar(require("./visit"), exports);
|
|
25
25
|
__exportStar(require("./diningCommit"), exports);
|
|
26
26
|
__exportStar(require("./diningMember"), exports);
|
|
27
|
+
__exportStar(require("./groupOrder"), exports);
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
package/dist/crm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/crm/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,uDAAqC;AACrC,wDAAsC;AACtC,+CAA6B;AAC7B,kDAAgC;AAChC,mDAAiC;AACjC,mDAAiC;AACjC,0CAAwB;AACxB,iDAA+B;AAC/B,iDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/crm/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,uDAAqC;AACrC,wDAAsC;AACtC,+CAA6B;AAC7B,kDAAgC;AAChC,mDAAiC;AACjC,mDAAiC;AACjC,0CAAwB;AACxB,iDAA+B;AAC/B,iDAA+B;AAC/B,+CAA6B"}
|
package/dist/event/ticket.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
export declare enum ITicketTypeEnum {
|
|
2
2
|
TICKET = "ticket",
|
|
3
3
|
SYSTEM_FREE_TICKET = "SystemFreeTicket",
|
|
4
|
-
SPECIAL = "special"
|
|
4
|
+
SPECIAL = "special",
|
|
5
|
+
/**
|
|
6
|
+
* #1002 — the hidden per-event "קבוצות" ticket every group order's seats are captured on.
|
|
7
|
+
* Its own type, not SYSTEM_FREE_TICKET: `is_enabled: false` gives NO backend protection
|
|
8
|
+
* (nothing filters or validates it, and it is typed as a string in the ticket response
|
|
9
|
+
* schemas so every `!== false` guard on the client is dead), and a hidden ticket added to an
|
|
10
|
+
* enabled event link is publicly buyable. The type is what excludes it from the link picker,
|
|
11
|
+
* the public page and the cashier, and what the order path rejects for non-group callers.
|
|
12
|
+
*/
|
|
13
|
+
GROUP_CAPACITY = "GroupCapacity"
|
|
5
14
|
}
|
|
6
15
|
export interface IGroupDiscountRule {
|
|
7
16
|
minQuantity: number;
|
package/dist/event/ticket.js
CHANGED
|
@@ -6,5 +6,14 @@ var ITicketTypeEnum;
|
|
|
6
6
|
ITicketTypeEnum["TICKET"] = "ticket";
|
|
7
7
|
ITicketTypeEnum["SYSTEM_FREE_TICKET"] = "SystemFreeTicket";
|
|
8
8
|
ITicketTypeEnum["SPECIAL"] = "special";
|
|
9
|
+
/**
|
|
10
|
+
* #1002 — the hidden per-event "קבוצות" ticket every group order's seats are captured on.
|
|
11
|
+
* Its own type, not SYSTEM_FREE_TICKET: `is_enabled: false` gives NO backend protection
|
|
12
|
+
* (nothing filters or validates it, and it is typed as a string in the ticket response
|
|
13
|
+
* schemas so every `!== false` guard on the client is dead), and a hidden ticket added to an
|
|
14
|
+
* enabled event link is publicly buyable. The type is what excludes it from the link picker,
|
|
15
|
+
* the public page and the cashier, and what the order path rejects for non-group callers.
|
|
16
|
+
*/
|
|
17
|
+
ITicketTypeEnum["GROUP_CAPACITY"] = "GroupCapacity";
|
|
9
18
|
})(ITicketTypeEnum || (exports.ITicketTypeEnum = ITicketTypeEnum = {}));
|
|
10
19
|
//# sourceMappingURL=ticket.js.map
|
package/dist/event/ticket.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticket.js","sourceRoot":"","sources":["../../src/event/ticket.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"ticket.js","sourceRoot":"","sources":["../../src/event/ticket.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,0DAAuC,CAAA;IACvC,sCAAmB,CAAA;IACnB;;;;;;;OAOG;IACH,mDAAgC,CAAA;AAClC,CAAC,EAbW,eAAe,+BAAf,eAAe,QAa1B"}
|
|
@@ -29,7 +29,8 @@ export declare enum IPostSQSType {
|
|
|
29
29
|
ENDUSER_EMAIL_VERIFICATION = "ENDUSER_EMAIL_VERIFICATION",
|
|
30
30
|
BASKET_COMPLETED = "BASKET_COMPLETED",
|
|
31
31
|
Z_REPORT = "Z_REPORT",
|
|
32
|
-
INVOICE_ISSUED = "INVOICE_ISSUED"
|
|
32
|
+
INVOICE_ISSUED = "INVOICE_ISSUED",
|
|
33
|
+
GROUP_ORDER_SEND_FOR_SIGNATURE = "GROUP_ORDER_SEND_FOR_SIGNATURE"
|
|
33
34
|
}
|
|
34
35
|
export declare enum IMailPostSQSType {
|
|
35
36
|
FORGOT_PASSWORD_EMAIL = "FORGOT_PASSWORD_EMAIL",
|
|
@@ -48,7 +49,8 @@ export declare enum IMailPostSQSType {
|
|
|
48
49
|
DASHBOARD_2FA = "DASHBOARD_2FA",
|
|
49
50
|
ENDUSER_EMAIL_VERIFICATION = "ENDUSER_EMAIL_VERIFICATION",
|
|
50
51
|
BASKET_COMPLETED = "BASKET_COMPLETED",
|
|
51
|
-
INVOICE_ISSUED = "INVOICE_ISSUED"
|
|
52
|
+
INVOICE_ISSUED = "INVOICE_ISSUED",
|
|
53
|
+
GROUP_ORDER_SEND_FOR_SIGNATURE = "GROUP_ORDER_SEND_FOR_SIGNATURE"
|
|
52
54
|
}
|
|
53
55
|
export declare enum IMailFormatTypes {
|
|
54
56
|
template = "template",
|
|
@@ -38,6 +38,9 @@ var IPostSQSType;
|
|
|
38
38
|
// Nimi invoice provider issues a document at a public URL and never mails it (iCount mails
|
|
39
39
|
// its own), so without this the buyer is never told the receipt exists.
|
|
40
40
|
IPostSQSType["INVOICE_ISSUED"] = "INVOICE_ISSUED";
|
|
41
|
+
// CRM group orders (#989): "שגר לחתימה" — emails the paying organization the order summary, the
|
|
42
|
+
// signing link and the PDF (to = org contact, cc = group contact). Payload: IGroupOrderSignatureEmailPayload.
|
|
43
|
+
IPostSQSType["GROUP_ORDER_SEND_FOR_SIGNATURE"] = "GROUP_ORDER_SEND_FOR_SIGNATURE";
|
|
41
44
|
})(IPostSQSType || (exports.IPostSQSType = IPostSQSType = {}));
|
|
42
45
|
var IMailPostSQSType;
|
|
43
46
|
(function (IMailPostSQSType) {
|
|
@@ -58,6 +61,7 @@ var IMailPostSQSType;
|
|
|
58
61
|
IMailPostSQSType["ENDUSER_EMAIL_VERIFICATION"] = "ENDUSER_EMAIL_VERIFICATION";
|
|
59
62
|
IMailPostSQSType["BASKET_COMPLETED"] = "BASKET_COMPLETED";
|
|
60
63
|
IMailPostSQSType["INVOICE_ISSUED"] = "INVOICE_ISSUED";
|
|
64
|
+
IMailPostSQSType["GROUP_ORDER_SEND_FOR_SIGNATURE"] = "GROUP_ORDER_SEND_FOR_SIGNATURE";
|
|
61
65
|
})(IMailPostSQSType || (exports.IMailPostSQSType = IMailPostSQSType = {}));
|
|
62
66
|
var IMailFormatTypes;
|
|
63
67
|
(function (IMailFormatTypes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqs.js","sourceRoot":"","sources":["../../src/send-notification/sqs.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"sqs.js","sourceRoot":"","sources":["../../src/send-notification/sqs.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAuCX;AAvCD,WAAY,YAAY;IACtB,+DAA+C,CAAA;IAC/C,2DAA2C,CAAA;IAC3C,qEAAqD,CAAA;IACrD,6CAA6B,CAAA;IAC7B,yDAAyC,CAAA;IACzC,qDAAqC,CAAA;IACrC,+CAA+B,CAAA;IAC/B,yEAAyD,CAAA;IACzD,iDAAiC,CAAA;IACjC,yDAAyC,CAAA;IACzC,iEAAiD,CAAA;IACjD,+DAA+C,CAAA;IAC/C,iCAAiB,CAAA;IACjB,2DAA2C,CAAA;IAC3C,+DAA+C,CAAA;IAC/C,iEAAiD,CAAA;IACjD,mFAAmE,CAAA;IACnE,qEAAqD,CAAA;IACrD,qDAAqC,CAAA;IACrC,+DAA+C,CAAA;IAC/C,iEAAiD,CAAA;IACjD,2EAA2D,CAAA;IAC3D,6DAA6C,CAAA;IAC7C,6EAA6D,CAAA;IAC7D,iEAAiD,CAAA;IACjD,uDAAuC,CAAA;IACvC,+CAA+B,CAAA;IAC/B,yEAAyD,CAAA;IACzD,qDAAqC,CAAA;IACrC,qCAAqB,CAAA;IACrB,sFAAsF;IACtF,6FAA6F;IAC7F,2FAA2F;IAC3F,wEAAwE;IACxE,iDAAiC,CAAA;IACjC,gGAAgG;IAChG,8GAA8G;IAC9G,iFAAiE,CAAA;AACnE,CAAC,EAvCW,YAAY,4BAAZ,YAAY,QAuCvB;AACD,IAAY,gBAmBX;AAnBD,WAAY,gBAAgB;IAC1B,mEAA+C,CAAA;IAC/C,6DAAyC,CAAA;IACzC,6DAAyC,CAAA;IACzC,mDAA+B,CAAA;IAC/B,qCAAiB,CAAA;IACjB,6EAAyD,CAAA;IACzD,qEAAiD,CAAA;IACjD,mEAA+C,CAAA;IAC/C,qEAAiD,CAAA;IACjD,+EAA2D,CAAA;IAC3D,iEAA6C,CAAA;IAC7C,iFAA6D,CAAA;IAC7D,qDAAiC,CAAA;IACjC,mDAA+B,CAAA;IAC/B,6EAAyD,CAAA;IACzD,yDAAqC,CAAA;IACrC,qDAAiC,CAAA;IACjC,qFAAiE,CAAA;AACnE,CAAC,EAnBW,gBAAgB,gCAAhB,gBAAgB,QAmB3B;AACD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,iCAAa,CAAA;AACf,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B"}
|
package/package.json
CHANGED
package/src/account/account.ts
CHANGED
|
@@ -251,6 +251,8 @@ export interface IAccountModel {
|
|
|
251
251
|
isBookable?: boolean;
|
|
252
252
|
isBookableWithTickets?: boolean;
|
|
253
253
|
hasCashier?: boolean;
|
|
254
|
+
/** Dashboard "הזמנות קבוצות" (CRM group orders) enabled — lives on the top-level seller account */
|
|
255
|
+
hasGroupOrders?: boolean;
|
|
254
256
|
origin?: string;
|
|
255
257
|
shouldSendInvoice?: boolean;
|
|
256
258
|
invoiceProvider?: InvoiceProviderType;
|
package/src/crm/calendarEvent.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
|
+
import { IGroupOrderStatus } from "./groupOrder";
|
|
2
3
|
|
|
3
4
|
export enum ICalendarEventType {
|
|
4
5
|
TABLE_RESERVATION = "TABLE_RESERVATION",
|
|
@@ -6,6 +7,9 @@ export enum ICalendarEventType {
|
|
|
6
7
|
TASK = "TASK",
|
|
7
8
|
REGULAR = "REGULAR",
|
|
8
9
|
WELLNESS = "WELLNESS",
|
|
10
|
+
// Mirror of a CRM group order slot (הזמנות קבוצות, #989): one calendar-event per order slot so
|
|
11
|
+
// the dashboard Calendar tab shows group visits with the order status.
|
|
12
|
+
GROUP_VISIT = "GROUP_VISIT",
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
export enum TaskStatus {
|
|
@@ -75,6 +79,12 @@ export interface ICalendarEventModel {
|
|
|
75
79
|
createdAt: Date;
|
|
76
80
|
}[];
|
|
77
81
|
};
|
|
82
|
+
/** GROUP_VISIT only — the calendar `status` stays "scheduled"; the order status lives here */
|
|
83
|
+
groupVisit?: {
|
|
84
|
+
groupOrderId: string | mongoose.Types.ObjectId;
|
|
85
|
+
status: IGroupOrderStatus;
|
|
86
|
+
headcount: number;
|
|
87
|
+
};
|
|
78
88
|
metadata?: Record<string, any>;
|
|
79
89
|
createdAt?: Date;
|
|
80
90
|
updatedAt?: Date;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { IMarketPlace } from "../account/marketPlace";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Group orders (הזמנות קבוצות) — CRM-owned vertical for visiting groups (schools, companies)
|
|
5
|
+
* booked by back-office staff. Issue nimi-events/nimi-backend#989 (Phase 1), #990 (Phase 2).
|
|
6
|
+
* Only the cross-service shapes live here; the CRM models are service-local.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Status flow: open → sent (for signature) → signed (external or manual) → active */
|
|
10
|
+
export enum IGroupOrderStatus {
|
|
11
|
+
OPEN = "open",
|
|
12
|
+
SENT = "sent",
|
|
13
|
+
SIGNED = "signed",
|
|
14
|
+
ACTIVE = "active",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum IGroupOrderHistoryType {
|
|
18
|
+
CREATED = "created",
|
|
19
|
+
EDITED = "edited",
|
|
20
|
+
STATUS = "status",
|
|
21
|
+
DEBT_DOC = "debt_doc",
|
|
22
|
+
DEBT_DOC_FAILED = "debt_doc_failed",
|
|
23
|
+
DEBT_DOC_SKIPPED = "debt_doc_skipped",
|
|
24
|
+
// #1002 — seat capture. `capture_failed` is recorded rather than thrown: capture runs on the public
|
|
25
|
+
// signing route and must never fail a signature.
|
|
26
|
+
CAPTURE = "capture",
|
|
27
|
+
CAPTURE_RELEASED = "capture_released",
|
|
28
|
+
CAPTURE_FAILED = "capture_failed",
|
|
29
|
+
/** A slot was captured beyond its remaining capacity — recorded for a human, never refused (#1002 §6). */
|
|
30
|
+
CAPTURE_OVER_CAPACITY = "capture_over_capacity",
|
|
31
|
+
/** `resend` amend: the admin chose to keep the old seats until the new signature lands (#1002 §4). */
|
|
32
|
+
CAPTURE_RETAINED = "capture_retained",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IGroupOrderEmailContact {
|
|
36
|
+
email: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* SQS body for IPostSQSType.GROUP_ORDER_SEND_FOR_SIGNATURE (CRM → send-notification).
|
|
42
|
+
* send-notification never fetches the marketplace — the producer ships it whole, as every other
|
|
43
|
+
* mail type does. Dates/times are pre-formatted display strings; money is in shekels.
|
|
44
|
+
*/
|
|
45
|
+
export interface IGroupOrderSignatureEmailPayload {
|
|
46
|
+
marketplace: IMarketPlace;
|
|
47
|
+
to: IGroupOrderEmailContact;
|
|
48
|
+
cc: IGroupOrderEmailContact[];
|
|
49
|
+
sellerName: string;
|
|
50
|
+
sellerContactEmail?: string;
|
|
51
|
+
sellerContactPhone?: string;
|
|
52
|
+
order: {
|
|
53
|
+
id: string;
|
|
54
|
+
number: number;
|
|
55
|
+
groupName: string;
|
|
56
|
+
orgName: string;
|
|
57
|
+
visitDate: string; // dd.mm.yyyy
|
|
58
|
+
slots: Array<{ eventName: string; startTime: string }>; // "10:00"
|
|
59
|
+
headcount: { adults: number; children: number; chaperones: number };
|
|
60
|
+
total: number; // shekels
|
|
61
|
+
};
|
|
62
|
+
/** Public signing page: `${baseAppURL}/group-order/:orderId?t=<token>` */
|
|
63
|
+
signUrl: string;
|
|
64
|
+
linkValidDays: number;
|
|
65
|
+
notesToGroup?: string;
|
|
66
|
+
/** Presigned URL of the unsigned document; send-notification fetches and attaches it */
|
|
67
|
+
pdf?: { url: string; filename: string };
|
|
68
|
+
}
|
package/src/crm/index.ts
CHANGED
package/src/event/ticket.ts
CHANGED
|
@@ -2,6 +2,15 @@ export enum ITicketTypeEnum {
|
|
|
2
2
|
TICKET = "ticket",
|
|
3
3
|
SYSTEM_FREE_TICKET = "SystemFreeTicket",
|
|
4
4
|
SPECIAL = "special",
|
|
5
|
+
/**
|
|
6
|
+
* #1002 — the hidden per-event "קבוצות" ticket every group order's seats are captured on.
|
|
7
|
+
* Its own type, not SYSTEM_FREE_TICKET: `is_enabled: false` gives NO backend protection
|
|
8
|
+
* (nothing filters or validates it, and it is typed as a string in the ticket response
|
|
9
|
+
* schemas so every `!== false` guard on the client is dead), and a hidden ticket added to an
|
|
10
|
+
* enabled event link is publicly buyable. The type is what excludes it from the link picker,
|
|
11
|
+
* the public page and the cashier, and what the order path rejects for non-group callers.
|
|
12
|
+
*/
|
|
13
|
+
GROUP_CAPACITY = "GroupCapacity",
|
|
5
14
|
}
|
|
6
15
|
|
|
7
16
|
export interface IGroupDiscountRule {
|
|
@@ -34,6 +34,9 @@ export enum IPostSQSType {
|
|
|
34
34
|
// Nimi invoice provider issues a document at a public URL and never mails it (iCount mails
|
|
35
35
|
// its own), so without this the buyer is never told the receipt exists.
|
|
36
36
|
INVOICE_ISSUED = "INVOICE_ISSUED",
|
|
37
|
+
// CRM group orders (#989): "שגר לחתימה" — emails the paying organization the order summary, the
|
|
38
|
+
// signing link and the PDF (to = org contact, cc = group contact). Payload: IGroupOrderSignatureEmailPayload.
|
|
39
|
+
GROUP_ORDER_SEND_FOR_SIGNATURE = "GROUP_ORDER_SEND_FOR_SIGNATURE",
|
|
37
40
|
}
|
|
38
41
|
export enum IMailPostSQSType {
|
|
39
42
|
FORGOT_PASSWORD_EMAIL = "FORGOT_PASSWORD_EMAIL",
|
|
@@ -53,6 +56,7 @@ export enum IMailPostSQSType {
|
|
|
53
56
|
ENDUSER_EMAIL_VERIFICATION = "ENDUSER_EMAIL_VERIFICATION",
|
|
54
57
|
BASKET_COMPLETED = "BASKET_COMPLETED",
|
|
55
58
|
INVOICE_ISSUED = "INVOICE_ISSUED",
|
|
59
|
+
GROUP_ORDER_SEND_FOR_SIGNATURE = "GROUP_ORDER_SEND_FOR_SIGNATURE",
|
|
56
60
|
}
|
|
57
61
|
export enum IMailFormatTypes {
|
|
58
62
|
template = "template",
|