@zeniai/client-epic-state 4.9.87 → 4.9.89
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/task/{taskState.d.ts → task.d.ts} +0 -12
- package/lib/entity/task/{taskState.js → task.js} +1 -6
- package/lib/entity/task/taskPayload.d.ts +3 -8
- package/lib/entity/task/taskPayload.js +4 -15
- package/lib/entity/task/taskReducer.d.ts +1 -1
- package/lib/entity/task/taskSelector.d.ts +1 -1
- package/lib/index.d.ts +2 -4
- package/lib/index.js +1 -5
- package/lib/reducer.d.ts +1 -1
- package/lib/view/commonVendorView/vendorView/epics/saveVendorEpic.d.ts +2 -2
- package/lib/view/commonVendorView/vendorView/epics/saveVendorEpic.js +1 -0
- package/lib/view/recommendation/recommendationHelper.js +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -2
- package/lib/view/spendManagement/helpers.js +1 -2
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -8
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -10
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +1 -11
- package/lib/view/taskManager/taskDetailView/taskDetail.js +0 -5
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +6 -10
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +1 -1
- package/lib/view/taskManager/taskListView/taskListSelector.js +2 -2
- package/package.json +1 -1
- package/lib/view/common/recurringViewHelper.d.ts +0 -10
- package/lib/view/common/recurringViewHelper.js +0 -65
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { RecurringFrequencyType } from '../../view/common/recurringViewHelper';
|
|
3
2
|
import { ZeniDate } from '../../zeniDayJS';
|
|
4
3
|
export interface Task {
|
|
5
4
|
id: ID;
|
|
@@ -14,10 +13,6 @@ export interface Task {
|
|
|
14
13
|
status: TaskStatus;
|
|
15
14
|
createTime: ZeniDate;
|
|
16
15
|
syncToken: string;
|
|
17
|
-
type: TaskType;
|
|
18
|
-
recurringEndDate?: ZeniDate;
|
|
19
|
-
recurringFrequency?: RecurringFrequencyType;
|
|
20
|
-
recurringStartDate?: ZeniDate;
|
|
21
16
|
tag?: TaskTag;
|
|
22
17
|
dueDate?: ZeniDate;
|
|
23
18
|
updateTime?: ZeniDate;
|
|
@@ -49,10 +44,3 @@ export declare const ALL_TASK_STATUS_CODE: readonly ["todo", "in_progress", "on_
|
|
|
49
44
|
export declare const toTaskStatusCodeType: (v: string) => "done" | "todo" | "in_progress" | "on_hold" | "resolved";
|
|
50
45
|
export declare const toTaskStatusCodeTypeStrict: (v?: string | undefined) => "done" | "todo" | "in_progress" | "on_hold" | "resolved" | undefined;
|
|
51
46
|
export declare type TaskStatusCodeType = ReturnType<typeof toTaskStatusCodeType>;
|
|
52
|
-
export declare const toTaskCodeType: (v: string) => "one_time" | "recurring";
|
|
53
|
-
export declare const toTaskCodeTypeStrict: (v?: string | undefined) => "one_time" | "recurring" | undefined;
|
|
54
|
-
export declare type TaskCodeType = NonNullable<ReturnType<typeof toTaskCodeType>>;
|
|
55
|
-
export interface TaskType {
|
|
56
|
-
code: TaskCodeType;
|
|
57
|
-
name: string;
|
|
58
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toTaskStatusCodeTypeStrict = exports.toTaskStatusCodeType = exports.ALL_TASK_STATUS_CODE = exports.toPriorityCodeTypeStrict = exports.toPriorityCodeType = exports.ALL_PRORITY_CODE = exports.toTaskTagCodeTypeStrict = exports.toTaskTagCodeType = exports.ALL_TASK_TAG_CODE = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
5
|
exports.ALL_TASK_TAG_CODE = [
|
|
6
6
|
'invoices',
|
|
@@ -34,8 +34,3 @@ const toTaskStatusCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, export
|
|
|
34
34
|
exports.toTaskStatusCodeType = toTaskStatusCodeType;
|
|
35
35
|
const toTaskStatusCodeTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v !== null && v !== void 0 ? v : '', exports.ALL_TASK_STATUS_CODE);
|
|
36
36
|
exports.toTaskStatusCodeTypeStrict = toTaskStatusCodeTypeStrict;
|
|
37
|
-
const ALL_TASK_CODE_TYPE = ['one_time', 'recurring'];
|
|
38
|
-
const toTaskCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_TASK_CODE_TYPE);
|
|
39
|
-
exports.toTaskCodeType = toTaskCodeType;
|
|
40
|
-
const toTaskCodeTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v !== null && v !== void 0 ? v : '', ALL_TASK_CODE_TYPE);
|
|
41
|
-
exports.toTaskCodeTypeStrict = toTaskCodeTypeStrict;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AllowedValueWithCodePayload } from '../../commonPayloadTypes/commonPayload';
|
|
2
1
|
import { AllowedValueWithCode } from '../../commonStateTypes/allowedValue';
|
|
3
|
-
import { Task } from './
|
|
2
|
+
import { Task } from './task';
|
|
4
3
|
export interface TaskPayload {
|
|
5
4
|
task_id: string;
|
|
6
5
|
assignees: string[];
|
|
@@ -11,15 +10,11 @@ export interface TaskPayload {
|
|
|
11
10
|
is_archived: boolean;
|
|
12
11
|
is_deleted: boolean;
|
|
13
12
|
name: string;
|
|
14
|
-
priority:
|
|
15
|
-
status:
|
|
13
|
+
priority: AllowedValueWithCode;
|
|
14
|
+
status: AllowedValueWithCode;
|
|
16
15
|
due_date: string | null;
|
|
17
16
|
tag: AllowedValueWithCode | null;
|
|
18
17
|
update_time: string | null;
|
|
19
|
-
type: AllowedValueWithCodePayload;
|
|
20
|
-
recurring_end_date: string | null;
|
|
21
|
-
recurring_frequency: AllowedValueWithCodePayload | null;
|
|
22
|
-
recurring_start_date: string | null;
|
|
23
18
|
sync_token?: string | null;
|
|
24
19
|
}
|
|
25
20
|
export declare const mapTaskPayloadToTask: (payload: TaskPayload) => Task;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapTaskPayloadToTask = void 0;
|
|
4
|
-
const recurringViewHelper_1 = require("../../view/common/recurringViewHelper");
|
|
5
4
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
6
|
-
const
|
|
5
|
+
const task_1 = require("./task");
|
|
7
6
|
const mapTaskPayloadToTask = (payload) => {
|
|
8
7
|
var _a;
|
|
9
8
|
return ({
|
|
@@ -17,29 +16,19 @@ const mapTaskPayloadToTask = (payload) => {
|
|
|
17
16
|
name: payload.name,
|
|
18
17
|
syncToken: (_a = payload.sync_token) !== null && _a !== void 0 ? _a : '',
|
|
19
18
|
priority: {
|
|
20
|
-
code: (0,
|
|
19
|
+
code: (0, task_1.toPriorityCodeType)(payload.priority.code),
|
|
21
20
|
name: payload.priority.name,
|
|
22
21
|
},
|
|
23
22
|
status: {
|
|
24
|
-
code: (0,
|
|
23
|
+
code: (0, task_1.toTaskStatusCodeType)(payload.status.code),
|
|
25
24
|
name: payload.status.name,
|
|
26
25
|
},
|
|
27
26
|
tag: payload.tag != null
|
|
28
27
|
? {
|
|
29
|
-
code: (0,
|
|
28
|
+
code: (0, task_1.toTaskTagCodeType)(payload.tag.code),
|
|
30
29
|
name: payload.tag.name,
|
|
31
30
|
}
|
|
32
31
|
: undefined,
|
|
33
|
-
type: { code: (0, taskState_1.toTaskCodeType)(payload.type.code), name: payload.type.name },
|
|
34
|
-
recurringEndDate: payload.recurring_end_date != null
|
|
35
|
-
? (0, zeniDayJS_1.date)(payload.recurring_end_date)
|
|
36
|
-
: undefined,
|
|
37
|
-
recurringFrequency: payload.recurring_frequency != null
|
|
38
|
-
? (0, recurringViewHelper_1.toRecurringFrequencyStrict)(payload.recurring_frequency.code)
|
|
39
|
-
: undefined,
|
|
40
|
-
recurringStartDate: payload.recurring_start_date != null
|
|
41
|
-
? (0, zeniDayJS_1.date)(payload.recurring_start_date)
|
|
42
|
-
: undefined,
|
|
43
32
|
createTime: (0, zeniDayJS_1.date)(payload.create_time),
|
|
44
33
|
dueDate: payload.due_date != null ? (0, zeniDayJS_1.date)(payload.due_date) : undefined,
|
|
45
34
|
updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : undefined,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TaskPayload } from './taskPayload';
|
|
2
|
-
import { TaskState } from './
|
|
2
|
+
import { TaskState } from './task';
|
|
3
3
|
export declare const initialState: TaskState;
|
|
4
4
|
export declare const updateTasks: import("@reduxjs/toolkit").ActionCreatorWithPayload<TaskPayload[], string>, updateTask: import("@reduxjs/toolkit").ActionCreatorWithPayload<TaskPayload, string>, removeTask: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, clearAllTasks: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
5
5
|
declare const _default: import("@reduxjs/toolkit").Reducer<TaskState, import("@reduxjs/toolkit").AnyAction>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { TaskState, Task } from './
|
|
2
|
+
import { TaskState, Task } from './task';
|
|
3
3
|
export declare function getTasksByIds(taskState: TaskState, taskIds: ID[]): Task[];
|
|
4
4
|
export declare function getTaskById(taskState: TaskState, taskId: ID): Task | undefined;
|
package/lib/index.d.ts
CHANGED
|
@@ -629,14 +629,14 @@ import { ArAgingDetail, getArAgingDetailForCustomer } from './view/arAgingView/a
|
|
|
629
629
|
export { fetchArAging, updateArAgingUIState, fetchArAgingDetail, updateArAgingDetailUIState, ArAgingReport, ArAgingDetail, AgingBalancesByCustomer, getArAgingReport, getArAgingDetailForCustomer, };
|
|
630
630
|
import { toRecurringBillFrequency, toRecurringBillFrequencyStrict, RecurringBillFrequency, RecurringBillDetail, RecurringBillConfig, RecurringBillStatus, RecurringBillPaymentStatus } from './entity/billPay/recurringBills/recurringBillsState';
|
|
631
631
|
export { toRecurringBillFrequency, toRecurringBillFrequencyStrict, RecurringBillFrequency, RecurringBillDetail, RecurringBillConfig, RecurringBillStatus, RecurringBillPaymentStatus, };
|
|
632
|
-
import { Task, TaskStatusCodeType, PriorityCodeType, TaskTagCodeType, TaskTag, TaskStatus, TaskPriority
|
|
632
|
+
import { Task, TaskStatusCodeType, PriorityCodeType, TaskTagCodeType, TaskTag, TaskStatus, TaskPriority } from './entity/task/task';
|
|
633
633
|
import { TaskListSelectorView, TaskWithUserDetails, getAllTasks } from './view/taskManager/taskListView/taskListSelector';
|
|
634
634
|
import { TaskListViewSortKey, TaskListUIState, TaskListFilters, TASK_LIST_FILTER_CATEGORIES, TaskListFilterCategoryField, TaskFilterCategory } from './view/taskManager/taskListView/taskList';
|
|
635
635
|
import { TaskDetailSelectorView, getTaskDetail, allTaskTags, allTaskStatus, allTaskPriority } from './view/taskManager/taskDetailView/taskDetailSelector';
|
|
636
636
|
import { EditTaskLocalData } from './view/taskManager/taskDetailView/taskDetail';
|
|
637
637
|
import { fetchTaskListPage, updateTaskFilters, updateTaskListSearchText, updateTaskListUIState } from './view/taskManager/taskListView/taskListReducer';
|
|
638
638
|
import { deleteTask, discardTaskUpdatesInLocalStore, fetchTaskDetailPage, saveTaskDetail, archiveTask, saveTaskUpdatesToLocalStore } from './view/taskManager/taskDetailView/taskDetailReducer';
|
|
639
|
-
export { Task, TaskListSelectorView, TaskWithUserDetails, TaskListViewSortKey, TaskListUIState, TaskDetailSelectorView, EditTaskLocalData, TaskStatusCodeType, PriorityCodeType, TaskTagCodeType, TaskTag, TaskStatus, TaskPriority,
|
|
639
|
+
export { Task, TaskListSelectorView, TaskWithUserDetails, TaskListViewSortKey, TaskListUIState, TaskDetailSelectorView, EditTaskLocalData, TaskStatusCodeType, PriorityCodeType, TaskTagCodeType, TaskTag, TaskStatus, TaskPriority, getAllTasks, fetchTaskListPage, getTaskDetail, fetchTaskDetailPage, saveTaskUpdatesToLocalStore, saveTaskDetail, archiveTask, updateTaskListSearchText, updateTaskListUIState, allTaskTags, allTaskStatus, allTaskPriority, TaskListFilters, updateTaskFilters, TASK_LIST_FILTER_CATEGORIES, TaskListFilterCategoryField, deleteTask, discardTaskUpdatesInLocalStore, TaskFilterCategory, };
|
|
640
640
|
import { getAuditReportGroupViewSelectorView, getAuditRuleGroupViewSelectorView, AuditReportGroupSelectorView, AuditReportGroupViewSelectorView, AuditRuleGroupViewSelectorView } from './view/auditReportView/auditReportViewSelector';
|
|
641
641
|
import { fetchAuditRuleGroupView, fetchAuditReportGroupView, clearAuditReportGroupViewByCompanyId } from './view/auditReportView/auditReportViewReducer';
|
|
642
642
|
import { AuditRuleGroup, AuditReportRule, AuditRuleGroupReport, AuditRuleEntityType, AuditRuleEntityIdType } from './view/auditReportView/auditReportViewState';
|
|
@@ -653,5 +653,3 @@ import { getReferralListView, ReferralListSelectorView, getInviteFormView } from
|
|
|
653
653
|
import { ReferralViewState, InviteCompanyLocalData, ReferralInvitation, ReferralListViewSortKey, ReferralViewUIState, StatusTypes, AmountStatusTypes, toReferralListViewSortKeyType, ReferralStatus, ReferralAmountStatus } from './view/referralView/referralState';
|
|
654
654
|
import { fetchReferrals, sendReferralInvite, clearReferrals, saveReferralFormDataInLocalStore, resendReferralInvite, updateReferralListSortUiState, fetchRewardsPlan } from './view/referralView/referralReducer';
|
|
655
655
|
export { getReferralListView, getInviteFormView, ReferralListSelectorView, ReferralViewState, InviteCompanyLocalData, ReferralInvitation, ReferralListViewSortKey, ReferralViewUIState, toReferralListViewSortKeyType, ReferralStatus, ReferralAmountStatus, StatusTypes, AmountStatusTypes, fetchReferrals, sendReferralInvite, clearReferrals, saveReferralFormDataInLocalStore, updateReferralListSortUiState, resendReferralInvite, fetchRewardsPlan, };
|
|
656
|
-
import { RecurringFrequencyType, getRecurringEndDateFromCount, toRecurringFrequency, getMinAllowedEndDate, RecurringDatePickerOptions } from './view/common/recurringViewHelper';
|
|
657
|
-
export { RecurringFrequencyType, getRecurringEndDateFromCount, toRecurringFrequency, getMinAllowedEndDate, RecurringDatePickerOptions, };
|
package/lib/index.js
CHANGED
|
@@ -46,7 +46,7 @@ exports.clearOnboardingCustomerView = exports.saveOnboardingCustomerViewDataInLo
|
|
|
46
46
|
exports.fetchChargeCardDetailPage = exports.getChargeCardListView = exports.fetchChargeCardListPage = exports.getChargeCardBusinessVerificationDetails = exports.companyHealthMetricDropDownOptions = exports.hasCompanyHealthMetricFormFieldChanged = exports.getCompanyHealthMetricView = exports.isCompanyRunwayInfinite = exports.updateCompanyHealthViewUIState = exports.updateCompanyHealthMetricViewSuccessStatus = exports.updateCompanyHealthMetricViewErrorStatus = exports.updateCompanyHealthMetricLocalStore = exports.saveCompanyHealthMetricById = exports.removeSelectedCompanyId = exports.initializeCompanyHealthMetricViewLocalData = exports.fetchCompanyHealthMetricView = exports.clearCompanyHealthMetricView = exports.updateCompanyHealth = exports.updateCompaniesHealth = exports.getUserRoleConfig = exports.fetchUserRoleConfig = exports.clearInternationalWire = exports.deletePaymentInstrument = exports.createPaymentInstrumentUpdateStatus = exports.createPaymentInstrument = exports.fetchInternationalWireDynamicForm = exports.initializeDynamicForm = exports.updateInternationalWireLocalStoreData = exports.initializeInternationalWireLocalData = exports.getInternationalWireView = exports.fetchWiseRedirectStatus = exports.getWiseRedirect = exports.saveMagicLinkAddressInLocalStore = exports.fetchMagicLinkBankNameBySwift = exports.fetchMagicLinkBankNameByRouting = exports.updateMagicLinkInternationalBankAccountLocalStoreData = exports.updateMagicLinkBankAccountLocalStoreData = exports.saveBankAccount = exports.fetchBillAttachment = exports.fetchMagicLinkTenant = exports.getMagicLinkCurrentAddressState = exports.getMagicLinkBankAccountView = exports.getMagicLinkView = exports.initializeAccountMappingView = exports.getAccountMappingView = exports.clearAccountMappingLocalData = exports.saveAccountMappingLocalData = exports.saveAccountMapping = exports.getOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = void 0;
|
|
47
47
|
exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.deleteScheduleDetail = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey = exports.updateScheduleListSortState = exports.updateScheduleListScrollState = exports.updateScheduleListSearchText = exports.updateScheduleListSubTab = exports.toScheduleSubTabType = exports.toScheduleListTabsFileTypeStrict = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.getFetchStateForScheduleAccountList = exports.updateScheduleListLocalData = exports.fetchSchedulesAccount = exports.fetchDownloadSchedules = exports.fetchScheduleList = exports.getScheduleListReport = exports.ALL_SCHEDULES_TYPES = exports.updateApAgingDetailUIState = exports.getApAgingDetailForVendor = exports.fetchApAgingDetail = exports.updateApAgingUIState = exports.getApAgingReport = exports.fetchApAging = exports.updateChargeCardDetail = exports.updateChargeCardListUIState = exports.updateChargeCardListSearchText = exports.resetIssueChargeCardForm = exports.updateChargeCardLocalStore = exports.issueChargeCard = exports.acceptChargeCardTerms = exports.fetchChargeCardSetupView = exports.getChargeCardSetupViewDetails = exports.toCreditLimitFrequencyCodeType = exports.toChargeCardSortKeyType = exports.fetchChargeCardTransactionList = exports.getChargeCardDetailView = void 0;
|
|
48
48
|
exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.allTaskTags = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.archiveTask = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks = exports.toRecurringBillFrequencyStrict = exports.toRecurringBillFrequency = exports.getArAgingDetailForCustomer = exports.getArAgingReport = exports.updateArAgingDetailUIState = exports.fetchArAgingDetail = exports.updateArAgingUIState = exports.fetchArAging = exports.toVendorGlobalReviewColumnSortKeyType = exports.getTenantMerchantByMerchantId = exports.getVendorGlobalReviewView = exports.updateVendorGlobalReviewViewUIState = exports.updateSelectedGlobalMerchant = exports.fetchVendorGlobalReviewView = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.getGlobalMerchantView = exports.clearGlobalMerchantView = exports.updateCreateGlobalMerchantLocalData = exports.createGlobalMerchant = exports.fetchGlobalMerchantRecommendation = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.getDefaultSelectedTimeframeForScheduleType = exports.getFetchStateForScheduleListByType = void 0;
|
|
49
|
-
exports.
|
|
49
|
+
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = exports.getInviteFormView = exports.getReferralListView = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = void 0;
|
|
50
50
|
const zeniDayJS_1 = require("./zeniDayJS");
|
|
51
51
|
Object.defineProperty(exports, "Dayjs", { enumerable: true, get: function () { return zeniDayJS_1.Dayjs; } });
|
|
52
52
|
Object.defineProperty(exports, "updateZeniDateLocaleID", { enumerable: true, get: function () { return zeniDayJS_1.updateZeniDateLocaleID; } });
|
|
@@ -1376,7 +1376,3 @@ Object.defineProperty(exports, "saveReferralFormDataInLocalStore", { enumerable:
|
|
|
1376
1376
|
Object.defineProperty(exports, "resendReferralInvite", { enumerable: true, get: function () { return referralReducer_1.resendReferralInvite; } });
|
|
1377
1377
|
Object.defineProperty(exports, "updateReferralListSortUiState", { enumerable: true, get: function () { return referralReducer_1.updateReferralListSortUiState; } });
|
|
1378
1378
|
Object.defineProperty(exports, "fetchRewardsPlan", { enumerable: true, get: function () { return referralReducer_1.fetchRewardsPlan; } });
|
|
1379
|
-
const recurringViewHelper_1 = require("./view/common/recurringViewHelper");
|
|
1380
|
-
Object.defineProperty(exports, "getRecurringEndDateFromCount", { enumerable: true, get: function () { return recurringViewHelper_1.getRecurringEndDateFromCount; } });
|
|
1381
|
-
Object.defineProperty(exports, "toRecurringFrequency", { enumerable: true, get: function () { return recurringViewHelper_1.toRecurringFrequency; } });
|
|
1382
|
-
Object.defineProperty(exports, "getMinAllowedEndDate", { enumerable: true, get: function () { return recurringViewHelper_1.getMinAllowedEndDate; } });
|
package/lib/reducer.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ import { JESchedulesState } from './entity/jeSchedules/jeSchedulesState';
|
|
|
147
147
|
import { GlobalMerchantAutoCompleteState } from './view/globalMerchantView/globalMerchantAutoCompleteView/globalMerchantAutoCompleteViewState';
|
|
148
148
|
import { GlobalMerchantViewState } from './view/globalMerchantView/globalMerchantViewState';
|
|
149
149
|
import { AuditReportViewState } from './view/auditReportView/auditReportViewState';
|
|
150
|
-
import { TaskState } from './entity/task/
|
|
150
|
+
import { TaskState } from './entity/task/task';
|
|
151
151
|
import { TaskSummaryState } from './entity/taskSummary/taskSummaryState';
|
|
152
152
|
import { TaskListState } from './view/taskManager/taskListView/taskList';
|
|
153
153
|
import { TaskDetailViewState } from './view/taskManager/taskDetailView/taskDetail';
|
|
@@ -4,11 +4,11 @@ import { RootState } from '../../../../reducer';
|
|
|
4
4
|
import { fetchUserDetails, resetVendorDetailLocalData, saveVendor, saveVendorSuccessOrFailure, updateVendorDetailLocalData } from '../vendorViewReducer';
|
|
5
5
|
import { updateVendors } from '../../../../entity/vendor/vendorReducer';
|
|
6
6
|
import { updateAddresses } from '../../../../entity/address/addressReducer';
|
|
7
|
-
import { convertAmountToHomeCurrency, saveBillUpdatesToLocalStore } from '../../../spendManagement/billPay/editBillView/editBillViewReducer';
|
|
7
|
+
import { convertAmountToHomeCurrency, saveBillUpdatesToLocalStore, updateRecommendedVendorId } from '../../../spendManagement/billPay/editBillView/editBillViewReducer';
|
|
8
8
|
import { fetchPreviousBills } from '../../../spendManagement/billPay/previousBills/previousBillsReducer';
|
|
9
9
|
import { updateContacts } from '../../../../entity/billPay/contact/contactReducer';
|
|
10
10
|
import { updateBankAccounts } from '../../../../entity/bankAccount/bankAccountReducer';
|
|
11
11
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
12
12
|
import { updatePaymentInstruments } from '../../../../entity/paymentInstrument/paymentInstrumentReducer';
|
|
13
|
-
export declare type ActionType = ReturnType<typeof saveVendor> | ReturnType<typeof updateVendors> | ReturnType<typeof updateContacts> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof saveBillUpdatesToLocalStore> | ReturnType<typeof fetchPreviousBills> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveVendorSuccessOrFailure> | ReturnType<typeof resetVendorDetailLocalData> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateVendorDetailLocalData> | ReturnType<typeof fetchUserDetails> | ReturnType<typeof updatePaymentInstruments> | ReturnType<typeof convertAmountToHomeCurrency>;
|
|
13
|
+
export declare type ActionType = ReturnType<typeof saveVendor> | ReturnType<typeof updateVendors> | ReturnType<typeof updateContacts> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof saveBillUpdatesToLocalStore> | ReturnType<typeof fetchPreviousBills> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveVendorSuccessOrFailure> | ReturnType<typeof resetVendorDetailLocalData> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateVendorDetailLocalData> | ReturnType<typeof fetchUserDetails> | ReturnType<typeof updatePaymentInstruments> | ReturnType<typeof convertAmountToHomeCurrency> | ReturnType<typeof updateRecommendedVendorId>;
|
|
14
14
|
export declare const saveVendorEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -126,6 +126,7 @@ const saveVendorEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operator
|
|
|
126
126
|
else if (Boolean(tentativeVendorName) === true &&
|
|
127
127
|
tentativeVendorName === (updatedVendor === null || updatedVendor === void 0 ? void 0 : updatedVendor.name)) {
|
|
128
128
|
showVendorGptRecommendationText = true;
|
|
129
|
+
actions.push((0, editBillViewReducer_1.updateRecommendedVendorId)(updatedVendor === null || updatedVendor === void 0 ? void 0 : updatedVendor.id));
|
|
129
130
|
}
|
|
130
131
|
else {
|
|
131
132
|
showVendorGptRecommendationText =
|
|
@@ -19,7 +19,7 @@ const getRecommendationByLineIdFromRecommendationPayload = (recommendationPayloa
|
|
|
19
19
|
}
|
|
20
20
|
const recommendationsWithLine = {};
|
|
21
21
|
/* Note: Below case will happen only when we are fetching vendor recomemndations from a JE transaction line item.
|
|
22
|
-
|
|
22
|
+
And in such a case, we only want to update recommendation for that line.lineIds will always have a single element */
|
|
23
23
|
if (lineIds.length !== recommendationPayload.length) {
|
|
24
24
|
recommendationsWithLine[lineIds[0]] = (0, transactionPayload_1.transformRecommendation)(recommendationPayload[parseInt(lineIds[0])]);
|
|
25
25
|
}
|
|
@@ -14,7 +14,6 @@ import { Contact } from '../../../../entity/billPay/contact/contact';
|
|
|
14
14
|
import { RecurringBillFrequency, RecurringBillPaymentStatus, RecurringBillStatus } from '../../../../entity/billPay/recurringBills/recurringBillsState';
|
|
15
15
|
import { BillStage } from '../../../../entity/billPay/billTransaction/billTransactionState';
|
|
16
16
|
import { TransferMoneyParty } from '../../zeniAccounts/transferDetail/transferDetailState';
|
|
17
|
-
import { RecurringDatePickerOptions } from '../../../common/recurringViewHelper';
|
|
18
17
|
export interface EditBillDetail {
|
|
19
18
|
fetchStatus: FetchStateAndError;
|
|
20
19
|
saveStatus: FetchStateAndError;
|
|
@@ -105,7 +104,7 @@ export interface RecurringBillConfigLocalData {
|
|
|
105
104
|
startDate?: ZeniDate;
|
|
106
105
|
endDate?: ZeniDate;
|
|
107
106
|
currentInstance?: number;
|
|
108
|
-
endDateSelectorOptionType?:
|
|
107
|
+
endDateSelectorOptionType?: 'date' | 'payments';
|
|
109
108
|
isActive: boolean;
|
|
110
109
|
updateRecurringBills?: EditRecurringBillType;
|
|
111
110
|
}
|
|
@@ -81,8 +81,7 @@ const updateRecurringBillDetails = (currentRecurringConfig, prevRecurringConfig,
|
|
|
81
81
|
endDateSelectorOptionType === 'date')) {
|
|
82
82
|
currentTotalPayments = (0, exports.getTotalPayments)(startDate, endDate, frequency, currentInstance);
|
|
83
83
|
}
|
|
84
|
-
else if (endDate == null ||
|
|
85
|
-
endDateSelectorOptionType === 'recurringCount') {
|
|
84
|
+
else if (endDate == null || endDateSelectorOptionType === 'payments') {
|
|
86
85
|
currentEndDate = (0, exports.getEndDate)(startDate, frequency, totalPaymentCycles, currentInstance);
|
|
87
86
|
}
|
|
88
87
|
//editRecurringBill
|
|
@@ -22,14 +22,6 @@ const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
22
22
|
priority: task.priority.code,
|
|
23
23
|
tag: task.tag != null ? task.tag.code : undefined,
|
|
24
24
|
fileIds: task.fileIds,
|
|
25
|
-
type: task.type,
|
|
26
|
-
recurringFrequency: task.recurringFrequency,
|
|
27
|
-
recurringEndDateLocalData: {
|
|
28
|
-
recurringDatePickerOptionsType: 'date',
|
|
29
|
-
recurringEndDate: task.recurringEndDate,
|
|
30
|
-
},
|
|
31
|
-
savedRecurringEndDate: task.recurringEndDate,
|
|
32
|
-
recurringStartDate: task.recurringStartDate,
|
|
33
25
|
};
|
|
34
26
|
const actions = [
|
|
35
27
|
(0, taskDetailReducer_1.saveTaskUpdatesToLocalStore)({ taskDetailLocalData, taskId }),
|
|
@@ -8,7 +8,6 @@ const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
|
8
8
|
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
9
9
|
const taskSelector_1 = require("../../../../entity/task/taskSelector");
|
|
10
10
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
|
-
const formatZeniDateFY_1 = require("../../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
12
11
|
const saveTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.saveTaskDetail.match), (0, operators_1.mergeMap)((action) => {
|
|
13
12
|
const { taskId } = action.payload;
|
|
14
13
|
const state = state$.value;
|
|
@@ -59,7 +58,7 @@ const saveTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, oper
|
|
|
59
58
|
}));
|
|
60
59
|
exports.saveTaskDetailEpic = saveTaskDetailEpic;
|
|
61
60
|
const prepareTaskPayload = (state, taskId) => {
|
|
62
|
-
var _a, _b, _c, _d
|
|
61
|
+
var _a, _b, _c, _d;
|
|
63
62
|
const { taskDetailState, taskState } = state;
|
|
64
63
|
const syncToken = taskId != null ? (_b = (_a = (0, taskSelector_1.getTaskById)(taskState, taskId)) === null || _a === void 0 ? void 0 : _a.syncToken) !== null && _b !== void 0 ? _b : '' : '';
|
|
65
64
|
const sourceState = taskId != null
|
|
@@ -75,14 +74,6 @@ const prepareTaskPayload = (state, taskId) => {
|
|
|
75
74
|
status: localData.status,
|
|
76
75
|
tag: localData.tag,
|
|
77
76
|
file_ids: localData.fileIds,
|
|
78
|
-
type: localData.type.code,
|
|
79
|
-
recurring_end_date: localData.type.code === 'recurring'
|
|
80
|
-
? (_f = (_e = localData.savedRecurringEndDate) === null || _e === void 0 ? void 0 : _e.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)) !== null && _f !== void 0 ? _f : null
|
|
81
|
-
: null,
|
|
82
|
-
recurring_frequency: localData.type.code === 'recurring' ? localData.recurringFrequency : null,
|
|
83
|
-
recurring_start_date: localData.type.code === 'recurring'
|
|
84
|
-
? (_h = (_g = localData.recurringStartDate) === null || _g === void 0 ? void 0 : _g.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)) !== null && _h !== void 0 ? _h : null
|
|
85
|
-
: null,
|
|
86
77
|
sync_token: syncToken,
|
|
87
78
|
};
|
|
88
79
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import { TaskStatusCodeType, PriorityCodeType, TaskTagCodeType
|
|
2
|
+
import { TaskStatusCodeType, PriorityCodeType, TaskTagCodeType } from '../../../entity/task/task';
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
|
-
import { RecurringDatePickerOptions, RecurringFrequencyType } from '../../common/recurringViewHelper';
|
|
5
4
|
import { CommonHistoryView } from '../../spendManagement/commonHistoryView/commonHistory';
|
|
6
5
|
export interface TaskDetailViewState {
|
|
7
6
|
newTaskState: EditTaskDetail;
|
|
@@ -24,15 +23,6 @@ export interface EditTaskLocalData {
|
|
|
24
23
|
dueDate?: ZeniDate;
|
|
25
24
|
priority: PriorityCodeType;
|
|
26
25
|
tag?: TaskTagCodeType;
|
|
27
|
-
type: TaskType;
|
|
28
|
-
recurringEndDateLocalData: {
|
|
29
|
-
recurringDatePickerOptionsType?: RecurringDatePickerOptions;
|
|
30
|
-
recurringEndDate?: ZeniDate;
|
|
31
|
-
recurringCount?: number;
|
|
32
|
-
};
|
|
33
|
-
savedRecurringEndDate?: ZeniDate;
|
|
34
|
-
recurringFrequency?: RecurringFrequencyType;
|
|
35
|
-
recurringStartDate?: ZeniDate;
|
|
36
26
|
fileIds: ID[];
|
|
37
27
|
}
|
|
38
28
|
export declare const initialTaskDetail: EditTaskDetail;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
3
|
import { Class } from '../../../entity/class/classState';
|
|
4
|
-
import { TaskTag, TaskStatus, TaskPriority } from '../../../entity/task/
|
|
4
|
+
import { TaskTag, TaskStatus, TaskPriority } from '../../../entity/task/task';
|
|
5
5
|
import { RootState } from '../../../reducer';
|
|
6
6
|
import { File } from '../../../entity/file/fileState';
|
|
7
7
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
@@ -169,17 +169,13 @@ exports.allTaskPriority = [
|
|
|
169
169
|
const showFormFooter = (taskDetailLocalData, taskDetailInStore) => {
|
|
170
170
|
var _a, _b, _c;
|
|
171
171
|
if (taskDetailLocalData.name !== (taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.name) ||
|
|
172
|
-
taskDetailLocalData.description !== taskDetailInStore.description ||
|
|
173
|
-
taskDetailLocalData.priority !== taskDetailInStore.priority.code ||
|
|
174
|
-
taskDetailLocalData.status !== taskDetailInStore.status.code ||
|
|
175
|
-
!(0, isEqual_1.default)(taskDetailLocalData.tag, (_a = taskDetailInStore.tag) === null || _a === void 0 ? void 0 : _a.code) ||
|
|
172
|
+
taskDetailLocalData.description !== (taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.description) ||
|
|
173
|
+
taskDetailLocalData.priority !== (taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.priority.code) ||
|
|
174
|
+
taskDetailLocalData.status !== (taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.status.code) ||
|
|
175
|
+
!(0, isEqual_1.default)(taskDetailLocalData.tag, (_a = taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.tag) === null || _a === void 0 ? void 0 : _a.code) ||
|
|
176
176
|
!(0, isEqual_1.default)(taskDetailLocalData.assignee, (_b = taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.assignees) !== null && _b !== void 0 ? _b : []) ||
|
|
177
|
-
!(0, isEqual_1.default)(taskDetailLocalData.fileIds, (_c = taskDetailInStore.fileIds) !== null && _c !== void 0 ? _c : []) ||
|
|
178
|
-
!(0, isEqual_1.default)(taskDetailLocalData.dueDate, taskDetailInStore.dueDate)
|
|
179
|
-
!(0, isEqual_1.default)(taskDetailLocalData.type, taskDetailInStore.type) ||
|
|
180
|
-
!(0, isEqual_1.default)(taskDetailLocalData.savedRecurringEndDate, taskDetailInStore.recurringEndDate) ||
|
|
181
|
-
!(0, isEqual_1.default)(taskDetailLocalData.recurringFrequency, taskDetailInStore.recurringFrequency) ||
|
|
182
|
-
!(0, isEqual_1.default)(taskDetailLocalData.recurringStartDate, taskDetailInStore.recurringStartDate)) {
|
|
177
|
+
!(0, isEqual_1.default)(taskDetailLocalData.fileIds, (_c = taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.fileIds) !== null && _c !== void 0 ? _c : []) ||
|
|
178
|
+
!(0, isEqual_1.default)(taskDetailLocalData.dueDate, taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.dueDate)) {
|
|
183
179
|
return true;
|
|
184
180
|
}
|
|
185
181
|
return false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
|
-
import { Task } from '../../../entity/task/
|
|
2
|
+
import { Task } from '../../../entity/task/task';
|
|
3
3
|
import { RootState } from '../../../reducer';
|
|
4
4
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
5
5
|
import { TaskListFilters, TaskListUIState } from './taskList';
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getAllTasks = void 0;
|
|
7
7
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
8
8
|
const sortOrderPayload_1 = require("../../../commonPayloadTypes/sortOrderPayload");
|
|
9
|
-
const
|
|
9
|
+
const task_1 = require("../../../entity/task/task");
|
|
10
10
|
const taskSelector_1 = require("../../../entity/task/taskSelector");
|
|
11
11
|
const userAndRole_1 = require("../../companyView/types/userAndRole");
|
|
12
12
|
const userListViewSelector_1 = require("../../userListView/userListViewSelector");
|
|
@@ -41,7 +41,7 @@ const getAllTasks = (state) => {
|
|
|
41
41
|
case 'status':
|
|
42
42
|
return task.status.name;
|
|
43
43
|
case 'priority':
|
|
44
|
-
return
|
|
44
|
+
return task_1.ALL_PRORITY_CODE.indexOf(task.priority.code);
|
|
45
45
|
case 'createdBy':
|
|
46
46
|
return (_c = task.createdByUser) === null || _c === void 0 ? void 0 : _c.user.firstName;
|
|
47
47
|
case 'name':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.89",
|
|
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",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ZeniDate } from '../../zeniDayJS';
|
|
2
|
-
export declare const toRecurringFrequency: (v: string) => "weekly" | "monthly" | "biweekly" | "quarterly";
|
|
3
|
-
export declare const toRecurringFrequencyStrict: (v?: string | undefined) => "weekly" | "monthly" | "biweekly" | "quarterly" | undefined;
|
|
4
|
-
export declare type RecurringFrequencyType = NonNullable<ReturnType<typeof toRecurringFrequency>>;
|
|
5
|
-
export declare const toRecurringDatePickerOptions: (v: string) => "date" | "recurringCount";
|
|
6
|
-
export declare const toRecurringDatePickerOptionsStrict: (v?: string | undefined) => "date" | "recurringCount" | undefined;
|
|
7
|
-
export declare type RecurringDatePickerOptions = NonNullable<ReturnType<typeof toRecurringDatePickerOptions>>;
|
|
8
|
-
export declare const getRecurringFrequencyInDays: (frequency: RecurringFrequencyType) => number;
|
|
9
|
-
export declare const getRecurringEndDateFromCount: (startDate: ZeniDate, frequency: RecurringFrequencyType, recurringCount: number) => ZeniDate;
|
|
10
|
-
export declare const getMinAllowedEndDate: (frequency: RecurringFrequencyType, startDate?: import("dayjs").Dayjs | undefined) => ZeniDate | undefined;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMinAllowedEndDate = exports.getRecurringEndDateFromCount = exports.getRecurringFrequencyInDays = exports.toRecurringDatePickerOptionsStrict = exports.toRecurringDatePickerOptions = exports.toRecurringFrequencyStrict = exports.toRecurringFrequency = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
-
const ALL_RECURRING_FREQUENCY = [
|
|
6
|
-
'weekly',
|
|
7
|
-
'biweekly',
|
|
8
|
-
'monthly',
|
|
9
|
-
'quarterly',
|
|
10
|
-
];
|
|
11
|
-
const toRecurringFrequency = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_RECURRING_FREQUENCY);
|
|
12
|
-
exports.toRecurringFrequency = toRecurringFrequency;
|
|
13
|
-
const toRecurringFrequencyStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v !== null && v !== void 0 ? v : '', ALL_RECURRING_FREQUENCY);
|
|
14
|
-
exports.toRecurringFrequencyStrict = toRecurringFrequencyStrict;
|
|
15
|
-
const ALL_RECURRING_DATE_PICKER_OPTIONS = ['date', 'recurringCount'];
|
|
16
|
-
const toRecurringDatePickerOptions = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_RECURRING_DATE_PICKER_OPTIONS);
|
|
17
|
-
exports.toRecurringDatePickerOptions = toRecurringDatePickerOptions;
|
|
18
|
-
const toRecurringDatePickerOptionsStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v !== null && v !== void 0 ? v : '', ALL_RECURRING_DATE_PICKER_OPTIONS);
|
|
19
|
-
exports.toRecurringDatePickerOptionsStrict = toRecurringDatePickerOptionsStrict;
|
|
20
|
-
const getRecurringFrequencyInDays = (frequency) => {
|
|
21
|
-
switch (frequency) {
|
|
22
|
-
case 'weekly':
|
|
23
|
-
return 7;
|
|
24
|
-
case 'biweekly':
|
|
25
|
-
return 14;
|
|
26
|
-
case 'monthly':
|
|
27
|
-
return 30;
|
|
28
|
-
case 'quarterly':
|
|
29
|
-
return 90;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.getRecurringFrequencyInDays = getRecurringFrequencyInDays;
|
|
33
|
-
const getRecurringEndDateFromCount = (startDate, frequency, recurringCount) => {
|
|
34
|
-
let endDate = startDate;
|
|
35
|
-
switch (frequency) {
|
|
36
|
-
case 'weekly':
|
|
37
|
-
case 'biweekly':
|
|
38
|
-
endDate = startDate.add((0, exports.getRecurringFrequencyInDays)(frequency) * (recurringCount - 1), 'day');
|
|
39
|
-
break;
|
|
40
|
-
case 'monthly':
|
|
41
|
-
endDate = startDate.add(recurringCount - 1, 'month');
|
|
42
|
-
break;
|
|
43
|
-
case 'quarterly':
|
|
44
|
-
endDate = startDate.add(recurringCount - 1, 'quarter');
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
return endDate;
|
|
48
|
-
};
|
|
49
|
-
exports.getRecurringEndDateFromCount = getRecurringEndDateFromCount;
|
|
50
|
-
const getMinAllowedEndDate = (frequency, startDate) => {
|
|
51
|
-
if (startDate == null) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
switch (frequency) {
|
|
55
|
-
case 'weekly':
|
|
56
|
-
return startDate.add(7, 'day');
|
|
57
|
-
case 'biweekly':
|
|
58
|
-
return startDate.add(14, 'day');
|
|
59
|
-
case 'monthly':
|
|
60
|
-
return startDate.add(1, 'month');
|
|
61
|
-
case 'quarterly':
|
|
62
|
-
return startDate.add(1, 'quarter');
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
exports.getMinAllowedEndDate = getMinAllowedEndDate;
|