@bisondesk/core-sdk 1.0.621 → 1.0.622

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,7 +4,7 @@ import { BusinessEntityIds, OpportunityType, WarningHints } from '../constants.j
4
4
  import { Contact, Organization } from './crm.js';
5
5
  import type { Interest, InterestBffMeta } from './interests.js';
6
6
  import { BaseEvent } from './internal-events.js';
7
- import { Payment } from './payments.js';
7
+ import { OpportunityPayment } from './opportunity-payments.js';
8
8
  import { Quote, QuoteStatus } from './quotes.js';
9
9
  import { OpportunityReservation } from './reservations.js';
10
10
  import { BaseSearchRequest } from './search.js';
@@ -229,12 +229,15 @@ export type OpportunityUpdate = {
229
229
  };
230
230
  };
231
231
 
232
- export type PaymentSummary = {
232
+ export type OpportunityPaymentSummary = {
233
233
  total: string;
234
234
  paid: string;
235
- entries: DataRecord<Payment>[];
235
+ entries: DataRecord<OpportunityPayment>[];
236
236
  };
237
237
 
238
+ /** @deprecated Renamed to {@link OpportunityPaymentSummary}. */
239
+ export type PaymentSummary = OpportunityPaymentSummary;
240
+
238
241
  export type VehicleBffMetadata = {
239
242
  openOpportunities: number;
240
243
  otherRelatedVehicleIds: string[];
@@ -273,7 +276,7 @@ export type OpportunityBFF = {
273
276
  bids: DataRecord<Bid>[];
274
277
  quotes: DataRecord<Quote>[];
275
278
  activeQuote?: DataRecord<Quote>;
276
- payments: PaymentSummary | undefined;
279
+ payments: OpportunityPaymentSummary | undefined;
277
280
  reservation?: DataRecord<OpportunityReservation>;
278
281
  tasks: DataRecord<Task>[];
279
282
  customer?: {
@@ -0,0 +1,77 @@
1
+ import { BaseEvent } from './internal-events.js';
2
+
3
+ export enum OpportunityPaymentActions {
4
+ DELETE = 'delete',
5
+ EDIT = 'edit',
6
+ }
7
+
8
+ export const OPPORTUNITY_PAYMENT_NOTIFICATION_ORIGIN = 'opportunity-payment-notification';
9
+
10
+ type BaseOpportunityPayment = {
11
+ opportunityId: string;
12
+ amount: string;
13
+ description?: string;
14
+ vehicleId: string;
15
+ organizationId: string;
16
+ };
17
+
18
+ export type NewOpportunityPayment = BaseOpportunityPayment & {
19
+ id?: undefined;
20
+ createdAt?: undefined;
21
+ createdBy?: undefined;
22
+ modifiedAt?: undefined;
23
+ modifiedBy?: undefined;
24
+ deletedAt?: undefined;
25
+ deletedBy?: undefined;
26
+ paidAt: string;
27
+ };
28
+
29
+ export type OpportunityPayment = BaseOpportunityPayment & {
30
+ id: string;
31
+ createdAt: string;
32
+ createdBy: string;
33
+ modifiedAt: string;
34
+ modifiedBy: string;
35
+ deletedAt?: string;
36
+ deletedBy?: string;
37
+ paidAt?: string;
38
+ };
39
+
40
+ export type OpportunityPaymentUpdate = {
41
+ description?: string;
42
+ amount?: string;
43
+ paidAt?: string;
44
+ };
45
+
46
+ export type OpportunityPaymentCreateEvent = {
47
+ payment: OpportunityPayment;
48
+ previousPayment?: undefined;
49
+ action: 'create';
50
+ actionAt: string;
51
+ userId: string;
52
+ tenantId: string;
53
+ branchId: string;
54
+ };
55
+
56
+ export type OpportunityPaymentUpdateEvent = {
57
+ payment: OpportunityPayment;
58
+ previousPayment: OpportunityPayment;
59
+ action: 'update';
60
+ actionAt: string;
61
+ userId: string;
62
+ tenantId: string;
63
+ branchId: string;
64
+ };
65
+
66
+ export type OpportunityPaymentDeleteEvent = {
67
+ payment?: undefined;
68
+ previousPayment: OpportunityPayment;
69
+ action: 'delete';
70
+ actionAt: string;
71
+ userId: string;
72
+ tenantId: string;
73
+ branchId: string;
74
+ };
75
+
76
+ export type OpportunityPaymentEvent = BaseEvent &
77
+ (OpportunityPaymentCreateEvent | OpportunityPaymentUpdateEvent | OpportunityPaymentDeleteEvent);
@@ -1,131 +1,29 @@
1
- import { BaseEvent } from './internal-events.js';
2
- import { SearchVehicle } from './vehicles.js';
3
-
4
- export enum PaymentActions {
5
- DELETE = 'delete',
6
- EDIT = 'edit',
7
- }
8
-
9
- export const PAYMENT_NOTIFICATION_ORIGIN = 'payment-notification';
10
-
11
- type BasePayment = {
12
- opportunityId: string;
13
- amount: string;
14
- description?: string;
15
- vehicleId: string;
16
- organizationId: string;
17
- };
18
-
19
- export type NewPayment = BasePayment & {
20
- id?: undefined;
21
- createdAt?: undefined;
22
- createdBy?: undefined;
23
- modifiedAt?: undefined;
24
- modifiedBy?: undefined;
25
- deletedAt?: undefined;
26
- deletedBy?: undefined;
27
- paidAt: string;
28
- };
29
-
30
- export type Payment = BasePayment & {
31
- id: string;
32
- createdAt: string;
33
- createdBy: string;
34
- modifiedAt: string;
35
- modifiedBy: string;
36
- deletedAt?: string;
37
- deletedBy?: string;
38
- paidAt?: string;
39
- };
40
-
41
- export type PaymentUpdate = {
42
- description?: string;
43
- amount?: string;
44
- paidAt?: string;
45
- };
46
-
47
- export type PaymentCreateEvent = {
48
- payment: Payment;
49
- previousPayment?: undefined;
50
- action: 'create';
51
- actionAt: string;
52
- userId: string;
53
- tenantId: string;
54
- branchId: string;
55
- };
56
-
57
- export type PaymentUpdateEvent = {
58
- payment: Payment;
59
- previousPayment: Payment;
60
- action: 'update';
61
- actionAt: string;
62
- userId: string;
63
- tenantId: string;
64
- branchId: string;
65
- };
66
-
67
- export type PaymentDeleteEvent = {
68
- payment?: undefined;
69
- previousPayment: Payment;
70
- action: 'delete';
71
- actionAt: string;
72
- userId: string;
73
- tenantId: string;
74
- branchId: string;
75
- };
76
-
77
- export type PaymentEvent = BaseEvent &
78
- (PaymentCreateEvent | PaymentUpdateEvent | PaymentDeleteEvent);
79
-
80
- export type NewVehiclePurchasePayment = {
81
- vehicleId: string;
82
- amount: string;
83
- description?: string;
84
- paidAt?: string;
85
- paidBy?: string;
86
- };
87
-
88
- export type VehiclePurchasePayment = NewVehiclePurchasePayment & {
89
- id: string;
90
- createdBy: string;
91
- createdAt: string;
92
- };
93
-
94
- export type VehiclePurchasePaymentBff = {
95
- payment: VehiclePurchasePayment;
96
- vehicle: SearchVehicle;
97
- };
98
-
99
- export type VehiclePurchasePaymentCreateEvent = {
100
- payment: VehiclePurchasePayment;
101
- previousPayment?: undefined;
102
- action: 'create';
103
- actionAt: string;
104
- userId: string;
105
- tenantId: string;
106
- };
107
-
108
- export type VehiclePurchasePaymentUpdateEvent = {
109
- payment: VehiclePurchasePayment;
110
- previousPayment: VehiclePurchasePayment;
111
- action: 'update';
112
- actionAt: string;
113
- userId: string;
114
- tenantId: string;
115
- };
116
-
117
- export type VehiclePurchasePaymentDeleteEvent = {
118
- payment?: undefined;
119
- previousPayment: VehiclePurchasePayment;
120
- action: 'delete';
121
- actionAt: string;
122
- userId: string;
123
- tenantId: string;
124
- };
125
-
126
- export type VehiclePurchasePaymentEvent = BaseEvent &
127
- (
128
- | VehiclePurchasePaymentCreateEvent
129
- | VehiclePurchasePaymentUpdateEvent
130
- | VehiclePurchasePaymentDeleteEvent
131
- );
1
+ /**
2
+ * @deprecated This module was split into `./opportunity-payments.js` (the generic "payment"
3
+ * entity, now called opportunity payment) and `./vehicle-purchase-payments.js`. It only
4
+ * re-exports the old names so consumers of the published SDK keep compiling; import from the
5
+ * new modules instead. Delete this file once bisondesk-client no longer imports it.
6
+ */
7
+
8
+ export type {
9
+ NewOpportunityPayment as NewPayment,
10
+ OpportunityPayment as Payment,
11
+ OpportunityPaymentCreateEvent as PaymentCreateEvent,
12
+ OpportunityPaymentDeleteEvent as PaymentDeleteEvent,
13
+ OpportunityPaymentEvent as PaymentEvent,
14
+ OpportunityPaymentUpdate as PaymentUpdate,
15
+ OpportunityPaymentUpdateEvent as PaymentUpdateEvent,
16
+ } from './opportunity-payments.js';
17
+ export {
18
+ OPPORTUNITY_PAYMENT_NOTIFICATION_ORIGIN as PAYMENT_NOTIFICATION_ORIGIN,
19
+ OpportunityPaymentActions as PaymentActions,
20
+ } from './opportunity-payments.js';
21
+ export type {
22
+ NewVehiclePurchasePayment,
23
+ VehiclePurchasePayment,
24
+ VehiclePurchasePaymentBff,
25
+ VehiclePurchasePaymentCreateEvent,
26
+ VehiclePurchasePaymentDeleteEvent,
27
+ VehiclePurchasePaymentEvent,
28
+ VehiclePurchasePaymentUpdateEvent,
29
+ } from './vehicle-purchase-payments.js';
@@ -0,0 +1,58 @@
1
+ import { BaseEvent } from './internal-events.js';
2
+ import { SearchVehicle } from './vehicles.js';
3
+
4
+ export const VEHICLE_PURCHASE_PAYMENT_ALLOWED_NOTIFICATION_ORIGIN =
5
+ 'vehicle-purchase-payment-allowed-notification';
6
+
7
+ export type NewVehiclePurchasePayment = {
8
+ vehicleId: string;
9
+ amount: string;
10
+ description?: string;
11
+ paidAt?: string;
12
+ paidBy?: string;
13
+ };
14
+
15
+ export type VehiclePurchasePayment = NewVehiclePurchasePayment & {
16
+ id: string;
17
+ createdBy: string;
18
+ createdAt: string;
19
+ };
20
+
21
+ export type VehiclePurchasePaymentBff = {
22
+ payment: VehiclePurchasePayment;
23
+ vehicle: SearchVehicle;
24
+ };
25
+
26
+ export type VehiclePurchasePaymentCreateEvent = {
27
+ payment: VehiclePurchasePayment;
28
+ previousPayment?: undefined;
29
+ action: 'create';
30
+ actionAt: string;
31
+ userId: string;
32
+ tenantId: string;
33
+ };
34
+
35
+ export type VehiclePurchasePaymentUpdateEvent = {
36
+ payment: VehiclePurchasePayment;
37
+ previousPayment: VehiclePurchasePayment;
38
+ action: 'update';
39
+ actionAt: string;
40
+ userId: string;
41
+ tenantId: string;
42
+ };
43
+
44
+ export type VehiclePurchasePaymentDeleteEvent = {
45
+ payment?: undefined;
46
+ previousPayment: VehiclePurchasePayment;
47
+ action: 'delete';
48
+ actionAt: string;
49
+ userId: string;
50
+ tenantId: string;
51
+ };
52
+
53
+ export type VehiclePurchasePaymentEvent = BaseEvent &
54
+ (
55
+ | VehiclePurchasePaymentCreateEvent
56
+ | VehiclePurchasePaymentUpdateEvent
57
+ | VehiclePurchasePaymentDeleteEvent
58
+ );