@nimee/shared-types 1.0.326 → 1.0.329

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.
@@ -220,6 +220,7 @@ export interface IAccountModel {
220
220
  subscriptionWalletDesign?: IWalletDesign;
221
221
  marketplaceDistributionId: string;
222
222
  isAllowSeasonTicket: boolean;
223
+ diningDefaultMonthlyAmount?: number;
223
224
  lockEndUserProfile?: boolean;
224
225
  hideCustomerChargesTab?: boolean;
225
226
  seasonTicketGrantsEntrance: boolean;
@@ -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;AA0QD,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"}
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;AA2QD,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"}
@@ -0,0 +1,85 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/session" />
19
+ /// <reference types="mongoose/types/types" />
20
+ /// <reference types="mongoose/types/utility" />
21
+ /// <reference types="mongoose/types/validation" />
22
+ /// <reference types="mongoose/types/virtuals" />
23
+ /// <reference types="mongoose/types/schematypes" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ /// <reference types="mongoose/types/inferrawdoctype" />
26
+ import mongoose from "mongoose";
27
+ export interface IDiningCommitItem {
28
+ index?: number;
29
+ price?: number;
30
+ priceBeforeDiscount?: number;
31
+ posDiscount?: number;
32
+ qty?: number;
33
+ offerId?: string;
34
+ offerName?: string;
35
+ menuId?: string;
36
+ sectionId?: string;
37
+ sectionName?: string;
38
+ addedAt?: Date | string;
39
+ [key: string]: unknown;
40
+ }
41
+ export interface IDiningCommitModel {
42
+ _id?: string | mongoose.Types.ObjectId;
43
+ endUser: string | mongoose.Types.ObjectId;
44
+ seller: string | mongoose.Types.ObjectId;
45
+ marketplace: string | mongoose.Types.ObjectId;
46
+ amount: number;
47
+ orderTotal?: number;
48
+ orderId: string;
49
+ orderOpenTime?: Date;
50
+ orderEndTime?: Date;
51
+ /**
52
+ * When the meal was eaten — `orderOpenTime` if the POS sent one, otherwise the time we recorded
53
+ * it. This, not `createdAt`, is what the reports filter and sort on: a seller asking for August
54
+ * means meals eaten in August, and a POS that reports late would otherwise file a meal under the
55
+ * day we happened to save it rather than the day it appears on their screen.
56
+ */
57
+ visitDate?: Date;
58
+ items?: IDiningCommitItem[];
59
+ siteName?: string;
60
+ /**
61
+ * The customer's name and phone as they stood in OUR record when the meal was reported.
62
+ * A snapshot on purpose: a commit is a receipt, so reports about August must keep saying what
63
+ * they said in August even if the customer later changes their details.
64
+ */
65
+ endUserName?: string;
66
+ endUserPhone?: string;
67
+ /** The POS's own view of the customer, stored verbatim for reconciliation. Never used as identity. */
68
+ customer?: Record<string, unknown>;
69
+ settled: boolean;
70
+ chargeId?: string | mongoose.Types.ObjectId | null;
71
+ createdAt?: Date;
72
+ updatedAt?: Date;
73
+ }
74
+ export interface IDiningBalanceResponse {
75
+ balance: number;
76
+ monthlyAmount: number;
77
+ fname?: string;
78
+ lname?: string;
79
+ phone?: string;
80
+ }
81
+ export interface IDiningCommitCreateResult {
82
+ success: true;
83
+ duplicate?: boolean;
84
+ balance: number;
85
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=diningCommit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diningCommit.js","sourceRoot":"","sources":["../../src/crm/diningCommit.ts"],"names":[],"mappings":""}
@@ -0,0 +1,36 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/session" />
19
+ /// <reference types="mongoose/types/types" />
20
+ /// <reference types="mongoose/types/utility" />
21
+ /// <reference types="mongoose/types/validation" />
22
+ /// <reference types="mongoose/types/virtuals" />
23
+ /// <reference types="mongoose/types/schematypes" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ /// <reference types="mongoose/types/inferrawdoctype" />
26
+ import mongoose from "mongoose";
27
+ export interface IDiningMemberModel {
28
+ _id?: string | mongoose.Types.ObjectId;
29
+ endUser: string | mongoose.Types.ObjectId;
30
+ seller: string | mongoose.Types.ObjectId;
31
+ marketplace: string | mongoose.Types.ObjectId;
32
+ monthlyAmount: number;
33
+ isActive: boolean;
34
+ createdAt?: Date;
35
+ updatedAt?: Date;
36
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=diningMember.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diningMember.js","sourceRoot":"","sources":["../../src/crm/diningMember.ts"],"names":[],"mappings":""}
@@ -6,3 +6,5 @@ export * from "./calendarEvent";
6
6
  export * from "./generalComment";
7
7
  export * from "./endUserComment";
8
8
  export * from "./visit";
9
+ export * from "./diningCommit";
10
+ export * from "./diningMember";
package/dist/crm/index.js CHANGED
@@ -22,4 +22,6 @@ __exportStar(require("./calendarEvent"), exports);
22
22
  __exportStar(require("./generalComment"), exports);
23
23
  __exportStar(require("./endUserComment"), exports);
24
24
  __exportStar(require("./visit"), exports);
25
+ __exportStar(require("./diningCommit"), exports);
26
+ __exportStar(require("./diningMember"), exports);
25
27
  //# sourceMappingURL=index.js.map
@@ -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"}
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"}
@@ -23,7 +23,7 @@
23
23
  /// <reference types="mongoose/types/schematypes" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  /// <reference types="mongoose/types/inferrawdoctype" />
26
- import { IAccountModel, IRoleTypeEnum } from "../account";
26
+ import { IAccountModel, IMarketPlace, IRoleTypeEnum } from "../account";
27
27
  import { IFeeCollectionType } from "../payment";
28
28
  import { IPaymentCouponTypeEnum } from "../payment/coupon";
29
29
  import mongoose from "mongoose";
@@ -144,6 +144,7 @@ export interface IEventModel {
144
144
  feeCollectionType: IFeeCollectionType;
145
145
  nimiFeeType: IFeeCollectionType;
146
146
  isPublic: boolean;
147
+ isMarketplaceOwnerDisable?: boolean;
147
148
  chartName?: string;
148
149
  seasonTicketEventDiscounts?: ISeasonTicketEventDiscount[];
149
150
  segmentsBehavior?: IEventSegmentsBehavior;
@@ -164,3 +165,12 @@ export interface IEventModel {
164
165
  incomeTypeId?: number;
165
166
  incomeTypeName?: string;
166
167
  }
168
+ /**
169
+ * Cross-marketplace listings populate the marketplace so the client can build an
170
+ * absolute event link. Only these fields are selected; every other endpoint
171
+ * keeps sending the bare id string on `IEventModel.marketplace`.
172
+ */
173
+ export type IPopulatedEventMarketplace = Pick<IMarketPlace, "_id" | "name" | "baseAppURL">;
174
+ export type IFeaturedPublicEvent = Omit<IEventModel, "marketplace"> & {
175
+ marketplace?: IPopulatedEventMarketplace;
176
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimee/shared-types",
3
- "version": "1.0.326",
3
+ "version": "1.0.329",
4
4
  "description": "Types and interfaces that any service can access if needed",
5
5
  "main": "dist/index.js",
6
6
  "author": "dan goldberg",
@@ -224,6 +224,7 @@ export interface IAccountModel {
224
224
  subscriptionWalletDesign?: IWalletDesign;
225
225
  marketplaceDistributionId: string;
226
226
  isAllowSeasonTicket: boolean;
227
+ diningDefaultMonthlyAmount?: number;
227
228
  lockEndUserProfile?: boolean;
228
229
  hideCustomerChargesTab?: boolean;
229
230
  seasonTicketGrantsEntrance: boolean;
@@ -0,0 +1,64 @@
1
+ import mongoose from "mongoose";
2
+
3
+ export interface IDiningCommitItem {
4
+ index?: number;
5
+ price?: number;
6
+ priceBeforeDiscount?: number;
7
+ posDiscount?: number;
8
+ qty?: number;
9
+ offerId?: string;
10
+ offerName?: string;
11
+ menuId?: string;
12
+ sectionId?: string;
13
+ sectionName?: string;
14
+ addedAt?: Date | string;
15
+ [key: string]: unknown;
16
+ }
17
+
18
+ export interface IDiningCommitModel {
19
+ _id?: string | mongoose.Types.ObjectId;
20
+ endUser: string | mongoose.Types.ObjectId;
21
+ seller: string | mongoose.Types.ObjectId;
22
+ marketplace: string | mongoose.Types.ObjectId;
23
+ amount: number;
24
+ orderTotal?: number;
25
+ orderId: string;
26
+ orderOpenTime?: Date;
27
+ orderEndTime?: Date;
28
+ /**
29
+ * When the meal was eaten — `orderOpenTime` if the POS sent one, otherwise the time we recorded
30
+ * it. This, not `createdAt`, is what the reports filter and sort on: a seller asking for August
31
+ * means meals eaten in August, and a POS that reports late would otherwise file a meal under the
32
+ * day we happened to save it rather than the day it appears on their screen.
33
+ */
34
+ visitDate?: Date;
35
+ items?: IDiningCommitItem[];
36
+ siteName?: string;
37
+ /**
38
+ * The customer's name and phone as they stood in OUR record when the meal was reported.
39
+ * A snapshot on purpose: a commit is a receipt, so reports about August must keep saying what
40
+ * they said in August even if the customer later changes their details.
41
+ */
42
+ endUserName?: string;
43
+ endUserPhone?: string;
44
+ /** The POS's own view of the customer, stored verbatim for reconciliation. Never used as identity. */
45
+ customer?: Record<string, unknown>;
46
+ settled: boolean;
47
+ chargeId?: string | mongoose.Types.ObjectId | null;
48
+ createdAt?: Date;
49
+ updatedAt?: Date;
50
+ }
51
+
52
+ export interface IDiningBalanceResponse {
53
+ balance: number;
54
+ monthlyAmount: number;
55
+ fname?: string;
56
+ lname?: string;
57
+ phone?: string;
58
+ }
59
+
60
+ export interface IDiningCommitCreateResult {
61
+ success: true;
62
+ duplicate?: boolean;
63
+ balance: number;
64
+ }
@@ -0,0 +1,12 @@
1
+ import mongoose from "mongoose";
2
+
3
+ export interface IDiningMemberModel {
4
+ _id?: string | mongoose.Types.ObjectId;
5
+ endUser: string | mongoose.Types.ObjectId;
6
+ seller: string | mongoose.Types.ObjectId;
7
+ marketplace: string | mongoose.Types.ObjectId;
8
+ monthlyAmount: number;
9
+ isActive: boolean;
10
+ createdAt?: Date;
11
+ updatedAt?: Date;
12
+ }
package/src/crm/index.ts CHANGED
@@ -6,3 +6,5 @@ export * from "./calendarEvent";
6
6
  export * from "./generalComment";
7
7
  export * from "./endUserComment";
8
8
  export * from "./visit";
9
+ export * from "./diningCommit";
10
+ export * from "./diningMember";
@@ -1,4 +1,4 @@
1
- import { IAccountModel, IRoleTypeEnum } from "../account";
1
+ import { IAccountModel, IMarketPlace, IRoleTypeEnum } from "../account";
2
2
  import { IFeeCollectionType } from "../payment";
3
3
  import { IPaymentCouponTypeEnum } from "../payment/coupon";
4
4
  import mongoose from "mongoose";
@@ -127,6 +127,7 @@ export interface IEventModel {
127
127
  feeCollectionType: IFeeCollectionType;
128
128
  nimiFeeType: IFeeCollectionType;
129
129
  isPublic: boolean;
130
+ isMarketplaceOwnerDisable?: boolean; // marketplace owner hides the event from cross-marketplace listings
130
131
  chartName?: string;
131
132
  seasonTicketEventDiscounts?: ISeasonTicketEventDiscount[];
132
133
  segmentsBehavior?: IEventSegmentsBehavior;
@@ -147,3 +148,14 @@ export interface IEventModel {
147
148
  incomeTypeId?: number;
148
149
  incomeTypeName?: string;
149
150
  }
151
+
152
+ /**
153
+ * Cross-marketplace listings populate the marketplace so the client can build an
154
+ * absolute event link. Only these fields are selected; every other endpoint
155
+ * keeps sending the bare id string on `IEventModel.marketplace`.
156
+ */
157
+ export type IPopulatedEventMarketplace = Pick<IMarketPlace, "_id" | "name" | "baseAppURL">;
158
+
159
+ export type IFeaturedPublicEvent = Omit<IEventModel, "marketplace"> & {
160
+ marketplace?: IPopulatedEventMarketplace;
161
+ };