This commit is contained in:
Ahmed Bouhuolia
2025-11-17 17:04:25 +02:00
parent 2383091b6e
commit 2c64e1b8ab
41 changed files with 709 additions and 87 deletions

View File

@@ -2,26 +2,31 @@
import { createSelector } from '@reduxjs/toolkit';
import { isEqual } from 'lodash';
import {
paginationLocationQuery,
} from '@/store/selectors';
import { paginationLocationQuery } from '@/store/selectors';
import { createDeepEqualSelector } from '@/utils';
import { defaultTableQuery } from './paymentReceives.reducer';
const paymentReceiveTableState = (state) => state.paymentReceives.tableState;
// Retrieve payment receives table fetch query.
export const getPaymentReceiveTableStateFactory = () => createSelector(
paginationLocationQuery,
paymentReceiveTableState,
(locationQuery, tableState) => {
return {
...locationQuery,
...tableState,
};
},
);
export const getPaymentReceiveTableStateFactory = () =>
createSelector(
paginationLocationQuery,
paymentReceiveTableState,
(locationQuery, tableState) => {
return {
...locationQuery,
...tableState,
};
},
);
export const paymentsTableStateChangedFactory = () =>
createDeepEqualSelector(paymentReceiveTableState, (tableState) => {
return !isEqual(tableState, defaultTableQuery);
});
export const getPaymentReceivesSelectedRowsFactory = () =>
createSelector(
(state) => state.paymentReceives.selectedRows,
(selectedRows) => selectedRows,
);

View File

@@ -1,5 +1,6 @@
// @ts-nocheck
import { isEqual } from 'lodash';
import { createSelector } from 'reselect';
import { paginationLocationQuery } from '@/store/selectors';
import { createDeepEqualSelector } from '@/utils';
import { defaultTableQuery } from './VendorCredit.reducer';

View File

@@ -12,4 +12,11 @@ export const resetReceiptsTableState = () => {
return {
type: t.RECEIPTS_TABLE_STATE_RESET,
};
}
}
export const setReceiptsSelectedRows = (selectedRows) => {
return {
type: t.RECEIPTS_SELECTED_ROWS_SET,
payload: selectedRows,
};
};

View File

@@ -3,4 +3,5 @@
export default {
RECEIPTS_TABLE_STATE_SET: 'RECEIPTS/TABLE_STATE_SET',
RECEIPTS_TABLE_STATE_RESET: 'RECEIPTS/TABLE_STATE_RESET',
RECEIPTS_SELECTED_ROWS_SET: 'RECEIPTS/SELECTED_ROWS_SET',
};