@zeniai/client-epic-state 5.2.28 → 5.2.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.
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +0 -21
- package/lib/entity/aiCfo/aiCfoReducer.js +1 -73
- package/lib/entity/aiCfo/aiCfoState.d.ts +0 -24
- package/lib/entity/file/fileState.d.ts +3 -3
- package/lib/entity/file/fileState.js +0 -2
- package/lib/entity/invoicing/creditNote/creditNotePayload.d.ts +1 -0
- package/lib/entity/invoicing/creditNote/creditNotePayload.js +1 -0
- package/lib/entity/invoicing/creditNote/creditNoteState.d.ts +1 -0
- package/lib/entity/invoicing/invoice/invoicePayload.d.ts +1 -0
- package/lib/entity/invoicing/invoice/invoicePayload.js +1 -0
- package/lib/entity/invoicing/invoice/invoiceState.d.ts +1 -0
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +0 -2
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.d.ts +1 -0
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -0
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerState.d.ts +1 -0
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.d.ts +2 -1
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +2 -1
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionState.d.ts +2 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +7 -0
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +0 -2
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +1 -73
- package/lib/esm/entity/file/fileState.js +0 -2
- package/lib/esm/entity/invoicing/creditNote/creditNotePayload.js +1 -0
- package/lib/esm/entity/invoicing/invoice/invoicePayload.js +1 -0
- package/lib/esm/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -0
- package/lib/esm/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +2 -1
- package/lib/esm/epic.js +0 -2
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +0 -5
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +0 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -4
- package/lib/esm/view/invoicing/couponView/couponViewState.js +4 -4
- package/lib/esm/view/invoicing/dataImportView/dataImportViewSelector.js +0 -2
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +0 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -2
- package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +3 -3
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +4 -4
- package/lib/esm/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +1 -0
- package/lib/esm/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +1 -2
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +0 -1
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +2 -0
- package/lib/esm/view/invoicing/settingsView/invoicingBrandingFormConfig.js +0 -5
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +1 -5
- package/lib/esm/view/recommendation/recommendationReducer.js +1 -13
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +2 -18
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +1 -0
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +3 -0
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -18
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +1 -0
- package/lib/index.d.ts +5 -7
- package/lib/index.js +23 -24
- package/lib/view/aiCfoView/aiCfoViewReducer.js +0 -5
- package/lib/view/aiCfoView/aiCfoViewSelector.js +0 -1
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +22 -0
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +3 -5
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +5 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -4
- package/lib/view/invoicing/couponView/couponViewState.d.ts +2 -2
- package/lib/view/invoicing/couponView/couponViewState.js +4 -4
- package/lib/view/invoicing/dataImportView/dataImportViewSelector.d.ts +0 -2
- package/lib/view/invoicing/dataImportView/dataImportViewSelector.js +0 -2
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +0 -1
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +0 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +0 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -2
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +0 -1
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +3 -3
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +4 -4
- package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.d.ts +1 -0
- package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +1 -0
- package/lib/view/invoicing/invoicingOverview/invoicingOverviewState.d.ts +1 -0
- package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.d.ts +1 -3
- package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +0 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +0 -2
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +0 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +2 -0
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +1 -0
- package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.d.ts +0 -1
- package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.js +0 -5
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +1 -5
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +0 -4
- package/lib/view/invoicing/subscriptionAction/subscriptionActionRequestPayload.d.ts +0 -8
- package/lib/view/recommendation/recommendationPayload.d.ts +0 -34
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -2
- package/lib/view/recommendation/recommendationReducer.js +2 -14
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.d.ts +1 -2
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +2 -18
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +1 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +3 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +1 -0
- package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.d.ts +1 -2
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -18
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +1 -0
- package/package.json +1 -1
- package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +0 -52
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +0 -7
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +0 -56
|
@@ -110,7 +110,6 @@ function chatHistoryToQA(history) {
|
|
|
110
110
|
? parsedAgentMessage.follow_up_questions
|
|
111
111
|
: [],
|
|
112
112
|
suggestedReply: parsedAgentMessage.suggested_reply ?? undefined,
|
|
113
|
-
capabilityPromo: toCapabilityPromo(parsedAgentMessage.capability_promo),
|
|
114
113
|
assumptions: parsedAgentMessage.assumptions ?? '',
|
|
115
114
|
insights: parsedAgentMessage.insights ?? '',
|
|
116
115
|
summarizedTitle: parsedAgentMessage.summarized_title ?? undefined,
|
|
@@ -119,7 +118,6 @@ function chatHistoryToQA(history) {
|
|
|
119
118
|
artifactTitle: parsedAgentMessage.artifact_title ?? undefined,
|
|
120
119
|
artifactHostUrl: parsedAgentMessage.artifact_host_url ?? undefined,
|
|
121
120
|
exports: toAiCfoExports(parsedAgentMessage.exports),
|
|
122
|
-
skillDraft: toSkillDraft(parsedAgentMessage.skill_draft),
|
|
123
121
|
},
|
|
124
122
|
createdAt: zeniDate(agentMessage.created_at),
|
|
125
123
|
};
|
|
@@ -370,76 +368,8 @@ const toAiCfoVisualizationData = (data) => {
|
|
|
370
368
|
columns,
|
|
371
369
|
};
|
|
372
370
|
};
|
|
373
|
-
const AI_CFO_CAPABILITY_PROMO_SURFACES = [
|
|
374
|
-
'banner',
|
|
375
|
-
'inline',
|
|
376
|
-
];
|
|
377
|
-
const toAiCfoCapabilityPromoSurface = (value) => AI_CFO_CAPABILITY_PROMO_SURFACES.find((surface) => surface === value);
|
|
378
|
-
const trimmedOrUndefined = (value) => {
|
|
379
|
-
const trimmed = value?.trim() ?? '';
|
|
380
|
-
return trimmed.length > 0 ? trimmed : undefined;
|
|
381
|
-
};
|
|
382
|
-
const toSkillDraft = (payload) => {
|
|
383
|
-
// Dropped rather than partially built when either required field is missing:
|
|
384
|
-
// a Save control wired to a body the create endpoint would reject is worse
|
|
385
|
-
// than no control, because the failure only surfaces after the click.
|
|
386
|
-
if (payload == null) {
|
|
387
|
-
return undefined;
|
|
388
|
-
}
|
|
389
|
-
// Trimmed to '' FIRST, then chosen by length. Not `??`: a whitespace-only
|
|
390
|
-
// display_name trims to '', which is not nullish, so `??` would keep the
|
|
391
|
-
// empty string and drop a draft that has a perfectly good `name`.
|
|
392
|
-
const rawName = payload.name?.trim() ?? '';
|
|
393
|
-
const rawDisplayName = payload.display_name?.trim() ?? '';
|
|
394
|
-
const name = rawName.length > 0 ? rawName : rawDisplayName;
|
|
395
|
-
const displayName = rawDisplayName.length > 0 ? rawDisplayName : name;
|
|
396
|
-
const instructions = payload.instructions?.trim() ?? '';
|
|
397
|
-
if (name.length === 0 || instructions.length === 0) {
|
|
398
|
-
return undefined;
|
|
399
|
-
}
|
|
400
|
-
const examples = payload.parameter_hints?.examples;
|
|
401
|
-
return {
|
|
402
|
-
// Kept SEPARATE even though the agent currently sends both the same: the
|
|
403
|
-
// create endpoint takes `name` and `display_name` as distinct fields, and
|
|
404
|
-
// collapsing them here would submit the display label as the identifier if
|
|
405
|
-
// they ever diverge.
|
|
406
|
-
name,
|
|
407
|
-
displayName,
|
|
408
|
-
instructions,
|
|
409
|
-
// An empty description is ABSENT, matching the way blank parameter hints
|
|
410
|
-
// are dropped below — `?? undefined` would store ''.
|
|
411
|
-
description: trimmedOrUndefined(payload.description),
|
|
412
|
-
parameterHints: Array.isArray(examples)
|
|
413
|
-
? examples.filter((hint) => typeof hint === 'string' && hint.trim().length > 0)
|
|
414
|
-
: undefined,
|
|
415
|
-
};
|
|
416
|
-
};
|
|
417
|
-
const toCapabilityPromo = (payload) => {
|
|
418
|
-
// Runtime payloads can miss fields regardless of the wire type — drop the
|
|
419
|
-
// promo on a missing/empty id or copy, and narrow surface to the union.
|
|
420
|
-
if (payload == null || !payload.id || !payload.copy) {
|
|
421
|
-
return undefined;
|
|
422
|
-
}
|
|
423
|
-
const surface = toAiCfoCapabilityPromoSurface(payload.surface);
|
|
424
|
-
if (surface == null) {
|
|
425
|
-
return undefined;
|
|
426
|
-
}
|
|
427
|
-
const cta = toCapabilityPromoCta(payload.cta);
|
|
428
|
-
return {
|
|
429
|
-
copy: payload.copy,
|
|
430
|
-
id: payload.id,
|
|
431
|
-
surface,
|
|
432
|
-
...(cta != null && { cta }),
|
|
433
|
-
};
|
|
434
|
-
};
|
|
435
|
-
const toCapabilityPromoCta = (payload) => {
|
|
436
|
-
if (payload == null || !payload.label || !payload.prefill) {
|
|
437
|
-
return undefined;
|
|
438
|
-
}
|
|
439
|
-
return { label: payload.label, prefill: payload.prefill };
|
|
440
|
-
};
|
|
441
371
|
const toResponseBlockType = (answer, userId) => {
|
|
442
|
-
const { metadata, state, type, text, visualization, table, follow_up_questions, suggested_reply, assumptions, insights, summarized_title, artifact, artifact_title, artifact_host_url,
|
|
372
|
+
const { metadata, state, type, text, visualization, table, follow_up_questions, suggested_reply, assumptions, insights, summarized_title, artifact, artifact_title, artifact_host_url, exports, } = answer;
|
|
443
373
|
const { chat_session_id, message_id, timestamp, chain_of_thought_action_steps: chainOfThoughtActionSteps = [], } = metadata;
|
|
444
374
|
return {
|
|
445
375
|
messageId: message_id,
|
|
@@ -454,7 +384,6 @@ const toResponseBlockType = (answer, userId) => {
|
|
|
454
384
|
table: table != null ? toAiCfoVisualization(table) : undefined,
|
|
455
385
|
followUpQuestions: follow_up_questions ?? [],
|
|
456
386
|
suggestedReply: suggested_reply ?? undefined,
|
|
457
|
-
capabilityPromo: toCapabilityPromo(capability_promo),
|
|
458
387
|
assumptions: assumptions ?? '',
|
|
459
388
|
insights: insights ?? '',
|
|
460
389
|
summarizedTitle: summarized_title ?? undefined,
|
|
@@ -463,7 +392,6 @@ const toResponseBlockType = (answer, userId) => {
|
|
|
463
392
|
artifactTitle: artifact_title ?? undefined,
|
|
464
393
|
artifactHostUrl: artifact_host_url ?? undefined,
|
|
465
394
|
exports: toAiCfoExports(exports),
|
|
466
|
-
skillDraft: toSkillDraft(skill_draft),
|
|
467
395
|
},
|
|
468
396
|
createdAt: zeniDate(timestamp),
|
|
469
397
|
};
|
|
@@ -72,7 +72,6 @@ const ALLOWED_DOCUMENT_TYPES = [
|
|
|
72
72
|
'bill_pay',
|
|
73
73
|
'certificate_of_incorporation',
|
|
74
74
|
'check',
|
|
75
|
-
'company_logo',
|
|
76
75
|
'contract',
|
|
77
76
|
'driving_license',
|
|
78
77
|
'employer_identification_number_confirmation',
|
|
@@ -96,7 +95,6 @@ const ALLOWED_PURPOSE_IDS = [
|
|
|
96
95
|
'business_verification_others',
|
|
97
96
|
'bill_pay',
|
|
98
97
|
'international_wire_business_verification',
|
|
99
|
-
'company_logo',
|
|
100
98
|
'others',
|
|
101
99
|
];
|
|
102
100
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -9,6 +9,7 @@ export const mapInvoicingCreditNoteLineItemPayloadToState = (payload, currencyCo
|
|
|
9
9
|
unitAmount: toAmount(payload.unit_amount, currencyCode, currencySymbol),
|
|
10
10
|
entityType: payload.entity_type,
|
|
11
11
|
id: payload.id,
|
|
12
|
+
productCode: payload.product_code,
|
|
12
13
|
});
|
|
13
14
|
export const mapInvoicingCreditNoteAllocationPayloadToState = (payload, currencyCode, currencySymbol) => ({
|
|
14
15
|
allocatedAmount: toAmount(payload.allocated_amount, currencyCode, currencySymbol),
|
|
@@ -19,6 +19,7 @@ const mapLineItem = (payload, currencyCode, currencySymbol) => ({
|
|
|
19
19
|
itemLevelDiscountAmount: payload.item_level_discount_amount != null
|
|
20
20
|
? toAmount(payload.item_level_discount_amount, currencyCode, currencySymbol)
|
|
21
21
|
: undefined,
|
|
22
|
+
productCode: payload.product_code,
|
|
22
23
|
subscriptionID: payload.subscription_id,
|
|
23
24
|
taxAmount: payload.tax_amount != null
|
|
24
25
|
? toAmount(payload.tax_amount, currencyCode, currencySymbol)
|
|
@@ -72,6 +72,7 @@ export const mapInvoicingCustomerPayloadToState = (payload) => {
|
|
|
72
72
|
phone: payload.phone,
|
|
73
73
|
plan: payload.plan,
|
|
74
74
|
planName: payload.plan_name,
|
|
75
|
+
productCode: payload.product_code,
|
|
75
76
|
preferredCurrencyCode: payload.preferred_currency_code,
|
|
76
77
|
promotionalCredits: payload.promotional_credits != null
|
|
77
78
|
? toAmount(payload.promotional_credits, currencyCode, currencySymbol)
|
|
@@ -12,6 +12,7 @@ export const mapInvoicingSubscriptionItemPayloadToState = (payload, currencyCode
|
|
|
12
12
|
itemPriceCode: payload.item_price_code,
|
|
13
13
|
itemPriceID: payload.item_price_id,
|
|
14
14
|
itemType: payload.item_type,
|
|
15
|
+
productCode: payload.product_code,
|
|
15
16
|
quantity: payload.quantity,
|
|
16
17
|
unitPrice: payload.unit_price != null
|
|
17
18
|
? toAmount(payload.unit_price, currencyCode, currencySymbol)
|
|
@@ -57,7 +58,6 @@ export const mapInvoicingSubscriptionPayloadToState = (payload) => {
|
|
|
57
58
|
billingPeriod: payload.billing_period,
|
|
58
59
|
billingPeriodUnit: payload.billing_period_unit,
|
|
59
60
|
cancelReason: payload.cancel_reason,
|
|
60
|
-
cancelReasonCode: payload.cancel_reason_code,
|
|
61
61
|
cancelledAt: payload.cancelled_at != null ? date(payload.cancelled_at) : undefined,
|
|
62
62
|
catalogItemID: payload.catalog_item_id,
|
|
63
63
|
contractTerm: payload.contract_term != null
|
|
@@ -88,6 +88,7 @@ export const mapInvoicingSubscriptionPayloadToState = (payload) => {
|
|
|
88
88
|
: undefined,
|
|
89
89
|
planID: payload.plan_id,
|
|
90
90
|
planName: payload.plan_name,
|
|
91
|
+
productCode: payload.product_code,
|
|
91
92
|
poNumber: payload.po_number,
|
|
92
93
|
remainingBillingCycles: payload.remaining_billing_cycles,
|
|
93
94
|
resumeDate: payload.resume_date != null ? date(payload.resume_date) : undefined,
|
package/lib/esm/epic.js
CHANGED
|
@@ -400,7 +400,6 @@ import { fetchEntityRecommendationsByTransactionIdEpic, } from './view/recommend
|
|
|
400
400
|
import { fetchEntityRecommendationsForLineUpdateEpic, } from './view/recommendation/fetchEntityRecommendationsForLineUpdateEpic';
|
|
401
401
|
import { fetchRecommendationByEntityIdEpic, } from './view/recommendation/fetchRecommendationByEntityIdEpic';
|
|
402
402
|
import { fetchRecommendationByEntityNameEpic, } from './view/recommendation/fetchRecommendationByEntityNameEpic';
|
|
403
|
-
import { submitRecommendationFeedbackEpic, } from './view/recommendation/submitRecommendationFeedbackEpic';
|
|
404
403
|
import { fetchReferralsEpic, } from './view/referralView/epics/fetchReferralsEpic';
|
|
405
404
|
import { fetchRewardsPlanEpic, } from './view/referralView/epics/fetchRewardsPlanEpic';
|
|
406
405
|
import { resendReferralInviteEpic, } from './view/referralView/epics/resendReferralInviteEpic';
|
|
@@ -1383,7 +1382,6 @@ const ALL_EPICS = [
|
|
|
1383
1382
|
submitInvoicingBrandingFormEpic,
|
|
1384
1383
|
submitInvoicingQboSettingsEpic,
|
|
1385
1384
|
submitQuestionEpic,
|
|
1386
|
-
submitRecommendationFeedbackEpic,
|
|
1387
1385
|
switchExpenseAutomationJESchedulesTabEpic,
|
|
1388
1386
|
syncInvoicingSubscriptionCouponsEpic,
|
|
1389
1387
|
syncTabsAfterAutomatchEpic,
|
package/lib/esm/index.js
CHANGED
|
@@ -266,7 +266,7 @@ import { fetchProfitAndLossForTimeframeProjectView, fetchProfitAndLossProjectVie
|
|
|
266
266
|
import { getProfitAndLossProjectView } from './view/profitAndLossProjectView/profitAndLossProjectViewSelector';
|
|
267
267
|
import { fetchProjectList } from './view/projectList/projectListReducer';
|
|
268
268
|
import { getProjectList, } from './view/projectList/projectListSelector';
|
|
269
|
-
import { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityId, fetchRecommendationByEntityName,
|
|
269
|
+
import { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityId, fetchRecommendationByEntityName, } from './view/recommendation/recommendationReducer';
|
|
270
270
|
import { DEFAULT_REFERRER_AMOUNT, clearReferrals, fetchReferrals, fetchRewardsPlan, resendReferralInvite, saveReferralFormDataInLocalStore, sendReferralInvite, updateReferViewed, updateReferralListSortUiState, } from './view/referralView/referralReducer';
|
|
271
271
|
import { getInviteFormView, getReferralListView, getRewardsPlanCard, } from './view/referralView/referralSelector';
|
|
272
272
|
import { AmountStatusTypes, StatusTypes, toReferralListViewSortKeyType, } from './view/referralView/referralState';
|
|
@@ -632,7 +632,7 @@ export { getSpendManagementEffectiveListPeriod, getSelectedCompanyOfficer, showB
|
|
|
632
632
|
export { canSendMonthEndEmailReport, shouldEnableCalendarPickerForLastReportSent, };
|
|
633
633
|
export { getInternationalSubConfigCodeKey, BILL_NEW_PAYMENT_METHODS, NEW_INTERNATIONAL_METHOD_SUBTEXT, SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT, LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT, };
|
|
634
634
|
export { getVendorList, updateSortUiState, updatePageToken, updateYTDSelectionUIState, isColumnYTDSpend, isVendorsTabVisible, toVendorReportIDType, getVendorFiling1099List, fetchVendorsFiling1099Download, };
|
|
635
|
-
export { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityId, fetchRecommendationByEntityName,
|
|
635
|
+
export { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityId, fetchRecommendationByEntityName, };
|
|
636
636
|
export { fetchOwnerList };
|
|
637
637
|
export { getZeniAccountsConfigDetail, getZeniAccountList, fetchZeniAccountList, fetchAccountList, createCheckingAccount, fetchPaymentAccountList, unlinkPaymentAccount, getDepositAccountDetail, getAllDepositAccounts, getDepositAccountDetailForPDF, fetchDepositAccount, fetchZeniAccountsConfig, updateTransferMoneyLocalData, updateTransferToLocalData, updateDepositToLocalData, transferMoney, getTransferDetail, clearTransferDetail, clearReviewTransferDetail, fetchReviewTransferDetail, fetchDepositAccountDetail, depositCheck, updateCheckDepositLocalData, clearCheckDeposit, getCheckDepositDetail, updateDepositAccount, fetchDepositAccountHistorySuccess, fetchDepositAccountHistoryFailure, fetchZeniAccStatementPage, getZeniAccStatements, };
|
|
638
638
|
export { fetchDepositAccountTransactionList, getDepositAccountTransactionList, };
|
|
@@ -58,7 +58,6 @@ export const initialAiCfoViewState = {
|
|
|
58
58
|
fetchState: 'Not-Started',
|
|
59
59
|
error: undefined,
|
|
60
60
|
savedMacroId: undefined,
|
|
61
|
-
kind: undefined,
|
|
62
61
|
},
|
|
63
62
|
skillVersionBody: {
|
|
64
63
|
fetchState: 'Not-Started',
|
|
@@ -778,7 +777,6 @@ const aiCfoView = createSlice({
|
|
|
778
777
|
fetchState: 'In-Progress',
|
|
779
778
|
error: undefined,
|
|
780
779
|
savedMacroId: undefined,
|
|
781
|
-
kind: 'save',
|
|
782
780
|
};
|
|
783
781
|
},
|
|
784
782
|
prepare(payload) {
|
|
@@ -830,7 +828,6 @@ const aiCfoView = createSlice({
|
|
|
830
828
|
fetchState: 'In-Progress',
|
|
831
829
|
error: undefined,
|
|
832
830
|
savedMacroId: undefined,
|
|
833
|
-
kind: 'visibility',
|
|
834
831
|
};
|
|
835
832
|
},
|
|
836
833
|
prepare(payload) {
|
|
@@ -866,7 +863,6 @@ const aiCfoView = createSlice({
|
|
|
866
863
|
fetchState: 'In-Progress',
|
|
867
864
|
error: undefined,
|
|
868
865
|
savedMacroId: undefined,
|
|
869
|
-
kind: 'delete',
|
|
870
866
|
};
|
|
871
867
|
},
|
|
872
868
|
prepare(payload) {
|
|
@@ -895,7 +891,6 @@ const aiCfoView = createSlice({
|
|
|
895
891
|
fetchState: 'Not-Started',
|
|
896
892
|
error: undefined,
|
|
897
893
|
savedMacroId: undefined,
|
|
898
|
-
kind: undefined,
|
|
899
894
|
};
|
|
900
895
|
},
|
|
901
896
|
openSkillsBrowser(draft) {
|
|
@@ -73,17 +73,39 @@ export const promoteOneTimeAccrualEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
73
73
|
const debitClassId = edits?.jeDebitAccountingClassId ?? accrual?.jeDebitAccountingClassId;
|
|
74
74
|
const debitClassName = edits?.jeDebitAccountingClassName ??
|
|
75
75
|
accrual?.jeDebitAccountingClassName;
|
|
76
|
+
// The accrual document stores names alongside ids, so every id below travels with its name.
|
|
77
|
+
// Sending an id on its own leaves the stored row -- and the JE posted from it -- naming the
|
|
78
|
+
// account the user just moved away from. Create has always sent the full set; promote did
|
|
79
|
+
// not, which is the difference the two paths were showing.
|
|
80
|
+
const debitAccountName = edits?.jeDebitAccountName ?? accrual?.jeDebitAccountName;
|
|
81
|
+
const creditAccountName = edits?.jeCreditAccountName ?? accrual?.jeCreditAccountName;
|
|
82
|
+
// Credit-side class is never edited on this form -- the liability side is the Balance Sheet
|
|
83
|
+
// class the draft was born with -- so it is echoed straight back from the draft.
|
|
84
|
+
const creditClassId = accrual?.jeCreditAccountingClassId;
|
|
85
|
+
const creditClassName = accrual?.jeCreditAccountingClassName;
|
|
76
86
|
const payload = {
|
|
77
87
|
amount,
|
|
78
88
|
memo: edits?.memo ?? accrual?.memo ?? '',
|
|
79
89
|
je_debit_account_id: debitAccountId,
|
|
80
90
|
je_credit_account_id: creditAccountId,
|
|
91
|
+
...(debitAccountName != null
|
|
92
|
+
? { je_debit_account_name: debitAccountName }
|
|
93
|
+
: {}),
|
|
94
|
+
...(creditAccountName != null
|
|
95
|
+
? { je_credit_account_name: creditAccountName }
|
|
96
|
+
: {}),
|
|
81
97
|
...(debitClassId != null
|
|
82
98
|
? { je_debit_accounting_class_id: debitClassId }
|
|
83
99
|
: {}),
|
|
84
100
|
...(debitClassName != null
|
|
85
101
|
? { je_debit_accounting_class_name: debitClassName }
|
|
86
102
|
: {}),
|
|
103
|
+
...(creditClassId != null
|
|
104
|
+
? { je_credit_accounting_class_id: creditClassId }
|
|
105
|
+
: {}),
|
|
106
|
+
...(creditClassName != null
|
|
107
|
+
? { je_credit_accounting_class_name: creditClassName }
|
|
108
|
+
: {}),
|
|
87
109
|
// Mirrors the create payload: reverse_next_month alone decides the policy, and the date is
|
|
88
110
|
// only meaningful when it is true -- agent-je derives the reversal from the bill otherwise.
|
|
89
111
|
reverse_next_month: reverseNextMonth,
|
|
@@ -12,8 +12,8 @@ import { getClassList, getNestedClassListHierarchy, } from '../../classList/clas
|
|
|
12
12
|
import { getAccountsTypesForScheduleDetails } from '../../scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper';
|
|
13
13
|
import { filterNestedAccountHierarchyById } from '../../scheduleView/scheduleDetailView/scheduleDetailSelector';
|
|
14
14
|
import { getAccountLabelForScheduleType, getAccountsTypesForScheduleList, } from '../../scheduleView/scheduleListView/scheduleListHelper';
|
|
15
|
-
import { ALL_JE_PAGE_TABS, getJESchedulePeriodTabKey, } from '../types/jeSchedulesViewState';
|
|
16
15
|
import { getAllSteps } from './getAllStepsHelper';
|
|
16
|
+
import { ALL_JE_PAGE_TABS, getJESchedulePeriodTabKey, } from '../types/jeSchedulesViewState';
|
|
17
17
|
import { getJEAccountSettingsView } from './jeAccountSettingsViewSelector';
|
|
18
18
|
import { getNewScheduleView } from './jeNewScheduleViewSelector';
|
|
19
19
|
// Matches the AI-automation user addresses webc's schedule list row already
|
|
@@ -330,9 +330,7 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
330
330
|
*/
|
|
331
331
|
const sumToAmount = (schedules) => {
|
|
332
332
|
const first = schedules[0];
|
|
333
|
-
const currency = first != null
|
|
334
|
-
? getScheduleAmountObject(first)
|
|
335
|
-
: allScheduleAmountFallback;
|
|
333
|
+
const currency = first != null ? getScheduleAmountObject(first) : allScheduleAmountFallback;
|
|
336
334
|
return {
|
|
337
335
|
...currency,
|
|
338
336
|
amount: sumAmount(schedules),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
2
|
export const ALL_INVOICING_COUPON_SORT_KEYS = [
|
|
3
|
-
'
|
|
4
|
-
'
|
|
3
|
+
'coupon_id',
|
|
4
|
+
'name',
|
|
5
5
|
'discount',
|
|
6
6
|
'duration',
|
|
7
7
|
'created',
|
|
@@ -12,8 +12,8 @@ export const ALL_INVOICING_COUPON_SORT_KEYS = [
|
|
|
12
12
|
];
|
|
13
13
|
export const toInvoicingCouponSortKey = (v) => stringToUnion(v, ALL_INVOICING_COUPON_SORT_KEYS);
|
|
14
14
|
export const INVOICING_COUPON_COLUMNS = [
|
|
15
|
-
{ key: '
|
|
16
|
-
{ key: '
|
|
15
|
+
{ key: 'coupon_id', sortable: true },
|
|
16
|
+
{ key: 'name', sortable: true },
|
|
17
17
|
{ key: 'discount', sortable: false },
|
|
18
18
|
{ key: 'duration', sortable: true },
|
|
19
19
|
{ key: 'created', sortable: true },
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
2
1
|
/**
|
|
3
2
|
* Single bundled view for the invoicing data-import surfaces — consumers read
|
|
4
3
|
* only this. Carries the migration `sessions` list + `sessionsFetch`, the
|
|
@@ -8,7 +7,6 @@ import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConf
|
|
|
8
7
|
export const getInvoicingDataImportView = (state) => {
|
|
9
8
|
const dataImportState = state.invoicingDataImportViewState;
|
|
10
9
|
return {
|
|
11
|
-
fieldHelp: invoicingFieldHelpForGroup(state, 'data_import'),
|
|
12
10
|
activeMigrationSessionId: dataImportState.activeDetailId,
|
|
13
11
|
sessionDetail: dataImportState.sessionDetail,
|
|
14
12
|
sessionDetailFetch: dataImportState.sessionDetailFetch,
|
|
@@ -18,7 +18,6 @@ export const getInvoicingCatalogPrices = (items) => items.flatMap((item) => (ite
|
|
|
18
18
|
export const getInvoicingCatalogListView = createSelector((state) => state.invoicingPlanState, (state) => state.invoicingCatalogListViewState, (state) => state.invoicingConfigViewState.catalogItemLifecycleActionOptions, (planState, listViewState, catalogItemLifecycleActionOptions) => ({
|
|
19
19
|
catalogItemLifecycleActionOptions,
|
|
20
20
|
plans: getInvoicingPlansByIds(planState, listViewState.planIds),
|
|
21
|
-
planSort: listViewState.planSort,
|
|
22
21
|
productColumns: INVOICING_PRODUCT_COLUMNS,
|
|
23
22
|
products: getInvoicingPlansByIds(planState, listViewState.productIds),
|
|
24
23
|
productSort: listViewState.productSort,
|
|
@@ -34,7 +34,6 @@ export const initialState = {
|
|
|
34
34
|
discountStatusOptions: [],
|
|
35
35
|
dunningCaseStatusOptions: [],
|
|
36
36
|
invoiceStatusOptions: [],
|
|
37
|
-
subscriptionCancelReasonCodeOptions: [],
|
|
38
37
|
subscriptionStatusOptions: [],
|
|
39
38
|
transactionStatusOptions: [],
|
|
40
39
|
transactionTypeOptions: [],
|
|
@@ -104,7 +103,6 @@ export function mapInvoicingConfigPayloadToState(payload) {
|
|
|
104
103
|
discountStatusOptions: (payload.discount_status_options ?? []).map(toInvoicingNamedOption),
|
|
105
104
|
dunningCaseStatusOptions: (payload.dunning_case_status_options ?? []).map(toInvoicingNamedOption),
|
|
106
105
|
invoiceStatusOptions: (payload.invoice_status_options ?? []).map(toInvoicingNamedOption),
|
|
107
|
-
subscriptionCancelReasonCodeOptions: (payload.subscription_cancel_reason_code_options ?? []).map(toInvoicingNamedOption),
|
|
108
106
|
subscriptionStatusOptions: (payload.subscription_status_options ?? []).map(toInvoicingNamedOption),
|
|
109
107
|
transactionStatusOptions: (payload.transaction_status_options ?? []).map(toInvoicingNamedOption),
|
|
110
108
|
transactionTypeOptions: (payload.transaction_type_options ?? []).map(toInvoicingNamedOption),
|
|
@@ -3,16 +3,16 @@ export const ALL_INVOICING_CUSTOMER_SORT_KEYS = [
|
|
|
3
3
|
'name',
|
|
4
4
|
'email',
|
|
5
5
|
'billingAddress',
|
|
6
|
-
'
|
|
6
|
+
'cardStatus',
|
|
7
7
|
'autoCollect',
|
|
8
8
|
'status',
|
|
9
9
|
];
|
|
10
10
|
export const toInvoicingCustomerSortKey = (v) => stringToUnion(v, ALL_INVOICING_CUSTOMER_SORT_KEYS);
|
|
11
11
|
export const INVOICING_CUSTOMER_COLUMNS = [
|
|
12
|
-
{ key: 'name', sortable:
|
|
12
|
+
{ key: 'name', sortable: true },
|
|
13
13
|
{ key: 'email', sortable: true },
|
|
14
14
|
{ key: 'billingAddress', sortable: false },
|
|
15
|
-
{ key: '
|
|
15
|
+
{ key: 'cardStatus', sortable: true },
|
|
16
16
|
{ key: 'autoCollect', sortable: true },
|
|
17
17
|
{ key: 'status', sortable: true },
|
|
18
18
|
];
|
package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js
CHANGED
|
@@ -3,8 +3,8 @@ export const ALL_INVOICING_DUNNING_CASE_SORT_KEYS = [
|
|
|
3
3
|
'customer',
|
|
4
4
|
'invoice',
|
|
5
5
|
'attempts',
|
|
6
|
-
'
|
|
7
|
-
'
|
|
6
|
+
'nextRetry',
|
|
7
|
+
'daysPastDue',
|
|
8
8
|
'failureReason',
|
|
9
9
|
'status',
|
|
10
10
|
'amount',
|
|
@@ -14,8 +14,8 @@ export const INVOICING_DUNNING_CASE_COLUMNS = [
|
|
|
14
14
|
{ key: 'customer', sortable: true },
|
|
15
15
|
{ key: 'invoice', sortable: true },
|
|
16
16
|
{ key: 'attempts', sortable: true },
|
|
17
|
-
{ key: '
|
|
18
|
-
{ key: '
|
|
17
|
+
{ key: 'nextRetry', sortable: true },
|
|
18
|
+
{ key: 'daysPastDue', sortable: true },
|
|
19
19
|
{ key: 'failureReason', sortable: false },
|
|
20
20
|
{ key: 'status', sortable: true },
|
|
21
21
|
{ key: 'amount', sortable: true },
|
|
@@ -37,6 +37,7 @@ export const mapInvoicingPlanRevenuePointPayloadToState = (payload) => ({
|
|
|
37
37
|
mrr: toAmount(payload.mrr, 'USD', '$'),
|
|
38
38
|
pct: payload.pct,
|
|
39
39
|
planID: payload.plan,
|
|
40
|
+
productCode: payload.product_code,
|
|
40
41
|
});
|
|
41
42
|
export const mapInvoicingDashboardSummaryPayloadToState = (payload) => ({
|
|
42
43
|
customerMovement: {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { getInvoicingSubscriptionById as getInvoicingSubscriptionByIdFromState } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionSelector';
|
|
2
|
-
import {
|
|
2
|
+
import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
3
|
import { getInvoicingSubscriptionActionState } from '../subscriptionAction/subscriptionActionSelector';
|
|
4
4
|
export const getInvoicingSubscriptionById = (state, id) => getInvoicingSubscriptionByIdFromState(state.invoicingSubscriptionState, id);
|
|
5
5
|
export const getInvoicingSubscriptionDetail = (state, invoicingSubscriptionID) => {
|
|
6
6
|
const { error, fetchState } = state.invoicingSubscriptionDetailViewState;
|
|
7
7
|
return {
|
|
8
8
|
fieldHelp: invoicingFieldHelpForGroup(state, 'subscription'),
|
|
9
|
-
cancelReasonCodeOptions: getInvoicingConfigView(state).subscriptionCancelReasonCodeOptions,
|
|
10
9
|
actionState: getInvoicingSubscriptionActionState(invoicingSubscriptionID)(state),
|
|
11
10
|
subscription: getInvoicingSubscriptionById(state, invoicingSubscriptionID),
|
|
12
11
|
fetchState,
|
|
@@ -28,7 +28,6 @@ export const getInvoicingSubscriptionListView = createSelector((state) => state.
|
|
|
28
28
|
count: listViewState.counts,
|
|
29
29
|
countsFetchState: listViewState.countsFetchState,
|
|
30
30
|
subscriptionCommercialEditAllowedFromStatuses: configState.subscriptionCommercialEditAllowedFromStatuses,
|
|
31
|
-
cancelReasonCodeOptions: configState.subscriptionCancelReasonCodeOptions,
|
|
32
31
|
subscriptionLifecycleActionOptions: configState.subscriptionLifecycleActionOptions,
|
|
33
32
|
subscriptionMetadataEditAllowedFromStatuses: configState.subscriptionMetadataEditAllowedFromStatuses,
|
|
34
33
|
statusOptions,
|
package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js
CHANGED
|
@@ -3,6 +3,7 @@ export const ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = [
|
|
|
3
3
|
'subscription',
|
|
4
4
|
'customer',
|
|
5
5
|
'plan',
|
|
6
|
+
'product_code',
|
|
6
7
|
'term_end',
|
|
7
8
|
'next_billing',
|
|
8
9
|
'auto_collect',
|
|
@@ -14,6 +15,7 @@ export const INVOICING_SUBSCRIPTION_COLUMNS = [
|
|
|
14
15
|
{ key: 'subscription', sortable: true },
|
|
15
16
|
{ key: 'customer', sortable: false },
|
|
16
17
|
{ key: 'plan', sortable: true },
|
|
18
|
+
{ key: 'product_code', sortable: true },
|
|
17
19
|
{ key: 'term_end', sortable: true },
|
|
18
20
|
{ key: 'next_billing', sortable: true },
|
|
19
21
|
{ key: 'auto_collect', sortable: true },
|
|
@@ -7,7 +7,6 @@ export const initialInvoicingBrandingFormLocalData = {
|
|
|
7
7
|
dateFormat: '',
|
|
8
8
|
defaultMemo: '',
|
|
9
9
|
email: '',
|
|
10
|
-
invoiceFooterText: '',
|
|
11
10
|
invoicePrefix: '',
|
|
12
11
|
logoFileId: '',
|
|
13
12
|
phone: '',
|
|
@@ -20,7 +19,6 @@ export const entityToInvoicingBrandingFormLocalData = (settings) => ({
|
|
|
20
19
|
dateFormat: settings?.date_format ?? '',
|
|
21
20
|
defaultMemo: settings?.default_memo ?? '',
|
|
22
21
|
email: settings?.email ?? '',
|
|
23
|
-
invoiceFooterText: settings?.invoice_footer_text ?? '',
|
|
24
22
|
invoicePrefix: settings?.invoice_prefix ?? '',
|
|
25
23
|
logoFileId: settings?.logo_file_id ?? '',
|
|
26
24
|
phone: settings?.phone ?? '',
|
|
@@ -41,9 +39,6 @@ export const brandingLocalDataToSettingsPayload = (localData, address) => ({
|
|
|
41
39
|
date_format: trimOrUndefined(localData.dateFormat),
|
|
42
40
|
default_memo: trimOrUndefined(localData.defaultMemo),
|
|
43
41
|
email: trimOrUndefined(localData.email),
|
|
44
|
-
// Sent even when blank: "" is how the API is told to hide the footer line,
|
|
45
|
-
// so this one must not collapse to `undefined` like the fields above.
|
|
46
|
-
invoice_footer_text: localData.invoiceFooterText.trim(),
|
|
47
42
|
invoice_prefix: trimOrUndefined(localData.invoicePrefix),
|
|
48
43
|
logo_file_id: localData.logoFileId,
|
|
49
44
|
phone: trimOrUndefined(localData.phone),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getInvoicingQboAccountMappingId, } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
2
|
import { getFormattedAddress } from '../../addressView/addressViewSelector';
|
|
3
|
-
import { getInvoicingConfigView
|
|
3
|
+
import { getInvoicingConfigView } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
4
4
|
import { getInvoicingQboView, isInvoicingAccountingPickerDataLoading, } from '../invoicingQboView/invoicingQboViewSelector';
|
|
5
5
|
import { INVOICING_BUSINESS_ADDRESS_TYPE, entityToInvoicingBrandingFormLocalData, } from './invoicingBrandingFormConfig';
|
|
6
6
|
import { initialInvoicingQboSettingsLocalData, } from './invoicingQboSettingsFormConfig';
|
|
@@ -26,7 +26,6 @@ export const getInvoicingSettingsFetchState = (state) => ({
|
|
|
26
26
|
export const getInvoicingSettingsView = (state) => {
|
|
27
27
|
const { error, fetchState, saveFetchState, settings, stripeFetchState } = state.invoicingSettingsViewState;
|
|
28
28
|
return {
|
|
29
|
-
fieldHelp: invoicingFieldHelpForGroup(state, 'settings'),
|
|
30
29
|
error,
|
|
31
30
|
fetchState,
|
|
32
31
|
saveState: saveFetchState,
|
|
@@ -79,7 +78,6 @@ export const getInvoicingSettingsHubView = (state) => {
|
|
|
79
78
|
const { dunningScheduleActionOptions, enableState, error: configError, fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, status, } = getInvoicingConfigView(state);
|
|
80
79
|
const { canEnable, isQboConfigured, isStripeConnected } = deriveInvoicingEnablePrerequisites(state.invoicingSettingsViewState.settings, state.invoicingQboViewState.connection?.connected === true, qboAccountMappingKindOptions);
|
|
81
80
|
return {
|
|
82
|
-
fieldHelp: invoicingFieldHelpForGroup(state, 'settings'),
|
|
83
81
|
// Keeps the onboarding step in the gate: a tenant that has not accepted the
|
|
84
82
|
// terms cannot enable invoicing, whatever the integrations say.
|
|
85
83
|
canEnableInvoicing: status === 'settings' && canEnable,
|
|
@@ -110,7 +108,6 @@ export const getInvoicingQboSettingsFormView = (state) => {
|
|
|
110
108
|
const { fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, } = getInvoicingConfigView(state);
|
|
111
109
|
const qboView = getInvoicingQboView(state);
|
|
112
110
|
return {
|
|
113
|
-
fieldHelp: invoicingFieldHelpForGroup(state, 'settings'),
|
|
114
111
|
accountMappingKindOptions: qboAccountMappingKindOptions,
|
|
115
112
|
accounts: qboView.accounts,
|
|
116
113
|
backfillState: qboView.backfillState,
|
|
@@ -150,7 +147,6 @@ export const getInvoicingBrandingFormView = (state) => {
|
|
|
150
147
|
? getFormattedAddress(newAddress.addressToCreate)
|
|
151
148
|
: undefined;
|
|
152
149
|
return {
|
|
153
|
-
fieldHelp: invoicingFieldHelpForGroup(state, 'settings'),
|
|
154
150
|
addressLabel,
|
|
155
151
|
dateFormatOptions: getInvoicingConfigView(state).dateFormatOptions,
|
|
156
152
|
localData: brandingDraft ?? entityToInvoicingBrandingFormLocalData(settings),
|
|
@@ -131,18 +131,6 @@ const recommendation = createSlice({
|
|
|
131
131
|
};
|
|
132
132
|
},
|
|
133
133
|
},
|
|
134
|
-
// Fire-and-forget human feedback on a recommendation (accept, ranked
|
|
135
|
-
// override or outside override). Handled by submitRecommendationFeedbackEpic
|
|
136
|
-
// which POSTs to the accounting recommendation-feedback endpoint. No state
|
|
137
|
-
// mutation: the categorization UX must not depend on the feedback round-trip.
|
|
138
|
-
submitRecommendationFeedback: {
|
|
139
|
-
reducer() {
|
|
140
|
-
// Fire-and-forget: no state mutation; the epic performs the POST.
|
|
141
|
-
},
|
|
142
|
-
prepare(args) {
|
|
143
|
-
return { payload: args };
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
134
|
},
|
|
147
135
|
extraReducers: (builder) => {
|
|
148
136
|
builder.addCase(clearAll, (draft) => {
|
|
@@ -150,7 +138,7 @@ const recommendation = createSlice({
|
|
|
150
138
|
});
|
|
151
139
|
},
|
|
152
140
|
});
|
|
153
|
-
export const { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityName, fetchRecommendationByEntityId, updateRecommendationForEntity, updateRecommendationForEntityFailure, indicateReadyToInitializeRecommendation,
|
|
141
|
+
export const { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityName, fetchRecommendationByEntityId, updateRecommendationForEntity, updateRecommendationForEntityFailure, indicateReadyToInitializeRecommendation, } = recommendation.actions;
|
|
154
142
|
export default recommendation.reducer;
|
|
155
143
|
const doUpdateRecommendationForEntity = (draft, entityId, entityType, payload) => {
|
|
156
144
|
const key = getEntityRecommendationKey(entityType, entityId);
|
|
@@ -2,20 +2,13 @@ import { from, of } from 'rxjs';
|
|
|
2
2
|
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
3
|
import { updateApprovalRules } from '../../../../../entity/approvalRule/approvalRuleReducer';
|
|
4
4
|
import { getApprovalRulesByIds } from '../../../../../entity/approvalRule/approvalRuleSelector';
|
|
5
|
-
import { getIsAccountingClassesEnabled } from '../../../../../entity/tenant/tenantSelector';
|
|
6
5
|
import { updateAllUsers } from '../../../../../entity/user/userReducer';
|
|
7
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
8
|
-
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
9
7
|
import { fetchBillPaySetupApproverView, fetchBillPaySetupApproverViewFailure, fetchBillPaySetupApproverViewSuccess, } from '../billPaySetupApproverViewReducer';
|
|
10
8
|
export const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchBillPaySetupApproverView.match), switchMap((action) => {
|
|
11
9
|
const { cacheOverride, useV3 } = action.payload;
|
|
12
|
-
const { billPaySetupApproverViewState, approvalRuleState
|
|
13
|
-
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state$.value);
|
|
10
|
+
const { billPaySetupApproverViewState, approvalRuleState } = state$.value;
|
|
14
11
|
const approvalRules = getApprovalRulesByIds(approvalRuleState, billPaySetupApproverViewState.approvalRuleIds);
|
|
15
|
-
const shouldFetchClassList = isAccountingClassesEnabled &&
|
|
16
|
-
(cacheOverride === true ||
|
|
17
|
-
(classListState.hasValidState() === false &&
|
|
18
|
-
classListState.fetchState !== 'In-Progress'));
|
|
19
12
|
if (cacheOverride === true ||
|
|
20
13
|
approvalRules.length !==
|
|
21
14
|
billPaySetupApproverViewState.approvalRuleIds.length ||
|
|
@@ -35,9 +28,6 @@ export const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) =>
|
|
|
35
28
|
updateApprovalRules(response.data.approval_rules),
|
|
36
29
|
fetchBillPaySetupApproverViewSuccess(approvalRuleIds),
|
|
37
30
|
];
|
|
38
|
-
if (shouldFetchClassList) {
|
|
39
|
-
actions.push(fetchClassList());
|
|
40
|
-
}
|
|
41
31
|
return from(actions);
|
|
42
32
|
}
|
|
43
33
|
else {
|
|
@@ -47,12 +37,6 @@ export const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) =>
|
|
|
47
37
|
}
|
|
48
38
|
else {
|
|
49
39
|
const { approvalRuleIds } = billPaySetupApproverViewState;
|
|
50
|
-
|
|
51
|
-
fetchBillPaySetupApproverViewSuccess(approvalRuleIds),
|
|
52
|
-
];
|
|
53
|
-
if (shouldFetchClassList) {
|
|
54
|
-
actions.push(fetchClassList());
|
|
55
|
-
}
|
|
56
|
-
return from(actions);
|
|
40
|
+
return of(fetchBillPaySetupApproverViewSuccess(approvalRuleIds));
|
|
57
41
|
}
|
|
58
42
|
}));
|
|
@@ -21,6 +21,7 @@ export const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state
|
|
|
21
21
|
name: approvalRule.name,
|
|
22
22
|
description: approvalRule.description,
|
|
23
23
|
separationOfDuties: approvalRule.separationOfDuties,
|
|
24
|
+
isFallback: approvalRule.isFallback,
|
|
24
25
|
};
|
|
25
26
|
fetchActions.push(clearBillPaySetupApproverViewUpdateData(), saveBillPaySetupApproverViewUpdateData(billPaySetupApproverViewUpdateData));
|
|
26
27
|
}
|