@zeniai/client-epic-state 4.18.95 → 4.18.96

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.
@@ -5,7 +5,6 @@ import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
5
5
  import { RootState } from '../../../reducer';
6
6
  import { initializeSelectedPeriodForTenants } from '../../../view/expenseAutomationView/expenseAutomationViewReducer';
7
7
  import { ZeniAPI } from '../../../zeniAPI';
8
- import { ZeniDate } from '../../../zeniDayJS';
9
8
  import { updateCompanies } from '../../company/companyReducer';
10
9
  import { TenantsData } from '../tenantPayload';
11
10
  import { fetchAllTenants, updateTenantsFailure, updateTenantsSuccess } from '../tenantReducer';
@@ -13,4 +12,3 @@ export type ActionType = ReturnType<typeof fetchAllTenants> | ReturnType<typeof
13
12
  export declare const fetchAllTenantsEpic: (actions$: ActionsObservable<ActionType>, state: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
14
13
  export declare const defaultMonthYearPeriod: MonthYearPeriod;
15
14
  export declare const getDefaultSelectedPeriodsForTenants: (tenantsData: TenantsData) => Record<ID, MonthYearPeriod>;
16
- export declare const getMonthYearPeriodFromBookCloseDate: (zeniBookCloseDate?: ZeniDate) => MonthYearPeriod;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMonthYearPeriodFromBookCloseDate = exports.getDefaultSelectedPeriodsForTenants = exports.defaultMonthYearPeriod = exports.fetchAllTenantsEpic = void 0;
3
+ exports.getDefaultSelectedPeriodsForTenants = exports.defaultMonthYearPeriod = exports.fetchAllTenantsEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
@@ -58,8 +58,11 @@ exports.defaultMonthYearPeriod = {
58
58
  };
59
59
  const getDefaultSelectedPeriodsForTenants = (tenantsData) => {
60
60
  const defaultSelectedPeriodsForTenants = tenantsData.tenants.reduce((prev, currentTenant) => {
61
- const currentMonthYearPeriod = currentTenant.zeni_book_close_month_and_year != null
62
- ? (0, timePeriod_1.toMonthYearPeriod)(currentTenant.zeni_book_close_month_and_year)
61
+ const currentMonthYearPeriod = currentTenant.book_close_date != null
62
+ ? {
63
+ month: (0, timePeriod_1.toMonth)((0, zeniDayJS_1.date)(currentTenant.book_close_date).month()),
64
+ year: (0, zeniDayJS_1.date)(currentTenant.book_close_date).year(),
65
+ }
63
66
  : undefined;
64
67
  if (currentMonthYearPeriod != null) {
65
68
  const currentDate = (0, zeniDayJS_1.date)(`${currentMonthYearPeriod.year}-${currentMonthYearPeriod.month}-01`);
@@ -75,12 +78,3 @@ const getDefaultSelectedPeriodsForTenants = (tenantsData) => {
75
78
  return defaultSelectedPeriodsForTenants;
76
79
  };
77
80
  exports.getDefaultSelectedPeriodsForTenants = getDefaultSelectedPeriodsForTenants;
78
- const getMonthYearPeriodFromBookCloseDate = (zeniBookCloseDate) => {
79
- return zeniBookCloseDate != null
80
- ? {
81
- month: (0, timePeriod_1.toMonth)(zeniBookCloseDate.add(1, 'month').get('month') + 1),
82
- year: zeniBookCloseDate.add(1, 'month').get('year'),
83
- }
84
- : exports.defaultMonthYearPeriod;
85
- };
86
- exports.getMonthYearPeriodFromBookCloseDate = getMonthYearPeriodFromBookCloseDate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.18.95",
3
+ "version": "4.18.96",
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",