@mydoormot/app-types 1.7.9 → 1.7.11

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @mydoormot/app-types@1.7.8 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
2
+ > @mydoormot/app-types@1.7.10 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,10 +9,10 @@
9
9
  ESM Build start
10
10
  CJS Build start
11
11
  CJS dist/index.cjs 7.84 KB
12
- CJS ⚡️ Build success in 46ms
12
+ CJS ⚡️ Build success in 263ms
13
13
  ESM dist/index.js 6.17 KB
14
- ESM ⚡️ Build success in 46ms
14
+ ESM ⚡️ Build success in 264ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 674ms
17
- DTS dist/index.d.ts 17.77 KB
18
- DTS dist/index.d.cts 17.77 KB
16
+ DTS ⚡️ Build success in 1001ms
17
+ DTS dist/index.d.ts 18.04 KB
18
+ DTS dist/index.d.cts 18.04 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mydoormot/app-types
2
2
 
3
+ ## 1.7.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified customer type
8
+
9
+ ## 1.7.10
10
+
11
+ ### Patch Changes
12
+
13
+ - Added riderDetails to errands
14
+
3
15
  ## 1.7.9
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.cts CHANGED
@@ -15,6 +15,7 @@ type City = {
15
15
  isRiderActive: boolean;
16
16
  isPropertyActive: boolean;
17
17
  errandPrice?: number;
18
+ defaultCourierBusinessId?: string;
18
19
  };
19
20
  type State = {
20
21
  id: string;
@@ -355,9 +356,12 @@ interface PendingErrand {
355
356
  }
356
357
  interface Errand {
357
358
  id: string;
358
- rider: string | Rider;
359
- customerId?: string | User;
360
359
  nameOfItem: string;
360
+ userId?: string;
361
+ riderId?: string;
362
+ vehicleId?: string;
363
+ businessId?: string;
364
+ courierBusinessId?: string;
361
365
  pickupDetails: AddressDetails;
362
366
  deliveryDetails: AddressDetails;
363
367
  parcelSize: `${ParcelSize}`;
@@ -377,7 +381,7 @@ interface Errand {
377
381
  payOnDeliveryAmount?: string;
378
382
  additionalData?: string;
379
383
  deliveryDate?: Date;
380
- city?: City;
384
+ cityId?: City;
381
385
  couponPrice?: number;
382
386
  price: number;
383
387
  coupon?: string | Coupon;
@@ -386,7 +390,6 @@ interface Errand {
386
390
  queuePosition?: number;
387
391
  isTest?: boolean;
388
392
  isInBusinessInvoice?: boolean;
389
- businessId?: string;
390
393
  riderStartLocation?: {
391
394
  type: string;
392
395
  coordinates: number[];
@@ -400,7 +403,9 @@ interface Errand {
400
403
  coordinates: number[];
401
404
  };
402
405
  businessDetails?: Business;
403
- customerDetails?: User;
406
+ userDetails?: User;
407
+ courierBusinessDetails?: Business;
408
+ riderDetails?: Rider;
404
409
  }
405
410
  interface AggregatedErrand extends Errand {
406
411
  parcelSize: `${ParcelSize}`;
@@ -422,7 +427,6 @@ interface AggregatedErrand extends Errand {
422
427
  stateCoords: number[];
423
428
  };
424
429
  riderUserDetails?: User;
425
- business?: Business;
426
430
  }
427
431
  interface ErrandRating {
428
432
  createdAt: string;
@@ -543,8 +547,6 @@ type Notification = {
543
547
 
544
548
  interface Business {
545
549
  id: string;
546
- pgId: string;
547
- seqId: number;
548
550
  userId: string;
549
551
  name: string;
550
552
  description: string;
@@ -572,9 +574,8 @@ interface Business {
572
574
  updatedAt: string | NullOrUndefined | Date;
573
575
  verifiedAt: string | NullOrUndefined | Date;
574
576
  registrationCompletedAt: string | NullOrUndefined | Date;
575
- mongoId: string;
576
- version: number;
577
577
  isManaged: boolean | NullOrUndefined;
578
+ businessCategoryDetails: BusinessCategory | NullOrUndefined;
578
579
  }
579
580
  interface BusinessPg extends Business {
580
581
  pgId: any;
@@ -621,18 +622,24 @@ interface BusinessMember {
621
622
 
622
623
  interface Customer {
623
624
  id: string;
624
- businessId: string | Business;
625
+ businessId: string;
625
626
  phoneNumber: string;
626
627
  fullName: string;
627
628
  cityId: string;
628
629
  address: string;
629
630
  landmark?: string;
630
- errandsCount?: number;
631
- city?: City;
632
- state?: State;
631
+ createdAt: string;
632
+ updatedAt: string;
633
+ customerBusinessId?: string;
633
634
  }
634
635
 
635
636
  type TransactionType = 'sale' | 'expense';
637
+ interface TransactionItem {
638
+ name: string;
639
+ quantity: number;
640
+ unitPrice: number;
641
+ totalPrice: number;
642
+ }
636
643
  interface Transaction {
637
644
  id: string;
638
645
  type: TransactionType;
@@ -644,6 +651,7 @@ interface Transaction {
644
651
  userId: string;
645
652
  businessId?: string;
646
653
  categoryId?: string;
654
+ items?: TransactionItem[];
647
655
  }
648
656
  interface TransactionCategory {
649
657
  id: string;
@@ -708,4 +716,4 @@ declare enum LinkDestination {
708
716
  }
709
717
  type NullOrUndefined = null | undefined;
710
718
 
711
- 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 TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleLogWithRiderAndErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
719
+ 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, type VehicleLogWithRiderAndErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ type City = {
15
15
  isRiderActive: boolean;
16
16
  isPropertyActive: boolean;
17
17
  errandPrice?: number;
18
+ defaultCourierBusinessId?: string;
18
19
  };
19
20
  type State = {
20
21
  id: string;
@@ -355,9 +356,12 @@ interface PendingErrand {
355
356
  }
356
357
  interface Errand {
357
358
  id: string;
358
- rider: string | Rider;
359
- customerId?: string | User;
360
359
  nameOfItem: string;
360
+ userId?: string;
361
+ riderId?: string;
362
+ vehicleId?: string;
363
+ businessId?: string;
364
+ courierBusinessId?: string;
361
365
  pickupDetails: AddressDetails;
362
366
  deliveryDetails: AddressDetails;
363
367
  parcelSize: `${ParcelSize}`;
@@ -377,7 +381,7 @@ interface Errand {
377
381
  payOnDeliveryAmount?: string;
378
382
  additionalData?: string;
379
383
  deliveryDate?: Date;
380
- city?: City;
384
+ cityId?: City;
381
385
  couponPrice?: number;
382
386
  price: number;
383
387
  coupon?: string | Coupon;
@@ -386,7 +390,6 @@ interface Errand {
386
390
  queuePosition?: number;
387
391
  isTest?: boolean;
388
392
  isInBusinessInvoice?: boolean;
389
- businessId?: string;
390
393
  riderStartLocation?: {
391
394
  type: string;
392
395
  coordinates: number[];
@@ -400,7 +403,9 @@ interface Errand {
400
403
  coordinates: number[];
401
404
  };
402
405
  businessDetails?: Business;
403
- customerDetails?: User;
406
+ userDetails?: User;
407
+ courierBusinessDetails?: Business;
408
+ riderDetails?: Rider;
404
409
  }
405
410
  interface AggregatedErrand extends Errand {
406
411
  parcelSize: `${ParcelSize}`;
@@ -422,7 +427,6 @@ interface AggregatedErrand extends Errand {
422
427
  stateCoords: number[];
423
428
  };
424
429
  riderUserDetails?: User;
425
- business?: Business;
426
430
  }
427
431
  interface ErrandRating {
428
432
  createdAt: string;
@@ -543,8 +547,6 @@ type Notification = {
543
547
 
544
548
  interface Business {
545
549
  id: string;
546
- pgId: string;
547
- seqId: number;
548
550
  userId: string;
549
551
  name: string;
550
552
  description: string;
@@ -572,9 +574,8 @@ interface Business {
572
574
  updatedAt: string | NullOrUndefined | Date;
573
575
  verifiedAt: string | NullOrUndefined | Date;
574
576
  registrationCompletedAt: string | NullOrUndefined | Date;
575
- mongoId: string;
576
- version: number;
577
577
  isManaged: boolean | NullOrUndefined;
578
+ businessCategoryDetails: BusinessCategory | NullOrUndefined;
578
579
  }
579
580
  interface BusinessPg extends Business {
580
581
  pgId: any;
@@ -621,18 +622,24 @@ interface BusinessMember {
621
622
 
622
623
  interface Customer {
623
624
  id: string;
624
- businessId: string | Business;
625
+ businessId: string;
625
626
  phoneNumber: string;
626
627
  fullName: string;
627
628
  cityId: string;
628
629
  address: string;
629
630
  landmark?: string;
630
- errandsCount?: number;
631
- city?: City;
632
- state?: State;
631
+ createdAt: string;
632
+ updatedAt: string;
633
+ customerBusinessId?: string;
633
634
  }
634
635
 
635
636
  type TransactionType = 'sale' | 'expense';
637
+ interface TransactionItem {
638
+ name: string;
639
+ quantity: number;
640
+ unitPrice: number;
641
+ totalPrice: number;
642
+ }
636
643
  interface Transaction {
637
644
  id: string;
638
645
  type: TransactionType;
@@ -644,6 +651,7 @@ interface Transaction {
644
651
  userId: string;
645
652
  businessId?: string;
646
653
  categoryId?: string;
654
+ items?: TransactionItem[];
647
655
  }
648
656
  interface TransactionCategory {
649
657
  id: string;
@@ -708,4 +716,4 @@ declare enum LinkDestination {
708
716
  }
709
717
  type NullOrUndefined = null | undefined;
710
718
 
711
- 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 TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleLogWithRiderAndErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
719
+ 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, type VehicleLogWithRiderAndErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mydoormot/app-types",
3
- "version": "1.7.9",
3
+ "version": "1.7.11",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
package/src/business.ts CHANGED
@@ -2,14 +2,11 @@ import { NullOrUndefined, User } from '.';
2
2
 
3
3
  export interface Business {
4
4
  id: string;
5
- pgId: string;
6
- seqId: number;
7
5
  userId: string;
8
6
  name: string;
9
7
  description: string;
10
8
  officeNumber: string;
11
9
  categoryId: string;
12
-
13
10
  address: string | NullOrUndefined;
14
11
  addressCoordinates:
15
12
  | number[]
@@ -39,9 +36,8 @@ export interface Business {
39
36
  updatedAt: string | NullOrUndefined | Date;
40
37
  verifiedAt: string | NullOrUndefined | Date;
41
38
  registrationCompletedAt: string | NullOrUndefined | Date;
42
- mongoId: string;
43
- version: number;
44
39
  isManaged: boolean | NullOrUndefined;
40
+ businessCategoryDetails: BusinessCategory | NullOrUndefined;
45
41
  }
46
42
 
47
43
  export interface BusinessPg extends Business {
package/src/customer.ts CHANGED
@@ -1,16 +1,20 @@
1
- import { Business, City, State } from '.';
1
+ // import { Business, City, State } from '.';
2
2
 
3
3
  export interface Customer {
4
4
  id: string;
5
- businessId: string | Business;
5
+ businessId: string;
6
6
  phoneNumber: string;
7
7
  fullName: string;
8
8
  cityId: string;
9
9
  address: string;
10
10
  landmark?: string;
11
+ createdAt: string;
12
+ updatedAt: string;
13
+
14
+ customerBusinessId?: string;
11
15
 
12
16
  // From aggregation
13
- errandsCount?: number;
14
- city?: City;
15
- state?: State;
17
+ // errandsCount?: number;
18
+ // city?: City;
19
+ // state?: State;
16
20
  }
package/src/errand.ts CHANGED
@@ -112,10 +112,18 @@ export interface PendingErrand {
112
112
  }
113
113
 
114
114
  export interface Errand {
115
+ // NOTE: Deprecated fields
116
+ // rider: string | Rider;
117
+ // customerId?: string | User; // Deprecated
118
+
115
119
  id: string;
116
- rider: string | Rider;
117
- customerId?: string | User;
118
120
  nameOfItem: string;
121
+ userId?: string;
122
+ riderId?: string;
123
+ vehicleId?: string;
124
+ businessId?: string;
125
+ courierBusinessId?: string;
126
+
119
127
  pickupDetails: AddressDetails;
120
128
  deliveryDetails: AddressDetails;
121
129
  parcelSize: `${ParcelSize}`;
@@ -135,7 +143,7 @@ export interface Errand {
135
143
  payOnDeliveryAmount?: string;
136
144
  additionalData?: string;
137
145
  deliveryDate?: Date;
138
- city?: City;
146
+ cityId?: City;
139
147
  couponPrice?: number;
140
148
  price: number;
141
149
  coupon?: string | Coupon;
@@ -144,12 +152,16 @@ export interface Errand {
144
152
  queuePosition?: number;
145
153
  isTest?: boolean;
146
154
  isInBusinessInvoice?: boolean;
147
- businessId?: string;
148
155
  riderStartLocation?: { type: string; coordinates: number[] };
149
156
  riderPickupLocation?: { type: string; coordinates: number[] };
150
157
  riderDeliveryLocation?: { type: string; coordinates: number[] };
151
158
  businessDetails?: Business;
152
- customerDetails?: User;
159
+ userDetails?: User;
160
+ courierBusinessDetails?: Business;
161
+
162
+ // new fields
163
+ riderDetails?: Rider;
164
+ // vehicleDetails?: Vehicle;
153
165
  }
154
166
 
155
167
  export interface AggregatedErrand extends Errand {
@@ -172,7 +184,6 @@ export interface AggregatedErrand extends Errand {
172
184
  stateCoords: number[];
173
185
  };
174
186
  riderUserDetails?: User;
175
- business?: Business;
176
187
  }
177
188
 
178
189
  export interface ErrandTimeline {
package/src/location.ts CHANGED
@@ -15,6 +15,7 @@ export type City = {
15
15
  isRiderActive: boolean;
16
16
  isPropertyActive: boolean;
17
17
  errandPrice?: number;
18
+ defaultCourierBusinessId?: string;
18
19
  };
19
20
 
20
21
  export type State = {
package/src/rider.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Enterprise } from './enterprise';
2
2
  import { Errand } from './errand';
3
- import { City, State } from './location';
3
+ import { State } from './location';
4
4
  import { User } from './user';
5
5
 
6
6
  export type Rider = {
@@ -1,5 +1,12 @@
1
1
  export type TransactionType = 'sale' | 'expense';
2
2
 
3
+ export interface TransactionItem {
4
+ name: string;
5
+ quantity: number;
6
+ unitPrice: number;
7
+ totalPrice: number;
8
+ }
9
+
3
10
  export interface Transaction {
4
11
  id: string;
5
12
  type: TransactionType;
@@ -11,6 +18,7 @@ export interface Transaction {
11
18
  userId: string;
12
19
  businessId?: string;
13
20
  categoryId?: string;
21
+ items?: TransactionItem[];
14
22
  }
15
23
 
16
24
  export interface TransactionCategory {