@zeniai/client-epic-state 4.10.21 → 4.10.22
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/entity/billPay/billTransaction/billTransactionPayload.d.ts +3 -3
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +7 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +1 -1
- package/lib/view/auditReportView/auditReportViewHelper.js +2 -0
- package/lib/view/auditReportView/auditReportViewPayload.d.ts +2 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +2 -0
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.d.ts +2 -2
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +4 -3
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +2 -2
- package/package.json +1 -1
|
@@ -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
|
|
15
|
-
home_currency_code
|
|
16
|
-
home_currency_symbol
|
|
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
|
|
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
|
|
22
|
+
totalAmountInUSD?: Amount;
|
|
23
23
|
recurringBillConfigId?: ID;
|
|
24
24
|
recurringBillInstance?: number;
|
|
25
25
|
bookCloseDate?: ZeniDate;
|
|
@@ -4,6 +4,7 @@ exports.toAuditRuleReportGroupFromPayload = exports.toAuditReportRuleFromPayload
|
|
|
4
4
|
const statusPayload_1 = require("../../commonPayloadTypes/statusPayload");
|
|
5
5
|
const viewAndReport_1 = require("../../commonStateTypes/viewAndReport/viewAndReport");
|
|
6
6
|
const auditReportViewState_1 = require("./auditReportViewState");
|
|
7
|
+
const reviewCompanyViewState_1 = require("../reviewCompanyView/reviewCompanyViewState");
|
|
7
8
|
const toAuditRuleGroupFromPayload = (auditRuleGroupPayload) => {
|
|
8
9
|
return {
|
|
9
10
|
auditRuleCategory: auditRuleGroupPayload.audit_rule_category,
|
|
@@ -49,6 +50,7 @@ exports.toAuditReportGroupQueryFromPayload = toAuditReportGroupQueryFromPayload;
|
|
|
49
50
|
const toAuditReportFromPayload = (auditReportPayload) => {
|
|
50
51
|
return {
|
|
51
52
|
auditMonthAndYear: auditReportPayload.audit_month_and_year,
|
|
53
|
+
auditSummary: (0, reviewCompanyViewState_1.toAuditSummary)(auditReportPayload.audit_summary),
|
|
52
54
|
auditRulesGroupReport: toAuditRuleReportGroupFromPayload(auditReportPayload.audit_rules_group_report),
|
|
53
55
|
reportId: auditReportPayload.report_id,
|
|
54
56
|
reportTitle: auditReportPayload.report_title,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StatusPayload } from '../../commonPayloadTypes/statusPayload';
|
|
2
2
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
|
+
import { AuditSummaryPayload } from '../reviewCompanyView/reviewCompanyPayload';
|
|
3
4
|
export interface AuditRuleGroupBasePayload {
|
|
4
5
|
audit_rule_group_id: string;
|
|
5
6
|
}
|
|
@@ -35,6 +36,7 @@ export interface AuditRuleGroupReportPayload extends AuditRuleGroupBasePayload {
|
|
|
35
36
|
}
|
|
36
37
|
export interface AuditReportPayload {
|
|
37
38
|
audit_month_and_year: string;
|
|
39
|
+
audit_summary: AuditSummaryPayload;
|
|
38
40
|
audit_rules_group_report: AuditRuleGroupReportPayload[];
|
|
39
41
|
report_id: string;
|
|
40
42
|
report_title: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FetchedState, ID } from '../../commonStateTypes/common';
|
|
2
2
|
import { Status } from '../../commonStateTypes/status';
|
|
3
3
|
import { View } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
+
import { AuditSummary } from '../reviewCompanyView/reviewCompanyViewState';
|
|
4
5
|
export declare const AUDIT_RULE_ENTITY_TYPES: readonly ["reports", "transactions", "dashboard"];
|
|
5
6
|
export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "transactions" | "reports";
|
|
6
7
|
export declare type AuditRuleEntityType = ReturnType<typeof toAuditRuleEntityType>;
|
|
@@ -41,6 +42,7 @@ export interface AuditRuleGroupReport extends AuditRuleGroupBase {
|
|
|
41
42
|
}
|
|
42
43
|
export interface AuditReport {
|
|
43
44
|
auditRulesGroupReport: AuditRuleGroupReport[];
|
|
45
|
+
auditSummary: AuditSummary;
|
|
44
46
|
reportId: ID;
|
|
45
47
|
reportTitle: string;
|
|
46
48
|
status: Status;
|
|
@@ -3,11 +3,11 @@ import { ReviewCompany, ReviewCompanyListUIState } from './reviewCompanyViewStat
|
|
|
3
3
|
import { User } from '../../entity/user/userState';
|
|
4
4
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
5
|
import { UserAndRole } from '../companyView/types/userAndRole';
|
|
6
|
-
import {
|
|
6
|
+
import { ID } from '../../commonStateTypes/common';
|
|
7
7
|
export interface ReviewCompanyView extends ReviewCompany {
|
|
8
8
|
noteLastUpdatedBy?: User;
|
|
9
9
|
controllers: UserAndRole[];
|
|
10
|
-
|
|
10
|
+
customerGroup: ID | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface ReviewCompanySelectorView extends SelectorView {
|
|
13
13
|
companies: ReviewCompanyView[];
|
|
@@ -18,14 +18,15 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
|
|
|
18
18
|
.toLowerCase()
|
|
19
19
|
.includes(filterText.toLowerCase()))
|
|
20
20
|
.map((company) => {
|
|
21
|
-
var _a
|
|
21
|
+
var _a;
|
|
22
22
|
const companyWithSchema = (0, companySelector_1.getCompanyByCompanyId)(rootState.companyState, company.companyId);
|
|
23
23
|
const controllerUserIds = (_a = companyWithSchema === null || companyWithSchema === void 0 ? void 0 : companyWithSchema.company.managegmentInfo.controllerUserIds) !== null && _a !== void 0 ? _a : [];
|
|
24
24
|
const controllers = controllerUserIds
|
|
25
25
|
.map((userId) => (0, userAndRole_1.getUserAndUserRole)(rootState.userState, rootState.userRoleState, rootState.addressState, userId))
|
|
26
26
|
.filter((value) => value != null);
|
|
27
|
-
const
|
|
28
|
-
const reviewViewCompany = Object.assign(Object.assign({}, company), { controllers,
|
|
27
|
+
const customerGroup = companyWithSchema === null || companyWithSchema === void 0 ? void 0 : companyWithSchema.company.managegmentInfo.companyGroupId;
|
|
28
|
+
const reviewViewCompany = Object.assign(Object.assign({}, company), { controllers,
|
|
29
|
+
customerGroup });
|
|
29
30
|
if (company.noteLastUpdatedUserId != null) {
|
|
30
31
|
reviewViewCompany.noteLastUpdatedBy = (0, userSelector_1.getUserByUserId)(rootState.userState, company.noteLastUpdatedUserId);
|
|
31
32
|
}
|
|
@@ -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 &&
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.22",
|
|
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",
|