@zeniai/client-epic-state 4.19.96-betaJK2 → 4.19.96-betaJK21
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/accountRecon/accountReconState.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconState.js +1 -0
- package/lib/epic.js +1 -3
- package/lib/esm/entity/accountRecon/accountReconState.js +1 -0
- package/lib/esm/epic.js +1 -3
- package/lib/esm/index.js +0 -5
- package/lib/esm/reducer.js +0 -4
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +2 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +37 -5
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +2 -1
- package/lib/index.d.ts +0 -7
- package/lib/index.js +22 -40
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -4
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +2 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +1 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +37 -5
- package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +2 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +4 -1
- package/package.json +1 -1
- package/lib/esm/view/spendManagement/billPay/vendorCreditView/epics/createVendorCreditEpic.js +0 -44
- package/lib/esm/view/spendManagement/billPay/vendorCreditView/epics/fetchVendorCreditsForVendorEpic.js +0 -17
- package/lib/esm/view/spendManagement/billPay/vendorCreditView/epics/vendorCreditPayloadMapper.js +0 -19
- package/lib/esm/view/spendManagement/billPay/vendorCreditView/vendorCreditViewPayload.js +0 -1
- package/lib/esm/view/spendManagement/billPay/vendorCreditView/vendorCreditViewReducer.js +0 -76
- package/lib/esm/view/spendManagement/billPay/vendorCreditView/vendorCreditViewSelector.js +0 -15
- package/lib/esm/view/spendManagement/billPay/vendorCreditView/vendorCreditViewState.js +0 -33
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/spendManagement/billPay/vendorCreditView/epics/createVendorCreditEpic.d.ts +0 -28
- package/lib/view/spendManagement/billPay/vendorCreditView/epics/createVendorCreditEpic.js +0 -48
- package/lib/view/spendManagement/billPay/vendorCreditView/epics/fetchVendorCreditsForVendorEpic.d.ts +0 -12
- package/lib/view/spendManagement/billPay/vendorCreditView/epics/fetchVendorCreditsForVendorEpic.js +0 -21
- package/lib/view/spendManagement/billPay/vendorCreditView/epics/vendorCreditPayloadMapper.d.ts +0 -3
- package/lib/view/spendManagement/billPay/vendorCreditView/epics/vendorCreditPayloadMapper.js +0 -25
- package/lib/view/spendManagement/billPay/vendorCreditView/vendorCreditViewPayload.d.ts +0 -22
- package/lib/view/spendManagement/billPay/vendorCreditView/vendorCreditViewPayload.js +0 -2
- package/lib/view/spendManagement/billPay/vendorCreditView/vendorCreditViewReducer.d.ts +0 -13
- package/lib/view/spendManagement/billPay/vendorCreditView/vendorCreditViewReducer.js +0 -80
- package/lib/view/spendManagement/billPay/vendorCreditView/vendorCreditViewSelector.d.ts +0 -16
- package/lib/view/spendManagement/billPay/vendorCreditView/vendorCreditViewSelector.js +0 -20
- package/lib/view/spendManagement/billPay/vendorCreditView/vendorCreditViewState.d.ts +0 -45
- package/lib/view/spendManagement/billPay/vendorCreditView/vendorCreditViewState.js +0 -36
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable } from 'redux-observable';
|
|
2
|
-
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
3
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
4
|
-
import { createVendorCredit, createVendorCreditFailure, createVendorCreditSuccess } from '../vendorCreditViewReducer';
|
|
5
|
-
type ActionType = ReturnType<typeof createVendorCredit> | ReturnType<typeof createVendorCreditSuccess> | ReturnType<typeof createVendorCreditFailure> | ReturnType<typeof openSnackbar>;
|
|
6
|
-
export declare const createVendorCreditEpic: (actions$: ActionsObservable<ActionType>, _state$: unknown, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
|
-
payload: {
|
|
8
|
-
messageSection: import("../../../../..").SnackbarMessageSections;
|
|
9
|
-
messageText: import("../../../../..").SnackbarMessageSectionTexts;
|
|
10
|
-
type: import("../../../../..").SnackbarMessageType;
|
|
11
|
-
showStatusIcon?: boolean;
|
|
12
|
-
variables?: {
|
|
13
|
-
variableName: string;
|
|
14
|
-
variableValue: string;
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
17
|
-
type: "snackbar/openSnackbar";
|
|
18
|
-
} | {
|
|
19
|
-
payload: {
|
|
20
|
-
credit: import("../vendorCreditViewState").VendorCreditSummary;
|
|
21
|
-
creditId: import("../../../../..").ID;
|
|
22
|
-
};
|
|
23
|
-
type: "vendorCreditView/createVendorCreditSuccess";
|
|
24
|
-
} | {
|
|
25
|
-
payload: import("../../../../../responsePayload").ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
26
|
-
type: "vendorCreditView/createVendorCreditFailure";
|
|
27
|
-
}>;
|
|
28
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createVendorCreditEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
-
const vendorCreditViewReducer_1 = require("../vendorCreditViewReducer");
|
|
9
|
-
const vendorCreditPayloadMapper_1 = require("./vendorCreditPayloadMapper");
|
|
10
|
-
const createVendorCreditEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorCreditViewReducer_1.createVendorCredit.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
-
const { localData } = action.payload;
|
|
12
|
-
const body = {
|
|
13
|
-
vendor_id: localData.vendorId,
|
|
14
|
-
vendor_name: localData.vendorName,
|
|
15
|
-
credit_note_number: localData.creditNoteNumber,
|
|
16
|
-
credit_note_date: localData.creditNoteDate,
|
|
17
|
-
memo: localData.memo,
|
|
18
|
-
total_amount: localData.totalAmount,
|
|
19
|
-
currency_code: localData.currencyCode,
|
|
20
|
-
file_id: localData.fileId,
|
|
21
|
-
applied_to_bill_id: localData.appliedToBillId,
|
|
22
|
-
};
|
|
23
|
-
const url = `${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/vendor-credits`;
|
|
24
|
-
return zeniAPI.postAndGetJSON(url, body).pipe((0, operators_1.mergeMap)((response) => {
|
|
25
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
26
|
-
const payload = response.data;
|
|
27
|
-
const credit = (0, vendorCreditPayloadMapper_1.toVendorCreditSummary)(payload);
|
|
28
|
-
return (0, rxjs_1.of)((0, vendorCreditViewReducer_1.createVendorCreditSuccess)({
|
|
29
|
-
creditId: credit.creditId,
|
|
30
|
-
credit,
|
|
31
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
32
|
-
messageSection: 'bill_pay_updated',
|
|
33
|
-
messageText: 'success',
|
|
34
|
-
type: 'success',
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
return (0, rxjs_1.of)((0, vendorCreditViewReducer_1.createVendorCreditFailure)(response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
38
|
-
messageSection: 'bill_pay_updated',
|
|
39
|
-
messageText: 'failed',
|
|
40
|
-
type: 'error',
|
|
41
|
-
}));
|
|
42
|
-
}), (0, operators_1.catchError)(() => (0, rxjs_1.of)((0, vendorCreditViewReducer_1.createVendorCreditFailure)(undefined), (0, snackbarReducer_1.openSnackbar)({
|
|
43
|
-
messageSection: 'bill_pay_updated',
|
|
44
|
-
messageText: 'failed',
|
|
45
|
-
type: 'error',
|
|
46
|
-
}))));
|
|
47
|
-
}));
|
|
48
|
-
exports.createVendorCreditEpic = createVendorCreditEpic;
|
package/lib/view/spendManagement/billPay/vendorCreditView/epics/fetchVendorCreditsForVendorEpic.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable } from 'redux-observable';
|
|
2
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
3
|
-
import { fetchVendorCreditsForVendor, fetchVendorCreditsForVendorFailure, fetchVendorCreditsForVendorSuccess } from '../vendorCreditViewReducer';
|
|
4
|
-
type ActionType = ReturnType<typeof fetchVendorCreditsForVendor> | ReturnType<typeof fetchVendorCreditsForVendorSuccess> | ReturnType<typeof fetchVendorCreditsForVendorFailure>;
|
|
5
|
-
export declare const fetchVendorCreditsForVendorEpic: (actions$: ActionsObservable<ActionType>, _state$: unknown, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
6
|
-
payload: import("../vendorCreditViewState").VendorCreditSummary[];
|
|
7
|
-
type: "vendorCreditView/fetchVendorCreditsForVendorSuccess";
|
|
8
|
-
} | {
|
|
9
|
-
payload: import("../../../../../responsePayload").ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
10
|
-
type: "vendorCreditView/fetchVendorCreditsForVendorFailure";
|
|
11
|
-
}>;
|
|
12
|
-
export {};
|
package/lib/view/spendManagement/billPay/vendorCreditView/epics/fetchVendorCreditsForVendorEpic.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchVendorCreditsForVendorEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
-
const vendorCreditViewReducer_1 = require("../vendorCreditViewReducer");
|
|
8
|
-
const vendorCreditPayloadMapper_1 = require("./vendorCreditPayloadMapper");
|
|
9
|
-
const fetchVendorCreditsForVendorEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorCreditViewReducer_1.fetchVendorCreditsForVendor.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
-
const { vendorId } = action.payload;
|
|
11
|
-
const url = `${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/vendor-credits?vendor_id=${encodeURIComponent(vendorId)}`;
|
|
12
|
-
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
14
|
-
const payloads = response.data;
|
|
15
|
-
const credits = payloads.map(vendorCreditPayloadMapper_1.toVendorCreditSummary);
|
|
16
|
-
return (0, rxjs_1.of)((0, vendorCreditViewReducer_1.fetchVendorCreditsForVendorSuccess)(credits));
|
|
17
|
-
}
|
|
18
|
-
return (0, rxjs_1.of)((0, vendorCreditViewReducer_1.fetchVendorCreditsForVendorFailure)(response.status));
|
|
19
|
-
}), (0, operators_1.catchError)(() => (0, rxjs_1.of)((0, vendorCreditViewReducer_1.fetchVendorCreditsForVendorFailure)(undefined))));
|
|
20
|
-
}));
|
|
21
|
-
exports.fetchVendorCreditsForVendorEpic = fetchVendorCreditsForVendorEpic;
|
package/lib/view/spendManagement/billPay/vendorCreditView/epics/vendorCreditPayloadMapper.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.toVendorCreditSummary = toVendorCreditSummary;
|
|
7
|
-
const dayjs_1 = __importDefault(require("dayjs"));
|
|
8
|
-
function toVendorCreditSummary(payload) {
|
|
9
|
-
return {
|
|
10
|
-
creditId: payload.credit_id,
|
|
11
|
-
vendorId: payload.vendor_id,
|
|
12
|
-
vendorName: payload.vendor_name,
|
|
13
|
-
creditNoteNumber: payload.credit_note_number,
|
|
14
|
-
creditNoteDate: payload.credit_note_date != null ? (0, dayjs_1.default)(payload.credit_note_date) : undefined,
|
|
15
|
-
memo: payload.memo,
|
|
16
|
-
totalAmount: payload.total_amount,
|
|
17
|
-
remainingAmount: payload.remaining_amount,
|
|
18
|
-
currencyCode: payload.currency_code ?? 'USD',
|
|
19
|
-
status: (payload.status ?? 'available'),
|
|
20
|
-
appliedToBillId: payload.applied_to_bill_id,
|
|
21
|
-
fileId: payload.file_id,
|
|
22
|
-
createTime: payload.create_time,
|
|
23
|
-
updateTime: payload.update_time,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
2
|
-
export interface VendorCreditPayload {
|
|
3
|
-
credit_id: string;
|
|
4
|
-
currency_code: string;
|
|
5
|
-
remaining_amount: number;
|
|
6
|
-
status: string;
|
|
7
|
-
total_amount: number;
|
|
8
|
-
vendor_id: string;
|
|
9
|
-
applied_to_bill_id?: string;
|
|
10
|
-
create_time?: string;
|
|
11
|
-
created_by_user_id?: string;
|
|
12
|
-
credit_note_date?: string;
|
|
13
|
-
credit_note_number?: string;
|
|
14
|
-
file_id?: string;
|
|
15
|
-
last_updated_by_user_id?: string;
|
|
16
|
-
memo?: string;
|
|
17
|
-
qbo_vendor_id?: string;
|
|
18
|
-
update_time?: string;
|
|
19
|
-
vendor_name?: string;
|
|
20
|
-
}
|
|
21
|
-
export type CreateVendorCreditResponse = ZeniAPIResponse<VendorCreditPayload>;
|
|
22
|
-
export type FetchVendorCreditsResponse = ZeniAPIResponse<VendorCreditPayload[]>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../../../commonStateTypes/common';
|
|
2
|
-
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
3
|
-
import { VendorCreditLocalData, VendorCreditSummary } from './vendorCreditViewState';
|
|
4
|
-
export declare const createVendorCredit: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[localData: VendorCreditLocalData], {
|
|
5
|
-
localData: VendorCreditLocalData;
|
|
6
|
-
}, "vendorCreditView/createVendorCredit", never, never>, createVendorCreditSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
|
-
credit: VendorCreditSummary;
|
|
8
|
-
creditId: ID;
|
|
9
|
-
}, "vendorCreditView/createVendorCreditSuccess">, createVendorCreditFailure: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<ZeniAPIStatus<Record<string, unknown>> | undefined, "vendorCreditView/createVendorCreditFailure">, fetchVendorCreditsForVendor: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string], {
|
|
10
|
-
vendorId: string;
|
|
11
|
-
}, "vendorCreditView/fetchVendorCreditsForVendor", never, never>, fetchVendorCreditsForVendorSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<VendorCreditSummary[], "vendorCreditView/fetchVendorCreditsForVendorSuccess">, fetchVendorCreditsForVendorFailure: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<ZeniAPIStatus<Record<string, unknown>> | undefined, "vendorCreditView/fetchVendorCreditsForVendorFailure">, updateVendorCreditLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<VendorCreditLocalData>, "vendorCreditView/updateVendorCreditLocalData">, clearVendorCreditView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorCreditView/clearVendorCreditView">, clearVendorCreditsForVendor: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorCreditView/clearVendorCreditsForVendor">;
|
|
12
|
-
declare const _default: import("redux").Reducer<import("./vendorCreditViewState").VendorCreditViewState>;
|
|
13
|
-
export default _default;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearVendorCreditsForVendor = exports.clearVendorCreditView = exports.updateVendorCreditLocalData = exports.fetchVendorCreditsForVendorFailure = exports.fetchVendorCreditsForVendorSuccess = exports.fetchVendorCreditsForVendor = exports.createVendorCreditFailure = exports.createVendorCreditSuccess = exports.createVendorCredit = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const vendorCreditViewState_1 = require("./vendorCreditViewState");
|
|
7
|
-
const vendorCreditView = (0, toolkit_1.createSlice)({
|
|
8
|
-
name: 'vendorCreditView',
|
|
9
|
-
initialState: vendorCreditViewState_1.initialVendorCreditViewState,
|
|
10
|
-
reducers: {
|
|
11
|
-
createVendorCredit: {
|
|
12
|
-
reducer(draft) {
|
|
13
|
-
draft.editVendorCreditDetail.saveStatus = {
|
|
14
|
-
fetchState: 'In-Progress',
|
|
15
|
-
error: undefined,
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
prepare(localData) {
|
|
19
|
-
return { payload: { localData } };
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
createVendorCreditSuccess(draft, action) {
|
|
23
|
-
draft.editVendorCreditDetail.saveStatus = {
|
|
24
|
-
fetchState: 'Completed',
|
|
25
|
-
error: undefined,
|
|
26
|
-
};
|
|
27
|
-
draft.editVendorCreditDetail.creditId = action.payload.creditId;
|
|
28
|
-
},
|
|
29
|
-
createVendorCreditFailure(draft, action) {
|
|
30
|
-
draft.editVendorCreditDetail.saveStatus = {
|
|
31
|
-
fetchState: 'Error',
|
|
32
|
-
error: action.payload,
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
fetchVendorCreditsForVendor: {
|
|
36
|
-
reducer(draft, action) {
|
|
37
|
-
draft.vendorCreditsForVendor.vendorId = action.payload.vendorId;
|
|
38
|
-
draft.vendorCreditsForVendor.fetchStatus = {
|
|
39
|
-
fetchState: 'In-Progress',
|
|
40
|
-
error: undefined,
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
prepare(vendorId) {
|
|
44
|
-
return { payload: { vendorId } };
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
fetchVendorCreditsForVendorSuccess(draft, action) {
|
|
48
|
-
draft.vendorCreditsForVendor.credits = action.payload;
|
|
49
|
-
draft.vendorCreditsForVendor.fetchStatus = {
|
|
50
|
-
fetchState: 'Completed',
|
|
51
|
-
error: undefined,
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
fetchVendorCreditsForVendorFailure(draft, action) {
|
|
55
|
-
draft.vendorCreditsForVendor.fetchStatus = {
|
|
56
|
-
fetchState: 'Error',
|
|
57
|
-
error: action.payload,
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
updateVendorCreditLocalData(draft, action) {
|
|
61
|
-
draft.editVendorCreditDetail.vendorCreditLocalData = {
|
|
62
|
-
...draft.editVendorCreditDetail.vendorCreditLocalData,
|
|
63
|
-
...action.payload,
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
clearVendorCreditView(draft) {
|
|
67
|
-
draft.editVendorCreditDetail = {
|
|
68
|
-
...vendorCreditViewState_1.initialVendorCreditViewState.editVendorCreditDetail,
|
|
69
|
-
vendorCreditLocalData: { ...vendorCreditViewState_1.initialVendorCreditLocalData },
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
clearVendorCreditsForVendor(draft) {
|
|
73
|
-
draft.vendorCreditsForVendor = {
|
|
74
|
-
...vendorCreditViewState_1.initialVendorCreditViewState.vendorCreditsForVendor,
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
_a = vendorCreditView.actions, exports.createVendorCredit = _a.createVendorCredit, exports.createVendorCreditSuccess = _a.createVendorCreditSuccess, exports.createVendorCreditFailure = _a.createVendorCreditFailure, exports.fetchVendorCreditsForVendor = _a.fetchVendorCreditsForVendor, exports.fetchVendorCreditsForVendorSuccess = _a.fetchVendorCreditsForVendorSuccess, exports.fetchVendorCreditsForVendorFailure = _a.fetchVendorCreditsForVendorFailure, exports.updateVendorCreditLocalData = _a.updateVendorCreditLocalData, exports.clearVendorCreditView = _a.clearVendorCreditView, exports.clearVendorCreditsForVendor = _a.clearVendorCreditsForVendor;
|
|
80
|
-
exports.default = vendorCreditView.reducer;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
2
|
-
import { RootState } from '../../../../reducer';
|
|
3
|
-
import { VendorCreditLocalData, VendorCreditSummary } from './vendorCreditViewState';
|
|
4
|
-
export interface VendorCreditEditSelectorView {
|
|
5
|
-
fetchStatus: FetchStateAndError;
|
|
6
|
-
saveStatus: FetchStateAndError;
|
|
7
|
-
vendorCreditLocalData: VendorCreditLocalData;
|
|
8
|
-
creditId?: ID;
|
|
9
|
-
}
|
|
10
|
-
export declare function getVendorCreditEditDetail(state: RootState): VendorCreditEditSelectorView;
|
|
11
|
-
export declare function getVendorCreditsForVendor(state: RootState): {
|
|
12
|
-
credits: VendorCreditSummary[];
|
|
13
|
-
fetchStatus: FetchStateAndError;
|
|
14
|
-
vendorId?: ID;
|
|
15
|
-
};
|
|
16
|
-
export declare function getAvailableVendorCreditsForVendor(state: RootState): VendorCreditSummary[];
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getVendorCreditEditDetail = getVendorCreditEditDetail;
|
|
4
|
-
exports.getVendorCreditsForVendor = getVendorCreditsForVendor;
|
|
5
|
-
exports.getAvailableVendorCreditsForVendor = getAvailableVendorCreditsForVendor;
|
|
6
|
-
function getVendorCreditEditDetail(state) {
|
|
7
|
-
const detail = state.vendorCreditViewState.editVendorCreditDetail;
|
|
8
|
-
return {
|
|
9
|
-
vendorCreditLocalData: detail.vendorCreditLocalData,
|
|
10
|
-
fetchStatus: detail.fetchStatus,
|
|
11
|
-
saveStatus: detail.saveStatus,
|
|
12
|
-
creditId: detail.creditId,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function getVendorCreditsForVendor(state) {
|
|
16
|
-
return state.vendorCreditViewState.vendorCreditsForVendor;
|
|
17
|
-
}
|
|
18
|
-
function getAvailableVendorCreditsForVendor(state) {
|
|
19
|
-
return state.vendorCreditViewState.vendorCreditsForVendor.credits.filter((c) => c.status === 'available');
|
|
20
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
2
|
-
import { ZeniDate } from '../../../../zeniDayJS';
|
|
3
|
-
export type VendorCreditStatus = 'available' | 'applied';
|
|
4
|
-
export interface VendorCreditSummary {
|
|
5
|
-
creditId: ID;
|
|
6
|
-
currencyCode: string;
|
|
7
|
-
remainingAmount: number;
|
|
8
|
-
status: VendorCreditStatus;
|
|
9
|
-
totalAmount: number;
|
|
10
|
-
vendorId: ID;
|
|
11
|
-
appliedToBillId?: ID;
|
|
12
|
-
createTime?: string;
|
|
13
|
-
creditNoteDate?: ZeniDate;
|
|
14
|
-
creditNoteNumber?: string;
|
|
15
|
-
fileId?: ID;
|
|
16
|
-
memo?: string;
|
|
17
|
-
updateTime?: string;
|
|
18
|
-
vendorName?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface VendorCreditLocalData {
|
|
21
|
-
currencyCode: string;
|
|
22
|
-
appliedToBillId?: ID;
|
|
23
|
-
creditNoteDate?: ZeniDate;
|
|
24
|
-
creditNoteNumber?: string;
|
|
25
|
-
fileId?: ID;
|
|
26
|
-
memo?: string;
|
|
27
|
-
totalAmount?: number;
|
|
28
|
-
vendorId?: ID;
|
|
29
|
-
vendorName?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface VendorCreditViewState {
|
|
32
|
-
editVendorCreditDetail: {
|
|
33
|
-
fetchStatus: FetchStateAndError;
|
|
34
|
-
saveStatus: FetchStateAndError;
|
|
35
|
-
vendorCreditLocalData: VendorCreditLocalData;
|
|
36
|
-
creditId?: ID;
|
|
37
|
-
};
|
|
38
|
-
vendorCreditsForVendor: {
|
|
39
|
-
credits: VendorCreditSummary[];
|
|
40
|
-
fetchStatus: FetchStateAndError;
|
|
41
|
-
vendorId?: ID;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export declare const initialVendorCreditLocalData: VendorCreditLocalData;
|
|
45
|
-
export declare const initialVendorCreditViewState: VendorCreditViewState;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialVendorCreditViewState = exports.initialVendorCreditLocalData = void 0;
|
|
4
|
-
exports.initialVendorCreditLocalData = {
|
|
5
|
-
vendorId: undefined,
|
|
6
|
-
vendorName: undefined,
|
|
7
|
-
creditNoteNumber: undefined,
|
|
8
|
-
creditNoteDate: undefined,
|
|
9
|
-
memo: undefined,
|
|
10
|
-
totalAmount: undefined,
|
|
11
|
-
currencyCode: 'USD',
|
|
12
|
-
fileId: undefined,
|
|
13
|
-
appliedToBillId: undefined,
|
|
14
|
-
};
|
|
15
|
-
exports.initialVendorCreditViewState = {
|
|
16
|
-
editVendorCreditDetail: {
|
|
17
|
-
vendorCreditLocalData: exports.initialVendorCreditLocalData,
|
|
18
|
-
fetchStatus: {
|
|
19
|
-
fetchState: 'Not-Started',
|
|
20
|
-
error: undefined,
|
|
21
|
-
},
|
|
22
|
-
saveStatus: {
|
|
23
|
-
fetchState: 'Not-Started',
|
|
24
|
-
error: undefined,
|
|
25
|
-
},
|
|
26
|
-
creditId: undefined,
|
|
27
|
-
},
|
|
28
|
-
vendorCreditsForVendor: {
|
|
29
|
-
credits: [],
|
|
30
|
-
fetchStatus: {
|
|
31
|
-
fetchState: 'Not-Started',
|
|
32
|
-
error: undefined,
|
|
33
|
-
},
|
|
34
|
-
vendorId: undefined,
|
|
35
|
-
},
|
|
36
|
-
};
|