@mydoormot/app-types 1.7.15 → 1.7.17
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 +6 -6
- package/CHANGELOG.md +12 -0
- package/dist/index.d.cts +85 -95
- package/dist/index.d.ts +85 -95
- package/package.json +1 -1
- package/src/errand.ts +9 -7
- package/src/invoice.ts +17 -18
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @mydoormot/app-types@1.7.
|
|
2
|
+
> @mydoormot/app-types@1.7.16 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
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[32mESM[39m [1mdist/index.js [22m[32m6.17 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 61ms
|
|
13
13
|
[32mCJS[39m [1mdist/index.cjs [22m[32m7.84 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 62ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 1296ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m17.78 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m17.78 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,38 +150,34 @@ 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;
|
|
167
|
+
paidErrandsCount?: number;
|
|
168
|
+
unpaidErrandsCount?: number;
|
|
206
169
|
}
|
|
207
170
|
interface InvoiceItem {
|
|
208
171
|
id: string;
|
|
209
172
|
invoiceId: string;
|
|
210
173
|
itemType: InvoiceItemType | `${InvoiceItemType}`;
|
|
211
174
|
itemId: string;
|
|
212
|
-
item: Errand;
|
|
213
175
|
amount: number;
|
|
214
176
|
description: string;
|
|
215
177
|
date: string;
|
|
216
178
|
createdAt: string;
|
|
217
179
|
updatedAt: string;
|
|
180
|
+
itemDetails?: Errand;
|
|
218
181
|
}
|
|
219
182
|
|
|
220
183
|
type Rider = {
|
|
@@ -360,13 +323,7 @@ interface Errand {
|
|
|
360
323
|
parcelSize: `${ParcelSize}`;
|
|
361
324
|
deliveryStatus: ErrandStatus | `${ErrandStatus}`;
|
|
362
325
|
paymentStatus: `${InvoiceStatus}`;
|
|
363
|
-
|
|
364
|
-
invoiceStatus: InvoiceStatus | `${InvoiceStatus}`;
|
|
365
|
-
refId: string;
|
|
366
|
-
authorizationUrl: string;
|
|
367
|
-
accessCode: string;
|
|
368
|
-
invoiceId?: string | Invoice;
|
|
369
|
-
};
|
|
326
|
+
invoiceId?: string;
|
|
370
327
|
aliasId: string;
|
|
371
328
|
updatedAt: Date;
|
|
372
329
|
createdAt: Date;
|
|
@@ -538,6 +495,61 @@ type Notification = {
|
|
|
538
495
|
updatedAt: string;
|
|
539
496
|
};
|
|
540
497
|
|
|
498
|
+
declare enum EnterpriseType {
|
|
499
|
+
Restaurant = "restaurant",
|
|
500
|
+
Dispatch = "dispatch",
|
|
501
|
+
Property = "property",
|
|
502
|
+
Store = "store"
|
|
503
|
+
}
|
|
504
|
+
type Enterprise = {
|
|
505
|
+
id: string;
|
|
506
|
+
user: string | User;
|
|
507
|
+
name: string;
|
|
508
|
+
city: string;
|
|
509
|
+
verified: boolean;
|
|
510
|
+
mobileNumber?: string;
|
|
511
|
+
enterpriseType: EnterpriseType | `${EnterpriseType}`;
|
|
512
|
+
deleted: boolean;
|
|
513
|
+
updatedAt: Date;
|
|
514
|
+
createdAt: Date;
|
|
515
|
+
isActive: boolean;
|
|
516
|
+
version: number;
|
|
517
|
+
officeNumber?: string;
|
|
518
|
+
address?: {
|
|
519
|
+
coordinates?: number[];
|
|
520
|
+
address?: string;
|
|
521
|
+
};
|
|
522
|
+
image?: string;
|
|
523
|
+
coverImage?: string;
|
|
524
|
+
activationDate?: string;
|
|
525
|
+
category: EnterpriseCategoryDoc[] | string[];
|
|
526
|
+
subCategory: EnterpriseSubCategoryDoc[] | string[];
|
|
527
|
+
socialLinks: {
|
|
528
|
+
name: string;
|
|
529
|
+
url: string;
|
|
530
|
+
active: boolean;
|
|
531
|
+
}[];
|
|
532
|
+
};
|
|
533
|
+
interface EnterpriseCategoryDoc {
|
|
534
|
+
id: string;
|
|
535
|
+
name: string;
|
|
536
|
+
slug: string;
|
|
537
|
+
subCategories: EnterpriseSubCategoryDoc[];
|
|
538
|
+
updatedAt: string;
|
|
539
|
+
createdAt: string;
|
|
540
|
+
image?: string;
|
|
541
|
+
}
|
|
542
|
+
interface EnterpriseSubCategoryDoc {
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
545
|
+
category: string;
|
|
546
|
+
slug: string;
|
|
547
|
+
image?: string;
|
|
548
|
+
serviceItems: string[];
|
|
549
|
+
updatedAt: string;
|
|
550
|
+
createdAt: string;
|
|
551
|
+
}
|
|
552
|
+
|
|
541
553
|
interface Business {
|
|
542
554
|
id: string;
|
|
543
555
|
userId: string;
|
|
@@ -613,28 +625,6 @@ interface BusinessMember {
|
|
|
613
625
|
updatedAt: string | NullOrUndefined;
|
|
614
626
|
}
|
|
615
627
|
|
|
616
|
-
interface CustomerTransactionStats {
|
|
617
|
-
totalSaleCount: number;
|
|
618
|
-
totalSaleAmount: number;
|
|
619
|
-
totalExpenseCount: number;
|
|
620
|
-
totalExpenseAmount: number;
|
|
621
|
-
lastTransactionDate: string | null;
|
|
622
|
-
updatedAt: string;
|
|
623
|
-
}
|
|
624
|
-
interface Customer {
|
|
625
|
-
id: string;
|
|
626
|
-
businessId: string;
|
|
627
|
-
phoneNumber: string;
|
|
628
|
-
fullName: string;
|
|
629
|
-
cityId: string;
|
|
630
|
-
address: string;
|
|
631
|
-
landmark?: string;
|
|
632
|
-
createdAt: string;
|
|
633
|
-
updatedAt: string;
|
|
634
|
-
customerBusinessId?: string;
|
|
635
|
-
transactionStats?: CustomerTransactionStats;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
628
|
type TransactionType = 'sale' | 'expense';
|
|
639
629
|
interface TransactionItem {
|
|
640
630
|
name: string;
|
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,38 +150,34 @@ 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;
|
|
167
|
+
paidErrandsCount?: number;
|
|
168
|
+
unpaidErrandsCount?: number;
|
|
206
169
|
}
|
|
207
170
|
interface InvoiceItem {
|
|
208
171
|
id: string;
|
|
209
172
|
invoiceId: string;
|
|
210
173
|
itemType: InvoiceItemType | `${InvoiceItemType}`;
|
|
211
174
|
itemId: string;
|
|
212
|
-
item: Errand;
|
|
213
175
|
amount: number;
|
|
214
176
|
description: string;
|
|
215
177
|
date: string;
|
|
216
178
|
createdAt: string;
|
|
217
179
|
updatedAt: string;
|
|
180
|
+
itemDetails?: Errand;
|
|
218
181
|
}
|
|
219
182
|
|
|
220
183
|
type Rider = {
|
|
@@ -360,13 +323,7 @@ interface Errand {
|
|
|
360
323
|
parcelSize: `${ParcelSize}`;
|
|
361
324
|
deliveryStatus: ErrandStatus | `${ErrandStatus}`;
|
|
362
325
|
paymentStatus: `${InvoiceStatus}`;
|
|
363
|
-
|
|
364
|
-
invoiceStatus: InvoiceStatus | `${InvoiceStatus}`;
|
|
365
|
-
refId: string;
|
|
366
|
-
authorizationUrl: string;
|
|
367
|
-
accessCode: string;
|
|
368
|
-
invoiceId?: string | Invoice;
|
|
369
|
-
};
|
|
326
|
+
invoiceId?: string;
|
|
370
327
|
aliasId: string;
|
|
371
328
|
updatedAt: Date;
|
|
372
329
|
createdAt: Date;
|
|
@@ -538,6 +495,61 @@ type Notification = {
|
|
|
538
495
|
updatedAt: string;
|
|
539
496
|
};
|
|
540
497
|
|
|
498
|
+
declare enum EnterpriseType {
|
|
499
|
+
Restaurant = "restaurant",
|
|
500
|
+
Dispatch = "dispatch",
|
|
501
|
+
Property = "property",
|
|
502
|
+
Store = "store"
|
|
503
|
+
}
|
|
504
|
+
type Enterprise = {
|
|
505
|
+
id: string;
|
|
506
|
+
user: string | User;
|
|
507
|
+
name: string;
|
|
508
|
+
city: string;
|
|
509
|
+
verified: boolean;
|
|
510
|
+
mobileNumber?: string;
|
|
511
|
+
enterpriseType: EnterpriseType | `${EnterpriseType}`;
|
|
512
|
+
deleted: boolean;
|
|
513
|
+
updatedAt: Date;
|
|
514
|
+
createdAt: Date;
|
|
515
|
+
isActive: boolean;
|
|
516
|
+
version: number;
|
|
517
|
+
officeNumber?: string;
|
|
518
|
+
address?: {
|
|
519
|
+
coordinates?: number[];
|
|
520
|
+
address?: string;
|
|
521
|
+
};
|
|
522
|
+
image?: string;
|
|
523
|
+
coverImage?: string;
|
|
524
|
+
activationDate?: string;
|
|
525
|
+
category: EnterpriseCategoryDoc[] | string[];
|
|
526
|
+
subCategory: EnterpriseSubCategoryDoc[] | string[];
|
|
527
|
+
socialLinks: {
|
|
528
|
+
name: string;
|
|
529
|
+
url: string;
|
|
530
|
+
active: boolean;
|
|
531
|
+
}[];
|
|
532
|
+
};
|
|
533
|
+
interface EnterpriseCategoryDoc {
|
|
534
|
+
id: string;
|
|
535
|
+
name: string;
|
|
536
|
+
slug: string;
|
|
537
|
+
subCategories: EnterpriseSubCategoryDoc[];
|
|
538
|
+
updatedAt: string;
|
|
539
|
+
createdAt: string;
|
|
540
|
+
image?: string;
|
|
541
|
+
}
|
|
542
|
+
interface EnterpriseSubCategoryDoc {
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
545
|
+
category: string;
|
|
546
|
+
slug: string;
|
|
547
|
+
image?: string;
|
|
548
|
+
serviceItems: string[];
|
|
549
|
+
updatedAt: string;
|
|
550
|
+
createdAt: string;
|
|
551
|
+
}
|
|
552
|
+
|
|
541
553
|
interface Business {
|
|
542
554
|
id: string;
|
|
543
555
|
userId: string;
|
|
@@ -613,28 +625,6 @@ interface BusinessMember {
|
|
|
613
625
|
updatedAt: string | NullOrUndefined;
|
|
614
626
|
}
|
|
615
627
|
|
|
616
|
-
interface CustomerTransactionStats {
|
|
617
|
-
totalSaleCount: number;
|
|
618
|
-
totalSaleAmount: number;
|
|
619
|
-
totalExpenseCount: number;
|
|
620
|
-
totalExpenseAmount: number;
|
|
621
|
-
lastTransactionDate: string | null;
|
|
622
|
-
updatedAt: string;
|
|
623
|
-
}
|
|
624
|
-
interface Customer {
|
|
625
|
-
id: string;
|
|
626
|
-
businessId: string;
|
|
627
|
-
phoneNumber: string;
|
|
628
|
-
fullName: string;
|
|
629
|
-
cityId: string;
|
|
630
|
-
address: string;
|
|
631
|
-
landmark?: string;
|
|
632
|
-
createdAt: string;
|
|
633
|
-
updatedAt: string;
|
|
634
|
-
customerBusinessId?: string;
|
|
635
|
-
transactionStats?: CustomerTransactionStats;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
628
|
type TransactionType = 'sale' | 'expense';
|
|
639
629
|
interface TransactionItem {
|
|
640
630
|
name: string;
|
package/package.json
CHANGED
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,23 @@ 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;
|
|
45
|
+
paidErrandsCount?: number;
|
|
46
|
+
unpaidErrandsCount?: number;
|
|
50
47
|
}
|
|
51
48
|
|
|
52
49
|
export interface InvoiceItem {
|
|
@@ -54,10 +51,12 @@ export interface InvoiceItem {
|
|
|
54
51
|
invoiceId: string;
|
|
55
52
|
itemType: InvoiceItemType | `${InvoiceItemType}`;
|
|
56
53
|
itemId: string;
|
|
57
|
-
item: Errand;
|
|
54
|
+
// item: Errand;
|
|
58
55
|
amount: number;
|
|
59
56
|
description: string;
|
|
60
57
|
date: string;
|
|
61
58
|
createdAt: string;
|
|
62
59
|
updatedAt: string;
|
|
60
|
+
|
|
61
|
+
itemDetails?: Errand;
|
|
63
62
|
}
|