@zeniai/client-epic-state 5.2.94 → 5.2.95-betaGS6

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.
Files changed (104) hide show
  1. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +29 -1
  2. package/lib/entity/jeSchedules/jeSchedulesPayload.js +39 -0
  3. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +32 -1
  4. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +11 -0
  5. package/lib/entity/jeSchedules/jeSchedulesTypes.js +23 -1
  6. package/lib/entity/reconciliationReport/reconciliationReportPayload.d.ts +1 -0
  7. package/lib/entity/reconciliationReport/reconciliationReportReducer.js +1 -0
  8. package/lib/entity/reconciliationReport/reconciliationReportState.d.ts +4 -2
  9. package/lib/entity/reconciliationReport/reconciliationReportState.js +4 -1
  10. package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
  11. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +3 -3
  12. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +2 -2
  13. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
  14. package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
  15. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
  16. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  17. package/lib/entity/tenant/tenantReducer.d.ts +32 -30
  18. package/lib/entity/tenant/tenantReducer.js +13 -2
  19. package/lib/entity/tenant/tenantState.d.ts +1 -0
  20. package/lib/entity/tenant/tenantTypes.d.ts +1 -1
  21. package/lib/entity/tenant/tenantTypes.js +1 -0
  22. package/lib/epic.d.ts +8 -1
  23. package/lib/epic.js +14 -0
  24. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +39 -1
  25. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +18 -0
  26. package/lib/esm/entity/reconciliationReport/reconciliationReportReducer.js +1 -0
  27. package/lib/esm/entity/reconciliationReport/reconciliationReportState.js +4 -1
  28. package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +2 -2
  29. package/lib/esm/entity/tenant/tenantReducer.js +13 -2
  30. package/lib/esm/entity/tenant/tenantTypes.js +1 -0
  31. package/lib/esm/epic.js +14 -0
  32. package/lib/esm/index.js +9 -4
  33. package/lib/esm/reducer.js +3 -0
  34. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +9 -4
  35. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/compensation/createCompensationAccrualEpic.js +97 -0
  36. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/compensation/deletePayrollCycleEpic.js +20 -0
  37. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/compensation/fetchCompensationAccrualsEpic.js +45 -0
  38. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/compensation/fetchCompensationPageEpic.js +16 -0
  39. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/compensation/fetchPayrollCyclesEpic.js +18 -0
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/compensation/promoteCompensationAccrualEpic.js +52 -0
  41. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/compensation/upsertPayrollCycleEpic.js +32 -0
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +6 -2
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +7 -0
  44. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +18 -7
  45. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +4 -4
  46. package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
  47. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +13 -1
  48. package/lib/esm/view/expenseAutomationView/payload/compensationPayload.js +178 -0
  49. package/lib/esm/view/expenseAutomationView/reducers/compensationViewReducer.js +203 -0
  50. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +11 -1
  51. package/lib/esm/view/expenseAutomationView/selectorTypes/compensationViewSelectorTypes.js +1 -0
  52. package/lib/esm/view/expenseAutomationView/selectors/compensationViewSelector.js +104 -0
  53. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -3
  54. package/lib/esm/view/expenseAutomationView/types/compensationViewState.js +2 -0
  55. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +9 -0
  56. package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +5 -7
  57. package/lib/index.d.ts +12 -5
  58. package/lib/index.js +84 -49
  59. package/lib/reducer.d.ts +1 -0
  60. package/lib/reducer.js +3 -0
  61. package/lib/rootStateTypes.d.ts +2 -0
  62. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +9 -4
  63. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/createCompensationAccrualEpic.d.ts +10 -0
  64. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/createCompensationAccrualEpic.js +101 -0
  65. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/deletePayrollCycleEpic.d.ts +9 -0
  66. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/deletePayrollCycleEpic.js +24 -0
  67. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/fetchCompensationAccrualsEpic.d.ts +9 -0
  68. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/fetchCompensationAccrualsEpic.js +49 -0
  69. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/fetchCompensationPageEpic.d.ts +7 -0
  70. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/fetchCompensationPageEpic.js +20 -0
  71. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/fetchPayrollCyclesEpic.d.ts +8 -0
  72. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/fetchPayrollCyclesEpic.js +22 -0
  73. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/promoteCompensationAccrualEpic.d.ts +13 -0
  74. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/promoteCompensationAccrualEpic.js +56 -0
  75. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/upsertPayrollCycleEpic.d.ts +9 -0
  76. package/lib/view/expenseAutomationView/epics/jeSchedule/compensation/upsertPayrollCycleEpic.js +36 -0
  77. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -1
  78. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +6 -2
  79. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +2 -1
  80. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +7 -0
  81. package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +2 -1
  82. package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +17 -6
  83. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +3 -3
  84. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -1
  85. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
  86. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +13 -1
  87. package/lib/view/expenseAutomationView/payload/compensationPayload.d.ts +120 -0
  88. package/lib/view/expenseAutomationView/payload/compensationPayload.js +186 -0
  89. package/lib/view/expenseAutomationView/reducers/compensationViewReducer.d.ts +50 -0
  90. package/lib/view/expenseAutomationView/reducers/compensationViewReducer.js +207 -0
  91. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +6 -5
  92. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +11 -1
  93. package/lib/view/expenseAutomationView/selectorTypes/compensationViewSelectorTypes.d.ts +44 -0
  94. package/lib/view/expenseAutomationView/selectorTypes/compensationViewSelectorTypes.js +2 -0
  95. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
  96. package/lib/view/expenseAutomationView/selectors/compensationViewSelector.d.ts +12 -0
  97. package/lib/view/expenseAutomationView/selectors/compensationViewSelector.js +109 -0
  98. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -2
  99. package/lib/view/expenseAutomationView/types/compensationViewState.d.ts +127 -0
  100. package/lib/view/expenseAutomationView/types/compensationViewState.js +5 -0
  101. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -1
  102. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +11 -1
  103. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +5 -7
  104. package/package.json +1 -1
@@ -7,7 +7,7 @@ import { TransactionIDPayload } from '../transaction/payloadTypes/transactionIDP
7
7
  import { TransactionCategory } from '../transaction/stateTypes/transactionType';
8
8
  import { UserPayload } from '../user/userPayload';
9
9
  import { VendorPayload } from '../vendor/vendorPayload';
10
- import { JEAccruedScheduledTransactionState, JEOneTimeAccrualState, JEScheduledTransactionState, ScheduledJournalEntryState } from './jeSchedulesState';
10
+ import { CompensationAccrualDetails, JEAccruedScheduledTransactionState, JEOneTimeAccrualState, JEScheduledTransactionState, ScheduledJournalEntryState } from './jeSchedulesState';
11
11
  import { JEScheduleKey, JEScheduleTransactionKey } from './jeSchedulesTypes';
12
12
  export interface JEScheduleOtherAttributesPayload {
13
13
  asset_id?: string | null;
@@ -155,6 +155,25 @@ export interface JEOneTimeAccrualMatchSuggestionPayload {
155
155
  matched_transaction_type?: string | null;
156
156
  resolution?: string | null;
157
157
  }
158
+ export interface CompensationAccrualLinePayload {
159
+ account_id: ID | null;
160
+ account_name: string;
161
+ amount: number;
162
+ accounting_class_id?: ID | null;
163
+ accounting_class_name?: string | null;
164
+ daily_rate?: number | null;
165
+ }
166
+ export interface CompensationPayPeriodPayload {
167
+ day_count_policy: string;
168
+ end: string;
169
+ period_len_days: number;
170
+ start: string;
171
+ }
172
+ export interface CompensationUncoveredPayload {
173
+ days: number;
174
+ end: string;
175
+ start: string;
176
+ }
158
177
  export interface JEOneTimeAccrualPayload {
159
178
  _id: ID;
160
179
  estimated_amount: number;
@@ -163,6 +182,7 @@ export interface JEOneTimeAccrualPayload {
163
182
  status: string;
164
183
  vendor_id: ID;
165
184
  vendor_name: string;
185
+ accrual_type?: string | null;
166
186
  actual_post_date?: string | null;
167
187
  actual_reversal_post_date?: string | null;
168
188
  ai_suggestion?: JEOneTimeAccrualAiSuggestionPayload | null;
@@ -180,8 +200,12 @@ export interface JEOneTimeAccrualPayload {
180
200
  je_debit_account_name?: string | null;
181
201
  je_debit_accounting_class_id?: ID | null;
182
202
  je_debit_accounting_class_name?: string | null;
203
+ lines?: CompensationAccrualLinePayload[] | null;
183
204
  match_suggestion?: JEOneTimeAccrualMatchSuggestionPayload | null;
184
205
  memo?: string | null;
206
+ pay_group_id?: ID | null;
207
+ pay_group_name?: string | null;
208
+ pay_period?: CompensationPayPeriodPayload | null;
185
209
  posting_date?: string | null;
186
210
  profile_snapshot?: JEOneTimeAccrualProfileSnapshotPayload | null;
187
211
  reversal_policy?: string | null;
@@ -190,8 +214,11 @@ export interface JEOneTimeAccrualPayload {
190
214
  reversal_transaction_integration_id?: ID | null;
191
215
  reversal_trigger?: string | null;
192
216
  reversed_by_user?: UserPayload | null;
217
+ review_reasons?: string[] | null;
218
+ source?: string | null;
193
219
  transaction_id?: ID | null;
194
220
  transaction_integration_id?: ID | null;
221
+ uncovered?: CompensationUncoveredPayload | null;
195
222
  }
196
223
  export interface ScheduledJournalEntryPayload {
197
224
  actual_post_date: string | null;
@@ -223,4 +250,5 @@ export declare function getJEScheduleTransactionDetailKeyPayload(payload: Schedu
223
250
  export declare function getJEScheduleKey(payload: JEAccruedScheduledTransactionPayload): JEScheduleKey;
224
251
  export declare function toJEScheduledTransaction(payload: JEScheduledTransactionPayload): JEScheduledTransactionState;
225
252
  export declare function toJEAccruedScheduledTransaction(payload: JEAccruedScheduledTransactionPayload): JEAccruedScheduledTransactionState;
253
+ export declare function toCompensationAccrual(payload: JEOneTimeAccrualPayload): CompensationAccrualDetails | undefined;
226
254
  export declare function toJEOneTimeAccrual(payload: JEOneTimeAccrualPayload): JEOneTimeAccrualState;
@@ -8,6 +8,7 @@ exports.getJEScheduleTransactionDetailKeyPayload = getJEScheduleTransactionDetai
8
8
  exports.getJEScheduleKey = getJEScheduleKey;
9
9
  exports.toJEScheduledTransaction = toJEScheduledTransaction;
10
10
  exports.toJEAccruedScheduledTransaction = toJEAccruedScheduledTransaction;
11
+ exports.toCompensationAccrual = toCompensationAccrual;
11
12
  exports.toJEOneTimeAccrual = toJEOneTimeAccrual;
12
13
  const amount_1 = require("../../commonStateTypes/amount");
13
14
  const timePeriod_1 = require("../../commonStateTypes/timePeriod");
@@ -503,9 +504,47 @@ function toJEOneTimeAccrualMatchSuggestion(payload, currencyCode) {
503
504
  matchedTransactionSyncToken: payload.matched_transaction_sync_token ?? undefined,
504
505
  };
505
506
  }
507
+ function toCompensationAccrual(payload) {
508
+ if (payload.accrual_type !== 'compensation_accrual' ||
509
+ payload.pay_group_id == null ||
510
+ payload.pay_period == null ||
511
+ payload.uncovered == null) {
512
+ return undefined;
513
+ }
514
+ return {
515
+ payGroupId: payload.pay_group_id,
516
+ payGroupName: payload.pay_group_name ?? payload.vendor_name,
517
+ source: (0, jeSchedulesTypes_1.toPayrollCycleSourceType)(payload.source ?? 'manual'),
518
+ payPeriod: {
519
+ start: payload.pay_period.start,
520
+ end: payload.pay_period.end,
521
+ dayCountPolicy: (0, jeSchedulesTypes_1.toDayCountPolicyType)(payload.pay_period.day_count_policy),
522
+ periodLenDays: payload.pay_period.period_len_days,
523
+ },
524
+ uncovered: {
525
+ start: payload.uncovered.start,
526
+ end: payload.uncovered.end,
527
+ days: payload.uncovered.days,
528
+ },
529
+ reviewReasons: payload.review_reasons ?? [],
530
+ lines: (payload.lines ?? []).map((line) => ({
531
+ // An agent draft for an unmapped pay group carries no account yet.
532
+ accountId: line.account_id ?? '',
533
+ accountName: line.account_name,
534
+ amount: line.amount,
535
+ accountingClassId: line.accounting_class_id ?? undefined,
536
+ accountingClassName: line.accounting_class_name ?? undefined,
537
+ dailyRate: line.daily_rate ?? undefined,
538
+ })),
539
+ };
540
+ }
506
541
  function toJEOneTimeAccrual(payload) {
507
542
  return {
508
543
  accrualId: payload._id,
544
+ accrualType: payload.accrual_type != null
545
+ ? (0, jeSchedulesTypes_1.toOneTimeAccrualType)(payload.accrual_type)
546
+ : undefined,
547
+ compensation: toCompensationAccrual(payload),
509
548
  vendorId: payload.vendor_id,
510
549
  vendorName: payload.vendor_name,
511
550
  serviceMonth: payload.service_month,
@@ -4,7 +4,7 @@ import { ScheduleDaysOfMonth } from '../../commonStateTypes/timePeriod';
4
4
  import { ZeniDate } from '../../zeniDayJS';
5
5
  import { ZeniUrl as Url } from '../../zeniUrl';
6
6
  import { TransactionID } from '../transaction/stateTypes/transactionID';
7
- import { JEOneTimeAccrualKey, JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, OneTimeAccrualAutomationTierType, OneTimeAccrualOriginType, OneTimeAccrualReversalPolicyType, OneTimeAccrualReversalTriggerType, OneTimeAccrualStatusCodeType, ScheduleJournalEntryStatusCodeType, ScheduleStatusCodeType, ScheduleTypes } from './jeSchedulesTypes';
7
+ import { DayCountPolicyType, JEOneTimeAccrualKey, JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, OneTimeAccrualAutomationTierType, OneTimeAccrualOriginType, OneTimeAccrualReversalPolicyType, OneTimeAccrualReversalTriggerType, OneTimeAccrualStatusCodeType, OneTimeAccrualType, PayrollCycleSourceType, ScheduleJournalEntryStatusCodeType, ScheduleStatusCodeType, ScheduleTypes } from './jeSchedulesTypes';
8
8
  export interface ScheduleStatus {
9
9
  code: ScheduleStatusCodeType;
10
10
  label: string;
@@ -234,6 +234,35 @@ export interface JEOneTimeAccrualMatchSuggestion {
234
234
  matchTier?: string;
235
235
  resolution?: string;
236
236
  }
237
+ export interface CompensationAccrualLine {
238
+ accountId: ID;
239
+ accountName: string;
240
+ amount: number;
241
+ accountingClassId?: ID;
242
+ accountingClassName?: string;
243
+ dailyRate?: number;
244
+ }
245
+ export interface CompensationPayPeriod {
246
+ dayCountPolicy: DayCountPolicyType;
247
+ end: string;
248
+ periodLenDays: number;
249
+ start: string;
250
+ }
251
+ export interface CompensationUncovered {
252
+ days: number;
253
+ end: string;
254
+ start: string;
255
+ }
256
+ /** Payroll-specific detail on a compensation accrual; undefined on vendor accruals. */
257
+ export interface CompensationAccrualDetails {
258
+ lines: CompensationAccrualLine[];
259
+ payGroupId: ID;
260
+ payGroupName: string;
261
+ payPeriod: CompensationPayPeriod;
262
+ reviewReasons: string[];
263
+ source: PayrollCycleSourceType;
264
+ uncovered: CompensationUncovered;
265
+ }
237
266
  export interface JEOneTimeAccrualState {
238
267
  accrualId: ID;
239
268
  accrualStatus: OneTimeAccrualStatusCodeType;
@@ -249,11 +278,13 @@ export interface JEOneTimeAccrualState {
249
278
  serviceMonth: string;
250
279
  vendorId: ID;
251
280
  vendorName: string;
281
+ accrualType?: OneTimeAccrualType;
252
282
  actualPostDate?: ZeniDate;
253
283
  actualReversalPostDate?: ZeniDate;
254
284
  aiSuggestion?: JEOneTimeAccrualAiSuggestion;
255
285
  automationTier?: OneTimeAccrualAutomationTierType;
256
286
  cleared?: JEOneTimeAccrualCleared;
287
+ compensation?: CompensationAccrualDetails;
257
288
  createdBy?: JEOneTimeAccrualCreator;
258
289
  expectedReversalDate?: ZeniDate;
259
290
  jeCreditAccountId?: ID;
@@ -25,6 +25,17 @@ export declare const toOneTimeAccrualReversalPolicyType: (v: string) => "on_bill
25
25
  export type OneTimeAccrualReversalPolicyType = ReturnType<typeof toOneTimeAccrualReversalPolicyType>;
26
26
  export declare const toOneTimeAccrualReversalTriggerType: (v?: string) => "scheduled_date" | "bill_match" | "manual_reverse" | undefined;
27
27
  export type OneTimeAccrualReversalTriggerType = ReturnType<typeof toOneTimeAccrualReversalTriggerType>;
28
+ export declare const toOneTimeAccrualType: (v: string) => "vendor_accrual" | "compensation_accrual";
29
+ export type OneTimeAccrualType = ReturnType<typeof toOneTimeAccrualType>;
30
+ export declare const PAY_CADENCES: readonly ["weekly", "biweekly", "semimonthly", "monthly"];
31
+ export declare const toPayCadenceType: (v: string) => "weekly" | "biweekly" | "semimonthly" | "monthly";
32
+ export type PayCadenceType = ReturnType<typeof toPayCadenceType>;
33
+ export declare const DAY_COUNT_POLICIES: readonly ["calendar", "business"];
34
+ export declare const toDayCountPolicyType: (v: string) => "calendar" | "business";
35
+ export type DayCountPolicyType = ReturnType<typeof toDayCountPolicyType>;
36
+ export declare const PAYROLL_CYCLE_SOURCES: readonly ["gusto", "manual"];
37
+ export declare const toPayrollCycleSourceType: (v: string) => "manual" | "gusto";
38
+ export type PayrollCycleSourceType = ReturnType<typeof toPayrollCycleSourceType>;
28
39
  export declare const toOneTimeAccrualIgnoreReasonType: (v: string) => "no_activity" | "paused" | "too_small" | "need_invoice" | "other_ignore";
29
40
  export type OneTimeAccrualIgnoreReasonType = ReturnType<typeof toOneTimeAccrualIgnoreReasonType>;
30
41
  export declare const ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS: readonly OneTimeAccrualIgnoreReasonType[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toJournalEntryErrorCodeType = exports.ALL_ONE_TIME_ACCRUAL_REVERT_REASONS = exports.toOneTimeAccrualRevertReasonType = exports.ALL_JE_SCHEDULE_REVERT_REASONS = exports.toJEScheduleRevertReasonType = exports.ALL_JE_SCHEDULE_IGNORE_REASONS = exports.toJEScheduleIgnoreReasonType = exports.ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS = exports.toOneTimeAccrualIgnoreReasonType = exports.toOneTimeAccrualReversalTriggerType = exports.toOneTimeAccrualReversalPolicyType = exports.toOneTimeAccrualAutomationTierType = exports.toOneTimeAccrualOriginType = exports.toOneTimeAccrualStatusCodeType = exports.toScheduleStatusCodeType = exports.toScheduleJournalEntryStatusCodeType = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.ALL_SCHEDULES_TYPES = exports.getJEScheduleTransactionKey = void 0;
3
+ exports.toJournalEntryErrorCodeType = exports.ALL_ONE_TIME_ACCRUAL_REVERT_REASONS = exports.toOneTimeAccrualRevertReasonType = exports.ALL_JE_SCHEDULE_REVERT_REASONS = exports.toJEScheduleRevertReasonType = exports.ALL_JE_SCHEDULE_IGNORE_REASONS = exports.toJEScheduleIgnoreReasonType = exports.ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS = exports.toOneTimeAccrualIgnoreReasonType = exports.toPayrollCycleSourceType = exports.PAYROLL_CYCLE_SOURCES = exports.toDayCountPolicyType = exports.DAY_COUNT_POLICIES = exports.toPayCadenceType = exports.PAY_CADENCES = exports.toOneTimeAccrualType = exports.toOneTimeAccrualReversalTriggerType = exports.toOneTimeAccrualReversalPolicyType = exports.toOneTimeAccrualAutomationTierType = exports.toOneTimeAccrualOriginType = exports.toOneTimeAccrualStatusCodeType = exports.toScheduleStatusCodeType = exports.toScheduleJournalEntryStatusCodeType = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.ALL_SCHEDULES_TYPES = exports.getJEScheduleTransactionKey = void 0;
4
4
  const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
5
5
  const getJEScheduleTransactionKey = (scheduleTransactionId) => `${scheduleTransactionId.id}_${scheduleTransactionId.type}_${scheduleTransactionId.lineId}`;
6
6
  exports.getJEScheduleTransactionKey = getJEScheduleTransactionKey;
@@ -79,6 +79,28 @@ const ONE_TIME_ACCRUAL_REVERSAL_TRIGGER = [
79
79
  ];
80
80
  const toOneTimeAccrualReversalTriggerType = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '', ONE_TIME_ACCRUAL_REVERSAL_TRIGGER);
81
81
  exports.toOneTimeAccrualReversalTriggerType = toOneTimeAccrualReversalTriggerType;
82
+ // Discriminates a vendor (bill-driven) accrual from a payroll compensation accrual. Absent on
83
+ // older vendor documents, so the mapper leaves it undefined rather than defaulting.
84
+ const ONE_TIME_ACCRUAL_TYPE = [
85
+ 'vendor_accrual',
86
+ 'compensation_accrual',
87
+ ];
88
+ const toOneTimeAccrualType = (v) => (0, stringToUnion_1.stringToUnion)(v, ONE_TIME_ACCRUAL_TYPE);
89
+ exports.toOneTimeAccrualType = toOneTimeAccrualType;
90
+ exports.PAY_CADENCES = [
91
+ 'weekly',
92
+ 'biweekly',
93
+ 'semimonthly',
94
+ 'monthly',
95
+ ];
96
+ const toPayCadenceType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.PAY_CADENCES);
97
+ exports.toPayCadenceType = toPayCadenceType;
98
+ exports.DAY_COUNT_POLICIES = ['calendar', 'business'];
99
+ const toDayCountPolicyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.DAY_COUNT_POLICIES);
100
+ exports.toDayCountPolicyType = toDayCountPolicyType;
101
+ exports.PAYROLL_CYCLE_SOURCES = ['gusto', 'manual'];
102
+ const toPayrollCycleSourceType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.PAYROLL_CYCLE_SOURCES);
103
+ exports.toPayrollCycleSourceType = toPayrollCycleSourceType;
82
104
  // Why a human told the AI Accountant not to accrue this month. The gateway validates against
83
105
  // exactly this set, so it is a union rather than a free-text string.
84
106
  const ONE_TIME_ACCRUAL_IGNORE_REASON = [
@@ -34,6 +34,7 @@ export interface ReconciliationReportTransactionRowPayload {
34
34
  date?: string | null;
35
35
  gl_account?: string | null;
36
36
  issue_date?: string | null;
37
+ qbo_id?: string | null;
37
38
  transaction_id?: ID | null;
38
39
  }
39
40
  export interface ReconciliationReportBucketPayload {
@@ -54,6 +54,7 @@ function mapCountAmount(payload, currency) {
54
54
  function mapTransactionRow(payload, currency) {
55
55
  return {
56
56
  transactionId: payload.transaction_id ?? undefined,
57
+ qboId: payload.qbo_id ?? undefined,
57
58
  date: toOptionalDate(payload.date),
58
59
  type: payload.type,
59
60
  payee: payload.payee,
@@ -5,8 +5,9 @@ import { ReconciliationStatusCodeType } from '../accountRecon/accountReconState'
5
5
  declare const RECONCILIATION_REPORT_MATCH_TYPE: readonly ["automatic", "manual"];
6
6
  export type ReconciliationReportMatchType = (typeof RECONCILIATION_REPORT_MATCH_TYPE)[number];
7
7
  export declare const toReconciliationReportMatchType: (value: string) => ReconciliationReportMatchType;
8
- export declare const toReconciliationReportDataSource: (value: string) => "Statement" | "Plaid";
9
- export type ReconciliationReportDataSource = ReturnType<typeof toReconciliationReportDataSource>;
8
+ declare const RECONCILIATION_REPORT_DATA_SOURCE: readonly ["bank_statement", "plaid"];
9
+ export type ReconciliationReportDataSource = (typeof RECONCILIATION_REPORT_DATA_SOURCE)[number];
10
+ export declare const toReconciliationReportDataSource: (value: string) => ReconciliationReportDataSource;
10
11
  export interface ReconciliationReportAccount {
11
12
  accountId: ID;
12
13
  accountName?: string;
@@ -44,6 +45,7 @@ export interface ReconciliationReportTransactionRow {
44
45
  date?: ZeniDate;
45
46
  glAccount?: string;
46
47
  issueDate?: ZeniDate;
48
+ qboId?: string;
47
49
  transactionId?: ID;
48
50
  }
49
51
  export interface ReconciliationReportBucket {
@@ -10,6 +10,9 @@ const toReconciliationReportMatchType = (value) => {
10
10
  return (0, stringToUnion_1.stringToUnion)(value, RECONCILIATION_REPORT_MATCH_TYPE);
11
11
  };
12
12
  exports.toReconciliationReportMatchType = toReconciliationReportMatchType;
13
- const RECONCILIATION_REPORT_DATA_SOURCE = ['Statement', 'Plaid'];
13
+ const RECONCILIATION_REPORT_DATA_SOURCE = [
14
+ 'bank_statement',
15
+ 'plaid',
16
+ ];
14
17
  const toReconciliationReportDataSource = (value) => (0, stringToUnion_1.stringToUnion)(value, RECONCILIATION_REPORT_DATA_SOURCE);
15
18
  exports.toReconciliationReportDataSource = toReconciliationReportDataSource;
@@ -7,7 +7,7 @@ export declare const deleteConnectionEpic: (actions$: ActionsObservable<ActionTy
7
7
  payload: {
8
8
  tenantId: string;
9
9
  connectionId: string;
10
- connectionType: "revenue" | "email" | "payments";
10
+ connectionType: "revenue" | "email" | "payroll" | "payments";
11
11
  };
12
12
  type: "tenant/deleteConnectionSuccess";
13
13
  } | {
@@ -1,20 +1,20 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { RootState } from '../../../rootStateTypes';
3
3
  import { ZeniAPI } from '../../../zeniAPI';
4
- import { initEmailConnectOAuth, initEmailConnectOAuthFailure, initEmailConnectOAuthSuccess } from '../tenantReducer';
4
+ import { ConnectorOAuthProvider, initEmailConnectOAuth, initEmailConnectOAuthFailure, initEmailConnectOAuthSuccess } from '../tenantReducer';
5
5
  export type ActionType = ReturnType<typeof initEmailConnectOAuth> | ReturnType<typeof initEmailConnectOAuthSuccess> | ReturnType<typeof initEmailConnectOAuthFailure>;
6
6
  export type NavigateFn = (url: string) => void;
7
7
  export declare const initEmailConnectOAuthEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI, navigate?: NavigateFn) => import("rxjs").Observable<{
8
8
  payload: {
9
9
  tenantId: string;
10
- provider: "gmail" | "outlook";
10
+ provider: ConnectorOAuthProvider;
11
11
  authorizationUrl: string;
12
12
  };
13
13
  type: "tenant/initEmailConnectOAuthSuccess";
14
14
  } | {
15
15
  payload: {
16
16
  tenantId: string;
17
- provider: "gmail" | "outlook";
17
+ provider: ConnectorOAuthProvider;
18
18
  status: import("../../../zeniAPIStatus").ZeniAPIStatus<Record<string, unknown>>;
19
19
  };
20
20
  type: "tenant/initEmailConnectOAuthFailure";
@@ -14,7 +14,7 @@ const defaultNavigate = (url) => {
14
14
  window.location.href = url;
15
15
  }
16
16
  };
17
- // Backs the new POST /1.0/connectors/email/<provider>/init endpoint on the
17
+ // Backs the POST /1.0/connectors/<provider>/init endpoint on the
18
18
  // auth service. The endpoint creates a CSRF state token in the auth NDB
19
19
  // store and returns the provider's authorization_url; this epic then drives
20
20
  // a full-page redirect so the user lands on Google's / Microsoft's consent
@@ -31,7 +31,7 @@ navigate = defaultNavigate) => actions$.pipe((0, operators_1.filter)(tenantReduc
31
31
  // the gmail provider's `saveConnectorCredentialsStateBySlug` in
32
32
  // `In-Progress` forever. groupBy gives each provider its own stream.
33
33
  (0, operators_1.groupBy)((action) => action.payload.provider), (0, operators_1.mergeMap)((perProvider$) => perProvider$.pipe((0, operators_1.switchMap)((action) => zeniAPI
34
- .postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors/email/${action.payload.provider}/init`, { redirect_after_url: action.payload.redirectAfterUrl }, { 'zeni-tenant-id': action.payload.tenantId })
34
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors/${action.payload.provider}/init`, { redirect_after_url: action.payload.redirectAfterUrl }, { 'zeni-tenant-id': action.payload.tenantId })
35
35
  .pipe((0, operators_1.mergeMap)((response) => {
36
36
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
37
37
  // Fire-and-forget side effect — once the browser navigates,
@@ -6,7 +6,7 @@ export type ActionType = ReturnType<typeof saveAPIKeyConnection> | ReturnType<ty
6
6
  export declare const saveAPIKeyConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
7
  payload: {
8
8
  tenantId: string;
9
- connectionType: "revenue" | "email" | "payments";
9
+ connectionType: "revenue" | "email" | "payroll" | "payments";
10
10
  connectionPayload: import("../tenantPayload").ConnectionDataPayload;
11
11
  };
12
12
  type: "tenant/saveAPIKeyConnectionSuccess";
@@ -6,15 +6,15 @@ export type ActionType = ReturnType<typeof saveConnectorCredentials> | ReturnTyp
6
6
  export declare const saveConnectorCredentialsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
7
  payload: {
8
8
  tenantId: string;
9
- connectionType: "revenue" | "email" | "payments";
10
- connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
9
+ connectionType: "revenue" | "email" | "payroll" | "payments";
10
+ connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
11
11
  connectionPayload: import("../tenantPayload").ConnectionDataPayload;
12
12
  };
13
13
  type: "tenant/saveConnectorCredentialsSuccess";
14
14
  } | {
15
15
  payload: {
16
16
  tenantId: string;
17
- connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
17
+ connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
18
18
  status: import("../../../zeniAPIStatus").ZeniAPIStatus<Record<string, unknown>>;
19
19
  };
20
20
  type: "tenant/saveConnectorCredentialsFailure";
@@ -6,7 +6,7 @@ export type ActionType = ReturnType<typeof saveOAuthConnection> | ReturnType<typ
6
6
  export declare const saveOAuthConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
7
  payload: {
8
8
  tenantId: string;
9
- connectionType: "revenue" | "email" | "payments";
9
+ connectionType: "revenue" | "email" | "payroll" | "payments";
10
10
  connectionPayload: import("../tenantPayload").ConnectionDataPayload;
11
11
  };
12
12
  type: "tenant/saveOAuthConnectionSuccess";
@@ -164,6 +164,7 @@ interface ConnectionsPayload {
164
164
  accounting: ConnectionDataPayload[];
165
165
  payments: ConnectionDataPayload[];
166
166
  email?: ConnectionDataPayload[];
167
+ payroll?: ConnectionDataPayload[];
167
168
  revenue?: ConnectionDataPayload[];
168
169
  };
169
170
  }
@@ -13,8 +13,9 @@ export interface DoSignInPayload {
13
13
  redirectUri: ZeniUrl;
14
14
  sourceUri: ZeniUrl;
15
15
  }
16
- export declare const toExternalIntegrationType: (v: string) => "revenue" | "email" | "payments";
16
+ export declare const toExternalIntegrationType: (v: string) => "revenue" | "email" | "payroll" | "payments";
17
17
  export type ExternalIntegrationType = ReturnType<typeof toExternalIntegrationType>;
18
+ export type ConnectorOAuthProvider = 'gmail' | 'outlook' | 'gusto';
18
19
  export type ConnectorCredentialsBySlug = {
19
20
  connectionName: 'stripe';
20
21
  credentials: {
@@ -99,26 +100,26 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
99
100
  }, "tenant/fetchExternalConnectionsFailure", never, never>, fetchExternalConnectionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, externalConnections: ConnectionsPayload], {
100
101
  tenantId: string;
101
102
  externalConnections: ConnectionsPayload;
102
- }, "tenant/fetchExternalConnectionsSuccess", never, never>, saveAPIKeyConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", credentials: {
103
+ }, "tenant/fetchExternalConnectionsSuccess", never, never>, saveAPIKeyConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", credentials: {
103
104
  api_key: string;
104
105
  site: string;
105
106
  }], {
106
107
  tenantId: string;
107
108
  connectionId: string;
108
- connectionType: "revenue" | "email" | "payments";
109
- connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
109
+ connectionType: "revenue" | "email" | "payroll" | "payments";
110
+ connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
110
111
  credentials: {
111
112
  api_key: string;
112
113
  site: string;
113
114
  };
114
- }, "tenant/saveAPIKeyConnection", never, never>, saveAPIKeyConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payments", connectionPayload: ConnectionDataPayload], {
115
+ }, "tenant/saveAPIKeyConnection", never, never>, saveAPIKeyConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionPayload: ConnectionDataPayload], {
115
116
  tenantId: string;
116
- connectionType: "revenue" | "email" | "payments";
117
+ connectionType: "revenue" | "email" | "payroll" | "payments";
117
118
  connectionPayload: ConnectionDataPayload;
118
119
  }, "tenant/saveAPIKeyConnectionSuccess", never, never>, saveAPIKeyConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
119
120
  tenantId: string;
120
121
  status: ZeniAPIStatus<Record<string, unknown>>;
121
- }, "tenant/saveAPIKeyConnectionFailure", never, never>, saveOAuthConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", credentials: {
122
+ }, "tenant/saveAPIKeyConnectionFailure", never, never>, saveOAuthConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", credentials: {
122
123
  authorization_code: string;
123
124
  client_id: string;
124
125
  client_secret: string;
@@ -126,35 +127,35 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
126
127
  }], {
127
128
  tenantId: string;
128
129
  connectionId: string;
129
- connectionType: "revenue" | "email" | "payments";
130
- connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
130
+ connectionType: "revenue" | "email" | "payroll" | "payments";
131
+ connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
131
132
  credentials: {
132
133
  authorization_code: string;
133
134
  client_id: string;
134
135
  client_secret: string;
135
136
  redirect_uri: string;
136
137
  };
137
- }, "tenant/saveOAuthConnection", never, never>, saveOAuthConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payments", connectionPayload: ConnectionDataPayload], {
138
+ }, "tenant/saveOAuthConnection", never, never>, saveOAuthConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionPayload: ConnectionDataPayload], {
138
139
  tenantId: string;
139
- connectionType: "revenue" | "email" | "payments";
140
+ connectionType: "revenue" | "email" | "payroll" | "payments";
140
141
  connectionPayload: ConnectionDataPayload;
141
142
  }, "tenant/saveOAuthConnectionSuccess", never, never>, saveOAuthConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
142
143
  tenantId: string;
143
144
  status: ZeniAPIStatus<Record<string, unknown>>;
144
- }, "tenant/saveOAuthConnectionFailure", never, never>, saveConnectorCredentials: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payments", args: ConnectorCredentialsBySlug], {
145
+ }, "tenant/saveOAuthConnectionFailure", never, never>, saveConnectorCredentials: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payroll" | "payments", args: ConnectorCredentialsBySlug], {
145
146
  connectionName: "stripe";
146
147
  credentials: {
147
148
  api_key: string;
148
149
  };
149
150
  tenantId: string;
150
- connectionType: "revenue" | "email" | "payments";
151
+ connectionType: "revenue" | "email" | "payroll" | "payments";
151
152
  } | {
152
153
  connectionName: "mercury";
153
154
  credentials: {
154
155
  api_key: string;
155
156
  };
156
157
  tenantId: string;
157
- connectionType: "revenue" | "email" | "payments";
158
+ connectionType: "revenue" | "email" | "payroll" | "payments";
158
159
  } | {
159
160
  connectionName: "paypal";
160
161
  credentials: {
@@ -162,36 +163,36 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
162
163
  client_secret: string;
163
164
  };
164
165
  tenantId: string;
165
- connectionType: "revenue" | "email" | "payments";
166
- }, "tenant/saveConnectorCredentials", never, never>, saveConnectorCredentialsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", connectionPayload: ConnectionDataPayload], {
166
+ connectionType: "revenue" | "email" | "payroll" | "payments";
167
+ }, "tenant/saveConnectorCredentials", never, never>, saveConnectorCredentialsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", connectionPayload: ConnectionDataPayload], {
167
168
  tenantId: string;
168
- connectionType: "revenue" | "email" | "payments";
169
- connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
169
+ connectionType: "revenue" | "email" | "payroll" | "payments";
170
+ connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
170
171
  connectionPayload: ConnectionDataPayload;
171
- }, "tenant/saveConnectorCredentialsSuccess", never, never>, saveConnectorCredentialsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", status: ZeniAPIStatus<Record<string, unknown>>], {
172
+ }, "tenant/saveConnectorCredentialsSuccess", never, never>, saveConnectorCredentialsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", status: ZeniAPIStatus<Record<string, unknown>>], {
172
173
  tenantId: string;
173
- connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
174
+ connectionName: "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
174
175
  status: ZeniAPIStatus<Record<string, unknown>>;
175
- }, "tenant/saveConnectorCredentialsFailure", never, never>, initEmailConnectOAuth: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: "gmail" | "outlook", redirectAfterUrl: string], {
176
+ }, "tenant/saveConnectorCredentialsFailure", never, never>, initEmailConnectOAuth: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: ConnectorOAuthProvider, redirectAfterUrl: string], {
176
177
  tenantId: string;
177
- provider: "gmail" | "outlook";
178
+ provider: ConnectorOAuthProvider;
178
179
  redirectAfterUrl: string;
179
- }, "tenant/initEmailConnectOAuth", never, never>, initEmailConnectOAuthSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: "gmail" | "outlook", authorizationUrl: string], {
180
+ }, "tenant/initEmailConnectOAuth", never, never>, initEmailConnectOAuthSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: ConnectorOAuthProvider, authorizationUrl: string], {
180
181
  tenantId: string;
181
- provider: "gmail" | "outlook";
182
+ provider: ConnectorOAuthProvider;
182
183
  authorizationUrl: string;
183
- }, "tenant/initEmailConnectOAuthSuccess", never, never>, initEmailConnectOAuthFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: "gmail" | "outlook", status: ZeniAPIStatus<Record<string, unknown>>], {
184
+ }, "tenant/initEmailConnectOAuthSuccess", never, never>, initEmailConnectOAuthFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: ConnectorOAuthProvider, status: ZeniAPIStatus<Record<string, unknown>>], {
184
185
  tenantId: string;
185
- provider: "gmail" | "outlook";
186
+ provider: ConnectorOAuthProvider;
186
187
  status: ZeniAPIStatus<Record<string, unknown>>;
187
- }, "tenant/initEmailConnectOAuthFailure", never, never>, deleteConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payments"], {
188
+ }, "tenant/initEmailConnectOAuthFailure", never, never>, deleteConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payroll" | "payments"], {
188
189
  tenantId: string;
189
190
  connectionId: string;
190
- connectionType: "revenue" | "email" | "payments";
191
- }, "tenant/deleteConnection", never, never>, deleteConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payments"], {
191
+ connectionType: "revenue" | "email" | "payroll" | "payments";
192
+ }, "tenant/deleteConnection", never, never>, deleteConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payroll" | "payments"], {
192
193
  tenantId: string;
193
194
  connectionId: string;
194
- connectionType: "revenue" | "email" | "payments";
195
+ connectionType: "revenue" | "email" | "payroll" | "payments";
195
196
  }, "tenant/deleteConnectionSuccess", never, never>, deleteConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
196
197
  tenantId: string;
197
198
  status: ZeniAPIStatus<Record<string, unknown>>;
@@ -258,6 +259,7 @@ export declare function mapConnectionsPayloadToState(connectionsPayload: Connect
258
259
  accounting: Connection[];
259
260
  email: Connection[];
260
261
  payments: Connection[];
262
+ payroll: Connection[];
261
263
  revenue: Connection[];
262
264
  };
263
265
  export declare const toConnection: (payload: ConnectionDataPayload) => Connection;
@@ -20,7 +20,12 @@ const netBurnOrIncomeStoryCardState_1 = require("../../view/netBurnOrIncomeStory
20
20
  const zeniDayJS_1 = require("../../zeniDayJS");
21
21
  const subscriptionSummaryReducer_1 = require("../subscription/subscriptionSummary/subscriptionSummaryReducer");
22
22
  const userRolePayload_1 = require("../userRole/userRolePayload");
23
- const EXTERNAL_INTEGRATION_TYPES = ['revenue', 'payments', 'email'];
23
+ const EXTERNAL_INTEGRATION_TYPES = [
24
+ 'revenue',
25
+ 'payments',
26
+ 'email',
27
+ 'payroll',
28
+ ];
24
29
  const toExternalIntegrationType = (v) => (0, stringToUnion_1.stringToUnion)(v, EXTERNAL_INTEGRATION_TYPES);
25
30
  exports.toExternalIntegrationType = toExternalIntegrationType;
26
31
  exports.initialState = {
@@ -433,6 +438,7 @@ const tenant = (0, toolkit_1.createSlice)({
433
438
  accounting: [],
434
439
  email: [],
435
440
  payments: [],
441
+ payroll: [],
436
442
  revenue: [],
437
443
  saveConnectionState: 'Not-Started',
438
444
  saveAPIKeyConnectionState: 'Not-Started',
@@ -449,12 +455,13 @@ const tenant = (0, toolkit_1.createSlice)({
449
455
  return { payload: { tenantId, externalConnections } };
450
456
  },
451
457
  reducer(draft, action) {
452
- const { accounting, email, payments, revenue } = mapConnectionsPayloadToState(action.payload.externalConnections);
458
+ const { accounting, email, payments, payroll, revenue } = mapConnectionsPayloadToState(action.payload.externalConnections);
453
459
  draft.externalConnectionsByTenant[action.payload.tenantId] = {
454
460
  fetchState: 'Completed',
455
461
  accounting,
456
462
  email,
457
463
  payments,
464
+ payroll,
458
465
  revenue,
459
466
  saveConnectionState: 'Completed',
460
467
  saveAPIKeyConnectionState: 'Not-Started',
@@ -477,6 +484,7 @@ const tenant = (0, toolkit_1.createSlice)({
477
484
  accounting: [],
478
485
  email: [],
479
486
  payments: [],
487
+ payroll: [],
480
488
  revenue: [],
481
489
  saveConnectionState: 'Error',
482
490
  saveAPIKeyConnectionState: 'Not-Started',
@@ -1126,6 +1134,9 @@ function mapConnectionsPayloadToState(connectionsPayload) {
1126
1134
  // tenant deploys (or disabled-everywhere envs) don't blow up here.
1127
1135
  email: (connections.email ?? []).map((payload) => (0, exports.toConnection)(payload)),
1128
1136
  payments: connections.payments.map((payload) => (0, exports.toConnection)(payload)),
1137
+ // Same back-compat shape as `email`: tenant materializes gusto under
1138
+ // `payroll` only when the slug is enabled in third_party_enabled_connectors.
1139
+ payroll: (connections.payroll ?? []).map((payload) => (0, exports.toConnection)(payload)),
1129
1140
  revenue: (connections.revenue ?? []).map((payload) => (0, exports.toConnection)(payload)),
1130
1141
  };
1131
1142
  }
@@ -16,6 +16,7 @@ export interface TenantExternalConnections {
16
16
  email: Connection[];
17
17
  fetchState: FetchState;
18
18
  payments: Connection[];
19
+ payroll: Connection[];
19
20
  revenue: Connection[];
20
21
  saveAPIKeyConnectionState: FetchState;
21
22
  saveConnectionState: FetchState;
@@ -1,3 +1,3 @@
1
1
  export type AuthProvider = 'google' | 'microsoft' | 'email';
2
- export declare const toExternalSupportedTool: (v: string) => "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
2
+ export declare const toExternalSupportedTool: (v: string) => "gusto" | "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
3
3
  export type ExternalSupportedTool = ReturnType<typeof toExternalSupportedTool>;