@nimee/shared-types 1.0.329 → 1.0.331
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 +64 -0
- package/dist/crm/groupOrder.js +26 -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/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 +59 -0
- package/src/crm/index.ts +1 -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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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,64 @@
|
|
|
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
|
+
}
|
|
22
|
+
export interface IGroupOrderEmailContact {
|
|
23
|
+
email: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* SQS body for IPostSQSType.GROUP_ORDER_SEND_FOR_SIGNATURE (CRM → send-notification).
|
|
28
|
+
* send-notification never fetches the marketplace — the producer ships it whole, as every other
|
|
29
|
+
* mail type does. Dates/times are pre-formatted display strings; money is in shekels.
|
|
30
|
+
*/
|
|
31
|
+
export interface IGroupOrderSignatureEmailPayload {
|
|
32
|
+
marketplace: IMarketPlace;
|
|
33
|
+
to: IGroupOrderEmailContact;
|
|
34
|
+
cc: IGroupOrderEmailContact[];
|
|
35
|
+
sellerName: string;
|
|
36
|
+
sellerContactEmail?: string;
|
|
37
|
+
sellerContactPhone?: string;
|
|
38
|
+
order: {
|
|
39
|
+
id: string;
|
|
40
|
+
number: number;
|
|
41
|
+
groupName: string;
|
|
42
|
+
orgName: string;
|
|
43
|
+
visitDate: string;
|
|
44
|
+
slots: Array<{
|
|
45
|
+
eventName: string;
|
|
46
|
+
startTime: string;
|
|
47
|
+
}>;
|
|
48
|
+
headcount: {
|
|
49
|
+
adults: number;
|
|
50
|
+
children: number;
|
|
51
|
+
chaperones: number;
|
|
52
|
+
};
|
|
53
|
+
total: number;
|
|
54
|
+
};
|
|
55
|
+
/** Public signing page: `${baseAppURL}/group-order/:orderId?t=<token>` */
|
|
56
|
+
signUrl: string;
|
|
57
|
+
linkValidDays: number;
|
|
58
|
+
notesToGroup?: string;
|
|
59
|
+
/** Presigned URL of the unsigned document; send-notification fetches and attaches it */
|
|
60
|
+
pdf?: {
|
|
61
|
+
url: string;
|
|
62
|
+
filename: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
})(IGroupOrderHistoryType || (exports.IGroupOrderHistoryType = IGroupOrderHistoryType = {}));
|
|
26
|
+
//# 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,sBAOX;AAPD,WAAY,sBAAsB;IAChC,6CAAmB,CAAA;IACnB,2CAAiB,CAAA;IACjB,2CAAiB,CAAA;IACjB,+CAAqB,CAAA;IACrB,6DAAmC,CAAA;IACnC,+DAAqC,CAAA;AACvC,CAAC,EAPW,sBAAsB,sCAAtB,sBAAsB,QAOjC"}
|
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"}
|
|
@@ -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":[],"m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A6D,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,59 @@
|
|
|
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
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface IGroupOrderEmailContact {
|
|
27
|
+
email: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* SQS body for IPostSQSType.GROUP_ORDER_SEND_FOR_SIGNATURE (CRM → send-notification).
|
|
33
|
+
* send-notification never fetches the marketplace — the producer ships it whole, as every other
|
|
34
|
+
* mail type does. Dates/times are pre-formatted display strings; money is in shekels.
|
|
35
|
+
*/
|
|
36
|
+
export interface IGroupOrderSignatureEmailPayload {
|
|
37
|
+
marketplace: IMarketPlace;
|
|
38
|
+
to: IGroupOrderEmailContact;
|
|
39
|
+
cc: IGroupOrderEmailContact[];
|
|
40
|
+
sellerName: string;
|
|
41
|
+
sellerContactEmail?: string;
|
|
42
|
+
sellerContactPhone?: string;
|
|
43
|
+
order: {
|
|
44
|
+
id: string;
|
|
45
|
+
number: number;
|
|
46
|
+
groupName: string;
|
|
47
|
+
orgName: string;
|
|
48
|
+
visitDate: string; // dd.mm.yyyy
|
|
49
|
+
slots: Array<{ eventName: string; startTime: string }>; // "10:00"
|
|
50
|
+
headcount: { adults: number; children: number; chaperones: number };
|
|
51
|
+
total: number; // shekels
|
|
52
|
+
};
|
|
53
|
+
/** Public signing page: `${baseAppURL}/group-order/:orderId?t=<token>` */
|
|
54
|
+
signUrl: string;
|
|
55
|
+
linkValidDays: number;
|
|
56
|
+
notesToGroup?: string;
|
|
57
|
+
/** Presigned URL of the unsigned document; send-notification fetches and attaches it */
|
|
58
|
+
pdf?: { url: string; filename: string };
|
|
59
|
+
}
|
package/src/crm/index.ts
CHANGED
|
@@ -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",
|