@vulog/aima-business 1.2.39 → 1.2.41

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.
@@ -2,13 +2,15 @@ import { Client } from '@vulog/aima-client';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export type SetInvoiceExternalPaymentBody = {
5
- paymentReference?: string;
6
- paymentDate?: string;
5
+ requesterId: string;
6
+ notes?: string;
7
+ paymentMethod?: string;
7
8
  };
8
9
 
9
10
  const bodySchema = z.object({
10
- paymentReference: z.string().trim().min(1).optional(),
11
- paymentDate: z.string().trim().min(1).optional(),
11
+ requesterId: z.string().trim().min(1),
12
+ notes: z.string().trim().optional(),
13
+ paymentMethod: z.string().trim().optional(),
12
14
  });
13
15
 
14
16
  export const setInvoiceExternalPayment = async (
package/src/types.ts CHANGED
@@ -1,51 +1,131 @@
1
- /** Represents a business entity */
1
+ /** Spring Page response wrapper used by the business API */
2
+ export type SpringPage<T> = {
3
+ content: T[];
4
+ totalElements: number;
5
+ totalPages: number;
6
+ size: number;
7
+ number: number;
8
+ first: boolean;
9
+ last: boolean;
10
+ numberOfElements: number;
11
+ empty: boolean;
12
+ [key: string]: any;
13
+ };
14
+
15
+ /** Represents a business entity (BusinessWSDTO) */
2
16
  export type Business = {
3
17
  /** Unique identifier */
4
18
  id: string;
19
+ /** Fleet identifier */
20
+ fleetId: string;
5
21
  /** Business name */
6
22
  name: string;
23
+ /** Legal name */
24
+ legalName?: string;
25
+ /** Phone number */
26
+ phoneNumber?: string;
27
+ /** Fax number */
28
+ faxNumber?: string;
29
+ /** Email address */
30
+ email?: string;
31
+ /** VAT number */
32
+ vat?: string;
33
+ /** EIN number */
34
+ ein?: string;
35
+ /** Registration URL */
36
+ registrationUrl?: string;
37
+ /** Comment */
38
+ comment?: string;
39
+ /** Payment type */
40
+ paymentType?: string;
41
+ /** Locale */
42
+ locale?: string;
43
+ /** Invoice frequency */
44
+ invoiceFrequency?: string;
7
45
  /** Business status */
8
- status: string;
46
+ status?: string;
47
+ /** Business type */
48
+ type?: string;
49
+ /** Entity name */
50
+ entityName?: string;
51
+ /** Whether trip notes are mandatory */
52
+ mandatoryTripNotes?: boolean;
53
+ /** Whether this is a master entity */
54
+ masterEntity?: boolean;
55
+ /** Next iteration date */
56
+ nextIteration?: string;
57
+ /** Creation date */
58
+ creationDate?: string;
59
+ /** Update date */
60
+ updateDate?: string;
9
61
  [key: string]: any;
10
62
  };
11
63
 
12
- /** Represents a contact within a business */
64
+ /** Represents a contact within a business (ContactsDTO) */
13
65
  export type BusinessContact = {
14
66
  /** Contact identifier */
15
67
  id: string;
16
- /** Contact name */
17
- name: string;
18
68
  /** Contact email */
19
69
  email: string;
20
70
  [key: string]: any;
21
71
  };
22
72
 
23
- /** Represents a cost center within a business */
73
+ /** Represents a cost center within a business (CostCenterDTO) */
24
74
  export type CostCenter = {
25
75
  /** Unique identifier */
26
76
  id: string;
27
77
  /** Cost center name */
28
78
  name: string;
29
- /** Parent business identifier */
30
- businessId: string;
79
+ /** Cost center value */
80
+ value: string;
31
81
  [key: string]: any;
32
82
  };
33
83
 
34
- /** Represents payment details for a business */
84
+ /** Represents payment details for a business (PaymentBusinessDTO) */
35
85
  export type BusinessPaymentDetails = {
86
+ /** Entity identifier */
87
+ entityId?: string;
88
+ /** Fleet identifier */
89
+ fleetId?: string;
90
+ /** Holder name */
91
+ holderName?: string;
92
+ /** Card type */
93
+ cardType?: string;
94
+ /** Card summary (last digits) */
95
+ cardSummary?: string;
96
+ /** Expiry date */
97
+ expiryDate?: string;
36
98
  /** Payment method type */
37
- paymentMethod: string;
99
+ paymentMethod?: string;
100
+ /** Mean of payment status */
101
+ mopStatus?: string;
102
+ /** PSP name */
103
+ pspName?: string;
104
+ /** IBAN */
105
+ iban?: string;
38
106
  [key: string]: any;
39
107
  };
40
108
 
41
- /** Represents a user linked to a business */
109
+ /** Represents a user linked to a business (UserBusinessDTO) */
42
110
  export type BusinessUser = {
43
111
  /** User identifier */
44
- userId: string;
45
- /** Business identifier */
46
- businessId: string;
47
- /** User role within the business */
48
- role: string;
112
+ id: string;
113
+ /** First name */
114
+ firstName?: string;
115
+ /** Last name */
116
+ lastName?: string;
117
+ /** Registration date */
118
+ registrationDate?: string;
119
+ /** Username */
120
+ userName?: string;
121
+ /** Account status */
122
+ accountStatus?: string;
123
+ /** Whether user is a delegated admin */
124
+ delegatedAdmin?: boolean;
125
+ /** Whether user is a delegated admin (alias) */
126
+ isDelegatedAdmin?: boolean;
127
+ /** Full name */
128
+ fullName?: string;
49
129
  [key: string]: any;
50
130
  };
51
131
 
@@ -95,14 +175,36 @@ export type StripeConfig = {
95
175
  [key: string]: any;
96
176
  };
97
177
 
98
- /** Represents a business invoice */
178
+ /** Represents a business invoice (InvoiceCumulativeBusinessDTO) */
99
179
  export type BusinessInvoice = {
100
180
  /** Invoice identifier */
101
181
  id: string;
102
- /** Invoice amount */
103
- amount: number;
182
+ /** Invoice sequence number */
183
+ sequence?: number;
184
+ /** Invoice date */
185
+ invoiceDate?: string;
186
+ /** Fleet identifier */
187
+ fleetId?: string;
188
+ /** Invoice year */
189
+ invoiceYear?: number;
104
190
  /** Invoice status */
105
- status: string;
191
+ invoicesStatus?: string;
192
+ /** Invoice amount */
193
+ amount?: number;
194
+ /** Currency */
195
+ currency?: string;
196
+ /** Entity identifier */
197
+ entityId?: string;
198
+ /** Number of payment attempts */
199
+ attempts?: number;
200
+ /** PSP name */
201
+ pspName?: string;
202
+ /** PSP reference */
203
+ pspReference?: string;
204
+ /** Invoice type */
205
+ type?: string;
206
+ /** Invoice number */
207
+ invoiceNumber?: string;
106
208
  [key: string]: any;
107
209
  };
108
210
 
@@ -111,19 +213,39 @@ export type InvoiceRefundNote = {
111
213
  [key: string]: any;
112
214
  };
113
215
 
114
- /** Represents the refundable amount for an invoice */
216
+ /** Represents the refundable amount for an invoice (InvoiceRefundDTO) */
115
217
  export type InvoiceRefundableAmount = {
116
218
  /** Invoice identifier */
117
219
  invoiceId: string;
220
+ /** Fleet identifier */
221
+ fleetId?: string;
118
222
  /** Refundable amount */
119
223
  refundableAmount: number;
224
+ /** Currency */
225
+ currency?: string;
120
226
  [key: string]: any;
121
227
  };
122
228
 
123
- /** Represents a business trip */
229
+ /** Represents a business trip (OngoingTripDTO) */
124
230
  export type BusinessTrip = {
231
+ /** Identifier */
232
+ id?: string;
125
233
  /** Trip identifier */
126
- tripId: string;
234
+ tripId?: string;
235
+ /** User identifier */
236
+ userId?: string;
237
+ /** Profile identifier */
238
+ profileId?: string;
239
+ /** Theoretical start date */
240
+ theorStartDate?: string;
241
+ /** Theoretical end date */
242
+ theorEndDate?: string;
243
+ /** Name */
244
+ name?: string;
245
+ /** Vehicle plate */
246
+ plate?: string;
247
+ /** Booking date */
248
+ booking_date?: string;
127
249
  [key: string]: any;
128
250
  };
129
251
 
@@ -136,12 +258,26 @@ export type TripNote = {
136
258
  [key: string]: any;
137
259
  };
138
260
 
139
- /** Represents a product in the business context */
261
+ /** Represents a product in the business context (ProductBusinessDTO) */
140
262
  export type BusinessProduct = {
141
263
  /** Product identifier */
142
264
  id: string;
265
+ /** Fleet identifier */
266
+ fleetId?: string;
143
267
  /** Product name */
144
268
  name: string;
269
+ /** Product type */
270
+ type?: string;
271
+ /** Price */
272
+ price?: number;
273
+ /** Whether tax is included */
274
+ taxIncluded?: boolean;
275
+ /** Expiration date */
276
+ expirationDate?: string;
277
+ /** Tax name */
278
+ taxName?: string;
279
+ /** Tax rate */
280
+ taxRate?: number;
145
281
  [key: string]: any;
146
282
  };
147
283
 
@@ -152,8 +288,28 @@ export type InvitationRequest = {
152
288
  [key: string]: any;
153
289
  };
154
290
 
155
- /** Represents a business wallet */
291
+ /** Represents a business wallet (WalletDTO) */
156
292
  export type BusinessWallet = {
293
+ /** Wallet identifier */
294
+ id?: string;
295
+ /** Available amount */
296
+ availableAmount?: number;
297
+ /** Initial amount */
298
+ initialAmount?: number;
299
+ /** Promo code reference */
300
+ promoCodeReference?: string;
301
+ /** Percentage discount */
302
+ percentage?: number;
303
+ /** Discount category */
304
+ discountCategory?: string;
305
+ /** Wallet type */
306
+ type?: string;
307
+ /** Wallet usage */
308
+ usage?: string;
309
+ /** Used amount */
310
+ usedAmount?: number;
311
+ /** Entity identifier */
312
+ entityId?: string;
157
313
  [key: string]: any;
158
314
  };
159
315
 
@@ -5,11 +5,53 @@ import { Business } from './types';
5
5
 
6
6
  export type UpdateBusinessBody = {
7
7
  name?: string;
8
+ legalName?: string;
9
+ phoneNumber?: string;
10
+ faxNumber?: string;
11
+ email?: string;
12
+ vat?: string;
13
+ ein?: string;
14
+ registrationUrl?: string;
15
+ comment?: string;
16
+ paymentType?: string;
17
+ locale?: string;
18
+ invoiceFrequency?: string;
19
+ status?: string;
20
+ nationality?: string;
21
+ pec?: string;
22
+ legalForm?: string;
23
+ fiscalCode?: string;
24
+ taxNumberCountry?: string;
25
+ communityTaxNumber?: string;
26
+ sdicemCode?: string;
27
+ mandatoryTripNotes?: boolean;
28
+ billingAddress?: {
29
+ city?: string;
30
+ country?: string;
31
+ region?: string;
32
+ streetName?: string;
33
+ postalCode?: string;
34
+ };
35
+ address?: {
36
+ city?: string;
37
+ country?: string;
38
+ region?: string;
39
+ streetName?: string;
40
+ postalCode?: string;
41
+ };
42
+ billingGroup?: {
43
+ id?: string;
44
+ fleetId?: string;
45
+ discount?: number;
46
+ name?: string;
47
+ };
8
48
  };
9
49
 
10
- const updateBusinessBodySchema = z.object({
11
- name: z.string().trim().min(1).max(255).optional(),
12
- });
50
+ const updateBusinessBodySchema = z
51
+ .object({
52
+ name: z.string().trim().min(1).max(255).optional(),
53
+ })
54
+ .passthrough();
13
55
 
14
56
  export const updateBusiness = async (
15
57
  client: Client,
@@ -5,12 +5,14 @@ import { CostCenter } from './types';
5
5
 
6
6
  export type UpdateCostCenterBody = {
7
7
  name?: string;
8
+ value?: string;
8
9
  };
9
10
 
10
11
  const uuidSchema = z.string().trim().min(1).uuid();
11
12
 
12
13
  const bodySchema = z.object({
13
14
  name: z.string().trim().min(1).max(255).optional(),
15
+ value: z.string().trim().min(1).optional(),
14
16
  });
15
17
 
16
18
  export const updateBusinessCostCenter = async (