@zeniai/client-epic-state 5.0.98 → 5.0.99-betaAR1
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/aiCfo/aiCfoState.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoState.js +2 -0
- package/lib/entity/approvalRule/approvalRulePayload.d.ts +1 -1
- package/lib/entity/approvalRule/approvalRulePayload.js +5 -1
- package/lib/esm/entity/aiCfo/aiCfoState.js +2 -0
- package/lib/esm/entity/approvalRule/approvalRulePayload.js +5 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +5 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +14 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +13 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +4 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +5 -1
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +15 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +12 -2
- package/package.json +1 -1
|
@@ -196,7 +196,7 @@ export interface ChatSessionWithMessages {
|
|
|
196
196
|
chatSession: ChatSession;
|
|
197
197
|
questionAnswers: AiCfoQuestionWithAnswer[];
|
|
198
198
|
}
|
|
199
|
-
export declare const ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS: readonly ["creating_cards", "creating_policy", "created_cards", "created_policy"];
|
|
199
|
+
export declare const ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS: readonly ["creating_cards", "creating_policy", "created_cards", "created_policy", "errored_cards", "errored_policy"];
|
|
200
200
|
export type SyntheticAiCfoAnswerKind = (typeof ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS)[number];
|
|
201
201
|
export interface SyntheticAiCfoAnswer {
|
|
202
202
|
createdAt: ZeniDate;
|
|
@@ -2,7 +2,7 @@ import { ApprovalRule } from './approvalRuleState';
|
|
|
2
2
|
/**
|
|
3
3
|
* Condition Payload — one entry inside criteria.conditions[].
|
|
4
4
|
*
|
|
5
|
-
* field examples: 'amount' | 'vendor_id' | '
|
|
5
|
+
* field examples: 'amount' | 'vendor_id' | 'accounting_class_id'
|
|
6
6
|
* type examples: 'gte' | 'lte' | 'eq' | 'in' | 'not_in'
|
|
7
7
|
* value: number for amount comparisons; string[] for in / not_in lookups.
|
|
8
8
|
*/
|
|
@@ -69,7 +69,11 @@ const toApprovalCriteria = (payload) => {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
payload.conditions
|
|
72
|
-
|
|
72
|
+
// Backend wire name is 'accounting_class_id' — kept in sync with
|
|
73
|
+
// the write-side mapper in 'commonPayload.ts'. State-side and
|
|
74
|
+
// form-side keep 'department' / 'departmentIds' to match product
|
|
75
|
+
// copy.
|
|
76
|
+
.filter((condition) => condition.field === 'accounting_class_id')
|
|
73
77
|
.forEach((condition) => {
|
|
74
78
|
const department = toDepartmentCriteria(condition);
|
|
75
79
|
if (department != null) {
|
|
@@ -65,7 +65,11 @@ const toApprovalCriteria = (payload) => {
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
payload.conditions
|
|
68
|
-
|
|
68
|
+
// Backend wire name is 'accounting_class_id' — kept in sync with
|
|
69
|
+
// the write-side mapper in 'commonPayload.ts'. State-side and
|
|
70
|
+
// form-side keep 'department' / 'departmentIds' to match product
|
|
71
|
+
// copy.
|
|
72
|
+
.filter((condition) => condition.field === 'accounting_class_id')
|
|
69
73
|
.forEach((condition) => {
|
|
70
74
|
const department = toDepartmentCriteria(condition);
|
|
71
75
|
if (department != null) {
|
package/lib/esm/index.js
CHANGED
|
@@ -677,7 +677,7 @@ export { toCardPolicyTemplateRequestFromDraft } from './view/spendManagement/cha
|
|
|
677
677
|
export { toBulkCardPolicyTemplateRequestsFromDraft } from './view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft';
|
|
678
678
|
export { toManualCardPolicyTemplateRequestFromDraft } from './view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft';
|
|
679
679
|
// List
|
|
680
|
-
export { archiveCardPolicy, clearCardPolicyList, fetchCardPolicyList, updateArchiveCardPolicyFetchStatus, updateCardPolicyListFetchStatus, } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer';
|
|
680
|
+
export { archiveCardPolicy, clearCardPolicyList, fetchCardPolicyList, prependCardPolicyTemplateIds, updateArchiveCardPolicyFetchStatus, updateCardPolicyListFetchStatus, } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer';
|
|
681
681
|
export { getArchiveCardPolicyFetchState, getCardPolicyListFetchState, getCardPolicyListView, getCardPolicyTemplateIds, } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector';
|
|
682
682
|
// Detail (edit-only)
|
|
683
683
|
export { clearCardPolicyDetail, fetchCardPolicyDetail, updateCardPolicy, updateCardPolicyDetailFetchStatus, updateCardPolicyFetchStatus, updateCardPolicyFormDraft, } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer';
|
package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js
CHANGED
|
@@ -29,7 +29,11 @@ export const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
|
|
|
29
29
|
}
|
|
30
30
|
if (department != null && department.departmentIds.length > 0) {
|
|
31
31
|
conditions.push({
|
|
32
|
-
|
|
32
|
+
// The backend models 'department' as the accounting class
|
|
33
|
+
// entity, so the wire field name is 'accounting_class_id'
|
|
34
|
+
// (not 'department_id'). State-side and form-side keep
|
|
35
|
+
// 'department' / 'departmentIds' to match product copy.
|
|
36
|
+
field: 'accounting_class_id',
|
|
33
37
|
type: department.operator === 'is_not' ? 'not_in' : 'in',
|
|
34
38
|
value: department.departmentIds,
|
|
35
39
|
});
|
package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js
CHANGED
|
@@ -26,6 +26,19 @@ const cardPolicyList = createSlice({
|
|
|
26
26
|
draft.templateIds = action.payload.templateIds;
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
+
// Lets the create epic prepend new ids onto the list in-place after a
|
|
30
|
+
// successful POST so the new rows render at the top without a wipe-
|
|
31
|
+
// and-refetch (which would otherwise flash the page skeleton).
|
|
32
|
+
// Newest-first: last id in the payload lands at index 0.
|
|
33
|
+
prependCardPolicyTemplateIds(draft, action) {
|
|
34
|
+
const existing = new Set(draft.templateIds);
|
|
35
|
+
for (const id of action.payload) {
|
|
36
|
+
if (!existing.has(id)) {
|
|
37
|
+
draft.templateIds.unshift(id);
|
|
38
|
+
existing.add(id);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
29
42
|
archiveCardPolicy: {
|
|
30
43
|
reducer(draft, action) {
|
|
31
44
|
draft.archiveFetchState.fetchState = 'In-Progress';
|
|
@@ -54,5 +67,5 @@ const cardPolicyList = createSlice({
|
|
|
54
67
|
},
|
|
55
68
|
},
|
|
56
69
|
});
|
|
57
|
-
export const { fetchCardPolicyList, updateCardPolicyListFetchStatus, archiveCardPolicy, updateArchiveCardPolicyFetchStatus, clearCardPolicyList, } = cardPolicyList.actions;
|
|
70
|
+
export const { fetchCardPolicyList, updateCardPolicyListFetchStatus, prependCardPolicyTemplateIds, archiveCardPolicy, updateArchiveCardPolicyFetchStatus, clearCardPolicyList, } = cardPolicyList.actions;
|
|
58
71
|
export default cardPolicyList.reducer;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { from, of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { updateCreatedCardPolicyTemplate } from '../../../../../entity/cardPolicy/cardPolicyReducer';
|
|
4
3
|
import { toBulkCreateCardPolicyTemplateError, toCreateCardPolicyTemplatesRequestBody, } from '../../../../../entity/cardPolicy/cardPolicyPayload';
|
|
5
|
-
import {
|
|
4
|
+
import { updateCreatedCardPolicyTemplate } from '../../../../../entity/cardPolicy/cardPolicyReducer';
|
|
5
|
+
import { createZeniAPIStatus, isSuccessStatus, } from '../../../../../responsePayload';
|
|
6
|
+
import { prependCardPolicyTemplateIds } from '../cardPolicyList/cardPolicyListReducer';
|
|
6
7
|
import { createCardPolicyTemplates, updateCreateCardPolicyTemplateRequestState, } from './createCardPolicyReducer';
|
|
7
8
|
// `POST /cards/1.0/policy-templates` (bulk). On success fans entity hydrations
|
|
8
9
|
// + a single state update with ids + per-item errors. Partial success is
|
|
@@ -15,12 +16,21 @@ export const createCardPolicyTemplatesEpic = (actions$, _state$, zeniAPI) => act
|
|
|
15
16
|
if (isSuccessStatus(response) && response.data != null) {
|
|
16
17
|
const { templates_created, errors } = response.data;
|
|
17
18
|
const createdTemplates = templates_created.map((row) => row.template);
|
|
19
|
+
const createdTemplateIds = createdTemplates.map((template) => template.template_id);
|
|
20
|
+
// Prepend new ids onto the list slice in-place so new rows
|
|
21
|
+
// render at the top on back-nav without a wipe-and-refetch
|
|
22
|
+
// (which would flash the page skeleton). Skipped when all
|
|
23
|
+
// items errored.
|
|
24
|
+
const prependActions = createdTemplateIds.length > 0
|
|
25
|
+
? [prependCardPolicyTemplateIds(createdTemplateIds)]
|
|
26
|
+
: [];
|
|
18
27
|
const actions = [
|
|
19
28
|
...createdTemplates.map((template) => updateCreatedCardPolicyTemplate(template)),
|
|
29
|
+
...prependActions,
|
|
20
30
|
updateCreateCardPolicyTemplateRequestState({
|
|
21
31
|
fetchState: 'Completed',
|
|
22
32
|
perItemErrors: (errors ?? []).map(toBulkCreateCardPolicyTemplateError),
|
|
23
|
-
templateIds:
|
|
33
|
+
templateIds: createdTemplateIds,
|
|
24
34
|
}),
|
|
25
35
|
];
|
|
26
36
|
return from(actions);
|
package/lib/index.d.ts
CHANGED
|
@@ -948,7 +948,7 @@ export type { ToCardPolicyTemplateRequestFromDraftArgs } from './view/spendManag
|
|
|
948
948
|
export { toBulkCardPolicyTemplateRequestsFromDraft } from './view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft';
|
|
949
949
|
export type { BulkCreateCardPolicyTemplateEntry, CardPolicyBulkSubmitKind, ToBulkCardPolicyTemplateRequestsFromDraftArgs, } from './view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft';
|
|
950
950
|
export { toManualCardPolicyTemplateRequestFromDraft } from './view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft';
|
|
951
|
-
export { archiveCardPolicy, clearCardPolicyList, fetchCardPolicyList, updateArchiveCardPolicyFetchStatus, updateCardPolicyListFetchStatus, } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer';
|
|
951
|
+
export { archiveCardPolicy, clearCardPolicyList, fetchCardPolicyList, prependCardPolicyTemplateIds, updateArchiveCardPolicyFetchStatus, updateCardPolicyListFetchStatus, } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer';
|
|
952
952
|
export { CardPolicyListSelectorView, getArchiveCardPolicyFetchState, getCardPolicyListFetchState, getCardPolicyListView, getCardPolicyTemplateIds, } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector';
|
|
953
953
|
export { CardPolicyListState } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState';
|
|
954
954
|
export { clearCardPolicyDetail, fetchCardPolicyDetail, updateCardPolicy, updateCardPolicyDetailFetchStatus, updateCardPolicyFetchStatus, updateCardPolicyFormDraft, } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer';
|
package/lib/index.js
CHANGED
|
@@ -73,9 +73,9 @@ exports.submitInternationalVerificationForm = exports.fetchInternationalVerifica
|
|
|
73
73
|
exports.clearCurrentSessionId = exports.clearAiCfoView = exports.setSession = exports.clearInput = exports.updateCotCollapsedState = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.submitQuestion = exports.createSession = exports.fetchChatSessionsForUser = exports.getAiAccountantCockpitView = exports.updateAiAccountantUIState = exports.triggerAiAccountantJob = exports.setSelectedTenantIdsForJobTrigger = exports.fetchAiAccountantJobs = exports.fetchAiAccountantCustomers = exports.clearAiAccountantView = exports.cancelAiAccountantOnboarding = exports.getAiAccountantJobsByTenantId = exports.getAiAccountantCustomers = exports.updateAiAccountantJobs = exports.updateAiAccountantCustomer = exports.updateAiAccountantCustomers = exports.clearAllAiAccountantCustomers = exports.toAiAccountantJob = exports.toAiAccountantEnrollment = exports.toAiAccountantCustomer = exports.toAiAccountantOperationType = exports.toAiAccountantJobStatus = exports.toAiAccountantEnrollmentStatus = exports.getAllowedOperationsForStatus = exports.getTreasuryFundsMaximumYield = exports.getTreasurySetupViewDetails = exports.updateTreasuryVideoViewed = exports.updateTreasuryPromoRemindMeLaterClicked = exports.updateTreasuryPromoIntroClosedByOutsideClick = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocation = exports.fetchTreasuryFunds = exports.clearTreasurySetupView = exports.fetchTreasurySetupView = exports.acceptTreasuryTerms = exports.getExpressPayView = exports.resetExpressPayLocalData = exports.submitExpressPay = exports.updateExpressPayFormLocalData = exports.fetchExpressPayInitialDetails = exports.getIntlWireVerificationView = exports.updateVerificationFormLocalData = void 0;
|
|
74
74
|
exports.toInteractiveFormTypeStrict = exports.toInteractiveFormType = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerStateType = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.ALL_INTERACTIVE_FORM_TYPES = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = exports.getSyntheticAiCfoAnswerByQuestionAnswerId = exports.getSyntheticAiCfoAnswersForChatSession = exports.getAiCfoSelectorView = exports.getAllQuestionsForChatSession = exports.getQuestionAnswerByIdForChatSession = exports.getAllQuestionAnswersForChatSession = exports.clearSyntheticAiCfoAnswers = exports.removeSyntheticAiCfoAnswer = exports.updateSyntheticAiCfoAnswer = exports.appendSyntheticAiCfoAnswer = exports.toAiCfoVisualization = exports.clearAiCfo = exports.clearSession = exports.addQuestionPayload = exports.upsertOrAddQuestionAnswerPayload = exports.upsertAnswerPayload = exports.updateAiCfoAnswerCardPolicyWizardPlan = exports.setSessions = exports.setNewSession = exports.getSuggestedQuestionsForPageContext = exports.getAiCfoView = exports.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateResponseState = exports.deleteChatSession = exports.acceptMasterTOS = exports.fetchChatHistory = exports.stopSubmitQuestion = exports.stopSubmit = exports.createSessionAndSubmit = exports.clearLastContextMessage = exports.clearDeleteChatSessionStatus = void 0;
|
|
75
75
|
exports.toCardPolicyStats = exports.toCardPolicyEditFormDraft = exports.toBulkCreateCardPolicyTemplateError = exports.toCardPolicyTemplateStatus = exports.toCardPolicyTemplateMode = exports.ALL_CARD_POLICY_TEMPLATE_STATUSES = exports.ALL_CARD_POLICY_TEMPLATE_MODES = exports.getUploadedPolicyDocumentFileName = exports.getPolicyRecommendationFromUploadFetchState = exports.getPolicyRecommendationFromUploadError = exports.getPolicyRecommendationFromUploadChatSessionId = exports.getPolicyRecommendationFromUploadAnswerId = exports.getPolicyDocumentExtractionFetchState = exports.getPolicyDocumentExtractionError = exports.getExtractedCardPolicyRules = exports.getCardPolicyVendorSearchString = exports.getCardPolicyVendorSearchOptions = exports.getCardPolicyVendorSearchFetchState = exports.getCardPolicyTemplatesByIds = exports.getCardPolicyTemplateById = exports.getCardPolicySuggestedBlockMerchants = exports.getCardPolicySuggestedBlockCategories = exports.getCardPolicySuggestedAllowMerchants = exports.getCardPolicySuggestedAllowCategories = exports.getCardPolicyStats = exports.getCardPolicyMccCategoriesFetchState = exports.getCardPolicyMccCategoriesError = exports.getCardPolicyMccCategories = exports.getAllCardPolicyTemplates = exports.clearCardPolicy = exports.updatePolicyRecommendationFromUploadSuccess = exports.updatePolicyRecommendationFromUploadFailure = exports.updatePolicyDocumentExtractionSuccess = exports.updatePolicyDocumentExtractionFailure = exports.updateCreatedCardPolicyTemplate = exports.updateCardPolicyVendorOptionsFailure = exports.updateCardPolicyVendorOptions = exports.updateCardPolicyTemplates = exports.updateCardPolicyStats = exports.updateCardPolicyMccCategoriesFailure = exports.updateCardPolicyMccCategories = exports.removeCardPolicyTemplate = exports.fetchCardPolicyVendorOptions = exports.fetchCardPolicyRecommendationFromUpload = exports.fetchCardPolicyMccCategories = exports.extractPolicyDocument = exports.clearPolicyDocumentExtraction = exports.toMessageType = exports.toMessageSender = exports.ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS = void 0;
|
|
76
|
-
exports.
|
|
77
|
-
exports.
|
|
78
|
-
exports.getCashManagementOverviewBanner = exports.getCashManagementOverview = exports.bufferAmountToRisk = exports.RISK_BUFFER_AMOUNT = exports.getAutoSweepFlow = exports.updateCashManagementSettingsFetchStatus = void 0;
|
|
76
|
+
exports.updateCardPolicyListFetchStatus = exports.updateArchiveCardPolicyFetchStatus = exports.prependCardPolicyTemplateIds = exports.fetchCardPolicyList = exports.clearCardPolicyList = exports.archiveCardPolicy = exports.toManualCardPolicyTemplateRequestFromDraft = exports.toBulkCardPolicyTemplateRequestsFromDraft = exports.toCardPolicyTemplateRequestFromDraft = exports.applyAiCardPolicyFormDraftUpdate = exports.deriveAiPolicyReviewRowsFromInputs = exports.buildManualCardPolicyFormDraftSeed = exports.buildUploadReviewRows = exports.buildEmptyLimitRows = exports.buildAiCardPolicyFormDraftSeed = exports.toVendorChipFieldValue = exports.toMccCategoryChipFieldValue = exports.buildVendorChipId = exports.buildMccCategoryChipId = exports.VENDOR_CHIP_ID_PREFIX = exports.MCC_CHIP_ID_PREFIX = exports.toMccCategoryLike = exports.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION = exports.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT = exports.getManualCardPolicyFormDraft = exports.getLastCreatedCardPolicyTemplateIds = exports.getLastCreatedCardPolicyTemplateId = exports.getLastCreateCardPolicyTemplateErrors = exports.getLastCreateCardPolicySourceChatSessionId = exports.getCreateCardPolicyTemplateRequestState = exports.getAiCardPolicyFormDraft = exports.updateManualCardPolicyFormDraft = exports.updateCreateCardPolicyTemplateRequestState = exports.updateAiCardPolicyFormDraftFromUploadPlan = exports.updateAiCardPolicyFormDraft = exports.seedManualCardPolicyFormDraft = exports.seedAiCardPolicyFormDraft = exports.createCardPolicyTemplates = exports.clearManualCardPolicyFormDraft = exports.clearCreateCardPolicy = exports.clearAiCardPolicyFormDraft = exports.applyExtractedPolicyToManualCardPolicyDraft = exports.applyExtractedPolicyToAiCardPolicyDraft = exports.toUpdateCardPolicyTemplateRequestBody = exports.toExtractedCardPolicyRules = exports.toCreateCardPolicyTemplatesRequestBody = exports.toCreateCardPolicyTemplateRequestBody = exports.toCardPolicyVendorSearchOption = exports.toCardPolicyTemplateList = exports.toCardPolicyTemplate = void 0;
|
|
77
|
+
exports.updateAutoSweepSettingsFetchStatus = exports.updateAutoSweepRisk = exports.updateAutoSweepDraft = exports.saveAutoSweepSettings = exports.clearAutoSweepFlow = exports.fetchCashManagementOverviewPage = exports.fetchCashManagementBanner = exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = exports.getTransactionActivityLogView = exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = exports.clearRuleUpdateLocalData = exports.updateRuleLocalData = exports.fetchAutoTransferReviewDetail = exports.fetchAutoTransferRuleHistory = exports.deleteAutoTransferRule = exports.updateAutoTransferRule = exports.createAutoTransferRule = exports.fetchAutoTransferRules = exports.getTreasuryTaxLetters = exports.fetchTreasuryTaxLetterList = exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryTransactionList = exports.fetchTreasuryOverviewDetail = exports.getUpdateCardPolicyFetchState = exports.getCardPolicyFormDraft = exports.getCardPolicyDetailView = exports.getCardPolicyDetailFetchState = exports.updateCardPolicyFormDraft = exports.updateCardPolicyFetchStatus = exports.updateCardPolicyDetailFetchStatus = exports.updateCardPolicy = exports.fetchCardPolicyDetail = exports.clearCardPolicyDetail = exports.getCardPolicyTemplateIds = exports.getCardPolicyListView = exports.getCardPolicyListFetchState = exports.getArchiveCardPolicyFetchState = void 0;
|
|
78
|
+
exports.getCashManagementOverviewBanner = exports.getCashManagementOverview = exports.bufferAmountToRisk = exports.RISK_BUFFER_AMOUNT = exports.getAutoSweepFlow = exports.updateCashManagementSettingsFetchStatus = exports.updateCashManagementSettings = void 0;
|
|
79
79
|
const allowedValue_1 = require("./commonStateTypes/allowedValue");
|
|
80
80
|
Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
|
|
81
81
|
Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
|
|
@@ -2461,6 +2461,7 @@ var cardPolicyListReducer_1 = require("./view/spendManagement/chargeCards/cardPo
|
|
|
2461
2461
|
Object.defineProperty(exports, "archiveCardPolicy", { enumerable: true, get: function () { return cardPolicyListReducer_1.archiveCardPolicy; } });
|
|
2462
2462
|
Object.defineProperty(exports, "clearCardPolicyList", { enumerable: true, get: function () { return cardPolicyListReducer_1.clearCardPolicyList; } });
|
|
2463
2463
|
Object.defineProperty(exports, "fetchCardPolicyList", { enumerable: true, get: function () { return cardPolicyListReducer_1.fetchCardPolicyList; } });
|
|
2464
|
+
Object.defineProperty(exports, "prependCardPolicyTemplateIds", { enumerable: true, get: function () { return cardPolicyListReducer_1.prependCardPolicyTemplateIds; } });
|
|
2464
2465
|
Object.defineProperty(exports, "updateArchiveCardPolicyFetchStatus", { enumerable: true, get: function () { return cardPolicyListReducer_1.updateArchiveCardPolicyFetchStatus; } });
|
|
2465
2466
|
Object.defineProperty(exports, "updateCardPolicyListFetchStatus", { enumerable: true, get: function () { return cardPolicyListReducer_1.updateCardPolicyListFetchStatus; } });
|
|
2466
2467
|
var cardPolicyListSelector_1 = require("./view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector");
|
|
@@ -32,7 +32,11 @@ const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
|
|
|
32
32
|
}
|
|
33
33
|
if (department != null && department.departmentIds.length > 0) {
|
|
34
34
|
conditions.push({
|
|
35
|
-
|
|
35
|
+
// The backend models 'department' as the accounting class
|
|
36
|
+
// entity, so the wire field name is 'accounting_class_id'
|
|
37
|
+
// (not 'department_id'). State-side and form-side keep
|
|
38
|
+
// 'department' / 'departmentIds' to match product copy.
|
|
39
|
+
field: 'accounting_class_id',
|
|
36
40
|
type: department.operator === 'is_not' ? 'not_in' : 'in',
|
|
37
41
|
value: department.departmentIds,
|
|
38
42
|
});
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const fetchCardPolicyList: import("@reduxjs/toolkit").ActionCreat
|
|
|
6
6
|
fetchState: FetchState;
|
|
7
7
|
error?: ZeniAPIStatus;
|
|
8
8
|
templateIds?: ID[];
|
|
9
|
-
}, "cardPolicyList/updateCardPolicyListFetchStatus">, archiveCardPolicy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[templateId: string], string, "cardPolicyList/archiveCardPolicy", never, never>, updateArchiveCardPolicyFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
+
}, "cardPolicyList/updateCardPolicyListFetchStatus">, prependCardPolicyTemplateIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "cardPolicyList/prependCardPolicyTemplateIds">, archiveCardPolicy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[templateId: string], string, "cardPolicyList/archiveCardPolicy", never, never>, updateArchiveCardPolicyFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
10
|
fetchState: FetchState;
|
|
11
11
|
error?: ZeniAPIStatus;
|
|
12
12
|
templateId?: ID;
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearCardPolicyList = exports.updateArchiveCardPolicyFetchStatus = exports.archiveCardPolicy = exports.updateCardPolicyListFetchStatus = exports.fetchCardPolicyList = exports.initialState = void 0;
|
|
4
|
+
exports.clearCardPolicyList = exports.updateArchiveCardPolicyFetchStatus = exports.archiveCardPolicy = exports.prependCardPolicyTemplateIds = exports.updateCardPolicyListFetchStatus = exports.fetchCardPolicyList = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
exports.initialState = {
|
|
7
7
|
templateIds: [],
|
|
@@ -30,6 +30,19 @@ const cardPolicyList = (0, toolkit_1.createSlice)({
|
|
|
30
30
|
draft.templateIds = action.payload.templateIds;
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
+
// Lets the create epic prepend new ids onto the list in-place after a
|
|
34
|
+
// successful POST so the new rows render at the top without a wipe-
|
|
35
|
+
// and-refetch (which would otherwise flash the page skeleton).
|
|
36
|
+
// Newest-first: last id in the payload lands at index 0.
|
|
37
|
+
prependCardPolicyTemplateIds(draft, action) {
|
|
38
|
+
const existing = new Set(draft.templateIds);
|
|
39
|
+
for (const id of action.payload) {
|
|
40
|
+
if (!existing.has(id)) {
|
|
41
|
+
draft.templateIds.unshift(id);
|
|
42
|
+
existing.add(id);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
33
46
|
archiveCardPolicy: {
|
|
34
47
|
reducer(draft, action) {
|
|
35
48
|
draft.archiveFetchState.fetchState = 'In-Progress';
|
|
@@ -58,5 +71,5 @@ const cardPolicyList = (0, toolkit_1.createSlice)({
|
|
|
58
71
|
},
|
|
59
72
|
},
|
|
60
73
|
});
|
|
61
|
-
_a = cardPolicyList.actions, exports.fetchCardPolicyList = _a.fetchCardPolicyList, exports.updateCardPolicyListFetchStatus = _a.updateCardPolicyListFetchStatus, exports.archiveCardPolicy = _a.archiveCardPolicy, exports.updateArchiveCardPolicyFetchStatus = _a.updateArchiveCardPolicyFetchStatus, exports.clearCardPolicyList = _a.clearCardPolicyList;
|
|
74
|
+
_a = cardPolicyList.actions, exports.fetchCardPolicyList = _a.fetchCardPolicyList, exports.updateCardPolicyListFetchStatus = _a.updateCardPolicyListFetchStatus, exports.prependCardPolicyTemplateIds = _a.prependCardPolicyTemplateIds, exports.archiveCardPolicy = _a.archiveCardPolicy, exports.updateArchiveCardPolicyFetchStatus = _a.updateArchiveCardPolicyFetchStatus, exports.clearCardPolicyList = _a.clearCardPolicyList;
|
|
62
75
|
exports.default = cardPolicyList.reducer;
|
|
@@ -3,6 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { updateCreatedCardPolicyTemplate } from '../../../../../entity/cardPolicy/cardPolicyReducer';
|
|
4
4
|
import { RootState } from '../../../../../reducer';
|
|
5
5
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { prependCardPolicyTemplateIds } from '../cardPolicyList/cardPolicyListReducer';
|
|
6
7
|
import { createCardPolicyTemplates, updateCreateCardPolicyTemplateRequestState } from './createCardPolicyReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof createCardPolicyTemplates> | ReturnType<typeof updateCreatedCardPolicyTemplate> | ReturnType<typeof updateCreateCardPolicyTemplateRequestState>;
|
|
8
|
+
export type ActionType = ReturnType<typeof createCardPolicyTemplates> | ReturnType<typeof updateCreatedCardPolicyTemplate> | ReturnType<typeof updateCreateCardPolicyTemplateRequestState> | ReturnType<typeof prependCardPolicyTemplateIds>;
|
|
8
9
|
export declare const createCardPolicyTemplatesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createCardPolicyTemplatesEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const cardPolicyReducer_1 = require("../../../../../entity/cardPolicy/cardPolicyReducer");
|
|
7
6
|
const cardPolicyPayload_1 = require("../../../../../entity/cardPolicy/cardPolicyPayload");
|
|
7
|
+
const cardPolicyReducer_1 = require("../../../../../entity/cardPolicy/cardPolicyReducer");
|
|
8
8
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
9
|
+
const cardPolicyListReducer_1 = require("../cardPolicyList/cardPolicyListReducer");
|
|
9
10
|
const createCardPolicyReducer_1 = require("./createCardPolicyReducer");
|
|
10
11
|
// `POST /cards/1.0/policy-templates` (bulk). On success fans entity hydrations
|
|
11
12
|
// + a single state update with ids + per-item errors. Partial success is
|
|
@@ -18,12 +19,21 @@ const createCardPolicyTemplatesEpic = (actions$, _state$, zeniAPI) => actions$.p
|
|
|
18
19
|
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
19
20
|
const { templates_created, errors } = response.data;
|
|
20
21
|
const createdTemplates = templates_created.map((row) => row.template);
|
|
22
|
+
const createdTemplateIds = createdTemplates.map((template) => template.template_id);
|
|
23
|
+
// Prepend new ids onto the list slice in-place so new rows
|
|
24
|
+
// render at the top on back-nav without a wipe-and-refetch
|
|
25
|
+
// (which would flash the page skeleton). Skipped when all
|
|
26
|
+
// items errored.
|
|
27
|
+
const prependActions = createdTemplateIds.length > 0
|
|
28
|
+
? [(0, cardPolicyListReducer_1.prependCardPolicyTemplateIds)(createdTemplateIds)]
|
|
29
|
+
: [];
|
|
21
30
|
const actions = [
|
|
22
31
|
...createdTemplates.map((template) => (0, cardPolicyReducer_1.updateCreatedCardPolicyTemplate)(template)),
|
|
32
|
+
...prependActions,
|
|
23
33
|
(0, createCardPolicyReducer_1.updateCreateCardPolicyTemplateRequestState)({
|
|
24
34
|
fetchState: 'Completed',
|
|
25
35
|
perItemErrors: (errors ?? []).map(cardPolicyPayload_1.toBulkCreateCardPolicyTemplateError),
|
|
26
|
-
templateIds:
|
|
36
|
+
templateIds: createdTemplateIds,
|
|
27
37
|
}),
|
|
28
38
|
];
|
|
29
39
|
return (0, rxjs_1.from)(actions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.99-betaAR1",
|
|
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
|
"module": "lib/esm/index.js",
|