@zeniai/client-epic-state 5.1.29-beta0ND → 5.1.30-beta0AY

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.
Files changed (49) hide show
  1. package/lib/__testHelpers__/apiFailure.json +6 -0
  2. package/lib/entity/customer/customerPayload.js +11 -2
  3. package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.js +1 -1
  4. package/lib/entity/vendor/__mocks__/vendorMock.d.ts +7 -0
  5. package/lib/entity/vendor/__mocks__/vendorMock.js +311 -0
  6. package/lib/entity/vendor/__mocks__/vendorStateMocks.d.ts +8 -0
  7. package/lib/entity/vendor/__mocks__/vendorStateMocks.js +415 -0
  8. package/lib/entity/vendor/vendorPayload.d.ts +2 -4
  9. package/lib/entity/vendor/vendorPayload.js +3 -12
  10. package/lib/entity/vendor/vendorReducer.js +0 -3
  11. package/lib/esm/__testHelpers__/apiFailure.json +6 -0
  12. package/lib/esm/entity/customer/customerPayload.js +11 -2
  13. package/lib/esm/entity/transaction/payloadTypes/vendorTransactionPayload.js +2 -2
  14. package/lib/esm/entity/vendor/__mocks__/vendorMock.js +308 -0
  15. package/lib/esm/entity/vendor/__mocks__/vendorStateMocks.js +412 -0
  16. package/lib/esm/entity/vendor/vendorPayload.js +2 -10
  17. package/lib/esm/entity/vendor/vendorReducer.js +1 -4
  18. package/lib/esm/index.js +2 -2
  19. package/lib/esm/view/accountMappingView/__mocks__/accountMappingSelectorMock.js +4650 -0
  20. package/lib/esm/view/addressView/__mocks__/addressViewMocks.js +203 -0
  21. package/lib/esm/view/addressView/__mocks__/json/createAddressResponse.json +23 -0
  22. package/lib/esm/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +258 -0
  23. package/lib/esm/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +418 -0
  24. package/lib/esm/view/addressView/__mocks__/json/fetchAddressResponse.json +24 -0
  25. package/lib/esm/view/addressView/__mocks__/json/updateAddressResponse.json +24 -0
  26. package/lib/esm/view/commonVendorView/transactionVendorView/transactionVendorViewReducer.js +0 -2
  27. package/lib/esm/view/referralView/referralReducer.js +3 -2
  28. package/lib/esm/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +2 -28
  29. package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +9 -10
  30. package/lib/index.d.ts +2 -2
  31. package/lib/index.js +7 -6
  32. package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.d.ts +11 -0
  33. package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.js +4659 -0
  34. package/lib/view/addressView/__mocks__/addressViewMocks.d.ts +35 -0
  35. package/lib/view/addressView/__mocks__/addressViewMocks.js +239 -0
  36. package/lib/view/addressView/__mocks__/json/createAddressResponse.json +23 -0
  37. package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +258 -0
  38. package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +418 -0
  39. package/lib/view/addressView/__mocks__/json/fetchAddressResponse.json +24 -0
  40. package/lib/view/addressView/__mocks__/json/updateAddressResponse.json +24 -0
  41. package/lib/view/commonVendorView/transactionVendorView/transactionVendorViewReducer.js +0 -2
  42. package/lib/view/referralView/referralReducer.d.ts +1 -0
  43. package/lib/view/referralView/referralReducer.js +4 -3
  44. package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +2 -28
  45. package/lib/view/transactionDetail/epics/transactionDetailEpic.js +8 -9
  46. package/package.json +70 -38
  47. package/lib/commonPayloadTypes/payloadIdentifier.d.ts +0 -6
  48. package/lib/commonPayloadTypes/payloadIdentifier.js +0 -18
  49. package/lib/esm/commonPayloadTypes/payloadIdentifier.js +0 -14
@@ -0,0 +1,415 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vendorStateMock8 = exports.vendorStateMock7 = exports.vendorStateMock6 = exports.vendorStateMock5 = exports.vendorStateMock4 = exports.vendorStateMock2 = exports.vendorStateMock1 = void 0;
4
+ const zeniDayJS_1 = require("../../../zeniDayJS");
5
+ const zeniUrl_1 = require("../../../zeniUrl");
6
+ exports.vendorStateMock1 = {
7
+ recommendations: [],
8
+ transactionAttachments: [],
9
+ id: 'vendor_j12jh1g2g12jg3jh12:12',
10
+ name: 'Sample Vendor 1',
11
+ legalName: 'Sample Vendor 1',
12
+ qboId: '12',
13
+ title: '',
14
+ suffix: '',
15
+ firstName: 'Sample',
16
+ middleName: '',
17
+ lastName: 'Vendor',
18
+ vendorType: 'individual',
19
+ isDeleted: false,
20
+ yearToDateSpend: undefined,
21
+ last30DaysSpend: undefined,
22
+ last90DaysSpend: undefined,
23
+ lastMonthSpend: 0,
24
+ last6MonthsSpend: 0,
25
+ last3MonthsSpend: 0,
26
+ last12MonthsSpend: 0,
27
+ previousYearSpend: 0,
28
+ createTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
29
+ updateTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
30
+ syncToken: '1',
31
+ email: '',
32
+ phone: '',
33
+ websiteUrl: '',
34
+ currencyCode: 'USD',
35
+ currencySymbol: '$',
36
+ countryCode: 'US',
37
+ balance: 0,
38
+ accountId: 'Travel Meals',
39
+ classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
40
+ addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
41
+ bankAccountIds: [
42
+ 'bank_adg67-asnds-a6sad-sdfgf8',
43
+ 'bank_asghj-hags23-hgfjh-g3asfas',
44
+ ],
45
+ contactIds: [
46
+ 'contacts_f3881db1-35c0-4699-891c-6cca724e75d6',
47
+ 'contacts_6856c987-17ff-44a4-aad3-eef4b7696554',
48
+ ],
49
+ matchScore: 0,
50
+ isVendor1099: false,
51
+ documentIds: [],
52
+ vendorCurrencySymbol: '$',
53
+ vendorCurrencyCode: 'USD',
54
+ paymentInstrumentIds: ['pay_inst_f3fc9b06-694a-4609-a710-b0e1d4de72d3'],
55
+ preferredInternationalTransferFeeBearerPaymentMethod: undefined,
56
+ filing1099Status: 'incomplete',
57
+ filing1099Tin: {
58
+ type: 'ein',
59
+ value: '550258131',
60
+ },
61
+ filing1099W9Files: undefined,
62
+ filing1099Total: undefined,
63
+ filing1099Type: undefined,
64
+ w9DocumentIds: [],
65
+ };
66
+ exports.vendorStateMock2 = {
67
+ recommendations: [],
68
+ transactionAttachments: [],
69
+ id: 'vendor_j12jh1g2g12jg3jh12:2',
70
+ name: 'Sample Vendor 2',
71
+ legalName: 'Sample Vendor 2',
72
+ qboId: '13',
73
+ title: '',
74
+ suffix: '',
75
+ firstName: 'Sample',
76
+ middleName: '',
77
+ lastName: 'Vendor 3',
78
+ vendorType: 'c_corporation',
79
+ isDeleted: false,
80
+ yearToDateSpend: undefined,
81
+ last30DaysSpend: undefined,
82
+ last90DaysSpend: undefined,
83
+ lastMonthSpend: 0,
84
+ last6MonthsSpend: 0,
85
+ last3MonthsSpend: 0,
86
+ last12MonthsSpend: 0,
87
+ previousYearSpend: 0,
88
+ createTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
89
+ updateTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
90
+ syncToken: '1',
91
+ email: '',
92
+ phone: '',
93
+ balance: 0,
94
+ websiteUrl: '',
95
+ currencyCode: 'USD',
96
+ currencySymbol: '$',
97
+ countryCode: 'US',
98
+ accountId: 'Travel Meals',
99
+ classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
100
+ bankAccountIds: [
101
+ 'bank_asghj-hgfjh-g3asfas-hags23',
102
+ 'bank_g3asfas-hags23-hgfjh-asghj',
103
+ ],
104
+ contactIds: [
105
+ 'contacts_f3881db1-35c0-4699-891c-6cca724e75d6',
106
+ 'contacts_6856c987-17ff-44a4-aad3-eef4b7696554',
107
+ ],
108
+ matchScore: 0,
109
+ isVendor1099: false,
110
+ documentIds: [],
111
+ vendorCurrencySymbol: '$',
112
+ vendorCurrencyCode: 'USD',
113
+ paymentInstrumentIds: ['pay_inst_f3fc9b06-694a-4609-a710-b0e1d4de72d3'],
114
+ preferredInternationalTransferFeeBearerPaymentMethod: undefined,
115
+ filing1099Status: 'incomplete',
116
+ filing1099Tin: {
117
+ type: 'ein',
118
+ value: '550258131',
119
+ },
120
+ w9DocumentIds: [],
121
+ };
122
+ exports.vendorStateMock4 = {
123
+ recommendations: [],
124
+ transactionAttachments: [],
125
+ id: 'vendor_j12jh1g2g12jg3jh12:12',
126
+ name: 'Sample Vendor',
127
+ legalName: 'Sample Vendor',
128
+ qboId: '12',
129
+ title: '',
130
+ suffix: '',
131
+ firstName: 'Sample',
132
+ middleName: '',
133
+ lastName: 'Vendor',
134
+ vendorType: 'Individual',
135
+ isDeleted: false,
136
+ yearToDateSpend: undefined,
137
+ last30DaysSpend: undefined,
138
+ last90DaysSpend: undefined,
139
+ lastMonthSpend: 0,
140
+ last6MonthsSpend: 0,
141
+ last3MonthsSpend: 0,
142
+ last12MonthsSpend: 0,
143
+ previousYearSpend: 0,
144
+ createTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
145
+ updateTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
146
+ syncToken: '1',
147
+ email: '',
148
+ phone: '',
149
+ websiteUrl: '',
150
+ currencyCode: 'USD',
151
+ currencySymbol: '$',
152
+ countryCode: 'US',
153
+ balance: 0,
154
+ accountId: 'Travel Meals',
155
+ classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
156
+ addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
157
+ bankAccountIds: [
158
+ 'bank_adg67-asnds-a6sad-sdfgf8',
159
+ 'bank_asghj-hags23-hgfjh-g3asfas',
160
+ ],
161
+ contactIds: [
162
+ 'contacts_6856c987-17ff-44a4-aad3-eef4b7696554',
163
+ 'contacts_f3881db1-35c0-4699-891c-6cca724e75d6',
164
+ ],
165
+ logo: undefined,
166
+ shippingAddressId: undefined,
167
+ matchScore: 0,
168
+ isVendor1099: false,
169
+ documentIds: [],
170
+ ownerId: undefined,
171
+ vendorCurrencySymbol: '$',
172
+ vendorCurrencyCode: 'USD',
173
+ paymentInstrumentIds: ['pay_inst_f3fc9b06-694a-4609-a710-b0e1d4de72d3'],
174
+ preferredInternationalTransferFeeBearerPaymentMethod: undefined,
175
+ filing1099Status: undefined,
176
+ filing1099Tin: undefined,
177
+ isINTType: false,
178
+ isMISCType: false,
179
+ isNECType: false,
180
+ filing1099INTTotal: undefined,
181
+ filing1099MISCTotal: undefined,
182
+ filing1099NECTotal: undefined,
183
+ filing1099W9Files: [],
184
+ filing1099TaxClassification: 'Individual',
185
+ w9DocumentIds: [],
186
+ };
187
+ exports.vendorStateMock5 = {
188
+ recommendations: [],
189
+ transactionAttachments: [
190
+ {
191
+ id: '5000000000000795428',
192
+ contentType: 'application/pdf',
193
+ createTime: (0, zeniDayJS_1.date)('2022-02-17T06:30:51.000000'),
194
+ updateTime: (0, zeniDayJS_1.date)('2022-02-17T06:30:52.000000'),
195
+ fileName: 'Rent Receipt.pdf',
196
+ fileSizeInBytes: 255841,
197
+ fileDownloadUrl: (0, zeniUrl_1.toZeniUrl)('https://storage.googleapis.com/zeni-dot-ai-tenant_745cc76c-5a82-4d2c-b9dc-9d1f283a4445/files/2022-05-05/file_bd906c26-0f37-44fe-8156-f5bfed67c383/file_bd906c26-0f37-44fe-8156-f5bfed67c383.pdf?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=zeni-apis-dev%40appspot.gserviceaccount.com%2F20220505%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20220505T083711Z&X-Goog-Expires=1200&X-Goog-SignedHeaders=host&X-Goog-Signature=bdba6c6b57b5a16973892683b57c27f29cbe72dc0e5a8acc03a630123bf5899536fd47178aef176ec5a2ebb549371e386bd0ac56e3d23e63446d20a0c8604f77b39aac055dcdb7a81529cbd934dba3e9a5934060b09695673a751436c96f1340979ce7c385f3bd3d4cb23211336bbdea7035d4f60997358c40020f8af0e6235b2e7fc43cdb3abb83c17d78abe5401257790601c01b97c1be5192178d0fe02d5828430ea763d0320beecea53a144a14c6f9e50ae8f29ea8bd9ae41686246f99a128ccdf7ef50ac102cc2ebc858c721a1006575a667b6963e4f95e37fcd17f94f8733ece376dbae145c6a91291fccb28b17eae7fe440a696302a901d7608384505'),
198
+ fileChecksum: undefined,
199
+ fileId: 'file_pu01bcfe-ebef-459b-a54c-7abdbdf0d77t',
200
+ },
201
+ ],
202
+ id: 'vendor_75f9e389-d9b7-4fcb-b4b5-8a691fcc96a5',
203
+ name: 'Google SVSS',
204
+ legalName: 'Google SVSS',
205
+ qboId: '10',
206
+ title: '',
207
+ suffix: '',
208
+ firstName: 'Google',
209
+ middleName: '',
210
+ lastName: 'SVSS',
211
+ vendorType: 'Individual',
212
+ isDeleted: false,
213
+ yearToDateSpend: undefined,
214
+ last30DaysSpend: undefined,
215
+ last90DaysSpend: undefined,
216
+ lastMonthSpend: 0,
217
+ last6MonthsSpend: 0,
218
+ last3MonthsSpend: 0,
219
+ last12MonthsSpend: 0,
220
+ previousYearSpend: 0,
221
+ createTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
222
+ updateTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
223
+ syncToken: '1',
224
+ email: '',
225
+ phone: '',
226
+ websiteUrl: '',
227
+ currencyCode: 'USD',
228
+ currencySymbol: '$',
229
+ countryCode: 'US',
230
+ balance: 0,
231
+ accountId: 'Travel Meals',
232
+ classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
233
+ addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
234
+ bankAccountIds: [
235
+ 'bank_adg67-asnds-a6sad-sdfgf8',
236
+ 'bank_asghj-hags23-hgfjh-g3asfas',
237
+ ],
238
+ contactIds: [
239
+ 'contacts_6856c987-17ff-44a4-aad3-eef4b7696554',
240
+ 'contacts_f3881db1-35c0-4699-891c-6cca724e75d6',
241
+ ],
242
+ logo: undefined,
243
+ shippingAddressId: undefined,
244
+ matchScore: 0,
245
+ isVendor1099: false,
246
+ documentIds: [],
247
+ ownerId: undefined,
248
+ vendorCurrencySymbol: '$',
249
+ vendorCurrencyCode: 'USD',
250
+ paymentInstrumentIds: ['pay_inst_f3fc9b06-694a-4609-a710-b0e1d4de72d3'],
251
+ filing1099Status: 'incomplete',
252
+ filing1099Tin: {
253
+ type: 'ein',
254
+ value: '550258131',
255
+ },
256
+ filing1099Type: 'int',
257
+ filing1099Total: 2287,
258
+ w9DocumentIds: [],
259
+ };
260
+ exports.vendorStateMock6 = {
261
+ recommendations: [],
262
+ id: 'vendor_44d40a18-22cb-49b7-b13f-c7c148ac1cf3',
263
+ name: 'Abb Enterprise',
264
+ legalName: 'Abb Enterprise',
265
+ qboId: '11',
266
+ title: '',
267
+ suffix: '',
268
+ firstName: 'Abb',
269
+ middleName: '',
270
+ lastName: 'Enterprise',
271
+ vendorType: 'Individual',
272
+ isDeleted: false,
273
+ yearToDateSpend: undefined,
274
+ last30DaysSpend: undefined,
275
+ last90DaysSpend: undefined,
276
+ lastMonthSpend: 0,
277
+ last6MonthsSpend: 0,
278
+ last3MonthsSpend: 0,
279
+ last12MonthsSpend: 0,
280
+ previousYearSpend: 0,
281
+ createTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
282
+ updateTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
283
+ syncToken: '1',
284
+ email: '',
285
+ phone: '',
286
+ websiteUrl: '',
287
+ currencyCode: 'USD',
288
+ currencySymbol: '$',
289
+ countryCode: 'US',
290
+ balance: 0,
291
+ accountId: 'Travel Meals',
292
+ classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
293
+ addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
294
+ bankAccountIds: [
295
+ 'bank_adg67-asnds-a6sad-sdfgf8',
296
+ 'bank_asghj-hags23-hgfjh-g3asfas',
297
+ ],
298
+ contactIds: [
299
+ 'contacts_6856c987-17ff-44a4-aad3-eef4b7696554',
300
+ 'contacts_f3881db1-35c0-4699-891c-6cca724e75d6',
301
+ ],
302
+ paymentInstrumentIds: ['pay_inst_f3fc9b06-694a-4609-a710-b0e1d4de72d3'],
303
+ logo: undefined,
304
+ shippingAddressId: undefined,
305
+ matchScore: 0,
306
+ isVendor1099: false,
307
+ documentIds: [],
308
+ ownerId: undefined,
309
+ vendorCurrencySymbol: '$',
310
+ vendorCurrencyCode: 'USD',
311
+ transactionAttachments: [],
312
+ filing1099Status: 'incomplete',
313
+ filing1099Tin: {
314
+ type: 'ein',
315
+ value: '550258131',
316
+ },
317
+ filing1099Type: 'int',
318
+ filing1099Total: 2287,
319
+ w9DocumentIds: [],
320
+ };
321
+ exports.vendorStateMock7 = {
322
+ id: 'vendor_7fd58fd7-2916-4fae-ba14-3c0f6e277743',
323
+ name: 'Hall Properties',
324
+ title: '',
325
+ suffix: '',
326
+ firstName: '',
327
+ middleName: '',
328
+ lastName: '',
329
+ vendorType: '',
330
+ isDeleted: false,
331
+ createTime: (0, zeniDayJS_1.date)('2024-02-19T12:38:08.740Z'),
332
+ updateTime: (0, zeniDayJS_1.date)('2024-02-19T12:38:08.740Z'),
333
+ currencyCode: 'USD',
334
+ currencySymbol: '$',
335
+ vendorCurrencyCode: 'USD',
336
+ vendorCurrencySymbol: '$',
337
+ qboId: '',
338
+ syncToken: '',
339
+ email: '',
340
+ phone: '',
341
+ websiteUrl: '',
342
+ contactIds: [],
343
+ bankAccountIds: [],
344
+ paymentInstrumentIds: [],
345
+ balance: 0,
346
+ matchScore: 0,
347
+ isVendor1099: false,
348
+ documentIds: [],
349
+ last30DaysSpend: 0,
350
+ last90DaysSpend: 0,
351
+ yearToDateSpend: 0,
352
+ recommendations: [],
353
+ transactionAttachments: [],
354
+ };
355
+ exports.vendorStateMock8 = {
356
+ recommendations: [],
357
+ transactionAttachments: [],
358
+ id: 'vendor_j12jh1g2g12jg3jh12:12',
359
+ name: 'Sample Vendor 1',
360
+ legalName: 'Sample Vendor 1',
361
+ qboId: '12',
362
+ title: '',
363
+ suffix: '',
364
+ firstName: 'Sample',
365
+ middleName: '',
366
+ lastName: 'Vendor',
367
+ vendorType: 'individual',
368
+ isDeleted: false,
369
+ yearToDateSpend: undefined,
370
+ last30DaysSpend: undefined,
371
+ last90DaysSpend: undefined,
372
+ lastMonthSpend: 0,
373
+ last6MonthsSpend: 0,
374
+ last3MonthsSpend: 0,
375
+ last12MonthsSpend: 0,
376
+ previousYearSpend: 0,
377
+ createTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
378
+ updateTime: (0, zeniDayJS_1.date)('2022-01-24T00:29:37.057Z'),
379
+ syncToken: '1',
380
+ email: '',
381
+ phone: '',
382
+ websiteUrl: '',
383
+ currencyCode: 'USD',
384
+ currencySymbol: '$',
385
+ countryCode: 'US',
386
+ balance: 0,
387
+ accountId: 'Travel Meals',
388
+ classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
389
+ addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
390
+ bankAccountIds: [
391
+ 'bank_adg67-asnds-a6sad-sdfgf8',
392
+ 'bank_asghj-hags23-hgfjh-g3asfas',
393
+ ],
394
+ contactIds: [
395
+ 'contacts_f3881db1-35c0-4699-891c-6cca724e75d6',
396
+ 'contacts_6856c987-17ff-44a4-aad3-eef4b7696554',
397
+ ],
398
+ matchScore: 0,
399
+ isVendor1099: false,
400
+ documentIds: [],
401
+ vendorCurrencySymbol: '$',
402
+ vendorCurrencyCode: 'USD',
403
+ paymentInstrumentIds: ['pay_inst_f3fc9b06-694a-4609-a710-b0e1d4de72d3'],
404
+ preferredInternationalTransferFeeBearerPaymentMethod: undefined,
405
+ filing1099Status: 'incomplete',
406
+ filing1099Tin: {
407
+ type: 'ein',
408
+ value: '550258131',
409
+ },
410
+ isINTType: true,
411
+ filing1099W9Files: undefined,
412
+ filing1099Total: undefined,
413
+ filing1099Type: 'int',
414
+ w9DocumentIds: [],
415
+ };
@@ -12,7 +12,7 @@ import { AttachmentPayload } from '../transaction/payloadTypes/attachmentPayload
12
12
  import { UserPayload } from '../user/userPayload';
13
13
  import { Vendor, VendorBase } from './vendorState';
14
14
  export interface VendorBasePayload {
15
- vendor_id: string | null;
15
+ vendor_id: string;
16
16
  vendor_name: string;
17
17
  logo?: URLPayload;
18
18
  qbo_id?: string;
@@ -20,11 +20,9 @@ export interface VendorBasePayload {
20
20
  /**
21
21
  * Resolves the effective vendor identifier from a payload.
22
22
  * For JE/Deposit transactions, vendor_id is null at runtime — qbo_id is the
23
- * actual identity.
23
+ * actual identity. Using nullish-coalescing (`??`) handles both cases uniformly.
24
24
  */
25
25
  export declare const getVendorPayloadIdentifier: (vendor: VendorBasePayload) => string | null;
26
- /** Normalizes vendor_id to the resolved identifier when one exists. */
27
- export declare const normalizeVendorBasePayload: (vendor: VendorBasePayload) => VendorBasePayload;
28
26
  export declare const mapVendorBasePayloadToVendorBase: (payload: VendorBasePayload) => VendorBase;
29
27
  export declare const toVendorBasePayload: (tranVendor: VendorBase | undefined, vendorUpdates?: VendorBase) => VendorBasePayload;
30
28
  interface MatchScorePayload {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapVendorPayloadToVendor = exports.toVendorBasePayload = exports.mapVendorBasePayloadToVendorBase = exports.normalizeVendorBasePayload = exports.getVendorPayloadIdentifier = void 0;
4
- const payloadIdentifier_1 = require("../../commonPayloadTypes/payloadIdentifier");
3
+ exports.mapVendorPayloadToVendor = exports.toVendorBasePayload = exports.mapVendorBasePayloadToVendorBase = exports.getVendorPayloadIdentifier = void 0;
5
4
  const urlPayload_1 = require("../../commonPayloadTypes/urlPayload");
6
5
  const common_1 = require("../../commonStateTypes/common");
7
6
  const zeniDayJS_1 = require("../../zeniDayJS");
@@ -12,18 +11,10 @@ const vendorType_1 = require("./vendorType");
12
11
  /**
13
12
  * Resolves the effective vendor identifier from a payload.
14
13
  * For JE/Deposit transactions, vendor_id is null at runtime — qbo_id is the
15
- * actual identity.
14
+ * actual identity. Using nullish-coalescing (`??`) handles both cases uniformly.
16
15
  */
17
- const getVendorPayloadIdentifier = (vendor) => (0, payloadIdentifier_1.resolvePayloadIdentifier)(vendor.vendor_id, vendor.qbo_id);
16
+ const getVendorPayloadIdentifier = (vendor) => vendor.vendor_id ?? vendor.qbo_id ?? null;
18
17
  exports.getVendorPayloadIdentifier = getVendorPayloadIdentifier;
19
- /** Normalizes vendor_id to the resolved identifier when one exists. */
20
- const normalizeVendorBasePayload = (vendor) => {
21
- const resolvedVendorId = (0, exports.getVendorPayloadIdentifier)(vendor);
22
- return resolvedVendorId != null
23
- ? { ...vendor, vendor_id: resolvedVendorId }
24
- : vendor;
25
- };
26
- exports.normalizeVendorBasePayload = normalizeVendorBasePayload;
27
18
  const mapVendorBasePayloadToVendorBase = (payload) => {
28
19
  const id = (0, exports.getVendorPayloadIdentifier)(payload);
29
20
  if (id == null) {
@@ -62,9 +62,6 @@ _a = vendor.actions, exports.updateVendors = _a.updateVendors, exports.removeVen
62
62
  exports.default = vendor.reducer;
63
63
  const doUpdateVendors = (draft, vendors, updateType) => {
64
64
  vendors.forEach((vendorPayload) => {
65
- if ((0, vendorPayload_1.getVendorPayloadIdentifier)(vendorPayload) == null) {
66
- return;
67
- }
68
65
  const latestVendor = (0, vendorPayload_1.mapVendorPayloadToVendor)(vendorPayload);
69
66
  if (latestVendor.id in draft && updateType === 'merge') {
70
67
  (0, assignWith_1.default)(draft[latestVendor.id], latestVendor, (objValue, srcValue) => Boolean(srcValue) === false ? objValue : srcValue); // IMPORTANT: replace the value only when source has valid value. Otherwise keep the existing value!);
@@ -0,0 +1,6 @@
1
+ {
2
+ "status": {
3
+ "message": "Internal server error",
4
+ "code": 500
5
+ }
6
+ }
@@ -1,12 +1,21 @@
1
1
  import { toURL } from '../../commonPayloadTypes/urlPayload';
2
- import { resolvePayloadIdentifier } from '../../commonPayloadTypes/payloadIdentifier';
3
2
  import { date } from '../../zeniDayJS';
4
3
  /**
5
4
  * Resolves the effective customer identifier from a payload.
6
5
  * For JE/Deposit transactions, customer_id is null at runtime — qbo_id is the
7
6
  * actual identity.
8
7
  */
9
- export const getCustomerPayloadIdentifier = (customer) => resolvePayloadIdentifier(customer.customer_id, customer.qbo_id);
8
+ export const getCustomerPayloadIdentifier = (customer) => {
9
+ const cid = customer.customer_id;
10
+ if (cid != null && cid !== '') {
11
+ return cid;
12
+ }
13
+ const qid = customer.qbo_id;
14
+ if (qid != null && qid !== '') {
15
+ return qid;
16
+ }
17
+ return null;
18
+ };
10
19
  export const toCustomerBase = (payload, parseOutParentName) => {
11
20
  const id = getCustomerPayloadIdentifier(payload);
12
21
  if (id == null) {
@@ -1,7 +1,7 @@
1
1
  import { toAmountWC } from '../../../commonStateTypes/amount';
2
2
  import { date as zeniDate } from '../../../zeniDayJS';
3
3
  import { toCustomerBase, toCustomerBasePayload, } from '../../customer/customerPayload';
4
- import { getVendorPayloadIdentifier, mapVendorBasePayloadToVendorBase, toVendorBasePayload, } from '../../vendor/vendorPayload';
4
+ import { mapVendorBasePayloadToVendorBase, toVendorBasePayload, } from '../../vendor/vendorPayload';
5
5
  import { toPaymentTypeStrict } from '../stateTypes/paymentType';
6
6
  import { toVendorTransactionTypeStrict } from '../stateTypes/transactionType';
7
7
  import { toTransaction, toTransactionPayload, } from './transactionPayload';
@@ -11,7 +11,7 @@ function buildVendorTransactionBase(payload) {
11
11
  return {
12
12
  ...transaction,
13
13
  documentId: payload.document_id,
14
- vendor: getVendorPayloadIdentifier(payload) != null
14
+ vendor: payload.vendor_id != null
15
15
  ? mapVendorBasePayloadToVendorBase(payload)
16
16
  : undefined,
17
17
  paymentType: toPaymentTypeStrict(payload.payment_type),