@zeniai/client-epic-state 4.12.73 → 4.12.75

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 (28) hide show
  1. package/lib/entity/vendor/__mocks__/vendorMock.js +2 -0
  2. package/lib/entity/vendor/__mocks__/vendorStateMocks.js +5 -0
  3. package/lib/entity/vendor/vendorPayload.d.ts +1 -0
  4. package/lib/entity/vendor/vendorPayload.js +1 -1
  5. package/lib/entity/vendor/vendorState.d.ts +1 -0
  6. package/lib/view/commonVendorView/vendorView/vendorViewPayload.d.ts +1 -0
  7. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  8. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +2 -0
  9. package/lib/view/commonVendorView/vendorsTabVendorView/epics/vendorsTabVendorDetailLocalDataHelpers.js +1 -0
  10. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.d.ts +1 -0
  11. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.js +1 -0
  12. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  13. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +1 -0
  14. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.d.ts +1 -0
  15. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +4 -2
  16. package/lib/view/spendManagement/helpers.js +1 -0
  17. package/lib/view/vendorFiling1099/__mock__/json/vendorFiling1099ListSuccess.json +1 -0
  18. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.d.ts +1 -0
  19. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.js +18 -6
  20. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListSelector.js +3 -3
  21. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
  22. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.js +1 -1
  23. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.d.ts +1 -1
  24. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.js +14 -3
  25. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +3 -1
  26. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +22 -14
  27. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState.d.ts +2 -2
  28. package/package.json +1 -1
@@ -8,6 +8,7 @@ exports.vendorPaylod = [
8
8
  transaction_attachments: [],
9
9
  qbo_id: '12',
10
10
  vendor_name: 'Sample Vendor 1',
11
+ legal_name: 'Sample Vendor 1',
11
12
  title: '',
12
13
  suffix: '',
13
14
  first_name: 'Sample',
@@ -179,6 +180,7 @@ exports.vendorPaylod = [
179
180
  transaction_attachments: [],
180
181
  qbo_id: '13',
181
182
  vendor_name: 'Sample Vendor 2',
183
+ legal_name: 'Sample Vendor 2',
182
184
  title: '',
183
185
  suffix: '',
184
186
  first_name: 'Sample',
@@ -8,6 +8,7 @@ exports.vendorStateMock1 = {
8
8
  transactionAttachments: [],
9
9
  id: 'vendor_j12jh1g2g12jg3jh12:12',
10
10
  name: 'Sample Vendor 1',
11
+ legalName: 'Sample Vendor 1',
11
12
  qboId: '12',
12
13
  title: '',
13
14
  suffix: '',
@@ -67,6 +68,7 @@ exports.vendorStateMock2 = {
67
68
  transactionAttachments: [],
68
69
  id: 'vendor_j12jh1g2g12jg3jh12:2',
69
70
  name: 'Sample Vendor 2',
71
+ legalName: 'Sample Vendor 2',
70
72
  qboId: '13',
71
73
  title: '',
72
74
  suffix: '',
@@ -124,6 +126,7 @@ exports.vendorStateMock4 = {
124
126
  transactionAttachments: [],
125
127
  id: 'vendor_j12jh1g2g12jg3jh12:12',
126
128
  name: 'Sample Vendor',
129
+ legalName: 'Sample Vendor',
127
130
  qboId: '12',
128
131
  title: '',
129
132
  suffix: '',
@@ -196,6 +199,7 @@ exports.vendorStateMock5 = {
196
199
  ],
197
200
  id: 'vendor_75f9e389-d9b7-4fcb-b4b5-8a691fcc96a5',
198
201
  name: 'Google SVSS',
202
+ legalName: 'Google SVSS',
199
203
  qboId: '10',
200
204
  title: '',
201
205
  suffix: '',
@@ -255,6 +259,7 @@ exports.vendorStateMock6 = {
255
259
  recommendations: [],
256
260
  id: 'vendor_44d40a18-22cb-49b7-b13f-c7c148ac1cf3',
257
261
  name: 'Abb Enterprise',
262
+ legalName: 'Abb Enterprise',
258
263
  qboId: '11',
259
264
  title: '',
260
265
  suffix: '',
@@ -77,6 +77,7 @@ export interface VendorPayload extends VendorBasePayload, SpendPayload {
77
77
  vendor_1099_status?: string;
78
78
  tin?: Filing1099TinTypePayload;
79
79
  vendor_1099_ytd_total?: number;
80
+ legal_name?: string;
80
81
  }
81
82
  interface Filing1099TinTypePayload {
82
83
  type: string | null;
@@ -30,7 +30,7 @@ const toVendorBasePayload = (tranVendor, vendorUpdates) => {
30
30
  exports.toVendorBasePayload = toVendorBasePayload;
31
31
  const mapVendorPayloadToVendor = (payload) => {
32
32
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
33
- return Object.assign(Object.assign({}, (0, exports.mapVendorBasePayloadToVendorBase)(payload)), { qboId: payload.qbo_id, title: (_a = payload.title) !== null && _a !== void 0 ? _a : '', suffix: (_b = payload.suffix) !== null && _b !== void 0 ? _b : '', firstName: (_d = (_c = payload.first_name) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '', middleName: (_f = (_e = payload.middle_name) === null || _e === void 0 ? void 0 : _e.trim()) !== null && _f !== void 0 ? _f : '', lastName: (_h = (_g = payload.last_name) === null || _g === void 0 ? void 0 : _g.trim()) !== null && _h !== void 0 ? _h : '', vendorType: (_j = payload.vendor_type) !== null && _j !== void 0 ? _j : '', isDeleted: (_k = payload.is_deleted) !== null && _k !== void 0 ? _k : false, createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : (0, zeniDayJS_1.dateNow)(), updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : (0, zeniDayJS_1.dateNow)(), syncToken: (_l = payload.sync_token) !== null && _l !== void 0 ? _l : '', email: (_o = (_m = payload.email) === null || _m === void 0 ? void 0 : _m.trim()) !== null && _o !== void 0 ? _o : '', phone: (_p = payload.phone) !== null && _p !== void 0 ? _p : '', websiteUrl: (_q = payload.website_url) !== null && _q !== void 0 ? _q : '', currencyCode: payload.currency_code, currencySymbol: payload.currency_symbol, vendorCurrencyCode: (_r = payload.vendor_currency_code) !== null && _r !== void 0 ? _r : payload.currency_code, vendorCurrencySymbol: (_s = payload.vendor_currency_symbol) !== null && _s !== void 0 ? _s : payload.currency_symbol, countryCode: (_t = payload.country_code) !== null && _t !== void 0 ? _t : undefined, accountId: (_v = (_u = payload.account) === null || _u === void 0 ? void 0 : _u.account_id) !== null && _v !== void 0 ? _v : undefined, classId: (_x = (_w = payload.accounting_class) === null || _w === void 0 ? void 0 : _w.accounting_class_id) !== null && _x !== void 0 ? _x : undefined, contactIds: (_z = (_y = payload.contacts) === null || _y === void 0 ? void 0 : _y.map((contact) => contact.contact_id)) !== null && _z !== void 0 ? _z : [], billingAddressId: payload.billing_address != null
33
+ return Object.assign(Object.assign({}, (0, exports.mapVendorBasePayloadToVendorBase)(payload)), { legalName: payload.legal_name, qboId: payload.qbo_id, title: (_a = payload.title) !== null && _a !== void 0 ? _a : '', suffix: (_b = payload.suffix) !== null && _b !== void 0 ? _b : '', firstName: (_d = (_c = payload.first_name) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '', middleName: (_f = (_e = payload.middle_name) === null || _e === void 0 ? void 0 : _e.trim()) !== null && _f !== void 0 ? _f : '', lastName: (_h = (_g = payload.last_name) === null || _g === void 0 ? void 0 : _g.trim()) !== null && _h !== void 0 ? _h : '', vendorType: (_j = payload.vendor_type) !== null && _j !== void 0 ? _j : '', isDeleted: (_k = payload.is_deleted) !== null && _k !== void 0 ? _k : false, createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : (0, zeniDayJS_1.dateNow)(), updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : (0, zeniDayJS_1.dateNow)(), syncToken: (_l = payload.sync_token) !== null && _l !== void 0 ? _l : '', email: (_o = (_m = payload.email) === null || _m === void 0 ? void 0 : _m.trim()) !== null && _o !== void 0 ? _o : '', phone: (_p = payload.phone) !== null && _p !== void 0 ? _p : '', websiteUrl: (_q = payload.website_url) !== null && _q !== void 0 ? _q : '', currencyCode: payload.currency_code, currencySymbol: payload.currency_symbol, vendorCurrencyCode: (_r = payload.vendor_currency_code) !== null && _r !== void 0 ? _r : payload.currency_code, vendorCurrencySymbol: (_s = payload.vendor_currency_symbol) !== null && _s !== void 0 ? _s : payload.currency_symbol, countryCode: (_t = payload.country_code) !== null && _t !== void 0 ? _t : undefined, accountId: (_v = (_u = payload.account) === null || _u === void 0 ? void 0 : _u.account_id) !== null && _v !== void 0 ? _v : undefined, classId: (_x = (_w = payload.accounting_class) === null || _w === void 0 ? void 0 : _w.accounting_class_id) !== null && _x !== void 0 ? _x : undefined, contactIds: (_z = (_y = payload.contacts) === null || _y === void 0 ? void 0 : _y.map((contact) => contact.contact_id)) !== null && _z !== void 0 ? _z : [], billingAddressId: payload.billing_address != null
34
34
  ? payload.billing_address.address_id
35
35
  : undefined, addressId: payload.address != null ? payload.address.address_id : undefined, shippingAddressId: payload.shipping_address != null
36
36
  ? payload.shipping_address.address_id
@@ -66,6 +66,7 @@ export interface Vendor extends VendorBase {
66
66
  filing1099Total?: number;
67
67
  filing1099TaxClassification?: string;
68
68
  w9DocumentIds?: ID[];
69
+ legalName?: string;
69
70
  }
70
71
  export interface VendorState {
71
72
  vendorByID: Record<ID, Vendor>;
@@ -13,6 +13,7 @@ export interface VendorUpdatePayload {
13
13
  qbo_id: string;
14
14
  vendor_name: string;
15
15
  vendor_type: string;
16
+ legal_name?: string;
16
17
  account: AccountBasePayload | null;
17
18
  accounting_class: ClassBasePayload | null;
18
19
  contacts: ContactPayload[];
@@ -33,6 +33,7 @@ export interface VendorDetails {
33
33
  }
34
34
  export interface VendorBasic {
35
35
  name: string;
36
+ legalName?: string;
36
37
  account?: AccountBase;
37
38
  class?: ClassBase;
38
39
  owner?: User;
@@ -131,6 +131,7 @@ const getBasicVendorDetails = (state, selectedVendor, localData) => {
131
131
  const { accountState, classState, bankAccountState, paymentInstrumentState, contactState, fileState, vendorTypeListState, userState, } = state;
132
132
  return {
133
133
  name: selectedVendor.name,
134
+ legalName: selectedVendor.legalName,
134
135
  account: selectedVendor.accountId != null
135
136
  ? (0, accountSelector_1.getAccountBase)(accountState, selectedVendor.accountId, 'account_list')
136
137
  : undefined,
@@ -165,6 +166,7 @@ const getBasicVendorDetailsForNewVendor = (state, newVendor) => {
165
166
  const classId = selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.classId;
166
167
  return {
167
168
  name: (_c = selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.name) !== null && _c !== void 0 ? _c : '',
169
+ legalName: selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.legalName,
168
170
  account: accountId != null
169
171
  ? (0, accountSelector_1.getAccountBase)(accountState, accountId, 'account_list')
170
172
  : undefined,
@@ -10,6 +10,7 @@ const getInitializedVendorTabDetailLocalData = (vendorData, state, vendorPayload
10
10
  const { recommendedAccount, recommendedClass } = (0, commonVendorViewHelper_1.getRecommendedCategoryClass)(vendorData.recommendations, vendorData.accountId, vendorData.classId);
11
11
  return {
12
12
  vendorName: vendorData.name,
13
+ legalName: vendorData.legalName,
13
14
  vendorEmail: vendorData.email,
14
15
  vendorPhone: vendorData.phone,
15
16
  vendorType: vendorData.vendorType,
@@ -12,6 +12,7 @@ export declare type VendorCreationResponse = ZeniAPIResponse<FetchAllVendorsPayl
12
12
  export interface VendorUpdatePayload {
13
13
  qbo_id: string;
14
14
  vendor_name: string;
15
+ legal_name: string;
15
16
  email: string;
16
17
  phone: string;
17
18
  tin: Filing1099TinType | null;
@@ -13,6 +13,7 @@ const prepareEditVendorPayload = (state, vendorDetailLocalData, vendorId) => {
13
13
  const payload = {};
14
14
  if (vendorDetailLocalData != null) {
15
15
  payload.vendor_name = vendorDetailLocalData.vendorName;
16
+ payload.legal_name = vendorDetailLocalData.legalName;
16
17
  if (vendorDetailLocalData.vendorCategory != null) {
17
18
  const accountBase = (0, accountSelector_1.getAccountBase)(accountState, vendorDetailLocalData.vendorCategory, 'account_list');
18
19
  if (accountBase != null) {
@@ -34,6 +34,7 @@ export interface VendorsTabVendorDetails {
34
34
  export interface VendorsTabVendorBasic {
35
35
  id: ID;
36
36
  name: string;
37
+ legalName?: string;
37
38
  email?: string;
38
39
  phone?: string;
39
40
  account?: AccountBase;
@@ -78,6 +78,7 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
78
78
  exports.getVendorsTabVendorView = getVendorsTabVendorView;
79
79
  const getBasicVendorDetails = (accountState, classState, userState, selectedVendor, vendorTypeListState, contactState) => ({
80
80
  name: selectedVendor.name,
81
+ legalName: selectedVendor.legalName,
81
82
  email: selectedVendor.email,
82
83
  phone: selectedVendor.phone,
83
84
  account: selectedVendor.accountId != null
@@ -20,6 +20,7 @@ export interface VendorsTabVendorViewState {
20
20
  }
21
21
  export interface VendorsTabVendorDetailLocalData {
22
22
  vendorName?: string;
23
+ legalName?: string;
23
24
  vendorEmail?: string;
24
25
  vendorPhone?: string;
25
26
  vendorType?: string;
@@ -189,12 +189,14 @@ const getAllFundingAccounts = (depositAccounts, paymentAccounts, paymentAccountB
189
189
  ...depositAccounts.map((depositAcc) => (0, exports.mapDepositAccToFundingAccount)(depositAcc)),
190
190
  ...(includeOnlyVerifiedAccounts
191
191
  ? paymentAccounts.filter((paymentAccount) => {
192
- var _a, _b, _c;
192
+ var _a, _b, _c, _d;
193
193
  return ((_a = paymentAccount.providerVerificationStatus) === null || _a === void 0 ? void 0 : _a.code) === 'verified' ||
194
194
  ((_b = paymentAccount.providerVerificationStatus) === null || _b === void 0 ? void 0 : _b.code) ===
195
195
  'manually_verified' ||
196
196
  ((_c = paymentAccount.providerVerificationStatus) === null || _c === void 0 ? void 0 : _c.code) ===
197
- 'automatically_verified';
197
+ 'automatically_verified' ||
198
+ ((_d = paymentAccount.providerVerificationStatus) === null || _d === void 0 ? void 0 : _d.code) ===
199
+ 'database_matched';
198
200
  })
199
201
  : paymentAccounts).map((paymentAcc) => (0, exports.mapPaymentAccToFundingAccount)(paymentAcc, paymentAccountBalanceFetchStatus)),
200
202
  ];
@@ -268,6 +268,7 @@ function isVerifiedStatusCode(statusCode) {
268
268
  'verified',
269
269
  'automatically_verified',
270
270
  'manually_verified',
271
+ 'database_matched',
271
272
  'pending_automatic_verification',
272
273
  'pending_manual_verification',
273
274
  'pending_verification',
@@ -30,6 +30,7 @@
30
30
  "vendor_id": "vendor_j12jh1g2g12jg3jh12:12",
31
31
  "qbo_id": "12",
32
32
  "vendor_name": "Sample Vendor 1",
33
+ "legal_name": "Sample Vendor 1",
33
34
  "title": "",
34
35
  "suffix": "",
35
36
  "first_name": "Sample",
@@ -31,6 +31,7 @@ export declare const vendorFiling1099UploadDetailsSuccessResponse: {
31
31
  vendor_id: string;
32
32
  qbo_id: string;
33
33
  vendor_name: string;
34
+ legal_name: string;
34
35
  title: string;
35
36
  suffix: string;
36
37
  first_name: string;
@@ -25,8 +25,12 @@ exports.vendorFiling1099UploadDetailsInProgressState = {
25
25
  vendorId: '123',
26
26
  w9Documents: [],
27
27
  legalName: '',
28
- email: '',
29
- phone: '',
28
+ contact: {
29
+ email: '',
30
+ phone: '',
31
+ fullName: '',
32
+ id: '',
33
+ },
30
34
  taxClassification: '',
31
35
  tin: {
32
36
  type: null,
@@ -52,8 +56,12 @@ exports.vendorFiling1099UploadDetailsInProgressInitialState = {
52
56
  vendorId: '123',
53
57
  w9Documents: [],
54
58
  legalName: '',
55
- email: '',
56
- phone: '',
59
+ contact: {
60
+ email: '',
61
+ fullName: '',
62
+ id: '',
63
+ phone: '',
64
+ },
57
65
  taxClassification: '',
58
66
  tin: {
59
67
  type: null,
@@ -79,8 +87,12 @@ exports.vendorFiling1099UploadDetailsSuccessState = {
79
87
  vendorId: '123',
80
88
  w9Documents: [],
81
89
  legalName: '',
82
- email: '',
83
- phone: '',
90
+ contact: {
91
+ email: '',
92
+ fullName: '',
93
+ id: '',
94
+ phone: '',
95
+ },
84
96
  taxClassification: '',
85
97
  tin: {
86
98
  type: null,
@@ -20,7 +20,7 @@ const getVendorFiling1099List = (state) => {
20
20
  .trim()
21
21
  .toLowerCase();
22
22
  let vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, targetIds);
23
- vendors = vendors.filter((vendor) => vendor.name.toLowerCase().includes(loweredSearchText));
23
+ vendors = vendors.filter((vendor) => { var _a; return (_a = vendor.legalName) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(loweredSearchText); });
24
24
  vendors = (0, exports.sortedVendorFiling1099View)(vendors, vendorFiling1099ListState.uiState.sortKey, vendorFiling1099ListState.uiState.sortOrder);
25
25
  const vendorFiling1099ViewList = vendors.map((vendor) => {
26
26
  return Object.assign({}, vendor);
@@ -40,8 +40,8 @@ exports.getVendorFiling1099List = getVendorFiling1099List;
40
40
  const sortedVendorFiling1099View = (vendorFiling1099List, sortKey, sortOrder) => {
41
41
  return (0, orderBy_1.default)(vendorFiling1099List, (vendor) => {
42
42
  switch (sortKey) {
43
- case 'vendor_name':
44
- return vendor.name;
43
+ case 'legal_name':
44
+ return vendor.legalName;
45
45
  case 'tax_classification':
46
46
  return vendor.vendorType;
47
47
  case 'w9':
@@ -18,6 +18,6 @@ export interface VendorFiling1099ListQuery {
18
18
  sortOrder: SortOrder;
19
19
  sortKey: VendorFiling1099ListViewSortKey;
20
20
  }
21
- declare const toVendorFiling1099ListViewSortKey: (v: string) => "total" | "status" | "w9" | "vendor_name" | "tax_classification";
21
+ declare const toVendorFiling1099ListViewSortKey: (v: string) => "total" | "status" | "w9" | "legal_name" | "tax_classification";
22
22
  export declare type VendorFiling1099ListViewSortKey = ReturnType<typeof toVendorFiling1099ListViewSortKey>;
23
23
  export {};
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
4
4
  const VENDOR_FILING_1099_LIST_VIEW_SORT_KEYS = [
5
- 'vendor_name',
5
+ 'legal_name',
6
6
  'tax_classification',
7
7
  'w9',
8
8
  'status',
@@ -8,7 +8,7 @@ import { AddressUpdatableInfo } from '../../addressView/addressViewState';
8
8
  import { Filing1099TinType } from '../../../entity/vendor/vendorType';
9
9
  export interface W9Form {
10
10
  tin?: Filing1099TinType;
11
- vendor_name?: string;
11
+ legal_name?: string;
12
12
  vendor_type?: string;
13
13
  }
14
14
  export interface W9FormProcessingPayload {
@@ -29,13 +29,24 @@ const prepareEditVendor1099DetailsPayload = (state, localData, vendorId, address
29
29
  if (address != null) {
30
30
  addressPayload = (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(address);
31
31
  }
32
+ const localDataContact = localData.contact;
33
+ let contactPayload;
34
+ if (localDataContact != null) {
35
+ contactPayload = [
36
+ {
37
+ contact_id: localDataContact.id,
38
+ full_name: localDataContact.fullName,
39
+ email: localDataContact.email,
40
+ phone: localDataContact.phone,
41
+ },
42
+ ];
43
+ }
32
44
  const cleanedTinValue = (_b = (_a = localData.tin) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.replace(/\D/g, '');
33
45
  return {
34
46
  qbo_id: vendor === null || vendor === void 0 ? void 0 : vendor.qboId,
35
47
  w9_document_ids: (_c = localData.w9Documents) === null || _c === void 0 ? void 0 : _c.map((doc) => doc.id),
36
- vendor_name: localData.legalName,
37
- email: localData.email,
38
- phone: localData.phone,
48
+ legal_name: localData.legalName,
49
+ contacts: contactPayload !== null && contactPayload !== void 0 ? contactPayload : [],
39
50
  vendor_type: localData.taxClassification,
40
51
  tin: {
41
52
  type: (_e = (_d = localData.tin) === null || _d === void 0 ? void 0 : _d.type) !== null && _e !== void 0 ? _e : null,
@@ -4,6 +4,7 @@ import { FilePayload } from '../../../entity/file/filePayload';
4
4
  import { W9Form } from './vendorFiling1099UploadDetailsPayload';
5
5
  import { ZeniAPIStatus } from '../../../responsePayload';
6
6
  import { Vendor } from '../../../entity/vendor/vendorState';
7
+ import { Contact } from '../../../entity/billPay/contact/contact';
7
8
  export declare const initialState: VendorFiling1099UploadDetailsState;
8
9
  export declare const updateW9FormUploadFile: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
9
10
  w9FormFile: FilePayload;
@@ -14,9 +15,10 @@ export declare const updateW9FormUploadFile: import("@reduxjs/toolkit").ActionCr
14
15
  }, string, never, never>, vendorFiling1099UploadDetailsSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
15
16
  fetchState: FetchState;
16
17
  error: ZeniAPIStatus<Record<string, unknown>> | undefined;
17
- }, string, never, never>, initializeVendorFiling1099UploadDetailsLocalState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, vendor: Vendor], {
18
+ }, string, never, never>, initializeVendorFiling1099UploadDetailsLocalState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, vendor: Vendor, contact: Contact], {
18
19
  vendorId: string;
19
20
  vendor: Vendor;
21
+ contact: Contact;
20
22
  }, string, never, never>, updateVendor1099DetailsLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<VendorsFiling1099UploadDetailsLocalData>, string>, updateW9FormOCRDataToLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
21
23
  ocrData: W9Form;
22
24
  vendorId: ID;
@@ -17,9 +17,13 @@ exports.initialState = {
17
17
  vendor1099DetailsLocalData: {
18
18
  vendorId: '',
19
19
  w9Documents: [],
20
- email: '',
20
+ contact: {
21
+ email: '',
22
+ phone: '',
23
+ fullName: '',
24
+ id: '',
25
+ },
21
26
  legalName: '',
22
- phone: '',
23
27
  taxClassification: '',
24
28
  tin: {
25
29
  type: null,
@@ -70,9 +74,13 @@ const vendorFiling1099UploadDetails = (0, toolkit_1.createSlice)({
70
74
  draft.vendor1099DetailsLocalData = {
71
75
  vendorId: action.payload.vendorId,
72
76
  w9Documents: [],
73
- email: '',
77
+ contact: {
78
+ email: '',
79
+ phone: '',
80
+ id: '',
81
+ fullName: '',
82
+ },
74
83
  legalName: '',
75
- phone: '',
76
84
  taxClassification: '',
77
85
  tin: {
78
86
  type: null,
@@ -136,26 +144,26 @@ const vendorFiling1099UploadDetails = (0, toolkit_1.createSlice)({
136
144
  },
137
145
  initializeVendorFiling1099UploadDetailsLocalState: {
138
146
  reducer(draft, action) {
139
- var _a, _b, _c, _d, _e, _f;
147
+ var _a, _b, _c, _d, _e, _f, _g;
140
148
  const vendor = action.payload.vendor;
141
149
  draft.vendor1099DetailsLocalData = {
142
150
  vendorId: action.payload.vendorId,
143
- legalName: vendor.name,
144
- email: vendor.email,
145
- w9Documents: (_a = vendor.filing1099W9Files) !== null && _a !== void 0 ? _a : [],
146
- phone: vendor.phone,
147
- taxClassification: (_b = vendor.filing1099TaxClassification) !== null && _b !== void 0 ? _b : '',
151
+ legalName: (_a = vendor.legalName) !== null && _a !== void 0 ? _a : '',
152
+ w9Documents: (_b = vendor.filing1099W9Files) !== null && _b !== void 0 ? _b : [],
153
+ contact: action.payload.contact,
154
+ taxClassification: (_c = vendor.filing1099TaxClassification) !== null && _c !== void 0 ? _c : '',
148
155
  tin: {
149
- type: (_d = (_c = vendor.filing1099Tin) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : null,
150
- value: (_f = (_e = vendor.filing1099Tin) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : '',
156
+ type: (_e = (_d = vendor.filing1099Tin) === null || _d === void 0 ? void 0 : _d.type) !== null && _e !== void 0 ? _e : null,
157
+ value: (_g = (_f = vendor.filing1099Tin) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : '',
151
158
  },
152
159
  };
153
160
  },
154
- prepare(vendorId, vendor) {
161
+ prepare(vendorId, vendor, contact) {
155
162
  return {
156
163
  payload: {
157
164
  vendorId,
158
165
  vendor,
166
+ contact,
159
167
  },
160
168
  };
161
169
  },
@@ -166,7 +174,7 @@ const vendorFiling1099UploadDetails = (0, toolkit_1.createSlice)({
166
174
  updateW9FormOCRDataToLocalData(draft, action) {
167
175
  var _a, _b, _c, _d, _e;
168
176
  const tin = (_a = action.payload.ocrData) === null || _a === void 0 ? void 0 : _a.tin;
169
- const vendorName = (_b = action.payload.ocrData) === null || _b === void 0 ? void 0 : _b.vendor_name;
177
+ const vendorName = (_b = action.payload.ocrData) === null || _b === void 0 ? void 0 : _b.legal_name;
170
178
  const vendorType = (_c = action.payload.ocrData) === null || _c === void 0 ? void 0 : _c.vendor_type;
171
179
  const tinType = (_d = tin === null || tin === void 0 ? void 0 : tin.type) !== null && _d !== void 0 ? _d : null;
172
180
  const tinValue = (_e = tin === null || tin === void 0 ? void 0 : tin.value) !== null && _e !== void 0 ? _e : null;
@@ -1,4 +1,5 @@
1
1
  import { FetchedState, FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
+ import { Contact } from '../../../entity/billPay/contact/contact';
2
3
  import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
3
4
  import { Filing1099TinType } from '../../../entity/vendor/vendorType';
4
5
  export interface VendorFiling1099UploadDetailsState extends FetchedState {
@@ -10,10 +11,9 @@ export interface VendorFiling1099UploadDetailsState extends FetchedState {
10
11
  export interface VendorsFiling1099UploadDetailsLocalData {
11
12
  vendorId: ID;
12
13
  legalName: string;
13
- email: string;
14
- phone: string;
15
14
  taxClassification: string;
16
15
  tin: Filing1099TinType;
16
+ contact: Contact;
17
17
  w9Documents?: Attachment[];
18
18
  }
19
19
  export interface Vendor1099DetailsAutoFilledValues {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.12.73",
3
+ "version": "4.12.75",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",