@doctocar/tooling 0.3.1-35 → 0.3.1-37

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.
@@ -4,6 +4,5 @@ export declare enum OrderStatusTypes {
4
4
  CONFIRMED = "confirmed",
5
5
  IN_PROGRESS = "in_progress",
6
6
  SERVICES_COMPLETED = "services_completed",
7
- COMPLETED = "completed",
8
- INVOICED = "invoiced"
7
+ COMPLETED = "completed"
9
8
  }
@@ -9,5 +9,4 @@ var OrderStatusTypes;
9
9
  OrderStatusTypes["IN_PROGRESS"] = "in_progress";
10
10
  OrderStatusTypes["SERVICES_COMPLETED"] = "services_completed";
11
11
  OrderStatusTypes["COMPLETED"] = "completed";
12
- OrderStatusTypes["INVOICED"] = "invoiced";
13
12
  })(OrderStatusTypes || (exports.OrderStatusTypes = OrderStatusTypes = {}));
@@ -8,6 +8,7 @@ import type { EntityAgreements } from "./EntityAgreements.type";
8
8
  import type { EntityInsuranceFile } from "./EntityInsuranceFile.type";
9
9
  import type { EntityLegalDetails } from "./EntityLegalDetails.type";
10
10
  import type { EntityLegalRepresentative } from "./EntityLegalRepresentative.type";
11
+ import type { FirestoreEntityMetrics } from "./FirestoreEntityMetrics.type";
11
12
  export type FirestoreEntityDocument = {
12
13
  createdAt: FirestoreTimestamp;
13
14
  updatedAt: FirestoreTimestamp;
@@ -49,46 +50,7 @@ export type FirestoreEntityDocument = {
49
50
  updatedAt: FirestoreTimestamp;
50
51
  };
51
52
  };
52
- metrics: {
53
- updatedAt: FirestoreTimestamp;
54
- members: {
55
- activeCount: number;
56
- totalCount: number;
57
- pendingInvitesCount?: number;
58
- updatedAt: FirestoreTimestamp;
59
- };
60
- customer?: {
61
- totalOrdersCreated: number;
62
- totalOrdersCompleted: number;
63
- totalOrdersCanceled: number;
64
- totalOrdersPaid: number;
65
- totalOrdersRefunded: number;
66
- totalAmountPaidInCents: number;
67
- totalAmountRefundedInCents: number;
68
- lastOrderCreatedAt?: FirestoreTimestamp;
69
- lastOrderCompletedAt?: FirestoreTimestamp;
70
- lastOrderCanceledAt?: FirestoreTimestamp;
71
- lastOrderIssueCreatedAt?: FirestoreTimestamp;
72
- totalOrderIssuesCreated: number;
73
- updatedAt: FirestoreTimestamp;
74
- };
75
- serviceProvider?: {
76
- totalOrdersCompleted: number;
77
- totalOrdersPaid: number;
78
- totalOrdersReceived: number;
79
- totalOrdersCanceled: number;
80
- lastOrderCompletedAt?: FirestoreTimestamp;
81
- lastOrderCanceledAt?: FirestoreTimestamp;
82
- lastOrderReceivedAt?: FirestoreTimestamp;
83
- lastOrderPaidAt?: FirestoreTimestamp;
84
- totalGrossAmountInCents: number;
85
- totalNetEarningsInCents: number;
86
- totalAmountRefundedInCents: number;
87
- lastOrderIssueCreatedAt?: FirestoreTimestamp;
88
- totalOrderIssuesCreated: number;
89
- updatedAt: FirestoreTimestamp;
90
- };
91
- };
53
+ metrics: FirestoreEntityMetrics;
92
54
  wallets: {
93
55
  byCurrency: Partial<Record<SupportedIsoCurrency, string>>;
94
56
  };
@@ -0,0 +1,10 @@
1
+ import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
2
+ export type FirestoreEntityMetrics = {
3
+ updatedAt: FirestoreTimestamp;
4
+ members: {
5
+ activeCount: number;
6
+ totalCount: number;
7
+ pendingInvitesCount?: number;
8
+ updatedAt: FirestoreTimestamp;
9
+ };
10
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,5 @@
1
1
  export * from "./FirestoreEntityDocument.type";
2
+ export * from "./FirestoreEntityMetrics.type";
2
3
  export * from "./EntityLegalDetails.type";
3
4
  export * from "./EntityLegalRepresentative.type";
4
5
  export * from "./EntityVatDetails.type";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./FirestoreEntityDocument.type"), exports);
18
+ __exportStar(require("./FirestoreEntityMetrics.type"), exports);
18
19
  __exportStar(require("./EntityLegalDetails.type"), exports);
19
20
  __exportStar(require("./EntityLegalRepresentative.type"), exports);
20
21
  __exportStar(require("./EntityVatDetails.type"), exports);
@@ -1,3 +1,4 @@
1
+ import type { SupportedIsoCurrency } from "../../../../enums";
1
2
  import type { FirestoreOpType, OrderInvoiceGenerationStatus, OrderIssueSeverityLevel, OrderStatusTypes } from "../../enums";
2
3
  import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
3
4
  import type { DoctoCarLocation } from "../location";
@@ -44,6 +45,7 @@ export type FirestoreOrderDocument = {
44
45
  serviceCompletedAt?: FirestoreTimestamp;
45
46
  issueReportedByCustomerAt?: FirestoreTimestamp;
46
47
  completedAt?: FirestoreTimestamp;
48
+ invoicedAt?: FirestoreTimestamp;
47
49
  cancelledAt?: FirestoreTimestamp;
48
50
  };
49
51
  publicReference: string;
@@ -138,8 +140,13 @@ export type FirestoreOrderDocument = {
138
140
  };
139
141
  execution?: {
140
142
  serviceProviderEntityWalletCredit?: {
141
- walletLedgerEntryId?: string;
142
- creditedAt?: FirestoreTimestamp;
143
+ walletLedgerEntryId: string;
144
+ creditedAt: FirestoreTimestamp;
145
+ amountInCents: number;
146
+ currency: SupportedIsoCurrency;
147
+ };
148
+ invoicedOrderMetrics?: {
149
+ appliedAt: FirestoreTimestamp;
143
150
  };
144
151
  };
145
152
  metadata?: Record<string, string>;
@@ -1,4 +1,4 @@
1
- import type { VehicleBrands, VehicleColorsTypes, VehicleTypes } from "../../enums";
1
+ import type { ServicesTypes, VehicleBrands, VehicleColorsTypes, VehicleTypes } from "../../enums";
2
2
  import type { LegalAddress } from "../company";
3
3
  import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
4
4
  import type { DoctoCarLocation } from "../location";
@@ -11,6 +11,21 @@ export type FirestoreVehicleDocument = {
11
11
  model: string | null;
12
12
  licensePlate: string;
13
13
  personalLabel: string | null;
14
+ metrics: {
15
+ updatedAt: FirestoreTimestamp;
16
+ totalOrdersCompleted: number;
17
+ lastCompletedOrder?: {
18
+ orderDocumentId: string;
19
+ completedAt: FirestoreTimestamp;
20
+ publicReference?: string;
21
+ mainServiceType: ServicesTypes;
22
+ serviceProviderDisplayName?: string;
23
+ };
24
+ lastCompletedByServiceType?: Partial<Record<ServicesTypes, {
25
+ orderDocumentId: string;
26
+ completedAt: FirestoreTimestamp;
27
+ }>>;
28
+ };
14
29
  createdAt: FirestoreTimestamp;
15
30
  updatedAt: FirestoreTimestamp;
16
31
  isTest: boolean;
@@ -35,28 +35,6 @@ function firestoreEntityDocumentStub(overwrite = {}) {
35
35
  pendingInvitesCount: 0,
36
36
  updatedAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
37
37
  },
38
- customer: {
39
- totalOrdersCreated: 0,
40
- totalOrdersCompleted: 0,
41
- totalOrdersCanceled: 0,
42
- totalOrdersPaid: 0,
43
- totalOrdersRefunded: 0,
44
- totalAmountPaidInCents: 0,
45
- totalAmountRefundedInCents: 0,
46
- totalOrderIssuesCreated: 0,
47
- updatedAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
48
- },
49
- serviceProvider: {
50
- totalOrdersCompleted: 0,
51
- totalOrdersPaid: 0,
52
- totalOrdersReceived: 0,
53
- totalOrdersCanceled: 0,
54
- totalGrossAmountInCents: 0,
55
- totalNetEarningsInCents: 0,
56
- totalAmountRefundedInCents: 0,
57
- totalOrderIssuesCreated: 0,
58
- updatedAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
59
- },
60
38
  updatedAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
61
39
  },
62
40
  isTest: true,
@@ -17,6 +17,10 @@ function firestoreVehicleDocumentStub(overwrite = {}) {
17
17
  personalLabel: "My car",
18
18
  location: (0, location_1.doctoCarLocationStub)(),
19
19
  address: (0, company_1.legalAddressStub)(),
20
+ metrics: {
21
+ updatedAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
22
+ totalOrdersCompleted: 0,
23
+ },
20
24
  isTest: true,
21
25
  ...overwrite,
22
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doctocar/tooling",
3
- "version": "0.3.1-35",
3
+ "version": "0.3.1-37",
4
4
  "description": "A set of tools for DoctoCar projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",