@vulog/aima-business 1.2.39 → 1.2.40

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