@zeniai/client-epic-state 4.14.61 → 4.14.63

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.
@@ -11,7 +11,8 @@ interface CompanyRunwayPayload {
11
11
  }
12
12
  interface LastEngagementPayload {
13
13
  type: string;
14
- date: string;
14
+ created_at: string;
15
+ scheduled_at: string | null;
15
16
  subject: string | null;
16
17
  to: string[] | null;
17
18
  from: string | null;
@@ -40,7 +40,7 @@ const toLastEngagements = (payload) => {
40
40
  if (engagement.type === 'email') {
41
41
  return {
42
42
  type: 'email',
43
- date: (0, zeniDayJS_1.date)(engagement.date),
43
+ createdAt: (0, zeniDayJS_1.date)(engagement.created_at),
44
44
  subject: (_a = engagement.subject) !== null && _a !== void 0 ? _a : '',
45
45
  to: engagement.to != null ? engagement.to.join(', ') : '',
46
46
  from: (_b = engagement.from) !== null && _b !== void 0 ? _b : '',
@@ -49,7 +49,10 @@ const toLastEngagements = (payload) => {
49
49
  }
50
50
  return {
51
51
  type: 'meeting',
52
- date: (0, zeniDayJS_1.date)(engagement.date),
52
+ createdAt: (0, zeniDayJS_1.date)(engagement.created_at),
53
+ scheduledAt: engagement.scheduled_at != null
54
+ ? (0, zeniDayJS_1.date)(engagement.scheduled_at)
55
+ : undefined,
53
56
  subject: (_c = engagement.subject) !== null && _c !== void 0 ? _c : '',
54
57
  hostName: (_d = engagement.host_name) !== null && _d !== void 0 ? _d : '',
55
58
  attendees: engagement.attendees != null ? engagement.attendees.join(', ') : '',
@@ -31,8 +31,9 @@ export interface CompanyHealthState {
31
31
  }
32
32
  export interface LastEngagement {
33
33
  type: string;
34
- date: ZeniDate;
35
34
  subject: string;
35
+ createdAt: ZeniDate;
36
+ scheduledAt?: ZeniDate;
36
37
  to?: string;
37
38
  from?: string;
38
39
  cc?: string;
@@ -69,20 +69,6 @@ exports.vendorPaylod = [
69
69
  contact_id: 'contacts_6856c987-17ff-44a4-aad3-eef4b7696554',
70
70
  },
71
71
  ],
72
- billing_address: {
73
- address_id: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
74
- city: 'Bangalore',
75
- country: 'India',
76
- country_code: null,
77
- create_time: '2022-02-01T15:47:44.681429',
78
- hash_value: '2be1de50bedd7a2dfb8094846698b2b8bc86869bf903c27b69b74ae3e2651983',
79
- latitude: null,
80
- longitude: null,
81
- postal_code: '560001',
82
- state: 'Karnataka',
83
- street: ['2nd lane', 'Opp Peter England showroom', 'Mg Road'],
84
- update_time: '2022-02-01T15:47:44.681439',
85
- },
86
72
  address: {
87
73
  address_id: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
88
74
  city: 'Bangalore',
@@ -237,20 +223,6 @@ exports.vendorPaylod = [
237
223
  fully_qualified_accounting_class_name: 'product 500',
238
224
  qbo_id: '5100000000000040143',
239
225
  },
240
- billing_address: {
241
- address_id: 'a_e3e99a8b-ae09-42ac-d400-e3e99a8b',
242
- city: 'Pune',
243
- country: 'India',
244
- country_code: null,
245
- create_time: '2022-02-01T15:47:44.681429',
246
- hash_value: '2be1de50bedd7a2dfb8094846698b2b8bc86869bf903c27b69b74ae3e2651983',
247
- latitude: null,
248
- longitude: null,
249
- postal_code: '411045',
250
- state: 'Maharashtra',
251
- street: ['1st Street', 'Near Mitcon College', 'Balewadi'],
252
- update_time: '2022-02-01T15:47:44.681439',
253
- },
254
226
  shipping_address: null,
255
227
  bank_accounts: [
256
228
  {
@@ -37,7 +37,6 @@ exports.vendorStateMock1 = {
37
37
  balance: 0,
38
38
  accountId: 'Travel Meals',
39
39
  classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
40
- billingAddressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
41
40
  addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
42
41
  bankAccountIds: [
43
42
  'bank_adg67-asnds-a6sad-sdfgf8',
@@ -98,7 +97,6 @@ exports.vendorStateMock2 = {
98
97
  countryCode: 'US',
99
98
  accountId: 'Travel Meals',
100
99
  classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
101
- billingAddressId: 'a_e3e99a8b-ae09-42ac-d400-e3e99a8b',
102
100
  bankAccountIds: [
103
101
  'bank_asghj-hgfjh-g3asfas-hags23',
104
102
  'bank_g3asfas-hags23-hgfjh-asghj',
@@ -155,7 +153,6 @@ exports.vendorStateMock4 = {
155
153
  balance: 0,
156
154
  accountId: 'Travel Meals',
157
155
  classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
158
- billingAddressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
159
156
  addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
160
157
  bankAccountIds: [
161
158
  'bank_adg67-asnds-a6sad-sdfgf8',
@@ -233,7 +230,6 @@ exports.vendorStateMock5 = {
233
230
  balance: 0,
234
231
  accountId: 'Travel Meals',
235
232
  classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
236
- billingAddressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
237
233
  addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
238
234
  bankAccountIds: [
239
235
  'bank_adg67-asnds-a6sad-sdfgf8',
@@ -294,7 +290,6 @@ exports.vendorStateMock6 = {
294
290
  balance: 0,
295
291
  accountId: 'Travel Meals',
296
292
  classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
297
- billingAddressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
298
293
  addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
299
294
  bankAccountIds: [
300
295
  'bank_adg67-asnds-a6sad-sdfgf8',
@@ -391,7 +386,6 @@ exports.vendorStateMock8 = {
391
386
  balance: 0,
392
387
  accountId: 'Travel Meals',
393
388
  classId: 'class_e0f33254-2651-4d5c-9d57-2611788265ca',
394
- billingAddressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
395
389
  addressId: 'a_e3e99a8b-d400-42ac-ae09-e655bff1af97',
396
390
  bankAccountIds: [
397
391
  'bank_adg67-asnds-a6sad-sdfgf8',
@@ -57,7 +57,6 @@ export interface VendorPayload extends VendorBasePayload, SpendPayload {
57
57
  account?: AccountBasePayload | null;
58
58
  accounting_class?: ClassBasePayload | null;
59
59
  contacts?: ContactPayload[];
60
- billing_address?: AddressPayload | null;
61
60
  address?: AddressPayload | null;
62
61
  shipping_address?: AddressPayload | null;
63
62
  bank_accounts?: BankAccountPayload[];
@@ -31,9 +31,7 @@ const toVendorBasePayload = (tranVendor, vendorUpdates) => {
31
31
  exports.toVendorBasePayload = toVendorBasePayload;
32
32
  const mapVendorPayloadToVendor = (payload) => {
33
33
  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, _15, _16, _17;
34
- 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
35
- ? payload.billing_address.address_id
36
- : undefined, addressId: payload.address != null ? payload.address.address_id : undefined, shippingAddressId: payload.shipping_address != null
34
+ 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 : [], addressId: payload.address != null ? payload.address.address_id : undefined, shippingAddressId: payload.shipping_address != null
37
35
  ? payload.shipping_address.address_id
38
36
  : undefined, bankAccountIds: (_1 = (_0 = payload.bank_accounts) === null || _0 === void 0 ? void 0 : _0.map((bankAcc) => bankAcc.bank_account_id)) !== null && _1 !== void 0 ? _1 : [], paymentInstrumentIds: (_3 = (_2 = payload.payment_instruments) === null || _2 === void 0 ? void 0 : _2.map((piAcc) => piAcc.zeni_payment_instrument_id)) !== null && _3 !== void 0 ? _3 : [], ownerId: (_5 = (_4 = payload.owner) === null || _4 === void 0 ? void 0 : _4.user_id) !== null && _5 !== void 0 ? _5 : undefined, balance: (_6 = payload.balance) !== null && _6 !== void 0 ? _6 : 0, matchScore: ((_7 = payload.match_score) === null || _7 === void 0 ? void 0 : _7.value) != null ? payload.match_score.value : 0, isVendor1099: (_8 = payload.is_vendor_1099) !== null && _8 !== void 0 ? _8 : false, documentIds: (_9 = payload.document_ids) !== null && _9 !== void 0 ? _9 : [], w9DocumentIds: (_11 = (_10 = payload.w9_documents) === null || _10 === void 0 ? void 0 : _10.map((file) => file.file_id)) !== null && _11 !== void 0 ? _11 : [], last30DaysSpend: payload.last_30_days_spend, last90DaysSpend: payload.last_90_days_spend, yearToDateSpend: payload.year_to_date_spend, lastMonthSpend: payload.last_month_spend, last3MonthsSpend: payload.last_3_months_spend, last6MonthsSpend: payload.last_6_months_spend, last12MonthsSpend: payload.last_12_months_spend, previousYearSpend: payload.previous_year_spend, recommendations: payload.recommendation != null && payload.recommendation.length > 0
39
37
  ? (0, transactionPayload_1.transformRecommendation)(payload.recommendation[0]) // In this case, there will be only one recommendation item since this is entity recommendation payload.
@@ -32,7 +32,6 @@ export interface Vendor extends VendorBase {
32
32
  phone: string;
33
33
  websiteUrl: string;
34
34
  contactIds: ID[];
35
- billingAddressId?: ID;
36
35
  addressId?: ID;
37
36
  shippingAddressId?: ID;
38
37
  bankAccountIds: ID[];
@@ -8,9 +8,6 @@ const getFlattenedAddress = (vendors) => {
8
8
  if (vendor.address != null) {
9
9
  addresses.push(vendor.address);
10
10
  }
11
- if (vendor.billing_address != null) {
12
- addresses.push(vendor.billing_address);
13
- }
14
11
  if (vendor.shipping_address != null) {
15
12
  addresses.push(vendor.shipping_address);
16
13
  }
@@ -26,7 +26,6 @@ export interface VendorUpdatePayload {
26
26
  vendor_currency_symbol: string;
27
27
  sync_token: string;
28
28
  address?: AddressUpdatableInfoPayload;
29
- billing_address?: AddressUpdatableInfoPayload;
30
29
  is_vendor_1099?: boolean;
31
30
  document_ids: ID[] | null;
32
31
  owner_id: ID | null;
@@ -495,7 +495,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
495
495
  case 'group':
496
496
  return (_j = company.managementInfo.companyGroupId) === null || _j === void 0 ? void 0 : _j.toLowerCase();
497
497
  case 'lastEngagement':
498
- return ((_l = (_k = company.companyHealthMetric.lastEngagements[0]) === null || _k === void 0 ? void 0 : _k.date) !== null && _l !== void 0 ? _l : DEFAULT_DATE);
498
+ return ((_l = (_k = company.companyHealthMetric.lastEngagements[0]) === null || _k === void 0 ? void 0 : _k.scheduledAt) !== null && _l !== void 0 ? _l : DEFAULT_DATE);
499
499
  case 'companyName':
500
500
  default:
501
501
  return company.companyInfo.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.14.61",
3
+ "version": "4.14.63",
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",