@zeniai/client-epic-state 4.10.27 → 4.10.29

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,9 +11,9 @@ export interface BillTransactionPayload extends VendorTransactionPayload {
11
11
  is_recurring: boolean;
12
12
  recurring_bill_config_id: string | null;
13
13
  recurring_bill_instance: number | null;
14
- home_currency_amount: number;
15
- home_currency_code: string;
16
- home_currency_symbol: string;
14
+ home_currency_amount?: number;
15
+ home_currency_code?: string;
16
+ home_currency_symbol?: string;
17
17
  class_id?: ID | null;
18
18
  class_name?: string | null;
19
19
  qbo_class_id?: ID | null;
@@ -9,7 +9,13 @@ const billTransactionState_1 = require("./billTransactionState");
9
9
  const billPayConfigPayload_1 = require("../../../view/spendManagement/billPay/billPayConfig/billPayConfigPayload");
10
10
  const toBillTransaction = (payload) => {
11
11
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
12
- return (Object.assign(Object.assign({}, (0, vendorTransactionPayload_1.toVendorTransaction)(payload)), { billPayInfo: (0, exports.toBillPayInfo)(payload.bill_pay_info), classId: (_a = payload.class_id) !== null && _a !== void 0 ? _a : '', className: (_b = payload.class_name) !== null && _b !== void 0 ? _b : '', qboClassId: (_c = payload.qbo_class_id) !== null && _c !== void 0 ? _c : '', transactionReferenceId: (_d = payload.transaction_reference_id) !== null && _d !== void 0 ? _d : '', entityApprovalId: payload.entity_approval_id, updateTime: (0, zeniDayJS_1.date)(payload.update_time), createdBy: (_e = payload.created_by_user_id) !== null && _e !== void 0 ? _e : '', candidateVendorName: (_f = payload.candidate_vendor_name) !== null && _f !== void 0 ? _f : '', bookCloseDate: payload.book_close_date != null ? (0, zeniDayJS_1.date)(payload.book_close_date) : undefined, lastUpdatedByUserId: (_g = payload.last_updated_by_user_id) !== null && _g !== void 0 ? _g : '', paymentProcessingTotalFee: (0, amount_1.toAmount)((_h = payload.total_fee) !== null && _h !== void 0 ? _h : 0, payload.currency_code, payload.currency_symbol), isDeleted: payload.is_deleted, deletionInfo: (0, exports.toDeletionInfo)(payload.deletion_info), isRecurring: payload.is_recurring, recurringBillConfigId: (_j = payload.recurring_bill_config_id) !== null && _j !== void 0 ? _j : undefined, recurringBillInstance: (_k = payload.recurring_bill_instance) !== null && _k !== void 0 ? _k : undefined, totalAmountInUSD: (0, amount_1.toAmount)(payload.home_currency_amount, payload.home_currency_code, payload.home_currency_symbol) }));
12
+ return Object.assign(Object.assign({}, (0, vendorTransactionPayload_1.toVendorTransaction)(payload)), { billPayInfo: (0, exports.toBillPayInfo)(payload.bill_pay_info), classId: (_a = payload.class_id) !== null && _a !== void 0 ? _a : '', className: (_b = payload.class_name) !== null && _b !== void 0 ? _b : '', qboClassId: (_c = payload.qbo_class_id) !== null && _c !== void 0 ? _c : '', transactionReferenceId: (_d = payload.transaction_reference_id) !== null && _d !== void 0 ? _d : '', entityApprovalId: payload.entity_approval_id, updateTime: (0, zeniDayJS_1.date)(payload.update_time), createdBy: (_e = payload.created_by_user_id) !== null && _e !== void 0 ? _e : '', candidateVendorName: (_f = payload.candidate_vendor_name) !== null && _f !== void 0 ? _f : '', bookCloseDate: payload.book_close_date != null
13
+ ? (0, zeniDayJS_1.date)(payload.book_close_date)
14
+ : undefined, lastUpdatedByUserId: (_g = payload.last_updated_by_user_id) !== null && _g !== void 0 ? _g : '', paymentProcessingTotalFee: (0, amount_1.toAmount)((_h = payload.total_fee) !== null && _h !== void 0 ? _h : 0, payload.currency_code, payload.currency_symbol), isDeleted: payload.is_deleted, deletionInfo: (0, exports.toDeletionInfo)(payload.deletion_info), isRecurring: payload.is_recurring, recurringBillConfigId: (_j = payload.recurring_bill_config_id) !== null && _j !== void 0 ? _j : undefined, recurringBillInstance: (_k = payload.recurring_bill_instance) !== null && _k !== void 0 ? _k : undefined, totalAmountInUSD: payload.home_currency_amount != null &&
15
+ payload.home_currency_code != null &&
16
+ payload.home_currency_symbol != null
17
+ ? (0, amount_1.toAmount)(payload.home_currency_amount, payload.home_currency_code, payload.home_currency_symbol)
18
+ : undefined });
13
19
  };
14
20
  exports.toBillTransaction = toBillTransaction;
15
21
  const toBillPayInfo = (payload) => {
@@ -19,7 +19,7 @@ export interface BillTransaction extends VendorTransaction {
19
19
  isDeleted: boolean;
20
20
  deletionInfo: DeletionInfo;
21
21
  isRecurring: boolean;
22
- totalAmountInUSD: Amount;
22
+ totalAmountInUSD?: Amount;
23
23
  recurringBillConfigId?: ID;
24
24
  recurringBillInstance?: number;
25
25
  bookCloseDate?: ZeniDate;
@@ -6,7 +6,7 @@ export interface CustomerBasePayload {
6
6
  qbo_id?: string;
7
7
  logo?: URLPayload;
8
8
  }
9
- export declare const toCustomerBase: (payload: CustomerBasePayload) => CustomerBase;
9
+ export declare const toCustomerBase: (payload: CustomerBasePayload, parseOutParentName: boolean) => CustomerBase;
10
10
  export declare const toCustomerBasePayload: (customer: CustomerBase | undefined) => CustomerBasePayload;
11
11
  export interface CustomerPayload extends CustomerBasePayload {
12
12
  currency_symbol: string | null;
@@ -44,4 +44,4 @@ export interface CustomerPayload extends CustomerBasePayload {
44
44
  qbo_update_time?: string;
45
45
  accounting_class_id?: string | null;
46
46
  }
47
- export declare const toCustomer: (payload: CustomerPayload) => Customer;
47
+ export declare const toCustomer: (payload: CustomerPayload, parseOutParentName?: boolean) => Customer;
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toCustomer = exports.toCustomerBasePayload = exports.toCustomerBase = void 0;
4
4
  const urlPayload_1 = require("../../commonPayloadTypes/urlPayload");
5
5
  const zeniDayJS_1 = require("../../zeniDayJS");
6
- const toCustomerBase = (payload) => ({
6
+ const toCustomerBase = (payload, parseOutParentName) => ({
7
7
  id: payload.customer_id,
8
- name: payload.customer_name,
8
+ name: parseOutParentName
9
+ ? removeParentName(payload.customer_name)
10
+ : payload.customer_name,
9
11
  qboId: payload.qbo_id,
10
12
  logo: payload.logo != null ? (0, urlPayload_1.toURL)(payload.logo) : undefined,
11
13
  });
@@ -19,8 +21,27 @@ const toCustomerBasePayload = (customer) => {
19
21
  });
20
22
  };
21
23
  exports.toCustomerBasePayload = toCustomerBasePayload;
22
- const toCustomer = (payload) => {
24
+ const toCustomer = (payload, parseOutParentName = false) => {
23
25
  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;
24
- return (Object.assign(Object.assign({}, (0, exports.toCustomerBase)(payload)), { addressId: (_a = payload.address_id) !== null && _a !== void 0 ? _a : undefined, lastName: (_b = payload.last_name) !== null && _b !== void 0 ? _b : undefined, paymentMethodId: (_c = payload.payment_method_id) !== null && _c !== void 0 ? _c : undefined, suffix: (_d = payload.suffix) !== null && _d !== void 0 ? _d : undefined, createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined, qboCreateTime: payload.qbo_create_time != null ? (0, zeniDayJS_1.date)(payload.qbo_create_time) : undefined, nameOnCheck: (_e = payload.name_on_check) !== null && _e !== void 0 ? _e : undefined, firstName: (_f = payload.first_name) !== null && _f !== void 0 ? _f : undefined, middleName: (_g = payload.middle_name) !== null && _g !== void 0 ? _g : undefined, contacts: (_h = payload.contacts) !== null && _h !== void 0 ? _h : undefined, termId: (_j = payload.term_id) !== null && _j !== void 0 ? _j : undefined, note: (_k = payload.note) !== null && _k !== void 0 ? _k : undefined, syncToken: payload.sync_token, email: (_l = payload.email) !== null && _l !== void 0 ? _l : undefined, websiteUrl: (_m = payload.website_url) !== null && _m !== void 0 ? _m : undefined, parentCustomerId: (_o = payload.parent_customer_id) !== null && _o !== void 0 ? _o : undefined, qboParentCustomerId: (_p = payload.qbo_parent_customer_id) !== null && _p !== void 0 ? _p : undefined, isBillWithParent: Boolean(payload.is_bill_with_parent), updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : undefined, accountId: (_q = payload.account_id) !== null && _q !== void 0 ? _q : undefined, phone: (_r = payload.phone) !== null && _r !== void 0 ? _r : undefined, bankAccountIds: (_s = payload.bank_account_ids) !== null && _s !== void 0 ? _s : undefined, balance: (_t = payload.balance) !== null && _t !== void 0 ? _t : undefined, isDeleted: Boolean(payload.is_deleted), tenantId: payload.tenant_id, title: (_u = payload.title) !== null && _u !== void 0 ? _u : undefined, isSubCustomer: Boolean(payload.is_sub_customer), isTaxable: Boolean(payload.is_taxable), shippingAddressId: (_v = payload.shipping_address_id) !== null && _v !== void 0 ? _v : undefined, billingAddressId: (_w = payload.billing_address_id) !== null && _w !== void 0 ? _w : undefined, currencySymbol: (_x = payload.currency_symbol) !== null && _x !== void 0 ? _x : undefined, qboUpdateTime: payload.qbo_update_time != null ? (0, zeniDayJS_1.date)(payload.qbo_update_time) : undefined, accountingClassId: (_y = payload.accounting_class_id) !== null && _y !== void 0 ? _y : undefined, currencyCode: (_z = payload.currency_code) !== null && _z !== void 0 ? _z : undefined }));
26
+ return (Object.assign(Object.assign({}, (0, exports.toCustomerBase)(payload, parseOutParentName)), { addressId: (_a = payload.address_id) !== null && _a !== void 0 ? _a : undefined, lastName: (_b = payload.last_name) !== null && _b !== void 0 ? _b : undefined, paymentMethodId: (_c = payload.payment_method_id) !== null && _c !== void 0 ? _c : undefined, suffix: (_d = payload.suffix) !== null && _d !== void 0 ? _d : undefined, createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined, qboCreateTime: payload.qbo_create_time != null ? (0, zeniDayJS_1.date)(payload.qbo_create_time) : undefined, nameOnCheck: (_e = payload.name_on_check) !== null && _e !== void 0 ? _e : undefined, firstName: (_f = payload.first_name) !== null && _f !== void 0 ? _f : undefined, middleName: (_g = payload.middle_name) !== null && _g !== void 0 ? _g : undefined, contacts: (_h = payload.contacts) !== null && _h !== void 0 ? _h : undefined, termId: (_j = payload.term_id) !== null && _j !== void 0 ? _j : undefined, note: (_k = payload.note) !== null && _k !== void 0 ? _k : undefined, syncToken: payload.sync_token, email: (_l = payload.email) !== null && _l !== void 0 ? _l : undefined, websiteUrl: (_m = payload.website_url) !== null && _m !== void 0 ? _m : undefined, parentCustomerId: (_o = payload.parent_customer_id) !== null && _o !== void 0 ? _o : undefined, qboParentCustomerId: (_p = payload.qbo_parent_customer_id) !== null && _p !== void 0 ? _p : undefined, isBillWithParent: Boolean(payload.is_bill_with_parent), updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : undefined, accountId: (_q = payload.account_id) !== null && _q !== void 0 ? _q : undefined, phone: (_r = payload.phone) !== null && _r !== void 0 ? _r : undefined, bankAccountIds: (_s = payload.bank_account_ids) !== null && _s !== void 0 ? _s : undefined, balance: (_t = payload.balance) !== null && _t !== void 0 ? _t : undefined, isDeleted: Boolean(payload.is_deleted), tenantId: payload.tenant_id, title: (_u = payload.title) !== null && _u !== void 0 ? _u : undefined, isSubCustomer: Boolean(payload.is_sub_customer), isTaxable: Boolean(payload.is_taxable), shippingAddressId: (_v = payload.shipping_address_id) !== null && _v !== void 0 ? _v : undefined, billingAddressId: (_w = payload.billing_address_id) !== null && _w !== void 0 ? _w : undefined, currencySymbol: (_x = payload.currency_symbol) !== null && _x !== void 0 ? _x : undefined, qboUpdateTime: payload.qbo_update_time != null ? (0, zeniDayJS_1.date)(payload.qbo_update_time) : undefined, accountingClassId: (_y = payload.accounting_class_id) !== null && _y !== void 0 ? _y : undefined, currencyCode: (_z = payload.currency_code) !== null && _z !== void 0 ? _z : undefined }));
25
27
  };
26
28
  exports.toCustomer = toCustomer;
29
+ /**
30
+ * In case of AR Aging detail reports, the customer name comes back prepended
31
+ * with the parent hierarchy looking like abc:xyz:Customer123
32
+ * In this case we want to continue to keep just `Customer Name` as name parameter
33
+ * This function parses the name and discards the parent hierarchy. In this
34
+ * case `Customer123`
35
+ * @param name
36
+ * @returns
37
+ */
38
+ const removeParentName = (name) => {
39
+ const allNames = name.split(':');
40
+ const length = allNames.length;
41
+ if (length === 0) {
42
+ return name;
43
+ }
44
+ else {
45
+ return allNames[length - 1];
46
+ }
47
+ };
@@ -1,6 +1,12 @@
1
1
  import { CustomerState } from './customerState';
2
2
  import { CustomerPayload } from './customerPayload';
3
3
  export declare const initialState: CustomerState;
4
- export declare const updateCustomers: import("@reduxjs/toolkit").ActionCreatorWithPayload<CustomerPayload[], string>, updateCustomer: import("@reduxjs/toolkit").ActionCreatorWithPayload<CustomerPayload, string>, removeCustomer: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, clearAllCustomers: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
4
+ export declare const updateCustomers: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[customersPayload: CustomerPayload[], parseOutParentName?: boolean | undefined], {
5
+ customersPayload: CustomerPayload[];
6
+ parseOutParentName: boolean | undefined;
7
+ }, string, never, never>, updateCustomer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[customerPayload: CustomerPayload, parseOutParentName?: boolean | undefined], {
8
+ customerPayload: CustomerPayload;
9
+ parseOutParentName: boolean | undefined;
10
+ }, string, never, never>, removeCustomer: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, clearAllCustomers: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
5
11
  declare const _default: import("@reduxjs/toolkit").Reducer<CustomerState, import("@reduxjs/toolkit").AnyAction>;
6
12
  export default _default;
@@ -11,15 +11,26 @@ const customer = (0, toolkit_1.createSlice)({
11
11
  name: 'customer',
12
12
  initialState: exports.initialState,
13
13
  reducers: {
14
- updateCustomers(draft, action) {
15
- action.payload.forEach((customerPayload) => {
16
- const customer = (0, customerPayload_1.toCustomer)(customerPayload);
17
- draft.byCustomerId[customer.id] = customer;
18
- });
14
+ updateCustomers: {
15
+ reducer(draft, action) {
16
+ const customersPayload = action.payload.customersPayload;
17
+ customersPayload.forEach((customerPayload) => {
18
+ const customer = (0, customerPayload_1.toCustomer)(customerPayload, action.payload.parseOutParentName);
19
+ draft.byCustomerId[customer.id] = customer;
20
+ });
21
+ },
22
+ prepare(customersPayload, parseOutParentName) {
23
+ return { payload: { customersPayload, parseOutParentName } };
24
+ },
19
25
  },
20
- updateCustomer(draft, action) {
21
- const customer = (0, customerPayload_1.toCustomer)(action.payload);
22
- draft.byCustomerId[customer.id] = customer;
26
+ updateCustomer: {
27
+ reducer(draft, action) {
28
+ const customer = (0, customerPayload_1.toCustomer)(action.payload.customerPayload, action.payload.parseOutParentName);
29
+ draft.byCustomerId[customer.id] = customer;
30
+ },
31
+ prepare(customerPayload, parseOutParentName) {
32
+ return { payload: { customerPayload, parseOutParentName } };
33
+ },
23
34
  },
24
35
  removeCustomer(draft, action) {
25
36
  delete draft.byCustomerId[action.payload];
@@ -5,13 +5,12 @@ const amount_1 = require("../../../commonStateTypes/amount");
5
5
  const customerPayload_1 = require("../../customer/customerPayload");
6
6
  const paymentType_1 = require("../stateTypes/paymentType");
7
7
  const transactionType_1 = require("../stateTypes/transactionType");
8
- // import {CustomerPayload, mapCustomerPayloadToCustomer} from './customerPayload';
9
8
  const transactionPayload_1 = require("./transactionPayload");
10
9
  const isCustomerTransactionPayload = (payload) => (0, transactionType_1.toCustomerTransactionTypeStrict)(payload.transaction_type) != null;
11
10
  exports.isCustomerTransactionPayload = isCustomerTransactionPayload;
12
11
  const toCustomerTransaction = (payload) => {
13
12
  const transaction = (0, transactionPayload_1.toTransaction)(payload);
14
- return Object.assign(Object.assign({}, transaction), { customer: payload.customer_id != null ? (0, customerPayload_1.toCustomerBase)(payload) : undefined, documentId: payload.document_id, paymentType: (0, paymentType_1.toPaymentTypeStrict)(payload.payment_type), paymentTypeName: payload.payment_type_name, paymentMethodName: payload.payment_method_name, balance: payload.balance != null
13
+ return Object.assign(Object.assign({}, transaction), { customer: payload.customer_id != null ? (0, customerPayload_1.toCustomerBase)(payload, false) : undefined, documentId: payload.document_id, paymentType: (0, paymentType_1.toPaymentTypeStrict)(payload.payment_type), paymentTypeName: payload.payment_type_name, paymentMethodName: payload.payment_method_name, balance: payload.balance != null
15
14
  ? (0, amount_1.toAmountWC)(payload.balance, transaction.amount)
16
15
  : undefined });
17
16
  };
@@ -23,7 +23,7 @@ const toTransactionWithAccountAndClassLine = (payload, currency, type = 'transac
23
23
  var _a, _b, _c, _d;
24
24
  return (Object.assign(Object.assign({}, (0, exports.toTransactionLineBase)(payload, type, currency)), { class: (0, classPayload_1.mapClassBasePayloadToClassBase)((_a = payload.line_detail.class) !== null && _a !== void 0 ? _a : {}), account: (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(payload.line_detail.account), customer: payload.line_detail.customer != null &&
25
25
  payload.line_detail.customer.customer_id != null
26
- ? (0, customerPayload_1.toCustomerBase)(payload.line_detail.customer)
26
+ ? (0, customerPayload_1.toCustomerBase)(payload.line_detail.customer, false)
27
27
  : undefined, vendor: payload.line_detail.vendor != null &&
28
28
  payload.line_detail.vendor.vendor_id != null
29
29
  ? (0, vendorPayload_1.mapVendorBasePayloadToVendorBase)(payload.line_detail.vendor)
package/lib/init.js CHANGED
@@ -32,7 +32,7 @@ function initialize(restEndPoints, userId, sessionId, tenantId) {
32
32
  console.info(`initializing with ${JSON.stringify(restEndPoints)}`);
33
33
  initialize3rdPartyExtensions();
34
34
  exports.zeniAPI = new zeniAPI_1.ZeniAPIClient(restEndPoints, userId, sessionId, tenantId);
35
- exports.store = (0, configureStore_1.default)(exports.zeniAPI, true);
35
+ exports.store = (0, configureStore_1.default)(exports.zeniAPI, false);
36
36
  return exports.store;
37
37
  }
38
38
  exports.default = initialize;
@@ -10,8 +10,8 @@ const zeniDayJS_1 = require("../../../zeniDayJS");
10
10
  const vendorState_1 = require("../../../entity/vendor/vendorState");
11
11
  exports.inititalUIState = {
12
12
  searchString: '',
13
- sortKey: 'vendor',
14
- sortOrder: 'ascending',
13
+ sortKey: 'total',
14
+ sortOrder: 'descending',
15
15
  downloadState: 'Not-Started',
16
16
  selectedDate: (0, zeniDayJS_1.dateNow)(),
17
17
  agingDateSelectionType: 'custom_date',
@@ -17,7 +17,7 @@ const fetchArAgingDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0,
17
17
  .pipe((0, operators_1.mergeMap)((response) => {
18
18
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
19
19
  const actions = [
20
- (0, customerReducer_1.updateCustomers)(response.data.report.customers),
20
+ (0, customerReducer_1.updateCustomers)(response.data.report.customers, true),
21
21
  (0, arAgingDetailReducer_1.updateArAgingDetailOnSuccess)(response.data.report, customerId, reportDate),
22
22
  ];
23
23
  return (0, rxjs_1.from)(actions);
@@ -12,8 +12,8 @@ const customerState_1 = require("../../../entity/customer/customerState");
12
12
  const getNestedCustomerHierarchy_1 = require("../../../commonStateTypes/customerView/getNestedCustomerHierarchy");
13
13
  exports.inititalUIState = {
14
14
  searchString: '',
15
- sortKey: 'customer',
16
- sortOrder: 'ascending',
15
+ sortKey: 'total',
16
+ sortOrder: 'descending',
17
17
  downloadState: 'Not-Started',
18
18
  selectedDate: (0, zeniDayJS_1.dateNow)(),
19
19
  agingDateSelectionType: 'custom_date',
@@ -49,7 +49,9 @@ const getNestedAgingBalancesByCustomer = (customerState, agingBalancesByCustomer
49
49
  case 'customer':
50
50
  return balance.customer.name.toLowerCase();
51
51
  case 'total':
52
- return balance.total.amount;
52
+ return balance.children.length > 0
53
+ ? balance.totalWithChildren.amount
54
+ : balance.total.amount;
53
55
  default: {
54
56
  const obj = balance.arAgingBalances.find((balance) => balance.period === sortKey);
55
57
  return (_a = obj === null || obj === void 0 ? void 0 : obj.balance.amount) !== null && _a !== void 0 ? _a : 0;
@@ -400,7 +400,7 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
400
400
  }
401
401
  };
402
402
  const sortedTransactionsWithSortKeyValue = (0, orderBy_1.default)(transactionsWithSortKeyValue, (transaction) => {
403
- var _a, _b;
403
+ var _a, _b, _c;
404
404
  switch (sortKey) {
405
405
  case 'name':
406
406
  return (_a = transaction.vendor) === null || _a === void 0 ? void 0 : _a.name.toLowerCase();
@@ -413,7 +413,7 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
413
413
  case 'status':
414
414
  return getStatusPerTab(transaction);
415
415
  case 'amount':
416
- return (_b = transaction.totalAmountInUSD.amount) !== null && _b !== void 0 ? _b : 0;
416
+ return (_c = (_b = transaction.totalAmountInUSD) === null || _b === void 0 ? void 0 : _b.amount) !== null && _c !== void 0 ? _c : 0;
417
417
  case 'paymentMethod':
418
418
  return transaction.billPayInfo.billPaymentMethodType.name;
419
419
  }
@@ -189,8 +189,8 @@ const getCategoryValueForTaskList = (key, task) => {
189
189
  return (_a = task.tag) === null || _a === void 0 ? void 0 : _a.code;
190
190
  case 'status':
191
191
  return task.status.code;
192
- case 'createdBy':
193
- return task.createdBy;
192
+ case 'creationDate':
193
+ return task.createTime;
194
194
  case 'assignee':
195
195
  return task.assignees;
196
196
  default:
@@ -18,12 +18,12 @@ export interface TaskFilterCategory {
18
18
  values: (string | ZeniDate)[];
19
19
  valuesCombinationOperator: 'ANY';
20
20
  }
21
- export declare type TaskListFilterCategoryField = 'status' | 'dueDate' | 'assignee' | 'createdBy' | 'priority' | 'tag';
21
+ export declare type TaskListFilterCategoryField = 'status' | 'dueDate' | 'assignee' | 'creationDate' | 'priority' | 'tag';
22
22
  export interface TaskListUIState extends SpendManagementUIState {
23
23
  sortKey: TaskListViewSortKey;
24
24
  }
25
- export declare const ALL_TASK_LIST_SORT_KEYS: readonly ["name", "dueDate", "assignee", "tag", "status", "priority", "createdBy"];
26
- export declare const toTaskListSortKeyType: (v: string) => "priority" | "name" | "status" | "dueDate" | "createdBy" | "assignee" | "tag";
25
+ export declare const ALL_TASK_LIST_SORT_KEYS: readonly ["name", "dueDate", "assignee", "creationDate", "tag", "status", "priority"];
26
+ export declare const toTaskListSortKeyType: (v: string) => "priority" | "name" | "status" | "dueDate" | "creationDate" | "assignee" | "tag";
27
27
  export declare type TaskListViewSortKey = ReturnType<typeof toTaskListSortKeyType>;
28
28
  export declare const TASK_LIST_FILTER_CATEGORIES: TaskListFilterCategoryOption[];
29
29
  export interface TaskListFilterCategoryOption {
@@ -6,10 +6,10 @@ exports.ALL_TASK_LIST_SORT_KEYS = [
6
6
  'name',
7
7
  'dueDate',
8
8
  'assignee',
9
+ 'creationDate',
9
10
  'tag',
10
11
  'status',
11
12
  'priority',
12
- 'createdBy',
13
13
  ];
14
14
  const toTaskListSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_TASK_LIST_SORT_KEYS);
15
15
  exports.toTaskListSortKeyType = toTaskListSortKeyType;
@@ -18,10 +18,10 @@ exports.TASK_LIST_FILTER_CATEGORIES = [
18
18
  { value: 'priority', type: 'dropdown', multiple: true },
19
19
  { value: 'tag', type: 'dropdown', multiple: true },
20
20
  { value: 'dueDate', type: 'dateRange', multiple: false },
21
- { value: 'createdBy', type: 'user', multiple: true },
22
21
  {
23
22
  value: 'assignee',
24
23
  type: 'user',
25
24
  multiple: true,
26
25
  },
26
+ { value: 'creationDate', type: 'dateRange', multiple: true },
27
27
  ];
@@ -6,7 +6,6 @@ import { TaskListFilters, TaskListUIState } from './taskList';
6
6
  import { UserListSelectorView } from '../../userListView/userListViewSelector';
7
7
  export interface TaskWithUserDetails extends Task {
8
8
  assigneeUsers: UserAndRole[];
9
- createdByUser?: UserAndRole;
10
9
  }
11
10
  export interface TaskListSelectorView extends SelectorView {
12
11
  taskList: TaskWithUserDetails[];
@@ -21,8 +21,7 @@ const getAllTasks = (state) => {
21
21
  const assigneeUsers = task.assignees
22
22
  .map((userId) => (0, userAndRole_1.getUserAndUserRole)(userState, userRoleState, addressState, userId))
23
23
  .filter((value) => value != null);
24
- const createdByUser = (0, userAndRole_1.getUserAndUserRole)(userState, userRoleState, addressState, task.createdBy);
25
- return Object.assign(Object.assign({}, task), { assigneeUsers, createdByUser });
24
+ return Object.assign(Object.assign({}, task), { assigneeUsers });
26
25
  }
27
26
  return undefined;
28
27
  })
@@ -32,18 +31,18 @@ const getAllTasks = (state) => {
32
31
  const sortOrder = (0, sortOrderPayload_1.getSortOrder)(taskListState.uiState.sortOrder);
33
32
  const filteredTaskList = (0, spendManagementFilterHelpers_1.applyAdvancedFiltersOnList)('task_management', searchedTaskList, taskListState.filters);
34
33
  const cardsInOrder = (0, orderBy_1.default)(filteredTaskList, (task) => {
35
- var _a, _b, _c;
34
+ var _a, _b;
36
35
  switch (sortKey) {
37
36
  case 'dueDate':
38
37
  return task.dueDate;
38
+ case 'creationDate':
39
+ return task.createTime;
39
40
  case 'tag':
40
41
  return (_b = (_a = task.tag) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '';
41
42
  case 'status':
42
43
  return task.status.name;
43
44
  case 'priority':
44
45
  return taskState_1.ALL_PRORITY_CODE.indexOf(task.priority.code);
45
- case 'createdBy':
46
- return (_c = task.createdByUser) === null || _c === void 0 ? void 0 : _c.user.firstName;
47
46
  case 'name':
48
47
  default:
49
48
  return task.name.toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.10.27",
3
+ "version": "4.10.29",
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",