@zeniai/client-epic-state 5.1.29-beta0ND → 5.1.30
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/lib/__testHelpers__/apiFailure.json +6 -0
- package/lib/entity/genericEntity/entity.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +3 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +4 -4
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +1 -1
- package/lib/entity/vendor/__mocks__/vendorMock.d.ts +7 -0
- package/lib/entity/vendor/__mocks__/vendorMock.js +311 -0
- package/lib/entity/vendor/__mocks__/vendorStateMocks.d.ts +8 -0
- package/lib/entity/vendor/__mocks__/vendorStateMocks.js +415 -0
- package/lib/entity/vendor/vendorPayload.d.ts +4 -2
- package/lib/entity/vendor/vendorPayload.js +3 -1
- package/lib/esm/__testHelpers__/apiFailure.json +6 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +3 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +4 -4
- package/lib/esm/entity/vendor/__mocks__/vendorMock.js +308 -0
- package/lib/esm/entity/vendor/__mocks__/vendorStateMocks.js +412 -0
- package/lib/esm/entity/vendor/vendorPayload.js +3 -1
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/accountMappingView/__mocks__/accountMappingSelectorMock.js +4650 -0
- package/lib/esm/view/addressView/__mocks__/addressViewMocks.js +203 -0
- package/lib/esm/view/addressView/__mocks__/json/createAddressResponse.json +23 -0
- package/lib/esm/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +258 -0
- package/lib/esm/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +418 -0
- package/lib/esm/view/addressView/__mocks__/json/fetchAddressResponse.json +24 -0
- package/lib/esm/view/addressView/__mocks__/json/updateAddressResponse.json +24 -0
- package/lib/esm/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.js +11 -6
- package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +5 -1
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +4 -1
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -1
- package/lib/esm/view/referralView/referralReducer.js +3 -2
- package/lib/esm/view/scheduleView/scheduleAccruedDetailView/epics/deleteScheduleAccruedDetailEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleAccruedDetailView/epics/fetchRecommendedTransactionRowIndexEpic.js +11 -5
- package/lib/esm/view/scheduleView/scheduleAccruedDetailView/scheduleAccruedDetailPayload.js +4 -1
- package/lib/esm/view/scheduleView/scheduleDetailView/epics/createNewSchedulesEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleDetailView/epics/deleteScheduleDetailEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleDetailView/epics/markAsCompleteScheduleDetailEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +12 -3
- package/lib/esm/view/scheduleView/scheduleListView/scheduleListSelector.js +8 -7
- package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +8 -3
- package/lib/esm/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +2 -28
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +5 -1
- package/lib/esm/view/trendWithTransactions/fetchTrendForEntityEpic.js +3 -1
- package/lib/esm/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListReducer.js +4 -1
- package/lib/esm/view/vendorList/vendorListReducer.js +4 -1
- package/lib/esm/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +9 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +7 -6
- package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.d.ts +11 -0
- package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.js +4659 -0
- package/lib/view/addressView/__mocks__/addressViewMocks.d.ts +35 -0
- package/lib/view/addressView/__mocks__/addressViewMocks.js +239 -0
- package/lib/view/addressView/__mocks__/json/createAddressResponse.json +23 -0
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +258 -0
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +418 -0
- package/lib/view/addressView/__mocks__/json/fetchAddressResponse.json +24 -0
- package/lib/view/addressView/__mocks__/json/updateAddressResponse.json +24 -0
- package/lib/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.js +11 -6
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +5 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +4 -1
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -1
- package/lib/view/referralView/referralReducer.d.ts +1 -0
- package/lib/view/referralView/referralReducer.js +4 -3
- package/lib/view/scheduleView/scheduleAccruedDetailView/epics/deleteScheduleAccruedDetailEpic.js +1 -1
- package/lib/view/scheduleView/scheduleAccruedDetailView/epics/fetchRecommendedTransactionRowIndexEpic.js +11 -5
- package/lib/view/scheduleView/scheduleAccruedDetailView/scheduleAccruedDetailPayload.js +4 -1
- package/lib/view/scheduleView/scheduleDetailView/epics/createNewSchedulesEpic.js +1 -1
- package/lib/view/scheduleView/scheduleDetailView/epics/deleteScheduleDetailEpic.js +1 -1
- package/lib/view/scheduleView/scheduleDetailView/epics/markAsCompleteScheduleDetailEpic.js +1 -1
- package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.js +1 -1
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +12 -3
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +8 -7
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +8 -3
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +2 -28
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +5 -1
- package/lib/view/trendWithTransactions/fetchTrendForEntityEpic.js +3 -1
- package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListReducer.js +4 -1
- package/lib/view/vendorList/vendorListReducer.js +4 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +9 -1
- package/package.json +1 -1
|
@@ -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
|
+
};
|
|
@@ -23,8 +23,10 @@ export interface VendorBasePayload {
|
|
|
23
23
|
* actual identity.
|
|
24
24
|
*/
|
|
25
25
|
export declare const getVendorPayloadIdentifier: (vendor: VendorBasePayload) => string | null;
|
|
26
|
-
/** Normalizes vendor_id to the resolved identifier when one exists.
|
|
27
|
-
|
|
26
|
+
/** Normalizes vendor_id to the resolved identifier when one exists.
|
|
27
|
+
* When no identifier resolves, returns the payload unchanged (including null/empty vendor_id).
|
|
28
|
+
* Callers must still gate on getVendorPayloadIdentifier(vendor) != null before mapping. */
|
|
29
|
+
export declare const normalizeVendorBasePayload: <T extends VendorBasePayload>(vendor: T) => T;
|
|
28
30
|
export declare const mapVendorBasePayloadToVendorBase: (payload: VendorBasePayload) => VendorBase;
|
|
29
31
|
export declare const toVendorBasePayload: (tranVendor: VendorBase | undefined, vendorUpdates?: VendorBase) => VendorBasePayload;
|
|
30
32
|
interface MatchScorePayload {
|
|
@@ -16,7 +16,9 @@ const vendorType_1 = require("./vendorType");
|
|
|
16
16
|
*/
|
|
17
17
|
const getVendorPayloadIdentifier = (vendor) => (0, payloadIdentifier_1.resolvePayloadIdentifier)(vendor.vendor_id, vendor.qbo_id);
|
|
18
18
|
exports.getVendorPayloadIdentifier = getVendorPayloadIdentifier;
|
|
19
|
-
/** Normalizes vendor_id to the resolved identifier when one exists.
|
|
19
|
+
/** Normalizes vendor_id to the resolved identifier when one exists.
|
|
20
|
+
* When no identifier resolves, returns the payload unchanged (including null/empty vendor_id).
|
|
21
|
+
* Callers must still gate on getVendorPayloadIdentifier(vendor) != null before mapping. */
|
|
20
22
|
const normalizeVendorBasePayload = (vendor) => {
|
|
21
23
|
const resolvedVendorId = (0, exports.getVendorPayloadIdentifier)(vendor);
|
|
22
24
|
return resolvedVendorId != null
|
|
@@ -2,6 +2,7 @@ import { toAmount } from '../../commonStateTypes/amount';
|
|
|
2
2
|
import { LAST_SCHEDULE_DAY_OF_MONTH, MAX_SCHEDULE_DAY_OF_MONTH, MIN_SCHEDULE_DAY_OF_MONTH, toScheduleDaysOfMonth, } from '../../commonStateTypes/timePeriod';
|
|
3
3
|
import { date } from '../../zeniDayJS';
|
|
4
4
|
import { toTransactionID, } from '../transaction/payloadTypes/transactionIDPayload';
|
|
5
|
+
import { getVendorPayloadIdentifier } from '../vendor/vendorPayload';
|
|
5
6
|
import { generateJEScheduleKey } from './jeScheduleHelper';
|
|
6
7
|
import { getJEScheduleTransactionKey, toJournalEntryErrorCodeType, toScheduleJournalEntryStatusCodeType, toScheduleStatusCodeType, toScheduleTypesTypeStrict, } from './jeSchedulesTypes';
|
|
7
8
|
export function toScheduledJournalEntryState(payload, currency_code, currency_symbol) {
|
|
@@ -240,7 +241,7 @@ export function toJEScheduledTransaction(payload) {
|
|
|
240
241
|
code: toScheduleStatusCodeType(payload.status.code),
|
|
241
242
|
label: payload.status.label,
|
|
242
243
|
},
|
|
243
|
-
vendorId: payload.vendor
|
|
244
|
+
vendorId: getVendorPayloadIdentifier(payload.vendor) ?? undefined,
|
|
244
245
|
baseTransaction: getJEScheduleTransactionKey({
|
|
245
246
|
...toTransactionID(payload.base_transaction),
|
|
246
247
|
lineId: payload.base_transaction.line_id,
|
|
@@ -286,7 +287,7 @@ export function toJEAccruedScheduledTransaction(payload) {
|
|
|
286
287
|
code: toScheduleStatusCodeType(payload.status.code),
|
|
287
288
|
label: payload.status.label,
|
|
288
289
|
},
|
|
289
|
-
vendorId: payload.vendor
|
|
290
|
+
vendorId: getVendorPayloadIdentifier(payload.vendor) ?? undefined,
|
|
290
291
|
recurringAmount: {
|
|
291
292
|
amount: payload.recurring_amount,
|
|
292
293
|
currencyCode: 'USD',
|
|
@@ -12,8 +12,8 @@ export const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
|
|
|
12
12
|
return undefined;
|
|
13
13
|
}
|
|
14
14
|
const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, memo, recurringAmount, createTime, otherAttributes, } = JEAccruedScheduleState;
|
|
15
|
-
const vendorDetails = getVendorByVendorId(vendorState, vendorId);
|
|
16
|
-
if (vendorDetails == null) {
|
|
15
|
+
const vendorDetails = vendorId != null ? getVendorByVendorId(vendorState, vendorId) : undefined;
|
|
16
|
+
if (vendorId != null && vendorDetails == null) {
|
|
17
17
|
throw new Error(`Vendor with ${vendorId} doesn't exist`);
|
|
18
18
|
}
|
|
19
19
|
const userDetails = updatedBy != null ? getUserByUserId(userState, updatedBy) : undefined;
|
|
@@ -71,8 +71,8 @@ export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTr
|
|
|
71
71
|
const { jeSchedulesState, vendorState, accountState, userState, classState, transactionState, } = state;
|
|
72
72
|
const jeScheduleTransactionState = recordGet(jeSchedulesState.schedulesByTransactionKey, jeScheduleTransactionKey);
|
|
73
73
|
const { period, updatedByUserID: updatedBy, createdByUserID: createdBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiSummaries, recommendations, } = jeScheduleTransactionState;
|
|
74
|
-
const vendorDetails = getVendorByVendorId(vendorState, vendorId);
|
|
75
|
-
if (vendorDetails == null) {
|
|
74
|
+
const vendorDetails = vendorId != null ? getVendorByVendorId(vendorState, vendorId) : undefined;
|
|
75
|
+
if (vendorId != null && vendorDetails == null) {
|
|
76
76
|
throw new Error(`Vendor with ${vendorId} doesn't exist`);
|
|
77
77
|
}
|
|
78
78
|
const userDetails = updatedBy != null ? getUserByUserId(userState, updatedBy) : undefined;
|