@mydoormot/app-types 1.7.13 → 1.7.15

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.12 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
2
+ > @mydoormot/app-types@1.7.14 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
  ESM dist/index.js 6.17 KB
12
- ESM ⚡️ Build success in 106ms
12
+ ESM ⚡️ Build success in 136ms
13
13
  CJS dist/index.cjs 7.84 KB
14
- CJS ⚡️ Build success in 107ms
14
+ CJS ⚡️ Build success in 137ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 2099ms
16
+ DTS ⚡️ Build success in 1414ms
17
17
  DTS dist/index.d.ts 18.13 KB
18
18
  DTS dist/index.d.cts 18.13 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mydoormot/app-types
2
2
 
3
+ ## 1.7.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 4cf55ae: Modified transactions test
8
+
9
+ ## 1.7.14
10
+
11
+ ### Patch Changes
12
+
13
+ - 0f76453: Modified rider details
14
+
3
15
  ## 1.7.13
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.cts CHANGED
@@ -232,8 +232,6 @@ type Rider = {
232
232
  rating: number;
233
233
  version: number;
234
234
  hasBeenRated: boolean;
235
- enterprise: string | Enterprise;
236
- isTracking: boolean;
237
235
  state?: string | State;
238
236
  currentErrand?: Errand;
239
237
  lastDeliveredErrand?: Errand;
@@ -264,29 +262,23 @@ declare enum VehicleLogType {
264
262
  }
265
263
  type VehicleLog = {
266
264
  id: string;
267
- previousLogId?: string;
268
- errandIdsSinceLastRefuel?: string[];
269
- vehicle: string | Vehicle;
270
- maintenanceType?: string;
271
- maintenanceCost?: number;
265
+ vehicleId: string;
266
+ businessId: string;
272
267
  type: VehicleLogType | `${VehicleLogType}`;
273
268
  fuelLiters?: number;
274
269
  fuelCost?: number;
275
270
  note?: string;
276
271
  createdAt: string;
277
272
  updatedAt: string;
278
- riderDetails: Rider | null;
279
- riderUserDetails: User | null;
280
- vehicleDetails: Vehicle | null;
273
+ previousLogId?: string;
274
+ errandIdsSinceLastRefuel?: string[];
275
+ maintenanceType?: string;
276
+ maintenanceCost?: number;
277
+ vehicleDetails?: Vehicle;
281
278
  };
282
279
  type VehicleLogWithErrands = VehicleLog & {
283
- errands: Errand[];
284
- errandsCount: number;
285
- totalErrandsRevenue: number;
286
- };
287
- type VehicleLogWithRiderAndErrands = VehicleLogWithErrands & {
288
- riderDetails: Rider | null;
289
- riderUserDetails: User | null;
280
+ errandsCount?: number;
281
+ totalErrandsRevenue?: number;
290
282
  };
291
283
 
292
284
  declare enum ErrandStatus {
@@ -621,6 +613,14 @@ interface BusinessMember {
621
613
  updatedAt: string | NullOrUndefined;
622
614
  }
623
615
 
616
+ interface CustomerTransactionStats {
617
+ totalSaleCount: number;
618
+ totalSaleAmount: number;
619
+ totalExpenseCount: number;
620
+ totalExpenseAmount: number;
621
+ lastTransactionDate: string | null;
622
+ updatedAt: string;
623
+ }
624
624
  interface Customer {
625
625
  id: string;
626
626
  businessId: string;
@@ -632,6 +632,7 @@ interface Customer {
632
632
  createdAt: string;
633
633
  updatedAt: string;
634
634
  customerBusinessId?: string;
635
+ transactionStats?: CustomerTransactionStats;
635
636
  }
636
637
 
637
638
  type TransactionType = 'sale' | 'expense';
@@ -719,4 +720,4 @@ declare enum LinkDestination {
719
720
  }
720
721
  type NullOrUndefined = null | undefined;
721
722
 
722
- 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 };
723
+ 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
@@ -232,8 +232,6 @@ type Rider = {
232
232
  rating: number;
233
233
  version: number;
234
234
  hasBeenRated: boolean;
235
- enterprise: string | Enterprise;
236
- isTracking: boolean;
237
235
  state?: string | State;
238
236
  currentErrand?: Errand;
239
237
  lastDeliveredErrand?: Errand;
@@ -264,29 +262,23 @@ declare enum VehicleLogType {
264
262
  }
265
263
  type VehicleLog = {
266
264
  id: string;
267
- previousLogId?: string;
268
- errandIdsSinceLastRefuel?: string[];
269
- vehicle: string | Vehicle;
270
- maintenanceType?: string;
271
- maintenanceCost?: number;
265
+ vehicleId: string;
266
+ businessId: string;
272
267
  type: VehicleLogType | `${VehicleLogType}`;
273
268
  fuelLiters?: number;
274
269
  fuelCost?: number;
275
270
  note?: string;
276
271
  createdAt: string;
277
272
  updatedAt: string;
278
- riderDetails: Rider | null;
279
- riderUserDetails: User | null;
280
- vehicleDetails: Vehicle | null;
273
+ previousLogId?: string;
274
+ errandIdsSinceLastRefuel?: string[];
275
+ maintenanceType?: string;
276
+ maintenanceCost?: number;
277
+ vehicleDetails?: Vehicle;
281
278
  };
282
279
  type VehicleLogWithErrands = VehicleLog & {
283
- errands: Errand[];
284
- errandsCount: number;
285
- totalErrandsRevenue: number;
286
- };
287
- type VehicleLogWithRiderAndErrands = VehicleLogWithErrands & {
288
- riderDetails: Rider | null;
289
- riderUserDetails: User | null;
280
+ errandsCount?: number;
281
+ totalErrandsRevenue?: number;
290
282
  };
291
283
 
292
284
  declare enum ErrandStatus {
@@ -621,6 +613,14 @@ interface BusinessMember {
621
613
  updatedAt: string | NullOrUndefined;
622
614
  }
623
615
 
616
+ interface CustomerTransactionStats {
617
+ totalSaleCount: number;
618
+ totalSaleAmount: number;
619
+ totalExpenseCount: number;
620
+ totalExpenseAmount: number;
621
+ lastTransactionDate: string | null;
622
+ updatedAt: string;
623
+ }
624
624
  interface Customer {
625
625
  id: string;
626
626
  businessId: string;
@@ -632,6 +632,7 @@ interface Customer {
632
632
  createdAt: string;
633
633
  updatedAt: string;
634
634
  customerBusinessId?: string;
635
+ transactionStats?: CustomerTransactionStats;
635
636
  }
636
637
 
637
638
  type TransactionType = 'sale' | 'expense';
@@ -719,4 +720,4 @@ declare enum LinkDestination {
719
720
  }
720
721
  type NullOrUndefined = null | undefined;
721
722
 
722
- 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 };
723
+ 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mydoormot/app-types",
3
- "version": "1.7.13",
3
+ "version": "1.7.15",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
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/rider.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Enterprise } from './enterprise';
1
+ // import { Enterprise } from './enterprise';
2
2
  import { Errand } from './errand';
3
3
  import { State } from './location';
4
4
  import { User } from './user';
@@ -21,8 +21,8 @@ export type Rider = {
21
21
  rating: number;
22
22
  version: number;
23
23
  hasBeenRated: boolean;
24
- enterprise: string | Enterprise;
25
- isTracking: boolean;
24
+ // enterprise: string | Enterprise;
25
+ // isTracking: boolean;
26
26
 
27
27
  state?: string | State;
28
28
  currentErrand?: Errand;
@@ -60,29 +60,27 @@ export enum VehicleLogType {
60
60
 
61
61
  export type VehicleLog = {
62
62
  id: string;
63
- previousLogId?: string;
64
- errandIdsSinceLastRefuel?: string[];
65
- vehicle: string | Vehicle;
66
- maintenanceType?: string;
67
- maintenanceCost?: number;
63
+ vehicleId: string;
64
+ businessId: string;
68
65
  type: VehicleLogType | `${VehicleLogType}`;
69
66
  fuelLiters?: number;
70
67
  fuelCost?: number;
71
68
  note?: string;
72
69
  createdAt: string;
73
70
  updatedAt: string;
74
- riderDetails: Rider | null;
75
- riderUserDetails: User | null;
76
- vehicleDetails: Vehicle | null;
71
+ previousLogId?: string;
72
+ errandIdsSinceLastRefuel?: string[];
73
+ maintenanceType?: string;
74
+ maintenanceCost?: number;
75
+ vehicleDetails?: Vehicle;
77
76
  };
78
77
 
79
78
  export type VehicleLogWithErrands = VehicleLog & {
80
- errands: Errand[];
81
- errandsCount: number;
82
- totalErrandsRevenue: number;
79
+ errandsCount?: number;
80
+ totalErrandsRevenue?: number;
83
81
  };
84
82
 
85
- export type VehicleLogWithRiderAndErrands = VehicleLogWithErrands & {
86
- riderDetails: Rider | null;
87
- riderUserDetails: User | null;
88
- };
83
+ // export type VehicleLogWithRiderAndErrands = VehicleLogWithErrands & {
84
+ // riderDetails: Rider | null;
85
+ // riderUserDetails: User | null;
86
+ // };