@mydoormot/app-types 1.7.14 → 1.7.16
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 +7 -7
- package/CHANGELOG.md +12 -0
- package/dist/index.d.cts +84 -86
- package/dist/index.d.ts +84 -86
- package/package.json +1 -1
- package/src/customer.ts +11 -0
- package/src/errand.ts +9 -7
- package/src/invoice.ts +12 -17
- package/src/rider.ts +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @mydoormot/app-types@1.7.
|
|
2
|
+
> @mydoormot/app-types@1.7.15 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2021
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.js [22m[32m6.17 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in 71ms
|
|
13
11
|
[32mCJS[39m [1mdist/index.cjs [22m[32m7.84 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 61ms
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m6.17 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 61ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m17.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m17.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 686ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m17.71 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m17.71 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -107,59 +107,26 @@ interface Coupon {
|
|
|
107
107
|
fullName?: string;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
type Enterprise = {
|
|
117
|
-
id: string;
|
|
118
|
-
user: string | User;
|
|
119
|
-
name: string;
|
|
120
|
-
city: string;
|
|
121
|
-
verified: boolean;
|
|
122
|
-
mobileNumber?: string;
|
|
123
|
-
enterpriseType: EnterpriseType | `${EnterpriseType}`;
|
|
124
|
-
deleted: boolean;
|
|
125
|
-
updatedAt: Date;
|
|
126
|
-
createdAt: Date;
|
|
127
|
-
isActive: boolean;
|
|
128
|
-
version: number;
|
|
129
|
-
officeNumber?: string;
|
|
130
|
-
address?: {
|
|
131
|
-
coordinates?: number[];
|
|
132
|
-
address?: string;
|
|
133
|
-
};
|
|
134
|
-
image?: string;
|
|
135
|
-
coverImage?: string;
|
|
136
|
-
activationDate?: string;
|
|
137
|
-
category: EnterpriseCategoryDoc[] | string[];
|
|
138
|
-
subCategory: EnterpriseSubCategoryDoc[] | string[];
|
|
139
|
-
socialLinks: {
|
|
140
|
-
name: string;
|
|
141
|
-
url: string;
|
|
142
|
-
active: boolean;
|
|
143
|
-
}[];
|
|
144
|
-
};
|
|
145
|
-
interface EnterpriseCategoryDoc {
|
|
146
|
-
id: string;
|
|
147
|
-
name: string;
|
|
148
|
-
slug: string;
|
|
149
|
-
subCategories: EnterpriseSubCategoryDoc[];
|
|
110
|
+
interface CustomerTransactionStats {
|
|
111
|
+
totalSaleCount: number;
|
|
112
|
+
totalSaleAmount: number;
|
|
113
|
+
totalExpenseCount: number;
|
|
114
|
+
totalExpenseAmount: number;
|
|
115
|
+
lastTransactionDate: string | null;
|
|
150
116
|
updatedAt: string;
|
|
151
|
-
createdAt: string;
|
|
152
|
-
image?: string;
|
|
153
117
|
}
|
|
154
|
-
interface
|
|
118
|
+
interface Customer {
|
|
155
119
|
id: string;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
120
|
+
businessId: string;
|
|
121
|
+
phoneNumber: string;
|
|
122
|
+
fullName: string;
|
|
123
|
+
cityId: string;
|
|
124
|
+
address: string;
|
|
125
|
+
landmark?: string;
|
|
162
126
|
createdAt: string;
|
|
127
|
+
updatedAt: string;
|
|
128
|
+
customerBusinessId?: string;
|
|
129
|
+
transactionStats?: CustomerTransactionStats;
|
|
163
130
|
}
|
|
164
131
|
|
|
165
132
|
declare enum InvoiceStatus {
|
|
@@ -183,26 +150,20 @@ declare enum PaymentOptions {
|
|
|
183
150
|
}
|
|
184
151
|
interface Invoice {
|
|
185
152
|
id: string;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
153
|
+
businessId: string;
|
|
154
|
+
userId: string;
|
|
155
|
+
invoiceNumber: string;
|
|
156
|
+
startDate: string;
|
|
157
|
+
endDate: string;
|
|
158
|
+
totalAmount: number;
|
|
159
|
+
paidAmount: number;
|
|
160
|
+
unpaidAmount: number;
|
|
190
161
|
status: InvoiceStatus | `${InvoiceStatus}`;
|
|
191
|
-
|
|
192
|
-
referenceId?: string;
|
|
193
|
-
errandId?: string;
|
|
194
|
-
authorizationUrl?: string;
|
|
195
|
-
accessCode?: string;
|
|
196
|
-
generationType?: InvoiceGenerationType | `${InvoiceGenerationType}`;
|
|
197
|
-
startDate?: string;
|
|
198
|
-
endDate?: string;
|
|
199
|
-
dueDate?: string;
|
|
200
|
-
invoiceNumber?: string;
|
|
201
|
-
isErrandsPaid?: boolean;
|
|
162
|
+
customerId: string;
|
|
202
163
|
items: InvoiceItem[];
|
|
203
|
-
businessId?: string;
|
|
204
164
|
createdAt: string;
|
|
205
165
|
updatedAt: string;
|
|
166
|
+
customerDetails?: Customer;
|
|
206
167
|
}
|
|
207
168
|
interface InvoiceItem {
|
|
208
169
|
id: string;
|
|
@@ -274,6 +235,7 @@ type VehicleLog = {
|
|
|
274
235
|
errandIdsSinceLastRefuel?: string[];
|
|
275
236
|
maintenanceType?: string;
|
|
276
237
|
maintenanceCost?: number;
|
|
238
|
+
vehicleDetails?: Vehicle;
|
|
277
239
|
};
|
|
278
240
|
type VehicleLogWithErrands = VehicleLog & {
|
|
279
241
|
errandsCount?: number;
|
|
@@ -359,13 +321,7 @@ interface Errand {
|
|
|
359
321
|
parcelSize: `${ParcelSize}`;
|
|
360
322
|
deliveryStatus: ErrandStatus | `${ErrandStatus}`;
|
|
361
323
|
paymentStatus: `${InvoiceStatus}`;
|
|
362
|
-
|
|
363
|
-
invoiceStatus: InvoiceStatus | `${InvoiceStatus}`;
|
|
364
|
-
refId: string;
|
|
365
|
-
authorizationUrl: string;
|
|
366
|
-
accessCode: string;
|
|
367
|
-
invoiceId?: string | Invoice;
|
|
368
|
-
};
|
|
324
|
+
invoiceId?: string;
|
|
369
325
|
aliasId: string;
|
|
370
326
|
updatedAt: Date;
|
|
371
327
|
createdAt: Date;
|
|
@@ -537,6 +493,61 @@ type Notification = {
|
|
|
537
493
|
updatedAt: string;
|
|
538
494
|
};
|
|
539
495
|
|
|
496
|
+
declare enum EnterpriseType {
|
|
497
|
+
Restaurant = "restaurant",
|
|
498
|
+
Dispatch = "dispatch",
|
|
499
|
+
Property = "property",
|
|
500
|
+
Store = "store"
|
|
501
|
+
}
|
|
502
|
+
type Enterprise = {
|
|
503
|
+
id: string;
|
|
504
|
+
user: string | User;
|
|
505
|
+
name: string;
|
|
506
|
+
city: string;
|
|
507
|
+
verified: boolean;
|
|
508
|
+
mobileNumber?: string;
|
|
509
|
+
enterpriseType: EnterpriseType | `${EnterpriseType}`;
|
|
510
|
+
deleted: boolean;
|
|
511
|
+
updatedAt: Date;
|
|
512
|
+
createdAt: Date;
|
|
513
|
+
isActive: boolean;
|
|
514
|
+
version: number;
|
|
515
|
+
officeNumber?: string;
|
|
516
|
+
address?: {
|
|
517
|
+
coordinates?: number[];
|
|
518
|
+
address?: string;
|
|
519
|
+
};
|
|
520
|
+
image?: string;
|
|
521
|
+
coverImage?: string;
|
|
522
|
+
activationDate?: string;
|
|
523
|
+
category: EnterpriseCategoryDoc[] | string[];
|
|
524
|
+
subCategory: EnterpriseSubCategoryDoc[] | string[];
|
|
525
|
+
socialLinks: {
|
|
526
|
+
name: string;
|
|
527
|
+
url: string;
|
|
528
|
+
active: boolean;
|
|
529
|
+
}[];
|
|
530
|
+
};
|
|
531
|
+
interface EnterpriseCategoryDoc {
|
|
532
|
+
id: string;
|
|
533
|
+
name: string;
|
|
534
|
+
slug: string;
|
|
535
|
+
subCategories: EnterpriseSubCategoryDoc[];
|
|
536
|
+
updatedAt: string;
|
|
537
|
+
createdAt: string;
|
|
538
|
+
image?: string;
|
|
539
|
+
}
|
|
540
|
+
interface EnterpriseSubCategoryDoc {
|
|
541
|
+
id: string;
|
|
542
|
+
name: string;
|
|
543
|
+
category: string;
|
|
544
|
+
slug: string;
|
|
545
|
+
image?: string;
|
|
546
|
+
serviceItems: string[];
|
|
547
|
+
updatedAt: string;
|
|
548
|
+
createdAt: string;
|
|
549
|
+
}
|
|
550
|
+
|
|
540
551
|
interface Business {
|
|
541
552
|
id: string;
|
|
542
553
|
userId: string;
|
|
@@ -612,19 +623,6 @@ interface BusinessMember {
|
|
|
612
623
|
updatedAt: string | NullOrUndefined;
|
|
613
624
|
}
|
|
614
625
|
|
|
615
|
-
interface Customer {
|
|
616
|
-
id: string;
|
|
617
|
-
businessId: string;
|
|
618
|
-
phoneNumber: string;
|
|
619
|
-
fullName: string;
|
|
620
|
-
cityId: string;
|
|
621
|
-
address: string;
|
|
622
|
-
landmark?: string;
|
|
623
|
-
createdAt: string;
|
|
624
|
-
updatedAt: string;
|
|
625
|
-
customerBusinessId?: string;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
626
|
type TransactionType = 'sale' | 'expense';
|
|
629
627
|
interface TransactionItem {
|
|
630
628
|
name: string;
|
|
@@ -710,4 +708,4 @@ declare enum LinkDestination {
|
|
|
710
708
|
}
|
|
711
709
|
type NullOrUndefined = null | undefined;
|
|
712
710
|
|
|
713
|
-
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, type Coupon, type Customer, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Rider, RoleType, type State, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
|
|
711
|
+
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, type Coupon, type Customer, type CustomerTransactionStats, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Rider, RoleType, type State, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
|
package/dist/index.d.ts
CHANGED
|
@@ -107,59 +107,26 @@ interface Coupon {
|
|
|
107
107
|
fullName?: string;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
type Enterprise = {
|
|
117
|
-
id: string;
|
|
118
|
-
user: string | User;
|
|
119
|
-
name: string;
|
|
120
|
-
city: string;
|
|
121
|
-
verified: boolean;
|
|
122
|
-
mobileNumber?: string;
|
|
123
|
-
enterpriseType: EnterpriseType | `${EnterpriseType}`;
|
|
124
|
-
deleted: boolean;
|
|
125
|
-
updatedAt: Date;
|
|
126
|
-
createdAt: Date;
|
|
127
|
-
isActive: boolean;
|
|
128
|
-
version: number;
|
|
129
|
-
officeNumber?: string;
|
|
130
|
-
address?: {
|
|
131
|
-
coordinates?: number[];
|
|
132
|
-
address?: string;
|
|
133
|
-
};
|
|
134
|
-
image?: string;
|
|
135
|
-
coverImage?: string;
|
|
136
|
-
activationDate?: string;
|
|
137
|
-
category: EnterpriseCategoryDoc[] | string[];
|
|
138
|
-
subCategory: EnterpriseSubCategoryDoc[] | string[];
|
|
139
|
-
socialLinks: {
|
|
140
|
-
name: string;
|
|
141
|
-
url: string;
|
|
142
|
-
active: boolean;
|
|
143
|
-
}[];
|
|
144
|
-
};
|
|
145
|
-
interface EnterpriseCategoryDoc {
|
|
146
|
-
id: string;
|
|
147
|
-
name: string;
|
|
148
|
-
slug: string;
|
|
149
|
-
subCategories: EnterpriseSubCategoryDoc[];
|
|
110
|
+
interface CustomerTransactionStats {
|
|
111
|
+
totalSaleCount: number;
|
|
112
|
+
totalSaleAmount: number;
|
|
113
|
+
totalExpenseCount: number;
|
|
114
|
+
totalExpenseAmount: number;
|
|
115
|
+
lastTransactionDate: string | null;
|
|
150
116
|
updatedAt: string;
|
|
151
|
-
createdAt: string;
|
|
152
|
-
image?: string;
|
|
153
117
|
}
|
|
154
|
-
interface
|
|
118
|
+
interface Customer {
|
|
155
119
|
id: string;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
120
|
+
businessId: string;
|
|
121
|
+
phoneNumber: string;
|
|
122
|
+
fullName: string;
|
|
123
|
+
cityId: string;
|
|
124
|
+
address: string;
|
|
125
|
+
landmark?: string;
|
|
162
126
|
createdAt: string;
|
|
127
|
+
updatedAt: string;
|
|
128
|
+
customerBusinessId?: string;
|
|
129
|
+
transactionStats?: CustomerTransactionStats;
|
|
163
130
|
}
|
|
164
131
|
|
|
165
132
|
declare enum InvoiceStatus {
|
|
@@ -183,26 +150,20 @@ declare enum PaymentOptions {
|
|
|
183
150
|
}
|
|
184
151
|
interface Invoice {
|
|
185
152
|
id: string;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
153
|
+
businessId: string;
|
|
154
|
+
userId: string;
|
|
155
|
+
invoiceNumber: string;
|
|
156
|
+
startDate: string;
|
|
157
|
+
endDate: string;
|
|
158
|
+
totalAmount: number;
|
|
159
|
+
paidAmount: number;
|
|
160
|
+
unpaidAmount: number;
|
|
190
161
|
status: InvoiceStatus | `${InvoiceStatus}`;
|
|
191
|
-
|
|
192
|
-
referenceId?: string;
|
|
193
|
-
errandId?: string;
|
|
194
|
-
authorizationUrl?: string;
|
|
195
|
-
accessCode?: string;
|
|
196
|
-
generationType?: InvoiceGenerationType | `${InvoiceGenerationType}`;
|
|
197
|
-
startDate?: string;
|
|
198
|
-
endDate?: string;
|
|
199
|
-
dueDate?: string;
|
|
200
|
-
invoiceNumber?: string;
|
|
201
|
-
isErrandsPaid?: boolean;
|
|
162
|
+
customerId: string;
|
|
202
163
|
items: InvoiceItem[];
|
|
203
|
-
businessId?: string;
|
|
204
164
|
createdAt: string;
|
|
205
165
|
updatedAt: string;
|
|
166
|
+
customerDetails?: Customer;
|
|
206
167
|
}
|
|
207
168
|
interface InvoiceItem {
|
|
208
169
|
id: string;
|
|
@@ -274,6 +235,7 @@ type VehicleLog = {
|
|
|
274
235
|
errandIdsSinceLastRefuel?: string[];
|
|
275
236
|
maintenanceType?: string;
|
|
276
237
|
maintenanceCost?: number;
|
|
238
|
+
vehicleDetails?: Vehicle;
|
|
277
239
|
};
|
|
278
240
|
type VehicleLogWithErrands = VehicleLog & {
|
|
279
241
|
errandsCount?: number;
|
|
@@ -359,13 +321,7 @@ interface Errand {
|
|
|
359
321
|
parcelSize: `${ParcelSize}`;
|
|
360
322
|
deliveryStatus: ErrandStatus | `${ErrandStatus}`;
|
|
361
323
|
paymentStatus: `${InvoiceStatus}`;
|
|
362
|
-
|
|
363
|
-
invoiceStatus: InvoiceStatus | `${InvoiceStatus}`;
|
|
364
|
-
refId: string;
|
|
365
|
-
authorizationUrl: string;
|
|
366
|
-
accessCode: string;
|
|
367
|
-
invoiceId?: string | Invoice;
|
|
368
|
-
};
|
|
324
|
+
invoiceId?: string;
|
|
369
325
|
aliasId: string;
|
|
370
326
|
updatedAt: Date;
|
|
371
327
|
createdAt: Date;
|
|
@@ -537,6 +493,61 @@ type Notification = {
|
|
|
537
493
|
updatedAt: string;
|
|
538
494
|
};
|
|
539
495
|
|
|
496
|
+
declare enum EnterpriseType {
|
|
497
|
+
Restaurant = "restaurant",
|
|
498
|
+
Dispatch = "dispatch",
|
|
499
|
+
Property = "property",
|
|
500
|
+
Store = "store"
|
|
501
|
+
}
|
|
502
|
+
type Enterprise = {
|
|
503
|
+
id: string;
|
|
504
|
+
user: string | User;
|
|
505
|
+
name: string;
|
|
506
|
+
city: string;
|
|
507
|
+
verified: boolean;
|
|
508
|
+
mobileNumber?: string;
|
|
509
|
+
enterpriseType: EnterpriseType | `${EnterpriseType}`;
|
|
510
|
+
deleted: boolean;
|
|
511
|
+
updatedAt: Date;
|
|
512
|
+
createdAt: Date;
|
|
513
|
+
isActive: boolean;
|
|
514
|
+
version: number;
|
|
515
|
+
officeNumber?: string;
|
|
516
|
+
address?: {
|
|
517
|
+
coordinates?: number[];
|
|
518
|
+
address?: string;
|
|
519
|
+
};
|
|
520
|
+
image?: string;
|
|
521
|
+
coverImage?: string;
|
|
522
|
+
activationDate?: string;
|
|
523
|
+
category: EnterpriseCategoryDoc[] | string[];
|
|
524
|
+
subCategory: EnterpriseSubCategoryDoc[] | string[];
|
|
525
|
+
socialLinks: {
|
|
526
|
+
name: string;
|
|
527
|
+
url: string;
|
|
528
|
+
active: boolean;
|
|
529
|
+
}[];
|
|
530
|
+
};
|
|
531
|
+
interface EnterpriseCategoryDoc {
|
|
532
|
+
id: string;
|
|
533
|
+
name: string;
|
|
534
|
+
slug: string;
|
|
535
|
+
subCategories: EnterpriseSubCategoryDoc[];
|
|
536
|
+
updatedAt: string;
|
|
537
|
+
createdAt: string;
|
|
538
|
+
image?: string;
|
|
539
|
+
}
|
|
540
|
+
interface EnterpriseSubCategoryDoc {
|
|
541
|
+
id: string;
|
|
542
|
+
name: string;
|
|
543
|
+
category: string;
|
|
544
|
+
slug: string;
|
|
545
|
+
image?: string;
|
|
546
|
+
serviceItems: string[];
|
|
547
|
+
updatedAt: string;
|
|
548
|
+
createdAt: string;
|
|
549
|
+
}
|
|
550
|
+
|
|
540
551
|
interface Business {
|
|
541
552
|
id: string;
|
|
542
553
|
userId: string;
|
|
@@ -612,19 +623,6 @@ interface BusinessMember {
|
|
|
612
623
|
updatedAt: string | NullOrUndefined;
|
|
613
624
|
}
|
|
614
625
|
|
|
615
|
-
interface Customer {
|
|
616
|
-
id: string;
|
|
617
|
-
businessId: string;
|
|
618
|
-
phoneNumber: string;
|
|
619
|
-
fullName: string;
|
|
620
|
-
cityId: string;
|
|
621
|
-
address: string;
|
|
622
|
-
landmark?: string;
|
|
623
|
-
createdAt: string;
|
|
624
|
-
updatedAt: string;
|
|
625
|
-
customerBusinessId?: string;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
626
|
type TransactionType = 'sale' | 'expense';
|
|
629
627
|
interface TransactionItem {
|
|
630
628
|
name: string;
|
|
@@ -710,4 +708,4 @@ declare enum LinkDestination {
|
|
|
710
708
|
}
|
|
711
709
|
type NullOrUndefined = null | undefined;
|
|
712
710
|
|
|
713
|
-
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, type Coupon, type Customer, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Rider, RoleType, type State, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
|
|
711
|
+
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, type Coupon, type Customer, type CustomerTransactionStats, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Rider, RoleType, type State, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
|
package/package.json
CHANGED
package/src/customer.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
// import { Business, City, State } from '.';
|
|
2
2
|
|
|
3
|
+
export interface CustomerTransactionStats {
|
|
4
|
+
totalSaleCount: number;
|
|
5
|
+
totalSaleAmount: number;
|
|
6
|
+
totalExpenseCount: number;
|
|
7
|
+
totalExpenseAmount: number;
|
|
8
|
+
lastTransactionDate: string | null;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
3
12
|
export interface Customer {
|
|
4
13
|
id: string;
|
|
5
14
|
businessId: string;
|
|
@@ -13,6 +22,8 @@ export interface Customer {
|
|
|
13
22
|
|
|
14
23
|
customerBusinessId?: string;
|
|
15
24
|
|
|
25
|
+
transactionStats?: CustomerTransactionStats;
|
|
26
|
+
|
|
16
27
|
// From aggregation
|
|
17
28
|
// errandsCount?: number;
|
|
18
29
|
// city?: City;
|
package/src/errand.ts
CHANGED
|
@@ -129,13 +129,15 @@ export interface Errand {
|
|
|
129
129
|
parcelSize: `${ParcelSize}`;
|
|
130
130
|
deliveryStatus: ErrandStatus | `${ErrandStatus}`;
|
|
131
131
|
paymentStatus: `${InvoiceStatus}`;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
invoiceId?: string;
|
|
133
|
+
|
|
134
|
+
// invoice: {
|
|
135
|
+
// invoiceStatus: InvoiceStatus | `${InvoiceStatus}`;
|
|
136
|
+
// refId: string;
|
|
137
|
+
// authorizationUrl: string;
|
|
138
|
+
// accessCode: string;
|
|
139
|
+
// invoiceId?: string | Invoice;
|
|
140
|
+
// };
|
|
139
141
|
aliasId: string;
|
|
140
142
|
updatedAt: Date;
|
|
141
143
|
createdAt: Date;
|
package/src/invoice.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Customer } from './customer';
|
|
2
2
|
import { Errand } from './errand';
|
|
3
3
|
|
|
4
4
|
export enum InvoiceStatus {
|
|
@@ -27,26 +27,21 @@ export enum PaymentOptions {
|
|
|
27
27
|
|
|
28
28
|
export interface Invoice {
|
|
29
29
|
id: string;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
businessId: string;
|
|
31
|
+
userId: string;
|
|
32
|
+
invoiceNumber: string;
|
|
33
|
+
startDate: string;
|
|
34
|
+
endDate: string;
|
|
35
|
+
totalAmount: number;
|
|
36
|
+
paidAmount: number;
|
|
37
|
+
unpaidAmount: number;
|
|
34
38
|
status: InvoiceStatus | `${InvoiceStatus}`;
|
|
35
|
-
|
|
36
|
-
referenceId?: string;
|
|
37
|
-
errandId?: string;
|
|
38
|
-
authorizationUrl?: string;
|
|
39
|
-
accessCode?: string;
|
|
40
|
-
generationType?: InvoiceGenerationType | `${InvoiceGenerationType}`;
|
|
41
|
-
startDate?: string;
|
|
42
|
-
endDate?: string;
|
|
43
|
-
dueDate?: string;
|
|
44
|
-
invoiceNumber?: string;
|
|
45
|
-
isErrandsPaid?: boolean;
|
|
39
|
+
customerId: string;
|
|
46
40
|
items: InvoiceItem[];
|
|
47
|
-
businessId?: string;
|
|
48
41
|
createdAt: string;
|
|
49
42
|
updatedAt: string;
|
|
43
|
+
|
|
44
|
+
customerDetails?: Customer;
|
|
50
45
|
}
|
|
51
46
|
|
|
52
47
|
export interface InvoiceItem {
|