@mydoormot/app-types 1.4.0 → 1.4.2
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/.turbo/turbo-build.log +18 -14
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +37 -3
- package/dist/index.d.ts +68 -11
- package/dist/index.js +27 -40
- package/package.json +10 -6
- package/src/business.ts +1 -0
- package/src/customer.ts +3 -1
- package/src/errand.ts +3 -1
- package/src/invoice.ts +34 -0
- package/tsconfig.json +1 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
> @mydoormot/app-types@1.
|
|
3
|
-
> tsup src/index.ts --format cjs --dts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
|
|
2
|
+
> @mydoormot/app-types@1.4.1 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
|
|
3
|
+
> tsup src/index.ts --format esm,cjs --dts
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v7.3.0
|
|
8
|
+
[34mCLI[39m Target: es2021
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[34mCJS[39m Build start
|
|
11
|
+
[32mESM[39m [1mdist/index.js [22m[32m5.14 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 46ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m6.67 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 46ms
|
|
15
|
+
[34mDTS[39m Build start
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 686ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m12.76 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m12.76 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,8 @@ __export(src_exports, {
|
|
|
25
25
|
DeliveryStatus: () => DeliveryStatus,
|
|
26
26
|
EnterpriseType: () => EnterpriseType,
|
|
27
27
|
ErrandStatus: () => ErrandStatus,
|
|
28
|
+
InvoiceGenerationType: () => InvoiceGenerationType,
|
|
29
|
+
InvoiceItemType: () => InvoiceItemType,
|
|
28
30
|
InvoiceStatus: () => InvoiceStatus,
|
|
29
31
|
LinkDestination: () => LinkDestination,
|
|
30
32
|
NotificationType: () => NotificationType,
|
|
@@ -126,9 +128,19 @@ var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
|
|
|
126
128
|
InvoiceStatus2["Failed"] = "failed";
|
|
127
129
|
return InvoiceStatus2;
|
|
128
130
|
})(InvoiceStatus || {});
|
|
131
|
+
var InvoiceItemType = /* @__PURE__ */ ((InvoiceItemType2) => {
|
|
132
|
+
InvoiceItemType2["Errand"] = "errand";
|
|
133
|
+
return InvoiceItemType2;
|
|
134
|
+
})(InvoiceItemType || {});
|
|
135
|
+
var InvoiceGenerationType = /* @__PURE__ */ ((InvoiceGenerationType2) => {
|
|
136
|
+
InvoiceGenerationType2["Auto"] = "auto";
|
|
137
|
+
InvoiceGenerationType2["Manual"] = "manual";
|
|
138
|
+
return InvoiceGenerationType2;
|
|
139
|
+
})(InvoiceGenerationType || {});
|
|
129
140
|
var PaymentOptions = /* @__PURE__ */ ((PaymentOptions2) => {
|
|
130
141
|
PaymentOptions2["Cash"] = "cash";
|
|
131
142
|
PaymentOptions2["Card"] = "card";
|
|
143
|
+
PaymentOptions2["BusinessInvoice"] = "business_invoice";
|
|
132
144
|
return PaymentOptions2;
|
|
133
145
|
})(PaymentOptions || {});
|
|
134
146
|
|
|
@@ -171,6 +183,8 @@ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
|
|
|
171
183
|
DeliveryStatus,
|
|
172
184
|
EnterpriseType,
|
|
173
185
|
ErrandStatus,
|
|
186
|
+
InvoiceGenerationType,
|
|
187
|
+
InvoiceItemType,
|
|
174
188
|
InvoiceStatus,
|
|
175
189
|
LinkDestination,
|
|
176
190
|
NotificationType,
|
package/dist/index.d.cts
CHANGED
|
@@ -159,9 +159,17 @@ declare enum InvoiceStatus {
|
|
|
159
159
|
Cancelled = "cancelled",
|
|
160
160
|
Failed = "failed"
|
|
161
161
|
}
|
|
162
|
+
declare enum InvoiceItemType {
|
|
163
|
+
Errand = "errand"
|
|
164
|
+
}
|
|
165
|
+
declare enum InvoiceGenerationType {
|
|
166
|
+
Auto = "auto",
|
|
167
|
+
Manual = "manual"
|
|
168
|
+
}
|
|
162
169
|
declare enum PaymentOptions {
|
|
163
170
|
Cash = "cash",
|
|
164
|
-
Card = "card"
|
|
171
|
+
Card = "card",
|
|
172
|
+
BusinessInvoice = "business_invoice"
|
|
165
173
|
}
|
|
166
174
|
interface Invoice {
|
|
167
175
|
id: string;
|
|
@@ -175,6 +183,27 @@ interface Invoice {
|
|
|
175
183
|
errandId?: string;
|
|
176
184
|
authorizationUrl?: string;
|
|
177
185
|
accessCode?: string;
|
|
186
|
+
generationType?: InvoiceGenerationType | `${InvoiceGenerationType}`;
|
|
187
|
+
startDate?: string;
|
|
188
|
+
endDate?: string;
|
|
189
|
+
dueDate?: string;
|
|
190
|
+
invoiceNumber?: string;
|
|
191
|
+
isErrandsPaid?: boolean;
|
|
192
|
+
items: InvoiceItem[];
|
|
193
|
+
businessId?: string;
|
|
194
|
+
createdAt: string;
|
|
195
|
+
updatedAt: string;
|
|
196
|
+
}
|
|
197
|
+
interface InvoiceItem {
|
|
198
|
+
id: string;
|
|
199
|
+
invoiceId: string;
|
|
200
|
+
itemType: InvoiceItemType | `${InvoiceItemType}`;
|
|
201
|
+
itemId: string | Errand;
|
|
202
|
+
amount: number;
|
|
203
|
+
description: string;
|
|
204
|
+
date: string;
|
|
205
|
+
createdAt: string;
|
|
206
|
+
updatedAt: string;
|
|
178
207
|
}
|
|
179
208
|
|
|
180
209
|
type Rider = {
|
|
@@ -309,6 +338,8 @@ interface Errand {
|
|
|
309
338
|
ownerMobileNumber?: string;
|
|
310
339
|
errandTimeline?: string | ErrandTimeline;
|
|
311
340
|
queuePosition?: number;
|
|
341
|
+
isTest?: boolean;
|
|
342
|
+
isInBusinessInvoice?: boolean;
|
|
312
343
|
}
|
|
313
344
|
interface AggregatedErrand extends Errand {
|
|
314
345
|
parcelSize: `${ParcelSize}`;
|
|
@@ -329,7 +360,7 @@ interface AggregatedErrand extends Errand {
|
|
|
329
360
|
stateName: string;
|
|
330
361
|
stateCoords: number[];
|
|
331
362
|
};
|
|
332
|
-
riderUserDetails
|
|
363
|
+
riderUserDetails?: User;
|
|
333
364
|
}
|
|
334
365
|
interface ErrandRating {
|
|
335
366
|
createdAt: string;
|
|
@@ -450,6 +481,7 @@ interface Business {
|
|
|
450
481
|
updatedAt: string | NullOrUndefined | Date;
|
|
451
482
|
verifiedAt: string | NullOrUndefined | Date;
|
|
452
483
|
registrationCompletedAt: string | NullOrUndefined | Date;
|
|
484
|
+
mongoId: string;
|
|
453
485
|
version: number;
|
|
454
486
|
}
|
|
455
487
|
interface BusinessCategory {
|
|
@@ -470,6 +502,8 @@ interface Customer {
|
|
|
470
502
|
address: string;
|
|
471
503
|
landmark?: string;
|
|
472
504
|
errandsCount?: number;
|
|
505
|
+
city?: City;
|
|
506
|
+
state?: State;
|
|
473
507
|
}
|
|
474
508
|
|
|
475
509
|
interface PaginateResult<T> {
|
|
@@ -494,4 +528,4 @@ declare enum LinkDestination {
|
|
|
494
528
|
}
|
|
495
529
|
type NullOrUndefined = null | undefined;
|
|
496
530
|
|
|
497
|
-
export { AddressDetails, AddressTypes, AggregatedErrand, AuthType, Business, BusinessCategory, City, Coupon, Customer, DeliveryStatus, Enterprise, EnterpriseCategoryDoc, EnterpriseSubCategoryDoc, EnterpriseType, Errand, ErrandRating, ErrandStatus, ErrandTimeline, Invoice, InvoiceStatus, LatLng, LinkDestination, Notification, NotificationData, NotificationType, NullOrUndefined, PaginateResult, ParcelSize, PaymentOptions, PendingErrand, Rider, RoleType, State, User, UserAddress, Vehicle, VehicleType, errandTimeline };
|
|
531
|
+
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type City, type Coupon, type Customer, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandRating, ErrandStatus, type ErrandTimeline, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Rider, RoleType, type State, type User, type UserAddress, type Vehicle, VehicleType, errandTimeline };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ type City = {
|
|
|
8
8
|
};
|
|
9
9
|
population: string;
|
|
10
10
|
populationProper: string;
|
|
11
|
-
updatedAt: Date;
|
|
12
|
-
createdAt: Date;
|
|
11
|
+
updatedAt: Date | string;
|
|
12
|
+
createdAt: Date | string;
|
|
13
13
|
version: number;
|
|
14
14
|
isRiderActive: boolean;
|
|
15
15
|
isPropertyActive: boolean;
|
|
@@ -24,8 +24,8 @@ type State = {
|
|
|
24
24
|
};
|
|
25
25
|
alias: string;
|
|
26
26
|
version: number;
|
|
27
|
-
updatedAt: Date;
|
|
28
|
-
createdAt: Date;
|
|
27
|
+
updatedAt: Date | string;
|
|
28
|
+
createdAt: Date | string;
|
|
29
29
|
};
|
|
30
30
|
type LatLng = `${number},${number}`;
|
|
31
31
|
|
|
@@ -159,9 +159,17 @@ declare enum InvoiceStatus {
|
|
|
159
159
|
Cancelled = "cancelled",
|
|
160
160
|
Failed = "failed"
|
|
161
161
|
}
|
|
162
|
+
declare enum InvoiceItemType {
|
|
163
|
+
Errand = "errand"
|
|
164
|
+
}
|
|
165
|
+
declare enum InvoiceGenerationType {
|
|
166
|
+
Auto = "auto",
|
|
167
|
+
Manual = "manual"
|
|
168
|
+
}
|
|
162
169
|
declare enum PaymentOptions {
|
|
163
170
|
Cash = "cash",
|
|
164
|
-
Card = "card"
|
|
171
|
+
Card = "card",
|
|
172
|
+
BusinessInvoice = "business_invoice"
|
|
165
173
|
}
|
|
166
174
|
interface Invoice {
|
|
167
175
|
id: string;
|
|
@@ -175,6 +183,27 @@ interface Invoice {
|
|
|
175
183
|
errandId?: string;
|
|
176
184
|
authorizationUrl?: string;
|
|
177
185
|
accessCode?: string;
|
|
186
|
+
generationType?: InvoiceGenerationType | `${InvoiceGenerationType}`;
|
|
187
|
+
startDate?: string;
|
|
188
|
+
endDate?: string;
|
|
189
|
+
dueDate?: string;
|
|
190
|
+
invoiceNumber?: string;
|
|
191
|
+
isErrandsPaid?: boolean;
|
|
192
|
+
items: InvoiceItem[];
|
|
193
|
+
businessId?: string;
|
|
194
|
+
createdAt: string;
|
|
195
|
+
updatedAt: string;
|
|
196
|
+
}
|
|
197
|
+
interface InvoiceItem {
|
|
198
|
+
id: string;
|
|
199
|
+
invoiceId: string;
|
|
200
|
+
itemType: InvoiceItemType | `${InvoiceItemType}`;
|
|
201
|
+
itemId: string | Errand;
|
|
202
|
+
amount: number;
|
|
203
|
+
description: string;
|
|
204
|
+
date: string;
|
|
205
|
+
createdAt: string;
|
|
206
|
+
updatedAt: string;
|
|
178
207
|
}
|
|
179
208
|
|
|
180
209
|
type Rider = {
|
|
@@ -206,7 +235,6 @@ declare enum VehicleType {
|
|
|
206
235
|
type Vehicle = {
|
|
207
236
|
user: string;
|
|
208
237
|
vehicleNumber: string;
|
|
209
|
-
enterprise: string;
|
|
210
238
|
version: number;
|
|
211
239
|
createdAt: string;
|
|
212
240
|
updatedAt: string;
|
|
@@ -309,8 +337,11 @@ interface Errand {
|
|
|
309
337
|
coupon?: string | Coupon;
|
|
310
338
|
ownerMobileNumber?: string;
|
|
311
339
|
errandTimeline?: string | ErrandTimeline;
|
|
340
|
+
queuePosition?: number;
|
|
341
|
+
isTest?: boolean;
|
|
342
|
+
isInBusinessInvoice?: boolean;
|
|
312
343
|
}
|
|
313
|
-
interface
|
|
344
|
+
interface AggregatedErrand extends Errand {
|
|
314
345
|
parcelSize: `${ParcelSize}`;
|
|
315
346
|
invoiceDetails: Invoice;
|
|
316
347
|
pickupLocation: {
|
|
@@ -329,7 +360,7 @@ interface AggragatedErrand extends Errand {
|
|
|
329
360
|
stateName: string;
|
|
330
361
|
stateCoords: number[];
|
|
331
362
|
};
|
|
332
|
-
riderUserDetails
|
|
363
|
+
riderUserDetails?: User;
|
|
333
364
|
}
|
|
334
365
|
interface ErrandRating {
|
|
335
366
|
createdAt: string;
|
|
@@ -420,6 +451,7 @@ type Notification = {
|
|
|
420
451
|
};
|
|
421
452
|
|
|
422
453
|
interface Business {
|
|
454
|
+
id: string;
|
|
423
455
|
pgId: string;
|
|
424
456
|
seqId: number;
|
|
425
457
|
userId: string;
|
|
@@ -428,7 +460,10 @@ interface Business {
|
|
|
428
460
|
officeNumber: string;
|
|
429
461
|
categoryId: string;
|
|
430
462
|
address: string | NullOrUndefined;
|
|
431
|
-
addressCoordinates: number[] | NullOrUndefined |
|
|
463
|
+
addressCoordinates: number[] | NullOrUndefined | {
|
|
464
|
+
x: number;
|
|
465
|
+
y: number;
|
|
466
|
+
};
|
|
432
467
|
loggedIn: boolean | NullOrUndefined;
|
|
433
468
|
slug: string;
|
|
434
469
|
verified: boolean | NullOrUndefined;
|
|
@@ -436,7 +471,7 @@ interface Business {
|
|
|
436
471
|
registrationCompleted: boolean | NullOrUndefined;
|
|
437
472
|
stateId: string | NullOrUndefined;
|
|
438
473
|
cityId: string | NullOrUndefined;
|
|
439
|
-
|
|
474
|
+
originalLogoUrl: string | NullOrUndefined;
|
|
440
475
|
logoUrl: string | NullOrUndefined;
|
|
441
476
|
logoBlurHash: string | NullOrUndefined;
|
|
442
477
|
coverImageUrl: string | NullOrUndefined;
|
|
@@ -446,8 +481,30 @@ interface Business {
|
|
|
446
481
|
updatedAt: string | NullOrUndefined | Date;
|
|
447
482
|
verifiedAt: string | NullOrUndefined | Date;
|
|
448
483
|
registrationCompletedAt: string | NullOrUndefined | Date;
|
|
484
|
+
mongoId: string;
|
|
449
485
|
version: number;
|
|
450
486
|
}
|
|
487
|
+
interface BusinessCategory {
|
|
488
|
+
id: string;
|
|
489
|
+
seqId: number;
|
|
490
|
+
name: string;
|
|
491
|
+
slug: string;
|
|
492
|
+
createdAt: string;
|
|
493
|
+
updatedAt: string;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
interface Customer {
|
|
497
|
+
id: string;
|
|
498
|
+
businessId: string | Business;
|
|
499
|
+
phoneNumber: string;
|
|
500
|
+
fullName: string;
|
|
501
|
+
cityId: string;
|
|
502
|
+
address: string;
|
|
503
|
+
landmark?: string;
|
|
504
|
+
errandsCount?: number;
|
|
505
|
+
city?: City;
|
|
506
|
+
state?: State;
|
|
507
|
+
}
|
|
451
508
|
|
|
452
509
|
interface PaginateResult<T> {
|
|
453
510
|
docs: T[];
|
|
@@ -471,4 +528,4 @@ declare enum LinkDestination {
|
|
|
471
528
|
}
|
|
472
529
|
type NullOrUndefined = null | undefined;
|
|
473
530
|
|
|
474
|
-
export { AddressDetails, AddressTypes,
|
|
531
|
+
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type City, type Coupon, type Customer, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandRating, ErrandStatus, type ErrandTimeline, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Rider, RoleType, type State, type User, type UserAddress, type Vehicle, VehicleType, errandTimeline };
|
package/dist/index.js
CHANGED
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
AddressTypes: () => AddressTypes,
|
|
24
|
-
AuthType: () => AuthType,
|
|
25
|
-
DeliveryStatus: () => DeliveryStatus,
|
|
26
|
-
EnterpriseType: () => EnterpriseType,
|
|
27
|
-
ErrandStatus: () => ErrandStatus,
|
|
28
|
-
InvoiceStatus: () => InvoiceStatus,
|
|
29
|
-
LinkDestination: () => LinkDestination,
|
|
30
|
-
NotificationType: () => NotificationType,
|
|
31
|
-
ParcelSize: () => ParcelSize,
|
|
32
|
-
PaymentOptions: () => PaymentOptions,
|
|
33
|
-
RoleType: () => RoleType,
|
|
34
|
-
errandTimeline: () => errandTimeline
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(src_exports);
|
|
37
|
-
|
|
38
1
|
// src/user.ts
|
|
39
2
|
var RoleType = /* @__PURE__ */ ((RoleType2) => {
|
|
40
3
|
RoleType2["Rider"] = "rider";
|
|
@@ -70,6 +33,11 @@ var errandTimeline = [
|
|
|
70
33
|
title: "pending" /* Pending */,
|
|
71
34
|
description: "Your errand is pending, you would be notified as soon as it is started"
|
|
72
35
|
},
|
|
36
|
+
{
|
|
37
|
+
status: "rider-assigned" /* RiderAssigned */,
|
|
38
|
+
title: "rider-assigned" /* RiderAssigned */,
|
|
39
|
+
description: "Your errand has been assigned to a dispatch rider, you would be notified by the dispatch rider shortly"
|
|
40
|
+
},
|
|
73
41
|
{
|
|
74
42
|
status: "started" /* Started */,
|
|
75
43
|
title: "started" /* Started */,
|
|
@@ -120,9 +88,19 @@ var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
|
|
|
120
88
|
InvoiceStatus2["Failed"] = "failed";
|
|
121
89
|
return InvoiceStatus2;
|
|
122
90
|
})(InvoiceStatus || {});
|
|
91
|
+
var InvoiceItemType = /* @__PURE__ */ ((InvoiceItemType2) => {
|
|
92
|
+
InvoiceItemType2["Errand"] = "errand";
|
|
93
|
+
return InvoiceItemType2;
|
|
94
|
+
})(InvoiceItemType || {});
|
|
95
|
+
var InvoiceGenerationType = /* @__PURE__ */ ((InvoiceGenerationType2) => {
|
|
96
|
+
InvoiceGenerationType2["Auto"] = "auto";
|
|
97
|
+
InvoiceGenerationType2["Manual"] = "manual";
|
|
98
|
+
return InvoiceGenerationType2;
|
|
99
|
+
})(InvoiceGenerationType || {});
|
|
123
100
|
var PaymentOptions = /* @__PURE__ */ ((PaymentOptions2) => {
|
|
124
101
|
PaymentOptions2["Cash"] = "cash";
|
|
125
102
|
PaymentOptions2["Card"] = "card";
|
|
103
|
+
PaymentOptions2["BusinessInvoice"] = "business_invoice";
|
|
126
104
|
return PaymentOptions2;
|
|
127
105
|
})(PaymentOptions || {});
|
|
128
106
|
|
|
@@ -135,6 +113,13 @@ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
|
|
|
135
113
|
return NotificationType2;
|
|
136
114
|
})(NotificationType || {});
|
|
137
115
|
|
|
116
|
+
// src/rider.ts
|
|
117
|
+
var VehicleType = /* @__PURE__ */ ((VehicleType2) => {
|
|
118
|
+
VehicleType2["Bike"] = "bike";
|
|
119
|
+
VehicleType2["Shuttle"] = "shuttle";
|
|
120
|
+
return VehicleType2;
|
|
121
|
+
})(VehicleType || {});
|
|
122
|
+
|
|
138
123
|
// src/enterprise.ts
|
|
139
124
|
var EnterpriseType = /* @__PURE__ */ ((EnterpriseType2) => {
|
|
140
125
|
EnterpriseType2["Restaurant"] = "restaurant";
|
|
@@ -151,18 +136,20 @@ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
|
|
|
151
136
|
LinkDestination2["RiderApp"] = "mydoormot:rider";
|
|
152
137
|
return LinkDestination2;
|
|
153
138
|
})(LinkDestination || {});
|
|
154
|
-
|
|
155
|
-
0 && (module.exports = {
|
|
139
|
+
export {
|
|
156
140
|
AddressTypes,
|
|
157
141
|
AuthType,
|
|
158
142
|
DeliveryStatus,
|
|
159
143
|
EnterpriseType,
|
|
160
144
|
ErrandStatus,
|
|
145
|
+
InvoiceGenerationType,
|
|
146
|
+
InvoiceItemType,
|
|
161
147
|
InvoiceStatus,
|
|
162
148
|
LinkDestination,
|
|
163
149
|
NotificationType,
|
|
164
150
|
ParcelSize,
|
|
165
151
|
PaymentOptions,
|
|
166
152
|
RoleType,
|
|
153
|
+
VehicleType,
|
|
167
154
|
errandTimeline
|
|
168
|
-
}
|
|
155
|
+
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mydoormot/app-types",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.cjs"
|
|
11
|
+
},
|
|
8
12
|
"keywords": [],
|
|
9
13
|
"author": "",
|
|
10
14
|
"license": "ISC",
|
|
@@ -17,7 +21,7 @@
|
|
|
17
21
|
},
|
|
18
22
|
"type": "module",
|
|
19
23
|
"scripts": {
|
|
20
|
-
"clean": "del ./
|
|
21
|
-
"build": "tsup src/index.ts --format cjs --dts"
|
|
24
|
+
"clean": "del ./dist/*",
|
|
25
|
+
"build": "tsup src/index.ts --format esm,cjs --dts"
|
|
22
26
|
}
|
|
23
27
|
}
|
package/src/business.ts
CHANGED
package/src/customer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Business } from '.';
|
|
1
|
+
import { Business, City, State } from '.';
|
|
2
2
|
|
|
3
3
|
export interface Customer {
|
|
4
4
|
id: string;
|
|
@@ -11,4 +11,6 @@ export interface Customer {
|
|
|
11
11
|
|
|
12
12
|
// From aggregation
|
|
13
13
|
errandsCount?: number;
|
|
14
|
+
city?: City;
|
|
15
|
+
state?: State;
|
|
14
16
|
}
|
package/src/errand.ts
CHANGED
|
@@ -140,6 +140,8 @@ export interface Errand {
|
|
|
140
140
|
ownerMobileNumber?: string;
|
|
141
141
|
errandTimeline?: string | ErrandTimeline;
|
|
142
142
|
queuePosition?: number;
|
|
143
|
+
isTest?: boolean;
|
|
144
|
+
isInBusinessInvoice?: boolean;
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
export interface AggregatedErrand extends Errand {
|
|
@@ -161,7 +163,7 @@ export interface AggregatedErrand extends Errand {
|
|
|
161
163
|
stateName: string;
|
|
162
164
|
stateCoords: number[];
|
|
163
165
|
};
|
|
164
|
-
riderUserDetails
|
|
166
|
+
riderUserDetails?: User;
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
export interface ErrandTimeline {
|
package/src/invoice.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EnterpriseType } from './enterprise';
|
|
2
|
+
import { Errand } from './errand';
|
|
2
3
|
|
|
3
4
|
export enum InvoiceStatus {
|
|
4
5
|
Pending = 'pending',
|
|
@@ -8,9 +9,20 @@ export enum InvoiceStatus {
|
|
|
8
9
|
Failed = 'failed',
|
|
9
10
|
}
|
|
10
11
|
|
|
12
|
+
export enum InvoiceItemType {
|
|
13
|
+
Errand = 'errand',
|
|
14
|
+
// Future item types can be added here
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum InvoiceGenerationType {
|
|
18
|
+
Auto = 'auto',
|
|
19
|
+
Manual = 'manual',
|
|
20
|
+
}
|
|
21
|
+
|
|
11
22
|
export enum PaymentOptions {
|
|
12
23
|
Cash = 'cash',
|
|
13
24
|
Card = 'card',
|
|
25
|
+
BusinessInvoice = 'business_invoice',
|
|
14
26
|
}
|
|
15
27
|
|
|
16
28
|
export interface Invoice {
|
|
@@ -25,4 +37,26 @@ export interface Invoice {
|
|
|
25
37
|
errandId?: string;
|
|
26
38
|
authorizationUrl?: string;
|
|
27
39
|
accessCode?: string;
|
|
40
|
+
generationType?: InvoiceGenerationType | `${InvoiceGenerationType}`;
|
|
41
|
+
startDate?: string;
|
|
42
|
+
endDate?: string;
|
|
43
|
+
dueDate?: string;
|
|
44
|
+
invoiceNumber?: string;
|
|
45
|
+
isErrandsPaid?: boolean;
|
|
46
|
+
items: InvoiceItem[];
|
|
47
|
+
businessId?: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
updatedAt: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface InvoiceItem {
|
|
53
|
+
id: string;
|
|
54
|
+
invoiceId: string;
|
|
55
|
+
itemType: InvoiceItemType | `${InvoiceItemType}`;
|
|
56
|
+
itemId: string | Errand;
|
|
57
|
+
amount: number;
|
|
58
|
+
description: string;
|
|
59
|
+
date: string;
|
|
60
|
+
createdAt: string;
|
|
61
|
+
updatedAt: string;
|
|
28
62
|
}
|
package/tsconfig.json
CHANGED
|
@@ -25,10 +25,9 @@
|
|
|
25
25
|
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
26
26
|
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
27
27
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
28
|
-
|
|
29
28
|
"preserveWatchOutput": true,
|
|
30
29
|
/* Modules */
|
|
31
|
-
"module": "
|
|
30
|
+
"module": "CommonJS" /* Specify what module code is generated. */,
|
|
32
31
|
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
33
32
|
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
34
33
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|