@zauru-sdk/redux 1.0.10

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 (43) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENCE.md +11 -0
  3. package/dist/slices/agency.slice.d.ts +8 -0
  4. package/dist/slices/agency.slice.js +20 -0
  5. package/dist/slices/automaticNumbers.slice.d.ts +17 -0
  6. package/dist/slices/automaticNumbers.slice.js +20 -0
  7. package/dist/slices/catalogs.slice.d.ts +50 -0
  8. package/dist/slices/catalogs.slice.js +61 -0
  9. package/dist/slices/formValidation.slice.d.ts +14 -0
  10. package/dist/slices/formValidation.slice.js +16 -0
  11. package/dist/slices/index.d.ts +11 -0
  12. package/dist/slices/index.js +11 -0
  13. package/dist/slices/profile.slice.d.ts +26 -0
  14. package/dist/slices/profile.slice.js +22 -0
  15. package/dist/slices/reception.slice.d.ts +43 -0
  16. package/dist/slices/reception.slice.js +57 -0
  17. package/dist/slices/session.slice.d.ts +9 -0
  18. package/dist/slices/session.slice.js +13 -0
  19. package/dist/slices/tables.slice.d.ts +12 -0
  20. package/dist/slices/tables.slice.js +17 -0
  21. package/dist/slices/templates.slice.d.ts +13 -0
  22. package/dist/slices/templates.slice.js +19 -0
  23. package/dist/slices/user.slice.d.ts +12 -0
  24. package/dist/slices/user.slice.js +38 -0
  25. package/dist/slices/webapp-tables.slice.d.ts +8 -0
  26. package/dist/slices/webapp-tables.slice.js +20 -0
  27. package/dist/store.d.ts +8 -0
  28. package/dist/store.js +125 -0
  29. package/package.json +31 -0
  30. package/src/slices/agency.slice.ts +32 -0
  31. package/src/slices/automaticNumbers.slice.ts +41 -0
  32. package/src/slices/catalogs.slice.ts +178 -0
  33. package/src/slices/formValidation.slice.ts +32 -0
  34. package/src/slices/index.ts +11 -0
  35. package/src/slices/profile.slice.ts +49 -0
  36. package/src/slices/reception.slice.ts +118 -0
  37. package/src/slices/session.slice.ts +25 -0
  38. package/src/slices/tables.slice.ts +33 -0
  39. package/src/slices/templates.slice.ts +34 -0
  40. package/src/slices/user.slice.ts +64 -0
  41. package/src/slices/webapp-tables.slice.ts +35 -0
  42. package/src/store.ts +152 -0
  43. package/tsconfig.json +24 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [1.0.10](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.9...v1.0.10) (2024-03-17)
7
+
8
+ **Note:** Version bump only for package @zauru-sdk/redux
package/LICENCE.md ADDED
@@ -0,0 +1,11 @@
1
+ # Released under MIT License
2
+
3
+ Copyright (c) 2013 Mark Otto.
4
+
5
+ Copyright (c) 2017 Andrew Fong.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,8 @@
1
+ import { AgencyGraphQL } from "@zauru-sdk/types";
2
+ export interface AgencyState {
3
+ agencyProfile: AgencyGraphQL;
4
+ loadingAgencyProfile: boolean;
5
+ }
6
+ export declare const setAgencyProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgencyGraphQL, "agency/setAgencyProfile">, setLoadingAgencyProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "agency/setLoadingAgencyProfile">;
7
+ declare const _default: import("redux").Reducer<AgencyState>;
8
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {
3
+ agencyProfile: {},
4
+ loadingAgencyProfile: false,
5
+ };
6
+ const agencySlice = createSlice({
7
+ name: "agency",
8
+ initialState,
9
+ reducers: {
10
+ setAgencyProfile: (state, action) => {
11
+ state.agencyProfile = action.payload;
12
+ },
13
+ setLoadingAgencyProfile: (state, action) => {
14
+ state.loadingAgencyProfile = action.payload;
15
+ state.loadingAgencyProfile = false;
16
+ },
17
+ },
18
+ });
19
+ export const { setAgencyProfile, setLoadingAgencyProfile } = agencySlice.actions;
20
+ export default agencySlice.reducer;
@@ -0,0 +1,17 @@
1
+ export type AUTOMATIC_NUMBER_NAMES = "dischargeIdNumber" | "purchaseOrderIdNumber";
2
+ export interface AutomaticNumberState {
3
+ purchaseOrderIdNumber: {
4
+ loading: boolean;
5
+ data: number | string;
6
+ };
7
+ dischargeIdNumber: {
8
+ loading: boolean;
9
+ data: number | string;
10
+ };
11
+ }
12
+ export declare const automaticNumberFetchStart: import("@reduxjs/toolkit").ActionCreatorWithPayload<AUTOMATIC_NUMBER_NAMES, "automaticNumbers/automaticNumberFetchStart">, automaticNumberFetchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
+ name: AUTOMATIC_NUMBER_NAMES;
14
+ data: any;
15
+ }, "automaticNumbers/automaticNumberFetchSuccess">;
16
+ declare const _default: import("redux").Reducer<AutomaticNumberState>;
17
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {
3
+ purchaseOrderIdNumber: { data: "", loading: false },
4
+ dischargeIdNumber: { data: "NCB00000", loading: false },
5
+ };
6
+ const automaticNumbersSlice = createSlice({
7
+ name: "automaticNumbers",
8
+ initialState,
9
+ reducers: {
10
+ automaticNumberFetchStart: (state, action) => {
11
+ state[action.payload].loading = true;
12
+ },
13
+ automaticNumberFetchSuccess: (state, action) => {
14
+ state[action.payload.name].data = action.payload.data;
15
+ state[action.payload.name].loading = false;
16
+ },
17
+ },
18
+ });
19
+ export const { automaticNumberFetchStart, automaticNumberFetchSuccess } = automaticNumbersSlice.actions;
20
+ export default automaticNumbersSlice.reducer;
@@ -0,0 +1,50 @@
1
+ import type { AgencyGraphQL, BitacoraPOMassive, BundleGraphQL, CaseGraphQL, CurrencyGraphQL, EmployeeGraphQL, FormGraphQL, FormSubmissionGraphQL, InvoiceGraphQL, ItemCategoryGraphQL, ItemGraphQL, LotStockGraphQL, MotivoRechazo, PayeeCategoryGraphQL, PayeeGraphQL, PaymentTermGraphQL, ReceptionType, ShipmentGraphQL, SuggestedPriceGraphQL, Template, TipoMuestra, WebAppRowGraphQL } from "@zauru-sdk/types";
2
+ export type ONLINE_CATALOGS_NAMES = "invoiceFormSubmissionsByInvoiceId" | "invoiceFormSubmissionsByAgencyId";
3
+ export type CATALOGS_NAMES = "agencies" | "suggestedPrices" | "providers" | "providerCategories" | "receptionTypes" | "tiposDeMuestra" | "motivosRechazo" | "bitacoraRechazoMasivo" | "items" | "itemsByReception" | "itemsByLab" | "itemServicesByLab" | "itemCategoriesForLab" | "payees" | "payeesForLab" | "payeeCategoriesLabPrices" | "clientCategories" | "bundlesRecipForLab" | "currencies" | "paymentTerms" | "employeesByLab" | "employeesByCurrentAgency" | "invoicesByLab" | "invoiceForms" | "caseForms" | "invoiceFormSubmissions" | "myCases" | "myCaseFormSubmissions" | "shipmentsToMyAgency" | "myAgencyLotStocks" | "shipments" | "bookings" | "templates" | "bundlesForLab";
4
+ type LoadingState<T> = {
5
+ data: T;
6
+ loading: boolean;
7
+ reFetch: boolean;
8
+ };
9
+ type CatalogState = {
10
+ agencies: LoadingState<AgencyGraphQL[]>;
11
+ suggestedPrices: LoadingState<SuggestedPriceGraphQL[]>;
12
+ providers: LoadingState<PayeeGraphQL[]>;
13
+ providerCategories: LoadingState<PayeeCategoryGraphQL[]>;
14
+ payees: LoadingState<PayeeGraphQL[]>;
15
+ payeesForLab: LoadingState<PayeeGraphQL[]>;
16
+ payeeCategoriesLabPrices: LoadingState<PayeeCategoryGraphQL[]>;
17
+ clientCategories: LoadingState<PayeeCategoryGraphQL[]>;
18
+ receptionTypes: LoadingState<WebAppRowGraphQL<ReceptionType>[]>;
19
+ tiposDeMuestra: LoadingState<WebAppRowGraphQL<TipoMuestra>[]>;
20
+ templates: LoadingState<WebAppRowGraphQL<Template>[]>;
21
+ shipments: LoadingState<ShipmentGraphQL[]>;
22
+ bookings: LoadingState<ShipmentGraphQL[]>;
23
+ motivosRechazo: LoadingState<WebAppRowGraphQL<MotivoRechazo>[]>;
24
+ bitacoraRechazoMasivo: LoadingState<WebAppRowGraphQL<BitacoraPOMassive>[]>;
25
+ items: LoadingState<ItemGraphQL[]>;
26
+ itemsByReception: LoadingState<ItemGraphQL[]>;
27
+ itemsByLab: LoadingState<ItemGraphQL[]>;
28
+ itemServicesByLab: LoadingState<ItemGraphQL[]>;
29
+ itemCategoriesForLab: LoadingState<ItemCategoryGraphQL[]>;
30
+ bundlesRecipForLab: LoadingState<BundleGraphQL[]>;
31
+ bundlesForLab: LoadingState<BundleGraphQL[]>;
32
+ currencies: LoadingState<CurrencyGraphQL[]>;
33
+ paymentTerms: LoadingState<PaymentTermGraphQL[]>;
34
+ employeesByLab: LoadingState<EmployeeGraphQL[]>;
35
+ employeesByCurrentAgency: LoadingState<EmployeeGraphQL[]>;
36
+ invoicesByLab: LoadingState<InvoiceGraphQL[]>;
37
+ invoiceForms: LoadingState<FormGraphQL[]>;
38
+ caseForms: LoadingState<FormGraphQL[]>;
39
+ invoiceFormSubmissions: LoadingState<FormSubmissionGraphQL[]>;
40
+ myCases: LoadingState<CaseGraphQL[]>;
41
+ myCaseFormSubmissions: LoadingState<FormSubmissionGraphQL[]>;
42
+ myAgencyLotStocks: LoadingState<LotStockGraphQL[]>;
43
+ shipmentsToMyAgency: LoadingState<ShipmentGraphQL[]>;
44
+ };
45
+ export declare const catalogsFetchStart: import("@reduxjs/toolkit").ActionCreatorWithPayload<CATALOGS_NAMES, "catalogs/catalogsFetchStart">, catalogsFetchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
46
+ name: CATALOGS_NAMES;
47
+ data: any[];
48
+ }, "catalogs/catalogsFetchSuccess">, catalogsSetReFetch: import("@reduxjs/toolkit").ActionCreatorWithPayload<CATALOGS_NAMES, "catalogs/catalogsSetReFetch">;
49
+ declare const _default: import("redux").Reducer<CatalogState>;
50
+ export default _default;
@@ -0,0 +1,61 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const createLoadingState = (initialData) => ({
3
+ data: initialData,
4
+ loading: false,
5
+ reFetch: false,
6
+ });
7
+ const initialState = {
8
+ agencies: createLoadingState([]),
9
+ suggestedPrices: createLoadingState([]),
10
+ providers: createLoadingState([]),
11
+ providerCategories: createLoadingState([]),
12
+ receptionTypes: createLoadingState([]),
13
+ tiposDeMuestra: createLoadingState([]),
14
+ templates: createLoadingState([]),
15
+ shipments: createLoadingState([]),
16
+ bookings: createLoadingState([]),
17
+ motivosRechazo: createLoadingState([]),
18
+ bitacoraRechazoMasivo: createLoadingState([]),
19
+ items: createLoadingState([]),
20
+ itemsByReception: createLoadingState([]),
21
+ payees: createLoadingState([]),
22
+ payeesForLab: createLoadingState([]),
23
+ itemCategoriesForLab: createLoadingState([]),
24
+ payeeCategoriesLabPrices: createLoadingState([]),
25
+ clientCategories: createLoadingState([]),
26
+ itemsByLab: createLoadingState([]),
27
+ itemServicesByLab: createLoadingState([]),
28
+ bundlesRecipForLab: createLoadingState([]),
29
+ bundlesForLab: createLoadingState([]),
30
+ currencies: createLoadingState([]),
31
+ paymentTerms: createLoadingState([]),
32
+ employeesByLab: createLoadingState([]),
33
+ employeesByCurrentAgency: createLoadingState([]),
34
+ invoicesByLab: createLoadingState([]),
35
+ invoiceForms: createLoadingState([]),
36
+ caseForms: createLoadingState([]),
37
+ invoiceFormSubmissions: createLoadingState([]),
38
+ myCases: createLoadingState([]),
39
+ myCaseFormSubmissions: createLoadingState([]),
40
+ myAgencyLotStocks: createLoadingState([]),
41
+ shipmentsToMyAgency: createLoadingState([]),
42
+ };
43
+ const catalogsSlice = createSlice({
44
+ name: "catalogs",
45
+ initialState,
46
+ reducers: {
47
+ catalogsSetReFetch: (state, action) => {
48
+ state[action.payload].reFetch = true;
49
+ },
50
+ catalogsFetchStart: (state, action) => {
51
+ state[action.payload].loading = true;
52
+ },
53
+ catalogsFetchSuccess: (state, action) => {
54
+ state[action.payload.name].data = action.payload.data;
55
+ state[action.payload.name].loading = false;
56
+ state[action.payload.name].reFetch = false;
57
+ },
58
+ },
59
+ });
60
+ export const { catalogsFetchStart, catalogsFetchSuccess, catalogsSetReFetch } = catalogsSlice.actions;
61
+ export default catalogsSlice.reducer;
@@ -0,0 +1,14 @@
1
+ export type FormValidations = {
2
+ formValidations: {
3
+ [key: string]: {
4
+ [key: string]: string;
5
+ };
6
+ };
7
+ };
8
+ export declare const setFieldError: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
9
+ formName: string;
10
+ name: string;
11
+ error: string;
12
+ }, "formValidations/setFieldError">;
13
+ declare const _default: import("redux").Reducer<FormValidations>;
14
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {
3
+ formValidations: {},
4
+ };
5
+ const formValidationsSlice = createSlice({
6
+ name: "formValidations",
7
+ initialState,
8
+ reducers: {
9
+ setFieldError: (state, action) => {
10
+ state.formValidations[action.payload.formName][action.payload.name] =
11
+ action.payload.error;
12
+ },
13
+ },
14
+ });
15
+ export const { setFieldError } = formValidationsSlice.actions;
16
+ export default formValidationsSlice.reducer;
@@ -0,0 +1,11 @@
1
+ export * from "./agency.slice.js";
2
+ export * from "./automaticNumbers.slice.js";
3
+ export * from "./catalogs.slice.js";
4
+ export * from "./formValidation.slice.js";
5
+ export * from "./profile.slice.js";
6
+ export * from "./reception.slice.js";
7
+ export * from "./session.slice.js";
8
+ export * from "./tables.slice.js";
9
+ export * from "./templates.slice.js";
10
+ export * from "./user.slice.js";
11
+ export * from "./webapp-tables.slice.js";
@@ -0,0 +1,11 @@
1
+ export * from "./agency.slice.js";
2
+ export * from "./automaticNumbers.slice.js";
3
+ export * from "./catalogs.slice.js";
4
+ export * from "./formValidation.slice.js";
5
+ export * from "./profile.slice.js";
6
+ export * from "./reception.slice.js";
7
+ export * from "./session.slice.js";
8
+ export * from "./tables.slice.js";
9
+ export * from "./templates.slice.js";
10
+ export * from "./user.slice.js";
11
+ export * from "./webapp-tables.slice.js";
@@ -0,0 +1,26 @@
1
+ import type { AgencyGraphQL, EmployeeGraphQL, OauthProfile, ProfileResponse } from "@zauru-sdk/types";
2
+ export type PROFILE_NAMES = "userProfile" | "oauthProfile" | "employeeProfile" | "agencyProfile";
3
+ export interface ProfilesState {
4
+ userProfile: {
5
+ loading: boolean;
6
+ data: ProfileResponse;
7
+ };
8
+ oauthProfile: {
9
+ loading: boolean;
10
+ data: OauthProfile;
11
+ };
12
+ employeeProfile: {
13
+ loading: boolean;
14
+ data: EmployeeGraphQL;
15
+ };
16
+ agencyProfile: {
17
+ loading: boolean;
18
+ data: AgencyGraphQL;
19
+ };
20
+ }
21
+ export declare const profileFetchStart: import("@reduxjs/toolkit").ActionCreatorWithPayload<PROFILE_NAMES, "profile/profileFetchStart">, profileFetchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
22
+ name: PROFILE_NAMES;
23
+ data: any;
24
+ }, "profile/profileFetchSuccess">;
25
+ declare const _default: import("redux").Reducer<ProfilesState>;
26
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {
3
+ userProfile: { data: {}, loading: false },
4
+ oauthProfile: { data: {}, loading: false },
5
+ employeeProfile: { data: {}, loading: false },
6
+ agencyProfile: { data: {}, loading: false },
7
+ };
8
+ const profileSlice = createSlice({
9
+ name: "profile",
10
+ initialState,
11
+ reducers: {
12
+ profileFetchStart: (state, action) => {
13
+ state[action.payload].loading = true;
14
+ },
15
+ profileFetchSuccess: (state, action) => {
16
+ state[action.payload.name].data = action.payload.data;
17
+ state[action.payload.name].loading = false;
18
+ },
19
+ },
20
+ });
21
+ export const { profileFetchStart, profileFetchSuccess } = profileSlice.actions;
22
+ export default profileSlice.reducer;
@@ -0,0 +1,43 @@
1
+ import { ItemAssociatedLots, NewPurchaseOrderResponse, PurchaseOrderGeneralInfo, PurchaseOrderGraphQL, RejectionWebAppTableObject, WebAppRowGraphQL, QueueFormReceptionWebAppTable } from "@zauru-sdk/types";
2
+ export type RECEPTION_NAMES = "basketLots" | "rejectionInfo" | "newPurchaseOrderInfo" | "purchaseOrderGeneralInfo" | "poReceptions" | "queueNewReceptions";
3
+ export interface ReceptionState {
4
+ basketLots: {
5
+ loading: boolean;
6
+ data: ItemAssociatedLots;
7
+ reFetch: boolean;
8
+ };
9
+ rejectionInfo: {
10
+ loading: boolean;
11
+ data: RejectionWebAppTableObject;
12
+ reFetch: boolean;
13
+ };
14
+ newPurchaseOrderInfo: {
15
+ loading: boolean;
16
+ data: NewPurchaseOrderResponse;
17
+ reFetch: boolean;
18
+ };
19
+ purchaseOrderGeneralInfo: {
20
+ loading: boolean;
21
+ data: PurchaseOrderGeneralInfo;
22
+ reFetch: boolean;
23
+ };
24
+ poReceptions: {
25
+ loading: boolean;
26
+ data: PurchaseOrderGraphQL[];
27
+ reFetch: boolean;
28
+ };
29
+ queueNewReceptions: {
30
+ loading: boolean;
31
+ data: WebAppRowGraphQL<QueueFormReceptionWebAppTable>[];
32
+ reFetch: boolean;
33
+ };
34
+ }
35
+ export declare const receptionFetchStart: import("@reduxjs/toolkit").ActionCreatorWithPayload<RECEPTION_NAMES, "reception/receptionFetchStart">, receptionFetchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
36
+ name: RECEPTION_NAMES;
37
+ data: any;
38
+ }, "reception/receptionFetchSuccess">, receptionConcatToArray: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
39
+ name: RECEPTION_NAMES;
40
+ data: any;
41
+ }, "reception/receptionConcatToArray">;
42
+ declare const _default: import("redux").Reducer<ReceptionState>;
43
+ export default _default;
@@ -0,0 +1,57 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {
3
+ basketLots: {
4
+ data: {},
5
+ loading: false,
6
+ reFetch: false,
7
+ },
8
+ rejectionInfo: {
9
+ data: {},
10
+ loading: false,
11
+ reFetch: false,
12
+ },
13
+ newPurchaseOrderInfo: {
14
+ data: {},
15
+ loading: false,
16
+ reFetch: false,
17
+ },
18
+ purchaseOrderGeneralInfo: {
19
+ data: {},
20
+ loading: false,
21
+ reFetch: false,
22
+ },
23
+ poReceptions: {
24
+ data: [],
25
+ loading: false,
26
+ reFetch: false,
27
+ },
28
+ queueNewReceptions: {
29
+ data: [],
30
+ loading: false,
31
+ reFetch: false,
32
+ },
33
+ };
34
+ const receptionSlice = createSlice({
35
+ name: "reception",
36
+ initialState,
37
+ reducers: {
38
+ receptionFetchStart: (state, action) => {
39
+ state[action.payload].loading = true;
40
+ },
41
+ receptionFetchSuccess: (state, action) => {
42
+ state[action.payload.name].data = action.payload.data;
43
+ state[action.payload.name].loading = false;
44
+ },
45
+ receptionConcatToArray: (state, action) => {
46
+ if (Array.isArray(state[action.payload.name].data)) {
47
+ state[action.payload.name].data = [
48
+ ...state[action.payload.name].data,
49
+ action.payload.data,
50
+ ];
51
+ }
52
+ state[action.payload.name].loading = false;
53
+ },
54
+ },
55
+ });
56
+ export const { receptionFetchStart, receptionFetchSuccess, receptionConcatToArray, } = receptionSlice.actions;
57
+ export default receptionSlice.reducer;
@@ -0,0 +1,9 @@
1
+ export interface SessionState {
2
+ [key: string]: any;
3
+ }
4
+ export declare const setSessionValue: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
5
+ name: string;
6
+ data: any;
7
+ }, "session/setSessionValue">;
8
+ declare const _default: import("redux").Reducer<SessionState>;
9
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {};
3
+ const sessionSlice = createSlice({
4
+ name: "session",
5
+ initialState,
6
+ reducers: {
7
+ setSessionValue: (state, action) => {
8
+ state[action.payload.name] = action.payload.data;
9
+ },
10
+ },
11
+ });
12
+ export const { setSessionValue } = sessionSlice.actions;
13
+ export default sessionSlice.reducer;
@@ -0,0 +1,12 @@
1
+ export type TABLE_NAMES = "pageTable1" | "pageTable2" | "pageTable3";
2
+ export interface TableState {
3
+ pageTable1: number;
4
+ pageTable2: number;
5
+ pageTable3: number;
6
+ }
7
+ export declare const tableSetPage: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
+ name: TABLE_NAMES;
9
+ data: number;
10
+ }, "table/tableSetPage">;
11
+ declare const _default: import("redux").Reducer<TableState>;
12
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {
3
+ pageTable1: 1,
4
+ pageTable2: 1,
5
+ pageTable3: 1,
6
+ };
7
+ const tableSlice = createSlice({
8
+ name: "table",
9
+ initialState,
10
+ reducers: {
11
+ tableSetPage: (state, action) => {
12
+ state[action.payload.name] = action.payload.data;
13
+ },
14
+ },
15
+ });
16
+ export const { tableSetPage } = tableSlice.actions;
17
+ export default tableSlice.reducer;
@@ -0,0 +1,13 @@
1
+ export type TEMPLATE_NAMES = "receptionTemplate";
2
+ export interface TemplateState {
3
+ receptionTemplate: {
4
+ loading: boolean;
5
+ data: string;
6
+ };
7
+ }
8
+ export declare const templateFetchStart: import("@reduxjs/toolkit").ActionCreatorWithPayload<"receptionTemplate", "template/templateFetchStart">, templateFetchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
9
+ name: TEMPLATE_NAMES;
10
+ data: any;
11
+ }, "template/templateFetchSuccess">;
12
+ declare const _default: import("redux").Reducer<TemplateState>;
13
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {
3
+ receptionTemplate: { data: "", loading: false },
4
+ };
5
+ const templateSlice = createSlice({
6
+ name: "template",
7
+ initialState,
8
+ reducers: {
9
+ templateFetchStart: (state, action) => {
10
+ state[action.payload].loading = true;
11
+ },
12
+ templateFetchSuccess: (state, action) => {
13
+ state[action.payload.name].data = action.payload.data;
14
+ state[action.payload.name].loading = false;
15
+ },
16
+ },
17
+ });
18
+ export const { templateFetchStart, templateFetchSuccess } = templateSlice.actions;
19
+ export default templateSlice.reducer;
@@ -0,0 +1,12 @@
1
+ import { EmployeeGraphQL, OauthProfile, ProfileResponse } from "@zauru-sdk/types";
2
+ export interface UserState {
3
+ userProfile: ProfileResponse;
4
+ loadingUserProfile: boolean;
5
+ oauthProfile: OauthProfile;
6
+ loadingOauthProfile: boolean;
7
+ employeeProfile: EmployeeGraphQL;
8
+ loadingEmployeeInfo: boolean;
9
+ }
10
+ export declare const setUserProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<ProfileResponse, "user/setUserProfile">, setEmployeeProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<EmployeeGraphQL, "user/setEmployeeProfile">, setOauthProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<OauthProfile, "user/setOauthProfile">, setLoadingEmployeeProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "user/setLoadingEmployeeProfile">, setLoadingOauthProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "user/setLoadingOauthProfile">, setLoadingUserProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "user/setLoadingUserProfile">;
11
+ declare const _default: import("redux").Reducer<UserState>;
12
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {
3
+ userProfile: {},
4
+ loadingUserProfile: false,
5
+ oauthProfile: {},
6
+ loadingOauthProfile: false,
7
+ employeeProfile: {},
8
+ loadingEmployeeInfo: false,
9
+ };
10
+ const userSlice = createSlice({
11
+ name: "user",
12
+ initialState,
13
+ reducers: {
14
+ setUserProfile: (state, action) => {
15
+ state.userProfile = action.payload;
16
+ state.loadingUserProfile = false;
17
+ },
18
+ setLoadingUserProfile: (state, action) => {
19
+ state.loadingUserProfile = action.payload;
20
+ },
21
+ setOauthProfile: (state, action) => {
22
+ state.oauthProfile = action.payload;
23
+ state.loadingOauthProfile = false;
24
+ },
25
+ setLoadingOauthProfile: (state, action) => {
26
+ state.loadingOauthProfile = action.payload;
27
+ },
28
+ setEmployeeProfile: (state, action) => {
29
+ state.employeeProfile = action.payload;
30
+ state.loadingEmployeeInfo = false;
31
+ },
32
+ setLoadingEmployeeProfile: (state, action) => {
33
+ state.loadingEmployeeInfo = action.payload;
34
+ },
35
+ },
36
+ });
37
+ export const { setUserProfile, setEmployeeProfile, setOauthProfile, setLoadingEmployeeProfile, setLoadingOauthProfile, setLoadingUserProfile, } = userSlice.actions;
38
+ export default userSlice.reducer;
@@ -0,0 +1,8 @@
1
+ import { SpecialItem, WebAppRowGraphQL } from "@zauru-sdk/types";
2
+ export interface WebAppTableState {
3
+ specialItems: WebAppRowGraphQL<SpecialItem>[];
4
+ loadingSpecialItems: boolean;
5
+ }
6
+ export declare const setLoadingSpecialItems: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "webappTables/setLoadingSpecialItems">, setSpecialItems: import("@reduxjs/toolkit").ActionCreatorWithPayload<WebAppRowGraphQL<SpecialItem>[], "webappTables/setSpecialItems">;
7
+ declare const _default: import("redux").Reducer<WebAppTableState>;
8
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+ const initialState = {
3
+ specialItems: [],
4
+ loadingSpecialItems: false,
5
+ };
6
+ const webappTablesSlice = createSlice({
7
+ name: "webappTables",
8
+ initialState,
9
+ reducers: {
10
+ setLoadingSpecialItems: (state, action) => {
11
+ state.loadingSpecialItems = action.payload;
12
+ },
13
+ setSpecialItems: (state, action) => {
14
+ state.specialItems = action.payload;
15
+ state.loadingSpecialItems = false;
16
+ },
17
+ },
18
+ });
19
+ export const { setLoadingSpecialItems, setSpecialItems } = webappTablesSlice.actions;
20
+ export default webappTablesSlice.reducer;
@@ -0,0 +1,8 @@
1
+ import { Tuple } from "@reduxjs/toolkit";
2
+ export declare const LOCAL_STORAGE_REDUX_NAME = "___redux__state__v2";
3
+ export declare const cleanLocalStorage: () => void;
4
+ export declare const store: import("@reduxjs/toolkit").EnhancedStore<any, import("redux").UnknownAction, Tuple<[import("redux").StoreEnhancer<{
5
+ dispatch: {};
6
+ }>, import("redux").StoreEnhancer]>>;
7
+ export type RootState = ReturnType<typeof store.getState>;
8
+ export type AppDispatch = typeof store.dispatch;