@zeniai/client-epic-state 4.8.89 → 4.8.91
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/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +1 -0
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +2 -1
- package/lib/entity/file/filePayload.d.ts +6 -0
- package/lib/entity/file/fileReducer.d.ts +7 -3
- package/lib/entity/file/fileReducer.js +39 -2
- package/lib/entity/file/fileSelector.d.ts +4 -1
- package/lib/entity/file/fileSelector.js +23 -1
- package/lib/entity/file/fileState.d.ts +16 -0
- package/lib/entity/file/fileState.js +27 -1
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/index.d.ts +6 -5
- package/lib/index.js +20 -11
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewPayload.d.ts +2 -0
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +4 -2
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +4 -3
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.d.ts +2 -0
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.js +4 -0
- package/lib/view/companyMonthEndReportView/fetchCompanyMonthEndReportViewEpic.d.ts +2 -1
- package/lib/view/companyMonthEndReportView/saveCompanyMonthEndReportEpic.js +13 -1
- package/lib/view/companyMonthEndReportView/sendCompanyMonthEndReportEpic.js +13 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +29 -27
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { Month } from '../timePeriod';
|
|
|
3
3
|
export declare const MONTH_YEAR_FORMAT = "MMM YYYY";
|
|
4
4
|
export declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
|
|
5
5
|
export declare const DAY_MONTH_YEAR_FORMAT = "DDMMYYYY";
|
|
6
|
+
export declare const MONTH_FORMAT = "MMMM";
|
|
6
7
|
export declare const toFiscalYearSupportedDateFormat: (format: string) => "YY" | "YYYY" | "Q YY" | "Q YYYY";
|
|
7
8
|
export declare const toFiscalYearSupportedDateFormatStrict: (format: string) => "YY" | "YYYY" | "Q YY" | "Q YYYY" | undefined;
|
|
8
9
|
export declare type FiscalYearSupportedDateFormat = ReturnType<typeof toFiscalYearSupportedDateFormat>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatZeniDateFY = exports.toFiscalYearSupportedDateFormatStrict = exports.toFiscalYearSupportedDateFormat = exports.DAY_MONTH_YEAR_FORMAT = exports.DEFAULT_DATE_FORMAT = exports.MONTH_YEAR_FORMAT = void 0;
|
|
3
|
+
exports.formatZeniDateFY = exports.toFiscalYearSupportedDateFormatStrict = exports.toFiscalYearSupportedDateFormat = exports.MONTH_FORMAT = exports.DAY_MONTH_YEAR_FORMAT = exports.DEFAULT_DATE_FORMAT = exports.MONTH_YEAR_FORMAT = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../stringToUnion");
|
|
5
5
|
const getFYQuarterAndYear_1 = require("./getFYQuarterAndYear");
|
|
6
6
|
exports.MONTH_YEAR_FORMAT = 'MMM YYYY';
|
|
7
7
|
exports.DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
|
|
8
8
|
exports.DAY_MONTH_YEAR_FORMAT = 'DDMMYYYY';
|
|
9
|
+
exports.MONTH_FORMAT = 'MMMM';
|
|
9
10
|
const ALL_FISCAL_YEAR_SUPPORTED_DATE_FORMATS = [
|
|
10
11
|
'YY',
|
|
11
12
|
'YYYY',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
1
2
|
export interface FilePayload {
|
|
2
3
|
file_size_unit: string;
|
|
3
4
|
update_time?: string | null;
|
|
@@ -28,3 +29,8 @@ export interface ImageFilePayload {
|
|
|
28
29
|
image_format: string;
|
|
29
30
|
image_size_type: string;
|
|
30
31
|
}
|
|
32
|
+
export interface AttachmentFilePayload {
|
|
33
|
+
data: string;
|
|
34
|
+
name: string;
|
|
35
|
+
id: ID;
|
|
36
|
+
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { FilePayload } from './filePayload';
|
|
2
|
-
import { File, FileState } from './fileState';
|
|
1
|
+
import { FilePayload, AttachmentFilePayload } from './filePayload';
|
|
2
|
+
import { File, AttachmentFile, FileState } from './fileState';
|
|
3
3
|
export declare const initialState: FileState;
|
|
4
4
|
export declare const updateFiles: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
5
5
|
files: FilePayload[];
|
|
6
|
-
}, string>, removeFiles: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], string>,
|
|
6
|
+
}, string>, removeFiles: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], string>, updateAttachmentFiles: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
|
+
files: AttachmentFilePayload[];
|
|
8
|
+
}, string>, removeAttachmentFiles: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], string>, clearAllFiles: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
7
9
|
declare const _default: import("@reduxjs/toolkit").Reducer<FileState, import("@reduxjs/toolkit").AnyAction>;
|
|
8
10
|
export default _default;
|
|
9
11
|
/**
|
|
10
12
|
* Helper functions.
|
|
11
13
|
*/
|
|
12
14
|
export declare function mapFilePayloadToFile(filepayload: FilePayload): File;
|
|
15
|
+
export declare function mapAttachmentFilePayloadToFile(filePayload: AttachmentFilePayload): AttachmentFile;
|
|
16
|
+
export declare function mapAttachmentFileToAttachmentFilePayload(file: AttachmentFile | undefined): AttachmentFilePayload | undefined;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.mapFilePayloadToFile = exports.clearAllFiles = exports.removeFiles = exports.updateFiles = exports.initialState = void 0;
|
|
4
|
+
exports.mapAttachmentFileToAttachmentFilePayload = exports.mapAttachmentFilePayloadToFile = exports.mapFilePayloadToFile = exports.clearAllFiles = exports.removeAttachmentFiles = exports.updateAttachmentFiles = exports.removeFiles = exports.updateFiles = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
7
|
+
const fileState_1 = require("./fileState");
|
|
7
8
|
const zeniUrl_1 = require("../../zeniUrl");
|
|
8
9
|
exports.initialState = {
|
|
9
10
|
fileByFileId: {},
|
|
11
|
+
attachmentFileByFileId: {},
|
|
10
12
|
};
|
|
11
13
|
const user = (0, toolkit_1.createSlice)({
|
|
12
14
|
name: 'file',
|
|
@@ -21,12 +23,21 @@ const user = (0, toolkit_1.createSlice)({
|
|
|
21
23
|
removeFiles(draft, action) {
|
|
22
24
|
action.payload.map((fileId) => delete draft.fileByFileId[fileId]);
|
|
23
25
|
},
|
|
26
|
+
updateAttachmentFiles(draft, action) {
|
|
27
|
+
action.payload.files.forEach((filePayload) => {
|
|
28
|
+
const latestFile = mapAttachmentFilePayloadToFile(filePayload);
|
|
29
|
+
draft.attachmentFileByFileId[latestFile.fileId] = latestFile;
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
removeAttachmentFiles(draft, action) {
|
|
33
|
+
action.payload.map((fileId) => delete draft.attachmentFileByFileId[fileId]);
|
|
34
|
+
},
|
|
24
35
|
clearAllFiles(draft) {
|
|
25
36
|
Object.assign(draft, exports.initialState);
|
|
26
37
|
},
|
|
27
38
|
},
|
|
28
39
|
});
|
|
29
|
-
_a = user.actions, exports.updateFiles = _a.updateFiles, exports.removeFiles = _a.removeFiles, exports.clearAllFiles = _a.clearAllFiles;
|
|
40
|
+
_a = user.actions, exports.updateFiles = _a.updateFiles, exports.removeFiles = _a.removeFiles, exports.updateAttachmentFiles = _a.updateAttachmentFiles, exports.removeAttachmentFiles = _a.removeAttachmentFiles, exports.clearAllFiles = _a.clearAllFiles;
|
|
30
41
|
exports.default = user.reducer;
|
|
31
42
|
/**
|
|
32
43
|
* Helper functions.
|
|
@@ -66,3 +77,29 @@ function mapFilePayloadToFile(filepayload) {
|
|
|
66
77
|
};
|
|
67
78
|
}
|
|
68
79
|
exports.mapFilePayloadToFile = mapFilePayloadToFile;
|
|
80
|
+
function mapAttachmentFilePayloadToFile(filePayload) {
|
|
81
|
+
const fileDetailsArray = filePayload.id.split(':');
|
|
82
|
+
const companyId = fileDetailsArray[2];
|
|
83
|
+
const fileEntension = (0, fileState_1.toSupportedAttachmentFileFormatType)('.' + filePayload.name.substring(filePayload.name.lastIndexOf('.') + 1));
|
|
84
|
+
return {
|
|
85
|
+
base64String: filePayload.data,
|
|
86
|
+
fileId: filePayload.id,
|
|
87
|
+
fileName: filePayload.name,
|
|
88
|
+
extension: fileEntension,
|
|
89
|
+
companyId: companyId,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
exports.mapAttachmentFilePayloadToFile = mapAttachmentFilePayloadToFile;
|
|
93
|
+
function mapAttachmentFileToAttachmentFilePayload(file) {
|
|
94
|
+
if (file == undefined) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
return {
|
|
99
|
+
data: file.base64String,
|
|
100
|
+
id: file.fileId,
|
|
101
|
+
name: file.fileName,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.mapAttachmentFileToAttachmentFilePayload = mapAttachmentFileToAttachmentFilePayload;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { File, FileState } from './fileState';
|
|
2
|
+
import { File, AttachmentFile, FileState } from './fileState';
|
|
3
3
|
export declare function getFilesByFileIds(fileState: FileState, fileIds: ID[]): File[];
|
|
4
4
|
export declare function getFileByFileId(fileState: FileState, fileId: ID): File | undefined;
|
|
5
|
+
export declare function getAttachmentFilesByFileIds(fileState: FileState, fileIds: ID[]): AttachmentFile[];
|
|
6
|
+
export declare function getAttachmentFileByFileId(fileState: FileState, fileId: ID): AttachmentFile | undefined;
|
|
7
|
+
export declare function getAttachmentFileIdByFileName(companyId: ID, fileName: string): ID;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFileByFileId = exports.getFilesByFileIds = void 0;
|
|
3
|
+
exports.getAttachmentFileIdByFileName = exports.getAttachmentFileByFileId = exports.getAttachmentFilesByFileIds = exports.getFileByFileId = exports.getFilesByFileIds = void 0;
|
|
4
|
+
const formatZeniDateFY_1 = require("../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
5
|
+
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
4
6
|
function getFilesByFileIds(fileState, fileIds) {
|
|
5
7
|
const files = fileIds
|
|
6
8
|
.map((fileId) => getFileByFileId(fileState, fileId))
|
|
@@ -13,3 +15,23 @@ function getFileByFileId(fileState, fileId) {
|
|
|
13
15
|
return (_a = fileState.fileByFileId[fileId]) !== null && _a !== void 0 ? _a : undefined;
|
|
14
16
|
}
|
|
15
17
|
exports.getFileByFileId = getFileByFileId;
|
|
18
|
+
function getAttachmentFilesByFileIds(fileState, fileIds) {
|
|
19
|
+
const files = fileIds
|
|
20
|
+
.map((fileId) => getAttachmentFileByFileId(fileState, fileId))
|
|
21
|
+
.filter((value) => value != null);
|
|
22
|
+
return files;
|
|
23
|
+
}
|
|
24
|
+
exports.getAttachmentFilesByFileIds = getAttachmentFilesByFileIds;
|
|
25
|
+
function getAttachmentFileByFileId(fileState, fileId) {
|
|
26
|
+
var _a;
|
|
27
|
+
return (_a = fileState.attachmentFileByFileId[fileId]) !== null && _a !== void 0 ? _a : undefined;
|
|
28
|
+
}
|
|
29
|
+
exports.getAttachmentFileByFileId = getAttachmentFileByFileId;
|
|
30
|
+
function getAttachmentFileIdByFileName(companyId, fileName) {
|
|
31
|
+
let fileId = 'file';
|
|
32
|
+
fileId += ':' + (0, zeniDayJS_1.dateNow)().subtract(1, 'month').format(formatZeniDateFY_1.MONTH_FORMAT);
|
|
33
|
+
fileId += ':' + companyId;
|
|
34
|
+
fileId += ':' + fileName;
|
|
35
|
+
return fileId;
|
|
36
|
+
}
|
|
37
|
+
exports.getAttachmentFileIdByFileName = getAttachmentFileIdByFileName;
|
|
@@ -3,6 +3,7 @@ import { ID } from '../../commonStateTypes/common';
|
|
|
3
3
|
import ZeniUrl from '../../zeniUrl';
|
|
4
4
|
export interface FileState {
|
|
5
5
|
fileByFileId: Record<ID, File>;
|
|
6
|
+
attachmentFileByFileId: Record<ID, AttachmentFile>;
|
|
6
7
|
}
|
|
7
8
|
export interface File {
|
|
8
9
|
fileSizeUnit: FileSizeUnit;
|
|
@@ -34,6 +35,13 @@ export interface ImageFile {
|
|
|
34
35
|
imageFormat: string;
|
|
35
36
|
imageSizeType: string;
|
|
36
37
|
}
|
|
38
|
+
export interface AttachmentFile {
|
|
39
|
+
base64String: string;
|
|
40
|
+
companyId: ID;
|
|
41
|
+
extension: SupportedAttachmentFileFormatType;
|
|
42
|
+
fileId: ID;
|
|
43
|
+
fileName: string;
|
|
44
|
+
}
|
|
37
45
|
export declare type FileSizeUnit = 'bytes';
|
|
38
46
|
export declare const SUPPORTED_FILE_TYPES: readonly ["application/pdf", "image/jpeg", "image/jpg", "image/png", "image/bmp", "image/heic", "text/html", "text/csv", "text/plain"];
|
|
39
47
|
export declare const toSupportedFileType: (v: string) => "text/html" | "application/pdf" | "image/jpeg" | "image/jpg" | "image/png" | "image/bmp" | "image/heic" | "text/csv" | "text/plain";
|
|
@@ -43,6 +51,14 @@ export declare const SUPPORTED_FILE_FORMATS: readonly [".pdf", ".jpeg", ".jpg",
|
|
|
43
51
|
export declare const toSupportedFileFormatType: (v: string) => ".pdf" | ".jpeg" | ".jpg" | ".bmp" | ".heic" | ".png" | ".csv" | ".txt";
|
|
44
52
|
export declare const toSupportedFileFormatTypeStrict: (v: string) => ".pdf" | ".jpeg" | ".jpg" | ".bmp" | ".heic" | ".png" | ".csv" | ".txt" | undefined;
|
|
45
53
|
export declare type SupportedFileFormatType = ReturnType<typeof toSupportedFileFormatType>;
|
|
54
|
+
export declare const SUPPORTED_ATTACHMENT_FILE_TYPES: readonly ["application/pdf", "image/jpeg", "image/jpg", "image/png", "text/plain", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];
|
|
55
|
+
export declare const toSupportedAttachmentFileType: (v: string) => "application/pdf" | "image/jpeg" | "image/jpg" | "image/png" | "text/plain" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
56
|
+
export declare const toSupportedAttachmentFileTypeStrict: (v: string) => "application/pdf" | "image/jpeg" | "image/jpg" | "image/png" | "text/plain" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | undefined;
|
|
57
|
+
export declare type SupportedAttachmentFileType = ReturnType<typeof toSupportedAttachmentFileType>;
|
|
58
|
+
export declare const SUPPORTED_ATTACHMENT_FILE_FORMATS: readonly [".pdf", ".jpeg", ".jpg", ".png", ".txt", ".xls", ".xlsx"];
|
|
59
|
+
export declare const toSupportedAttachmentFileFormatType: (v: string) => ".pdf" | ".jpeg" | ".jpg" | ".png" | ".txt" | ".xls" | ".xlsx";
|
|
60
|
+
export declare const toSupportedAttachmentFileFormatTypeStrict: (v: string) => ".pdf" | ".jpeg" | ".jpg" | ".png" | ".txt" | ".xls" | ".xlsx" | undefined;
|
|
61
|
+
export declare type SupportedAttachmentFileFormatType = ReturnType<typeof toSupportedAttachmentFileFormatType>;
|
|
46
62
|
export declare const ALLOWED_DOCUMENT_TYPES: readonly ["1099_C", "address_verification", "bill_pay", "certificate_of_incorporation", "check", "contract", "driving_license", "employer_identification_number_confirmation", "id_document", "others", "passport", "purchase_order", "social_security_card", "tax_ein", "w4", "w9"];
|
|
47
63
|
export declare const toAllowedDocumentType: (v: string) => "bill_pay" | "check" | "others" | "1099_C" | "address_verification" | "certificate_of_incorporation" | "contract" | "driving_license" | "employer_identification_number_confirmation" | "id_document" | "passport" | "purchase_order" | "social_security_card" | "tax_ein" | "w4" | "w9";
|
|
48
64
|
export declare const toAllowedDocumentTypeStrict: (v: string) => "bill_pay" | "check" | "others" | "1099_C" | "address_verification" | "certificate_of_incorporation" | "contract" | "driving_license" | "employer_identification_number_confirmation" | "id_document" | "passport" | "purchase_order" | "social_security_card" | "tax_ein" | "w4" | "w9" | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toAllowedImageSizeTypeStrict = exports.toAllowedImageSizeType = exports.ALLOWED_IMAGE_SIZE_TYPE = exports.toAllowedDocumentSideTypeStrict = exports.toAllowedDocumentSideType = exports.ALLOWED_DOCUMENT_SIDES = exports.toAllowedPurposeIdTypeStrict = exports.toAllowedPurposeIdType = exports.ALLOWED_PURPOSE_IDS = exports.toAllowedDocumentTypeStrict = exports.toAllowedDocumentType = exports.ALLOWED_DOCUMENT_TYPES = exports.toSupportedFileFormatTypeStrict = exports.toSupportedFileFormatType = exports.SUPPORTED_FILE_FORMATS = exports.toSupportedFileTypeStrict = exports.toSupportedFileType = exports.SUPPORTED_FILE_TYPES = void 0;
|
|
3
|
+
exports.toAllowedImageSizeTypeStrict = exports.toAllowedImageSizeType = exports.ALLOWED_IMAGE_SIZE_TYPE = exports.toAllowedDocumentSideTypeStrict = exports.toAllowedDocumentSideType = exports.ALLOWED_DOCUMENT_SIDES = exports.toAllowedPurposeIdTypeStrict = exports.toAllowedPurposeIdType = exports.ALLOWED_PURPOSE_IDS = exports.toAllowedDocumentTypeStrict = exports.toAllowedDocumentType = exports.ALLOWED_DOCUMENT_TYPES = exports.toSupportedAttachmentFileFormatTypeStrict = exports.toSupportedAttachmentFileFormatType = exports.SUPPORTED_ATTACHMENT_FILE_FORMATS = exports.toSupportedAttachmentFileTypeStrict = exports.toSupportedAttachmentFileType = exports.SUPPORTED_ATTACHMENT_FILE_TYPES = exports.toSupportedFileFormatTypeStrict = exports.toSupportedFileFormatType = exports.SUPPORTED_FILE_FORMATS = exports.toSupportedFileTypeStrict = exports.toSupportedFileType = exports.SUPPORTED_FILE_TYPES = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
5
|
exports.SUPPORTED_FILE_TYPES = [
|
|
6
6
|
'application/pdf',
|
|
@@ -31,6 +31,32 @@ const toSupportedFileFormatType = (v) => (0, stringToUnion_1.stringToUnion)(v, e
|
|
|
31
31
|
exports.toSupportedFileFormatType = toSupportedFileFormatType;
|
|
32
32
|
const toSupportedFileFormatTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.SUPPORTED_FILE_FORMATS);
|
|
33
33
|
exports.toSupportedFileFormatTypeStrict = toSupportedFileFormatTypeStrict;
|
|
34
|
+
exports.SUPPORTED_ATTACHMENT_FILE_TYPES = [
|
|
35
|
+
'application/pdf',
|
|
36
|
+
'image/jpeg',
|
|
37
|
+
'image/jpg',
|
|
38
|
+
'image/png',
|
|
39
|
+
'text/plain',
|
|
40
|
+
'application/vnd.ms-excel',
|
|
41
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', // these are BIFF types
|
|
42
|
+
];
|
|
43
|
+
const toSupportedAttachmentFileType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.SUPPORTED_ATTACHMENT_FILE_TYPES);
|
|
44
|
+
exports.toSupportedAttachmentFileType = toSupportedAttachmentFileType;
|
|
45
|
+
const toSupportedAttachmentFileTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.SUPPORTED_ATTACHMENT_FILE_TYPES);
|
|
46
|
+
exports.toSupportedAttachmentFileTypeStrict = toSupportedAttachmentFileTypeStrict;
|
|
47
|
+
exports.SUPPORTED_ATTACHMENT_FILE_FORMATS = [
|
|
48
|
+
'.pdf',
|
|
49
|
+
'.jpeg',
|
|
50
|
+
'.jpg',
|
|
51
|
+
'.png',
|
|
52
|
+
'.txt',
|
|
53
|
+
'.xls',
|
|
54
|
+
'.xlsx',
|
|
55
|
+
];
|
|
56
|
+
const toSupportedAttachmentFileFormatType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.SUPPORTED_ATTACHMENT_FILE_FORMATS);
|
|
57
|
+
exports.toSupportedAttachmentFileFormatType = toSupportedAttachmentFileFormatType;
|
|
58
|
+
const toSupportedAttachmentFileFormatTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.SUPPORTED_ATTACHMENT_FILE_FORMATS);
|
|
59
|
+
exports.toSupportedAttachmentFileFormatTypeStrict = toSupportedAttachmentFileFormatTypeStrict;
|
|
34
60
|
exports.ALLOWED_DOCUMENT_TYPES = [
|
|
35
61
|
'1099_C',
|
|
36
62
|
'address_verification',
|
|
@@ -2,9 +2,9 @@ import { ID } from '../../../commonStateTypes/common';
|
|
|
2
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
3
3
|
import { ZeniUrl as Url } from '../../../zeniUrl';
|
|
4
4
|
import { File } from '../../file/fileState';
|
|
5
|
-
export declare const toContentType: (v: string) => "image/svg+xml" | "text/html" | "text/xml" | "application/pdf" | "image/jpeg" | "image/jpg" | "image/png" | "image/heic" | "text/csv" | "text/plain" | "application/
|
|
5
|
+
export declare const toContentType: (v: string) => "image/svg+xml" | "text/html" | "text/xml" | "application/pdf" | "image/jpeg" | "image/jpg" | "image/png" | "image/heic" | "text/csv" | "text/plain" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/postscript" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/rtf" | "image/heif" | "image/webp" | "image/gif";
|
|
6
6
|
export declare type ContentType = ReturnType<typeof toContentType>;
|
|
7
|
-
export declare const toContentTypeStrict: (v: string) => "image/svg+xml" | "text/html" | "text/xml" | "application/pdf" | "image/jpeg" | "image/jpg" | "image/png" | "image/heic" | "text/csv" | "text/plain" | "application/
|
|
7
|
+
export declare const toContentTypeStrict: (v: string) => "image/svg+xml" | "text/html" | "text/xml" | "application/pdf" | "image/jpeg" | "image/jpg" | "image/png" | "image/heic" | "text/csv" | "text/plain" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/postscript" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/rtf" | "image/heif" | "image/webp" | "image/gif" | undefined;
|
|
8
8
|
export interface Attachment {
|
|
9
9
|
id: ID;
|
|
10
10
|
contentType?: ContentType;
|
package/lib/index.d.ts
CHANGED
|
@@ -324,16 +324,17 @@ import { getSubscriptionListView, getSubscriptionsDetailView, getSubscriptionLoc
|
|
|
324
324
|
import { SubscriptionListView, SubscriptionEstimationData, SubscriptionLocalStoreDataView, SubscriptionsDetailView, SubscriptionDetails } from './view/subscriptionView/subscriptionViewSelectorTypes';
|
|
325
325
|
import { SubscriptionEstimateWithSchema, AddOnEstimate } from './view/subscriptionView/types/subscriptionEstmiate';
|
|
326
326
|
export { AddOnEstimate, SubscriptionViewSortKey, toSubscriptionSortKeyType, SubscriptionView, SubscriptionListView as CompanySubscriptionView, getSubscriptionListView as getCompanySubscriptionView, SubscriptionListUIState as SubscriptionUIState, updateSubscriptionListUIState as updateCompanySubscriptionUIState, SubscriptionUpdateData, SubscriptionCreateData, SubscriptionActionType, SubscriptionDetails, SubscriptionEstimateWithSchema, fetchSubscriptionList, fetchSubscriptionPlans, fetchSubscriptionAddOns, fetchSubscriptionCoupons, fetchSubscriptionDetails, saveSubscriptionUpdates, saveSubscriptionNotesUpdates, fetchSubscriptionCreateEstimate, fetchSubscriptionUpdateEstimate, clearSubscriptionView, initializeSubscriptionLocalData, saveSubscriptionLocalData, clearSubscriptionUpdateViewDataByTenantId, clearSubscriptionLocalData, getSubscriptionsDetailView, getSubscriptionLocalStoreDataView, getSubscriptionEstimationData, SubscriptionEstimationData, SubscriptionLocalStoreDataView, SubscriptionsDetailView, };
|
|
327
|
-
import { FilePayload } from './entity/file/filePayload';
|
|
328
|
-
import { updateFiles, mapFilePayloadToFile } from './entity/file/fileReducer';
|
|
329
|
-
import { SupportedFileType, File, AllowedDocumentType, toSupportedFileTypeStrict } from './entity/file/fileState';
|
|
330
|
-
export { SupportedFileType, File, FilePayload, AllowedDocumentType, updateFiles, toSupportedFileTypeStrict, };
|
|
327
|
+
import { FilePayload, AttachmentFilePayload } from './entity/file/filePayload';
|
|
328
|
+
import { updateFiles, updateAttachmentFiles, removeAttachmentFiles, mapFilePayloadToFile, mapAttachmentFilePayloadToFile, mapAttachmentFileToAttachmentFilePayload } from './entity/file/fileReducer';
|
|
329
|
+
import { SupportedFileType, SupportedAttachmentFileType, SUPPORTED_ATTACHMENT_FILE_TYPES, File, AttachmentFile, AllowedDocumentType, toSupportedFileTypeStrict, toSupportedAttachmentFileFormatType, toSupportedAttachmentFileType } from './entity/file/fileState';
|
|
330
|
+
export { SupportedFileType, SupportedAttachmentFileType, SUPPORTED_ATTACHMENT_FILE_TYPES, File, AttachmentFile, FilePayload, AttachmentFilePayload, AllowedDocumentType, updateFiles, updateAttachmentFiles, removeAttachmentFiles, toSupportedFileTypeStrict, toSupportedAttachmentFileFormatType, toSupportedAttachmentFileType, };
|
|
331
|
+
import { getAttachmentFileIdByFileName } from './entity/file/fileSelector';
|
|
331
332
|
import { fetchFileList, fetchFileListFailure, fetchFileListSuccess, fetchFile, updateFileName, updateFileNameFailure, updateFileNameSuccess, updateFilesMetadata, deleteFileList, deleteFileListFailure, deleteFileListSuccess, deleteFile, deleteFileFailure, deleteFileSuccess, clearFileViewList } from './view/fileView/fileViewReducer';
|
|
332
333
|
import { FileListSelectorView, getFileListWithStatus, DeleteFileListSelectorView, getDeleteFileListWithStatus, getFileUpdateNameStatusById, getFileDeleteStatusById } from './view/fileView/fileViewSelector';
|
|
333
334
|
import { FileViewState } from './view/fileView/fileViewState';
|
|
334
335
|
import uploadFile, { AuthParams, FileMetadataPayload } from './view/fileView/fileUploadHelpers';
|
|
335
336
|
import downloadFile from './view/fileView/fileDownloadHelpers';
|
|
336
|
-
export { fetchFileList, fetchFileListFailure, fetchFileListSuccess, fetchFile, updateFileName, updateFileNameFailure, updateFileNameSuccess, updateFilesMetadata, deleteFileList, deleteFileListFailure, deleteFileListSuccess, deleteFile, deleteFileFailure, deleteFileSuccess, clearFileViewList, FileListSelectorView, getFileListWithStatus, DeleteFileListSelectorView, getDeleteFileListWithStatus, getFileUpdateNameStatusById, getFileDeleteStatusById, FileViewState, uploadFile, mapFilePayloadToFile, AuthParams, FileMetadataPayload, downloadFile, };
|
|
337
|
+
export { fetchFileList, fetchFileListFailure, fetchFileListSuccess, fetchFile, updateFileName, updateFileNameFailure, updateFileNameSuccess, updateFilesMetadata, deleteFileList, deleteFileListFailure, deleteFileListSuccess, deleteFile, deleteFileFailure, deleteFileSuccess, clearFileViewList, FileListSelectorView, getFileListWithStatus, DeleteFileListSelectorView, getDeleteFileListWithStatus, getFileUpdateNameStatusById, getFileDeleteStatusById, FileViewState, uploadFile, mapFilePayloadToFile, mapAttachmentFilePayloadToFile, mapAttachmentFileToAttachmentFilePayload, getAttachmentFileIdByFileName, AuthParams, FileMetadataPayload, downloadFile, };
|
|
337
338
|
import { fetchTasksCard } from './view/tasksCard/tasksCardReducer';
|
|
338
339
|
export { fetchTasksCard };
|
|
339
340
|
import { TasksCardReport } from './view/tasksCard/tasksCardSelector';
|
package/lib/index.js
CHANGED
|
@@ -35,17 +35,17 @@ exports.defaultCustomerCurrency = exports.toAttachment = exports.mapFileEntityTo
|
|
|
35
35
|
exports.getUpdatablePeriodsForTransactionRecommendations = exports.getTransactionDetailForTransaction = exports.getTransactionDetail = exports.getTransactionListByEntityForSinglePeriod = exports.getTransactionListUIStateByClassKey = exports.getTransactionListByClass = exports.getTransactionListByEntity = exports.getThirdPartyIdFromTransactionId = exports.uploadMissingReceiptSuccess = exports.updateTransactionDetail = exports.fetchTransactionDetail = exports.updateLocalDataWithTransactionsUpdateWithVendorCheckbox = exports.resetVendor = exports.updateSelectedVendor = exports.removeEntityRecommendationForLineIdForTransactionDetail = exports.initializeTransactionDetailLocalData = exports.setAllLineItemsLocalDataIsUpdateAllChecked = exports.saveTransactionDetail = exports.setAllLineItemsToCategoryClassInLocalData = exports.resetLineItemsCategoryClassInLocalData = exports.updateTransactionListByEntityFailure = exports.clearTransactionDetailSaveStatus = exports.saveTransactionDetailLocalData = exports.updateTransactionListByEntity = exports.fetchEntityTransactionList = exports.getTransactionListUIStateByAccountKey = exports.getTransactionListByAccount = exports.parallelFetchTransactionListByCategoryType = exports.updateTransactionListUIStateByCategoryType = exports.updateTransactionListByClass = exports.updateTransactionListByClassUIState = exports.parallelFetchClassTransactionList = exports.updateTransactionListByAccountUIState = exports.updateTransactionListByAccountFailure = exports.updateTransactionListByAccount = exports.fetchAccountTransactionList = exports.parallelFetchEntityTransactionList = exports.parallelFetchAccountTransactionList = exports.updateLatestTransactionId = exports.clearTransactionList = exports.isTransferTransaction = exports.isVendorTransaction = exports.updateVendors = exports.defaultVendorCurrency = exports.toTransactionCategory = exports.toTransactionTypeStrict = exports.toTransactionType = exports.toPlatformLineDetailType = exports.toTransactionID = exports.isCustomerTransaction = void 0;
|
|
36
36
|
exports.fetchPortfolioView = exports.fetchManagementView = exports.fetchOnboardingView = exports.fetchParentSubsidiaryManagementView = exports.updateCompanyManagementUIState = exports.updateCompanyPortfolioUIState = exports.fetchCompanyPortfolioView = exports.fetchCompanyManagementView = exports.fetchAllCockpitViews = exports.companyManagementSaveUpdates = exports.getParentSubsidiaryManagementView = exports.getAddonListZeniSku = exports.getPlanListZeniSku = exports.getCompanyManagementView = exports.getCompanyByCompanyId = exports.ALL_ACCOUNTING_CONNECTION_CREATION_MODES = exports.getEntityByEntityIDs = exports.clearAllEntities = exports.updateEntities = exports.getEntityAutoCompleteResults = exports.fetchEntityAutoCompleteResults = exports.clearEntityAutoCompleteResults = exports.fetchEntityAutoCompleteEpic = exports.toEntityType = exports.VendorExpenseTrend = exports.CustomerIncomeTrend = exports.getTrendForEntity = exports.clearTrendData = exports.fetchExpenseTrend = exports.fetchIncomeTrend = exports.getEntityDetailUIStateByEntity = exports.getLatestTimeFrameWithTransactionsForEntity = exports.getTrendWithTransactions = exports.trendWithTransactionsUpdateSelectedTimeperiod = exports.clearTrendWithTransactions = exports.fetchTransactionsForEntity = exports.fetchTrendForEntity = exports.updateReportUIOptionCOABalancesRange = exports.updateReportUIOptionThisPeriod = exports.toggleReportUIOptionForecastMode = exports.updateReportUIOptionIsCompareModeOn = exports.updateReportUIOptionCompareMode = exports.updateReportUIOptionIsForecastVsActualOn = exports.updateReportUIOptionSelectedForecast = exports.updateReportUIOptionTimeframe = exports.getForecastList = exports.fetchForecastList = exports.updateSelectedInsightIndex = exports.fetchInsightsCard = exports.getInsights = void 0;
|
|
37
37
|
exports.toSubscriptionSortKeyType = exports.getBankAccount = exports.getNestedAccountListHeirarchy = exports.getUncategorizedAccounts = exports.toCompanyPassportLocalData = exports.clearCompanyView = exports.saveCompanyPassportDetails = exports.updateCompanyPassportLocalStoreData = exports.companyPassportClearDataInLocalStore = exports.deleteCompanyOfficerInLocalStore = exports.saveIndustryAndIncDateInCompanyPassportLocalStore = exports.companyPassportSaveDataInLocalStore = exports.isCompanyPassportDataToBeSaved = exports.getCompanyPassportLocalStoreData = exports.getCompanyPassportView = exports.fetchCompanyPassportView = exports.isAllowedValueWithID = exports.isAllowedValueWithCode = exports.toCockpitTabsFileTypeStrict = exports.toCockpitTabsIDStrict = exports.ALL_COCKPIT_TABS_IDS = exports.ALL_COCKPIT_TABS_FILE_TYPES = exports.toPortfolioSortKeyType = exports.toOnboardingSortKeyType = exports.toManagementSortKeyType = exports.clearAddressView = exports.fetchAddress = exports.getFormattedAddress = exports.getAllNewAddresses = exports.getNewAddress = exports.getAddress = exports.newAddressInLocalStore = exports.getCompanyMonthEndReportSelectorView = exports.resetCompanyMonthEndReportFetchStatus = exports.saveCompanyMonthEndReport = exports.sendCompanyMonthEndReport = exports.fetchCompanyMonthEndReportView = exports.fetchImproveUsingZeniGPT = exports.getAllCockpitTabsFilterView = exports.isInfiniteRunway = exports.getCompanyPortfolioView = exports.getAuditWarningsCount = exports.retryBankAccountConnection = exports.getReviewCompanyListCount = exports.getReviewCompanySelectorView = exports.updateReviewCompanyListUIState = exports.fetchReviewCompanyView = exports.updateCompanyDownloadState = exports.fetchZeniUsers = exports.fetchSubscriptionView = void 0;
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.closeReferralInviteConfirmationPopup = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = exports.getInviteFormView = exports.getReferralListView = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.allTaskTags = void 0;
|
|
38
|
+
exports.getAttachmentFileIdByFileName = exports.mapAttachmentFileToAttachmentFilePayload = exports.mapAttachmentFilePayloadToFile = exports.mapFilePayloadToFile = exports.uploadFile = exports.getFileDeleteStatusById = exports.getFileUpdateNameStatusById = exports.getDeleteFileListWithStatus = exports.getFileListWithStatus = exports.clearFileViewList = exports.deleteFileSuccess = exports.deleteFileFailure = exports.deleteFile = exports.deleteFileListSuccess = exports.deleteFileListFailure = exports.deleteFileList = exports.updateFilesMetadata = exports.updateFileNameSuccess = exports.updateFileNameFailure = exports.updateFileName = exports.fetchFile = exports.fetchFileListSuccess = exports.fetchFileListFailure = exports.fetchFileList = exports.toSupportedAttachmentFileType = exports.toSupportedAttachmentFileFormatType = exports.toSupportedFileTypeStrict = exports.removeAttachmentFiles = exports.updateAttachmentFiles = exports.updateFiles = exports.SUPPORTED_ATTACHMENT_FILE_TYPES = exports.getSubscriptionEstimationData = exports.getSubscriptionLocalStoreDataView = exports.getSubscriptionsDetailView = exports.clearSubscriptionLocalData = exports.clearSubscriptionUpdateViewDataByTenantId = exports.saveSubscriptionLocalData = exports.initializeSubscriptionLocalData = exports.clearSubscriptionView = exports.fetchSubscriptionUpdateEstimate = exports.fetchSubscriptionCreateEstimate = exports.saveSubscriptionNotesUpdates = exports.saveSubscriptionUpdates = exports.fetchSubscriptionDetails = exports.fetchSubscriptionCoupons = exports.fetchSubscriptionAddOns = exports.fetchSubscriptionPlans = exports.fetchSubscriptionList = exports.updateCompanySubscriptionUIState = exports.getCompanySubscriptionView = void 0;
|
|
39
|
+
exports.updateRemiListUIState = exports.updateRemiDetailSaveRemiCode = exports.updateRemiListSubTab = exports.updateRemiListTab = exports.fetchRemiListPerTab = exports.fetchRemiList = exports.getRemiDownloadList = exports.getRemiList = exports.toRemiTabTypeStrict = exports.toRemiTabType = exports.toRemiSubTabTypeStrict = exports.toRemiSubTabType = exports.deleteUserBankAccount = exports.createUserBankAccount = exports.resetCreateBankAccountDetails = exports.createBankAccount = exports.deleteBankAccount = exports.fetchBankCountryNameByIban = exports.fetchBankNameBySwift = exports.fetchBankNameByRouting = exports.fetchVendorDetailPageView = exports.fetchVendorDetails = exports.updateStatusForCreateBankAccountFlow = exports.clearBankAccountView = exports.updateInternationalBankAccountViewLocalStoreData = exports.updateBankAccountViewLocalStoreData = exports.initializeVendorAddress = exports.updateSelectedVendorForCreateFlow = exports.removeBankAccountsInVendorView = exports.saveVendor = exports.fetchVendor = exports.updateScrollYOffset = exports.fetchVendorsList = exports.vendorsTabResetVendorDetailLocalData = exports.vendorsTabUpdateVendorDetailLocalData = exports.vendorsTabSaveVendorSuccessOrFailure = exports.vendorsTabSaveVendor = exports.getVendorsTabDetailPageView = exports.toVendorDetailTabsType = exports.getVendorAllTransactionsDefaultTimePeriod = exports.resetVendorsTabVendorAllTransactionsTabData = exports.resetSelectedTabType = exports.updateVendorsTabVendorAllTransactionsTabData = exports.updateSelectedTabType = exports.fetchVendorsTabVendorDetailPageView = exports.getVendorDetailPageView = exports.getVendorView = exports.getAnalyticsDataOnVendorSave = exports.fetchTasksCard = exports.downloadFile = void 0;
|
|
40
|
+
exports.hideCreatedByFilter = exports.convertAmountToHomeCurrency = exports.toPaymentToOption = exports.updateVendorContact = exports.verifyUser = exports.fetchUserDetails = exports.updateBillListSearchResult = exports.updateBillUploadFetchState = exports.updateContactsInVendorDetailLocalData = exports.resetVendorDetailLocalData = exports.updateVendorDetailLocalData = exports.BILL_PAY_FILTER_CATEGORIES = exports.updateBillListUIState = exports.saveVendorSuccessOrFailure = exports.updateShowAutofill = exports.fetchBillAndInitializeLocalStore = exports.getReviewPageBillDetail = exports.getEditBillDetail = exports.clearBillPayReview = exports.fetchDuplicateBill = exports.fetchAndUpdateVendorRecommendations = exports.fetchEditBillDetailPage = exports.fetchBillDetail = exports.getBillTransactionDetailKey = exports.checkApproveRejectBtnShowForBill = exports.getBillDetailView = exports.getBillDownloadList = exports.getBillList = exports.cancelAndDeleteBill = exports.deleteBill = exports.updateApprovalStatusOnSuccess = exports.approveOrRejectBill = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.updateBillDetailSaveBillCode = exports.updateSelectedBillId = exports.updateSubTab = exports.updateTab = exports.fetchBillListPerTab = exports.fetchBillList = exports.getClassList = exports.updateBillListDownloadUIState = exports.updateRemiListDownloadUIState = exports.REIMBURSEMENT_FILTER_CATEGORIES_RESTRICTED = exports.REIMBURSEMENT_FILTER_CATEGORIES = exports.updateRemiListFilterResult = exports.updateBillListFilterResult = exports.updateRemiListSearchResult = void 0;
|
|
41
|
+
exports.getBillPaySetupApproverUpdateDataView = exports.getBillPaySetupApproverView = exports.toRoleTypeStrict = exports.toAttributeOrRoleTypeStrict = exports.toAttributeTypeStrict = exports.isSuccessResponse = exports.getRemiBusinessVerificationDetails = exports.getRemiSetupViewDetails = exports.clearRemiSetupView = exports.acceptEmployeeRemiTerms = exports.acceptRemiTerms = exports.saveRemiSetupViewDataInLocalStore = exports.updateMileageDetails = exports.fetchRemiSetupView = exports.getUserFinancialAccount = exports.fetchUserFinancialAccount = exports.getIntegrationsView = exports.getBankConnectionsSetupViewDetails = exports.getApprovalRuleViewDetails = exports.getCommonSetupViewDetails = exports.getZeniAccountBusinessVerificationDetails = exports.getBillPayBusinessVerificationDetails = exports.getBusinessVerificationDetails = exports.getZeniAccountSetupViewDetails = exports.getBillPaySetupViewDetails = exports.verifyOtp = exports.resendOtp = exports.sendOtp = exports.clearZeniAccountSetupView = exports.clearBillPaySetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.acceptBillPayUpdatedTerms = exports.acceptZeniAccountTerms = exports.acceptBillPayTerms = exports.establishPlaidConnection = exports.updatePaymentAccountStatus = exports.updatePaymentAccountLoginStatus = exports.updatePaymentAccount = exports.updateBusinessVerificationDetails = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.getPlaidLinkToken = exports.getPaymentAccounts = exports.enableSetup = exports.fetchZeniAccountSetupView = exports.fetchBillPaySetupView = void 0;
|
|
42
|
+
exports.clearAddRemiAutoFields = exports.clearTentativeMerchantName = exports.updateTentativeMerchantNames = exports.updateUploadFetchState = exports.updateAddRemiAutoFields = exports.clearEditRemiViewDetail = exports.parseReceiptsToRemi = exports.saveRemiSuccessOrFailure = exports.saveRemiDetail = exports.removeFileFromRemiUpdatesInLocalStore = exports.discardRemiUpdatesInLocalStore = exports.fetchCurrencyConversionValue = exports.saveRemiUpdatesToLocalStore = exports.initializeRemiToLocalStore = exports.fetchRemiAndInitializeLocalStore = exports.fetchRecommendationsAndUpdateMerchantRecommendations = exports.fetchEditRemiDetailPage = exports.getEditRemiDetail = exports.removeDuplicateReimbursementByLineId = exports.clearDuplicateReimbursementDetail = exports.fetchDuplicateReimbursement = exports.clearRemiDetailView = exports.approveOrRejectRemi = exports.cancelAndDeleteRemi = exports.fetchRemiDetail = exports.deleteRemi = exports.updateIsEditModeRealTimeApprovals = exports.saveRealTimeApproval = exports.checkApproveRejectBtnShowForRemi = exports.getRemiDetailView = exports.clearRemiSetupApproverView = exports.clearRemiSetupApproverViewUpdateData = exports.initializeRemiSetupApproverViewUpdateData = exports.saveRemiSetupApproverViewUpdates = exports.saveRemiSetupApproverViewUpdateData = exports.deleteRemiApprovalRule = exports.fetchRemiApproversDetails = exports.fetchRemiApproversList = exports.fetchRemiSetupApproverView = exports.getRemiSetupApproverUpdateDataView = exports.getRemiSetupApproverView = exports.clearBillPaySetupApproverView = exports.clearBillPaySetupApproverViewUpdateData = exports.initializeBillPaySetupApproverViewUpdateData = exports.saveBillPaySetupApproverViewUpdates = exports.saveBillPaySetupApproverViewUpdateData = exports.deleteBillPayApprovalRule = exports.fetchBillPayApproversList = exports.fetchBillPayApproversDetails = exports.fetchBillPaySetupApproverView = void 0;
|
|
43
|
+
exports.getVendorList = exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.getInternationalSubConfigCodeKey = exports.shouldEnableCalendarPickerForLastReportSent = exports.canSendMonthEndEmailReport = exports.showReimbursementPromoPage = exports.showBillPayPromoPage = exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = exports.getSnackbar = exports.closeSnackbar = exports.openSnackbar = exports.getChangedLineItemCountFromLocalData = exports.getTransactionListUIStateByCategoryType = exports.getTransactionsListByCategoryType = exports.retryBankAccountConnectionForOnboarding = exports.sendOnboardingCustomerViewInvite = exports.resetNewOnboardedCustomerId = exports.updateOnboardingCustomerDataInLocalStore = exports.saveOnboardingCustomerDataInLocalStore = exports.saveOnboardingCustomerNotes = exports.saveOnboardingCustomerViewUpdates = exports.updateStatusAfterOnboardingCompleted = exports.updateCustomerCreationStatus = exports.updateOnboardingCustomerListUIState = exports.saveOnboardingCustomerViewUpdateData = exports.clearOnboardingCustomerViewUpdateData = exports.initializeOnboardingCustomerViewUpdateData = exports.getOnboardingEmailGroup = exports.getNewOnboardingCustomerView = exports.getOnboardingCockpitView = exports.saveOnboardingCustomerCompletedStatus = exports.fetchOnboardingCompletedCompanies = exports.fetchCompanyOnboardingView = exports.PAYMENT_BUSINESS_DAYS = exports.holidaysFormatted = exports.isHoliday = exports.getYearsList = exports.filterDays = exports.isHolidayToday = exports.getPreviousNthWorkingDay = exports.getNextNthWorkingDay = exports.toFileTypeStrict = exports.ALL_FILE_TYPES = exports.reduceAllFetchState = exports.reduceAnyFetchState = exports.reduceFetchState = void 0;
|
|
44
|
+
exports.ZENI_CLEARING_ACCOUNT = exports.isZeniClearingAccountReport = exports.getCompanyConfig = exports.fetchCompanyConfig = exports.clearTransactionVendorSaveStatus = exports.resetTransactionVendorLocalData = exports.updateTransactionVendorLocalData = exports.saveTransactionVendorSuccessOrFailure = exports.saveTransactionVendor = exports.getTransactionVendorView = exports.getZeniAccStatements = exports.fetchZeniAccStatementPage = exports.getDepositAccountTransactionList = exports.fetchDepositAccountTransactionList = exports.fetchDepositAccountHistoryFailure = exports.fetchDepositAccountHistorySuccess = exports.updateDepositAccount = exports.getCheckDepositDetail = exports.clearCheckDeposit = exports.updateCheckDepositLocalData = exports.depositCheck = exports.ZENI_ACCOUNTS_TAB = exports.fetchDepositAccountDetail = exports.clearTransferDetail = exports.getTransferDetail = exports.transferMoney = exports.updateDepositToLocalData = exports.updateTransferToLocalData = exports.updateTransferMoneyLocalData = exports.fetchZeniAccountsConfig = exports.fetchDepositAccount = exports.getDepositAccountDetailForPDF = exports.getDepositAccountDetail = exports.unlinkPaymentAccount = exports.fetchPaymentAccountList = exports.createCheckingAccount = exports.updateZeniAccountListTab = exports.fetchZeniAccountList = exports.getZeniAccountList = exports.getZeniAccountsConfigDetail = exports.fetchOwnerList = exports.fetchRecommendationByEntityName = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityQboId = exports.toVendorReportIDType = exports.isVendorsTabVisible = exports.isColumnYTDSpend = exports.updateYTDSelectionUIState = exports.updatePageToken = exports.updateSortUiState = void 0;
|
|
45
|
+
exports.clearCompanyHealthMetricView = exports.updateCompanyHealth = exports.updateCompaniesHealth = exports.getUserRoleConfig = exports.fetchUserRoleConfig = exports.clearInternationalWire = exports.deletePaymentInstrument = exports.createPaymentInstrumentUpdateStatus = exports.createPaymentInstrument = exports.fetchInternationalWireDynamicForm = exports.initializeDynamicForm = exports.updateInternationalWireLocalStoreData = exports.initializeInternationalWireLocalData = exports.getInternationalWireView = exports.fetchWiseRedirectStatus = exports.getWiseRedirect = exports.saveMagicLinkAddressInLocalStore = exports.fetchMagicLinkBankNameBySwift = exports.fetchMagicLinkBankNameByRouting = exports.updateMagicLinkInternationalBankAccountLocalStoreData = exports.updateMagicLinkBankAccountLocalStoreData = exports.saveBankAccount = exports.fetchBillAttachment = exports.fetchMagicLinkTenant = exports.getMagicLinkCurrentAddressState = exports.getMagicLinkBankAccountView = exports.getMagicLinkView = exports.initializeAccountMappingView = exports.getAccountMappingView = exports.clearAccountMappingLocalData = exports.saveAccountMappingLocalData = exports.saveAccountMapping = exports.getOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.clearOnboardingCustomerView = exports.saveOnboardingCustomerViewDataInLocalStore = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.updateOnboardingCustomerViewUIState = exports.updateCurrentStep = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerView = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingCustomerViewCompleteStatus = exports.updateOnboardingCustomerViewAccountDetails = exports.establishOnboardingPlaidConnection = exports.getOnboardingPlaidLinkToken = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.isZeniClearingAccount = void 0;
|
|
46
|
+
exports.updateScheduleListScrollState = exports.updateScheduleListSearchText = exports.updateScheduleListSubTab = exports.updateScheduleListTab = exports.toScheduleSubTabType = exports.toScheduleListTabsFileTypeStrict = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.getFetchStateForScheduleAccountList = exports.updateScheduleListLocalData = exports.fetchSchedulesAccount = exports.fetchDownloadSchedules = exports.fetchScheduleList = exports.getScheduleListReport = exports.ALL_SCHEDULES_TYPES = exports.updateApAgingDetailUIState = exports.getApAgingDetailForVendor = exports.fetchApAgingDetail = exports.updateApAgingUIState = exports.getApAgingReport = exports.fetchApAging = exports.updateChargeCardDetail = exports.updateChargeCardListUIState = exports.updateChargeCardListSearchText = exports.resetIssueChargeCardForm = exports.updateChargeCardLocalStore = exports.issueChargeCard = exports.acceptChargeCardTerms = exports.fetchChargeCardSetupView = exports.getChargeCardSetupViewDetails = exports.toCreditLimitFrequencyCodeType = exports.toChargeCardSortKeyType = exports.fetchChargeCardTransactionList = exports.getChargeCardDetailView = exports.fetchChargeCardDetailPage = exports.getChargeCardListView = exports.fetchChargeCardListPage = exports.getChargeCardBusinessVerificationDetails = exports.companyHealthMetricDropDownOptions = exports.hasCompanyHealthMetricFormFieldChanged = exports.getCompanyHealthMetricView = exports.isCompanyRunwayInfinite = exports.updateCompanyHealthViewUIState = exports.updateCompanyHealthMetricViewSuccessStatus = exports.updateCompanyHealthMetricViewErrorStatus = exports.updateCompanyHealthMetricLocalStore = exports.saveCompanyHealthMetricById = exports.removeSelectedCompanyId = exports.initializeCompanyHealthMetricViewLocalData = exports.fetchCompanyHealthMetricView = void 0;
|
|
47
|
+
exports.toRecurringBillFrequencyStrict = exports.toRecurringBillFrequency = exports.getArAgingDetailForCustomer = exports.getArAgingReport = exports.updateArAgingDetailUIState = exports.fetchArAgingDetail = exports.updateArAgingUIState = exports.fetchArAging = exports.toVendorGlobalReviewColumnSortKeyType = exports.getTenantMerchantByMerchantId = exports.getVendorGlobalReviewView = exports.updateVendorGlobalReviewViewUIState = exports.updateSelectedGlobalMerchant = exports.fetchVendorGlobalReviewView = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.getGlobalMerchantView = exports.clearGlobalMerchantView = exports.updateCreateGlobalMerchantLocalData = exports.createGlobalMerchant = exports.fetchGlobalMerchantRecommendation = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey = exports.updateScheduleListSortState = void 0;
|
|
48
|
+
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.closeReferralInviteConfirmationPopup = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = exports.getInviteFormView = exports.getReferralListView = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.allTaskTags = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks = void 0;
|
|
49
49
|
const zeniDayJS_1 = require("./zeniDayJS");
|
|
50
50
|
Object.defineProperty(exports, "Dayjs", { enumerable: true, get: function () { return zeniDayJS_1.Dayjs; } });
|
|
51
51
|
Object.defineProperty(exports, "updateZeniDateLocaleID", { enumerable: true, get: function () { return zeniDayJS_1.updateZeniDateLocaleID; } });
|
|
@@ -669,9 +669,18 @@ Object.defineProperty(exports, "getSubscriptionLocalStoreDataView", { enumerable
|
|
|
669
669
|
Object.defineProperty(exports, "getSubscriptionEstimationData", { enumerable: true, get: function () { return subscriptionViewSelector_1.getSubscriptionEstimationData; } });
|
|
670
670
|
const fileReducer_1 = require("./entity/file/fileReducer");
|
|
671
671
|
Object.defineProperty(exports, "updateFiles", { enumerable: true, get: function () { return fileReducer_1.updateFiles; } });
|
|
672
|
+
Object.defineProperty(exports, "updateAttachmentFiles", { enumerable: true, get: function () { return fileReducer_1.updateAttachmentFiles; } });
|
|
673
|
+
Object.defineProperty(exports, "removeAttachmentFiles", { enumerable: true, get: function () { return fileReducer_1.removeAttachmentFiles; } });
|
|
672
674
|
Object.defineProperty(exports, "mapFilePayloadToFile", { enumerable: true, get: function () { return fileReducer_1.mapFilePayloadToFile; } });
|
|
675
|
+
Object.defineProperty(exports, "mapAttachmentFilePayloadToFile", { enumerable: true, get: function () { return fileReducer_1.mapAttachmentFilePayloadToFile; } });
|
|
676
|
+
Object.defineProperty(exports, "mapAttachmentFileToAttachmentFilePayload", { enumerable: true, get: function () { return fileReducer_1.mapAttachmentFileToAttachmentFilePayload; } });
|
|
673
677
|
const fileState_1 = require("./entity/file/fileState");
|
|
678
|
+
Object.defineProperty(exports, "SUPPORTED_ATTACHMENT_FILE_TYPES", { enumerable: true, get: function () { return fileState_1.SUPPORTED_ATTACHMENT_FILE_TYPES; } });
|
|
674
679
|
Object.defineProperty(exports, "toSupportedFileTypeStrict", { enumerable: true, get: function () { return fileState_1.toSupportedFileTypeStrict; } });
|
|
680
|
+
Object.defineProperty(exports, "toSupportedAttachmentFileFormatType", { enumerable: true, get: function () { return fileState_1.toSupportedAttachmentFileFormatType; } });
|
|
681
|
+
Object.defineProperty(exports, "toSupportedAttachmentFileType", { enumerable: true, get: function () { return fileState_1.toSupportedAttachmentFileType; } });
|
|
682
|
+
const fileSelector_1 = require("./entity/file/fileSelector");
|
|
683
|
+
Object.defineProperty(exports, "getAttachmentFileIdByFileName", { enumerable: true, get: function () { return fileSelector_1.getAttachmentFileIdByFileName; } });
|
|
675
684
|
const fileViewReducer_1 = require("./view/fileView/fileViewReducer");
|
|
676
685
|
Object.defineProperty(exports, "fetchFileList", { enumerable: true, get: function () { return fileViewReducer_1.fetchFileList; } });
|
|
677
686
|
Object.defineProperty(exports, "fetchFileListFailure", { enumerable: true, get: function () { return fileViewReducer_1.fetchFileListFailure; } });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AttachmentFilePayload } from '../../entity/file/filePayload';
|
|
1
2
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
2
3
|
export declare type MonthEndTemplateData = Record<string, unknown>;
|
|
3
4
|
export interface CompanyMonthEndReportViewPayload {
|
|
@@ -6,6 +7,7 @@ export interface CompanyMonthEndReportViewPayload {
|
|
|
6
7
|
tenant_receiver_email_list: string[];
|
|
7
8
|
subject: string | null;
|
|
8
9
|
template_data: MonthEndTemplateData;
|
|
10
|
+
files: AttachmentFilePayload[];
|
|
9
11
|
zeni_requests_html?: string;
|
|
10
12
|
last_month_end_email_draft_saved_at?: string;
|
|
11
13
|
draft_user_id?: string;
|
|
@@ -24,13 +24,15 @@ export declare const fetchImproveUsingZeniGPT: import("@reduxjs/toolkit").Action
|
|
|
24
24
|
}, string, never, never>, updateCompanyMonthEndReportViewOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
25
25
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
26
26
|
companyId: string;
|
|
27
|
-
}, string, never, never>, sendCompanyMonthEndReport: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
27
|
+
}, string, never, never>, sendCompanyMonthEndReport: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, fileId?: string | undefined], {
|
|
28
28
|
companyId: string;
|
|
29
|
-
|
|
29
|
+
fileId: string | undefined;
|
|
30
|
+
}, string, never, never>, saveCompanyMonthEndReport: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[recipientEmailList: any, companyId: string, subject: string, isPreview: boolean, fileId?: string | undefined, zeniRequestsHtml?: string | undefined], {
|
|
30
31
|
recipientEmailList: any;
|
|
31
32
|
companyId: string;
|
|
32
33
|
subject: string;
|
|
33
34
|
isPreview: boolean;
|
|
35
|
+
fileId: string | undefined;
|
|
34
36
|
zeniRequestsHtml: string | undefined;
|
|
35
37
|
}, string, never, never>, updateStatusForSendCompanyMonthEndReport: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, status: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
36
38
|
companyId: string;
|
|
@@ -65,13 +65,14 @@ const companyMonthEndReportView = (0, toolkit_1.createSlice)({
|
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
saveCompanyMonthEndReport: {
|
|
68
|
-
prepare(recipientEmailList, companyId, subject, isPreview, zeniRequestsHtml) {
|
|
68
|
+
prepare(recipientEmailList, companyId, subject, isPreview, fileId, zeniRequestsHtml) {
|
|
69
69
|
return {
|
|
70
70
|
payload: {
|
|
71
71
|
recipientEmailList,
|
|
72
72
|
companyId,
|
|
73
73
|
subject,
|
|
74
74
|
isPreview,
|
|
75
|
+
fileId,
|
|
75
76
|
zeniRequestsHtml,
|
|
76
77
|
},
|
|
77
78
|
};
|
|
@@ -117,8 +118,8 @@ const companyMonthEndReportView = (0, toolkit_1.createSlice)({
|
|
|
117
118
|
},
|
|
118
119
|
},
|
|
119
120
|
sendCompanyMonthEndReport: {
|
|
120
|
-
prepare(companyId) {
|
|
121
|
-
return { payload: { companyId } };
|
|
121
|
+
prepare(companyId, fileId) {
|
|
122
|
+
return { payload: { companyId, fileId } };
|
|
122
123
|
},
|
|
123
124
|
reducer(draft, action) {
|
|
124
125
|
const { companyId } = action.payload;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { AttachmentFile } from '../../entity/file/fileState';
|
|
2
3
|
import { ZeniDate } from '../../zeniDayJS';
|
|
3
4
|
import { MonthEndTemplateData, CompanyMonthEndReportViewPayload } from './companyMonthEndReportViewPayload';
|
|
4
5
|
export interface CompanyMonthEndReportData {
|
|
5
6
|
html?: string;
|
|
6
7
|
subject?: string;
|
|
8
|
+
attachmentFile?: AttachmentFile;
|
|
7
9
|
zeniRequestsHtml?: string;
|
|
8
10
|
templateData?: MonthEndTemplateData;
|
|
9
11
|
recipientEmailList: string[];
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toCompanyMonthEndReportData = void 0;
|
|
4
|
+
const fileReducer_1 = require("../../entity/file/fileReducer");
|
|
4
5
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
5
6
|
const toCompanyMonthEndReportData = (data) => {
|
|
6
7
|
var _a, _b;
|
|
7
8
|
return {
|
|
8
9
|
html: (_a = data.html) !== null && _a !== void 0 ? _a : undefined,
|
|
9
10
|
subject: (_b = data.subject) !== null && _b !== void 0 ? _b : undefined,
|
|
11
|
+
attachmentFile: data.files != undefined && data.files.length > 0
|
|
12
|
+
? (0, fileReducer_1.mapAttachmentFilePayloadToFile)(data.files[0])
|
|
13
|
+
: undefined,
|
|
10
14
|
zeniRequestsHtml: data.zeni_requests_html,
|
|
11
15
|
templateData: data.template_data,
|
|
12
16
|
recipientEmailList: data.recipient_email_list,
|
|
@@ -3,5 +3,6 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
3
3
|
import { ZeniAPI } from '../../zeniAPI';
|
|
4
4
|
import { RootState } from '../../reducer';
|
|
5
5
|
import { fetchCompanyMonthEndReportView, updateCompanyMonthEndReportViewOnFailure, updateCompanyMonthEndReportViewOnSuccess } from './companyMonthEndReportViewReducer';
|
|
6
|
-
|
|
6
|
+
import { updateAttachmentFiles } from '../../entity/file/fileReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof updateCompanyMonthEndReportViewOnSuccess> | ReturnType<typeof updateCompanyMonthEndReportViewOnFailure> | ReturnType<typeof updateAttachmentFiles>;
|
|
7
8
|
export declare const fetchCompanyMonthEndReportViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,14 +8,26 @@ const responsePayload_1 = require("../../responsePayload");
|
|
|
8
8
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
9
9
|
const snackbarReducer_1 = require("../../entity/snackbar/snackbarReducer");
|
|
10
10
|
const companyReducer_1 = require("../../entity/company/companyReducer");
|
|
11
|
+
const fileSelector_1 = require("../../entity/file/fileSelector");
|
|
11
12
|
const saveCompanyMonthEndReportEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyMonthEndReportViewReducer_1.saveCompanyMonthEndReport.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
-
const { companyId, recipientEmailList, subject, isPreview, zeniRequestsHtml, } = action.payload;
|
|
13
|
+
const { companyId, recipientEmailList, subject, isPreview, fileId, zeniRequestsHtml, } = action.payload;
|
|
13
14
|
const state = state$.value;
|
|
14
15
|
const company = state.companyState.companiesById[companyId];
|
|
15
16
|
const companyName = state.companyState.companiesById[companyId].companyInfo.name;
|
|
16
17
|
const tenantId = company.companyInfo.tenantId;
|
|
17
18
|
const lastReportSentBusinessDay = (0, zeniDayJS_1.getBusinessDayOfDate)((0, zeniDayJS_1.dateNow)());
|
|
18
19
|
const lastReportSentDate = (0, zeniDayJS_1.dateNow)();
|
|
20
|
+
const filePayload = [];
|
|
21
|
+
if (fileId != undefined && fileId != null) {
|
|
22
|
+
const attachmentFile = (0, fileSelector_1.getAttachmentFileByFileId)(state.fileState, fileId);
|
|
23
|
+
if (attachmentFile != null) {
|
|
24
|
+
filePayload.push({
|
|
25
|
+
data: attachmentFile.base64String,
|
|
26
|
+
id: attachmentFile.fileId,
|
|
27
|
+
name: attachmentFile.fileName,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
19
31
|
const payload = {
|
|
20
32
|
template_data: Object.assign(Object.assign({}, state.companyMonthEndReportViewState.monthEndReportDataByCompanyId[companyId].companyMonthEndReportData.templateData), { subject }),
|
|
21
33
|
recipient_email_list: recipientEmailList,
|
|
@@ -8,8 +8,9 @@ const responsePayload_1 = require("../../responsePayload");
|
|
|
8
8
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
9
9
|
const companyReducer_1 = require("../../entity/company/companyReducer");
|
|
10
10
|
const snackbarReducer_1 = require("../../entity/snackbar/snackbarReducer");
|
|
11
|
+
const fileSelector_1 = require("../../entity/file/fileSelector");
|
|
11
12
|
const sendCompanyMonthEndReportEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyMonthEndReportViewReducer_1.sendCompanyMonthEndReport.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
-
const { companyId } = action.payload;
|
|
13
|
+
const { companyId, fileId } = action.payload;
|
|
13
14
|
const state = state$.value;
|
|
14
15
|
const recipientEmailList = state.companyMonthEndReportViewState.monthEndReportDataByCompanyId[companyId].companyMonthEndReportData.recipientEmailList;
|
|
15
16
|
const subject = state.companyMonthEndReportViewState.monthEndReportDataByCompanyId[companyId].companyMonthEndReportData.subject;
|
|
@@ -19,6 +20,17 @@ const sendCompanyMonthEndReportEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
19
20
|
const tenantId = company.companyInfo.tenantId;
|
|
20
21
|
const lastReportSentBusinessDay = (0, zeniDayJS_1.getBusinessDayOfDate)((0, zeniDayJS_1.dateNow)());
|
|
21
22
|
const lastReportSentDate = (0, zeniDayJS_1.dateNow)();
|
|
23
|
+
const filePayload = [];
|
|
24
|
+
if (fileId != undefined && fileId != null) {
|
|
25
|
+
const attachmentFile = (0, fileSelector_1.getAttachmentFileByFileId)(state.fileState, fileId);
|
|
26
|
+
if (attachmentFile != null) {
|
|
27
|
+
filePayload.push({
|
|
28
|
+
data: attachmentFile.base64String,
|
|
29
|
+
id: attachmentFile.fileId,
|
|
30
|
+
name: attachmentFile.fileName,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
22
34
|
const payload = {
|
|
23
35
|
template_data: Object.assign(Object.assign({}, state.companyMonthEndReportViewState.monthEndReportDataByCompanyId[companyId].companyMonthEndReportData.templateData), { subject }),
|
|
24
36
|
recipient_email_list: recipientEmailList,
|
|
@@ -84,7 +84,7 @@ const getSaveBillApiURL = (saveBillBaseURL, isRecurring, billId, billTransaction
|
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
function prepareSaveBillPayload(accountState, billTransactionState, paymentAccountState, vendorState, recurringBillState, billDetail, billStageCode, isVendorRecommendationEnabled, isLocalCurrencyEnabled) {
|
|
87
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21;
|
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22;
|
|
88
88
|
const billId = billDetail.billId;
|
|
89
89
|
let detail;
|
|
90
90
|
const withdrawFromAccount = (_a = billDetail.billDetailLocalData.paymentDetailsSection) === null || _a === void 0 ? void 0 : _a.withdrawFrom;
|
|
@@ -104,57 +104,59 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
104
104
|
vendor_name: isRecommendedVendor
|
|
105
105
|
? recommendedVendor.name
|
|
106
106
|
: (_e = billDetail.billDetailLocalData.vendor) === null || _e === void 0 ? void 0 : _e.name,
|
|
107
|
-
candidate_vendor_name
|
|
107
|
+
//pass candidate_vendor_name only when we are not adding vendor(recommended or actual) to the bill
|
|
108
|
+
candidate_vendor_name: isRecommendedVendor ||
|
|
109
|
+
((_f = billDetail.billDetailLocalData.vendor) === null || _f === void 0 ? void 0 : _f.qboId) != null
|
|
108
110
|
? undefined
|
|
109
|
-
: (
|
|
111
|
+
: (_g = billDetail.addBillAutoFields.tentativeVendorName) !== null && _g !== void 0 ? _g : billDetail.billDetailLocalData.candidateVendorname,
|
|
110
112
|
ocr_parsed_vendor_term: Boolean(billDetail.addBillAutoFields.tentativeVendorName) === true
|
|
111
113
|
? billDetail.addBillAutoFields.tentativeVendorName
|
|
112
114
|
: null,
|
|
113
115
|
transaction_type: 'bill',
|
|
114
116
|
bill_pay_provider: 'zeni',
|
|
115
117
|
account_id: zeniAccountId != null
|
|
116
|
-
? (
|
|
118
|
+
? (_h = (0, accountSelector_1.getAccountBase)(accountState, zeniAccountId, 'bill_pay')) === null || _h === void 0 ? void 0 : _h.qboId
|
|
117
119
|
: '',
|
|
118
|
-
file_id: (
|
|
119
|
-
transaction_date: (
|
|
120
|
-
due_date: (
|
|
121
|
-
total_amount: (
|
|
120
|
+
file_id: (_j = billDetail.billDetailLocalData.file) === null || _j === void 0 ? void 0 : _j.fileId,
|
|
121
|
+
transaction_date: (_m = (_l = (_k = billDetail.billDetailLocalData.whatForSection) === null || _k === void 0 ? void 0 : _k.invoiceDate) === null || _l === void 0 ? void 0 : _l.format('YYYY-MM-DD')) !== null && _m !== void 0 ? _m : (0, zeniDayJS_1.dateNow)().format('YYYY-MM-DD'),
|
|
122
|
+
due_date: (_q = (_p = (_o = billDetail.billDetailLocalData.whatForSection) === null || _o === void 0 ? void 0 : _o.billDueDate) === null || _p === void 0 ? void 0 : _p.format('YYYY-MM-DD')) !== null && _q !== void 0 ? _q : null,
|
|
123
|
+
total_amount: (_s = (_r = billDetail.billDetailLocalData.totalAmount) === null || _r === void 0 ? void 0 : _r.amount) !== null && _s !== void 0 ? _s : 0,
|
|
122
124
|
bill_pay_info: {
|
|
123
125
|
stage: {
|
|
124
126
|
code: billStageCode,
|
|
125
127
|
},
|
|
126
|
-
payment_date: (
|
|
128
|
+
payment_date: (_v = (_u = (_t = billDetail.billDetailLocalData.paymentDetailsSection) === null || _t === void 0 ? void 0 : _t.paymentDate) === null || _u === void 0 ? void 0 : _u.format('YYYY-MM-DD')) !== null && _v !== void 0 ? _v : null,
|
|
127
129
|
from_account: {
|
|
128
|
-
account_id: (
|
|
129
|
-
account_type: (
|
|
130
|
+
account_id: (_y = (_x = (_w = billDetail.billDetailLocalData.paymentDetailsSection) === null || _w === void 0 ? void 0 : _w.withdrawFrom) === null || _x === void 0 ? void 0 : _x.id) !== null && _y !== void 0 ? _y : '',
|
|
131
|
+
account_type: (_1 = (0, helpers_1.accountTypeSubConfigCodeToAccType)((_0 = (_z = billDetail.billDetailLocalData.paymentDetailsSection) === null || _z === void 0 ? void 0 : _z.withdrawFrom) === null || _0 === void 0 ? void 0 : _0.accType)) !== null && _1 !== void 0 ? _1 : '',
|
|
130
132
|
},
|
|
131
133
|
to_account: Object.assign({}, (isLocalCurrencyEnabled === true &&
|
|
132
|
-
((
|
|
134
|
+
((_3 = (_2 = billDetail.billDetailLocalData.paymentDetailsSection) === null || _2 === void 0 ? void 0 : _2.paymentType) === null || _3 === void 0 ? void 0 : _3.method.includes('international')) === true
|
|
133
135
|
? {
|
|
134
136
|
payment_instrument_id: Boolean(billDetail.billDetailLocalData
|
|
135
137
|
.isCollectToAccountInfoFromVendorContact) === false
|
|
136
|
-
? (
|
|
138
|
+
? (_5 = (_4 = billDetail.billDetailLocalData.paymentDetailsSection) === null || _4 === void 0 ? void 0 : _4.paymentTo) !== null && _5 !== void 0 ? _5 : null
|
|
137
139
|
: null,
|
|
138
140
|
}
|
|
139
141
|
: {
|
|
140
142
|
account_id: Boolean(billDetail.billDetailLocalData
|
|
141
143
|
.isCollectToAccountInfoFromVendorContact) === false
|
|
142
|
-
? (
|
|
144
|
+
? (_7 = (_6 = billDetail.billDetailLocalData.paymentDetailsSection) === null || _6 === void 0 ? void 0 : _6.paymentTo) !== null && _7 !== void 0 ? _7 : null
|
|
143
145
|
: null,
|
|
144
146
|
})),
|
|
145
|
-
to_account_vendor_email: (
|
|
147
|
+
to_account_vendor_email: (_8 = billDetail.billDetailLocalData.toAccountVendorEmail) !== null && _8 !== void 0 ? _8 : null,
|
|
146
148
|
is_collect_to_account_info_from_vendor_contact: billDetail.billDetailLocalData.isCollectToAccountInfoFromVendorContact,
|
|
147
149
|
is_cancelled: false,
|
|
148
|
-
bill_payment_method_type: getBillPaymentMethodTypePayload((
|
|
149
|
-
international_transfer_fee_bearer_payment_method: ((
|
|
150
|
-
((
|
|
151
|
-
? (
|
|
152
|
-
.internationalTransferFeeBearerPaymentMethod) !== null &&
|
|
150
|
+
bill_payment_method_type: getBillPaymentMethodTypePayload((_9 = billDetail.billDetailLocalData.paymentDetailsSection) === null || _9 === void 0 ? void 0 : _9.paymentType),
|
|
151
|
+
international_transfer_fee_bearer_payment_method: ((_11 = (_10 = billDetail.billDetailLocalData.paymentDetailsSection) === null || _10 === void 0 ? void 0 : _10.paymentType) === null || _11 === void 0 ? void 0 : _11.method.includes('international')) === true &&
|
|
152
|
+
((_12 = billDetail.billDetailLocalData.vendor) === null || _12 === void 0 ? void 0 : _12.vendorCurrencyCode) === 'USD'
|
|
153
|
+
? (_13 = billDetail.billDetailLocalData.paymentDetailsSection
|
|
154
|
+
.internationalTransferFeeBearerPaymentMethod) !== null && _13 !== void 0 ? _13 : 'swift_our' //default value for international method and USD currency
|
|
153
155
|
: null,
|
|
154
156
|
},
|
|
155
|
-
document_id: (
|
|
156
|
-
transaction_memo: (
|
|
157
|
-
currency_code: (
|
|
157
|
+
document_id: (_14 = billDetail.billDetailLocalData.whatForSection) === null || _14 === void 0 ? void 0 : _14.invoiceNumber,
|
|
158
|
+
transaction_memo: (_15 = billDetail.billDetailLocalData.whatForSection) === null || _15 === void 0 ? void 0 : _15.memo,
|
|
159
|
+
currency_code: (_17 = (_16 = billDetail.billDetailLocalData.whatForSection) === null || _16 === void 0 ? void 0 : _16.currencyCode) !== null && _17 !== void 0 ? _17 : 'USD',
|
|
158
160
|
lines: Object.keys(billDetail.billDetailLocalData.updatesByLineId).map((lineId) => {
|
|
159
161
|
const line = billDetail.billDetailLocalData.updatesByLineId[lineId];
|
|
160
162
|
const lineAsTransactionLinePayload = (0, editBillViewPayload_1.fromLineLocalDataToTransactionLinePayload)(line);
|
|
@@ -162,12 +164,12 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
162
164
|
}),
|
|
163
165
|
};
|
|
164
166
|
if (!isRecurring) {
|
|
165
|
-
payload.vendor_name = (
|
|
167
|
+
payload.vendor_name = (_19 = (_18 = billDetail.billDetailLocalData.vendor) === null || _18 === void 0 ? void 0 : _18.name) !== null && _19 !== void 0 ? _19 : '';
|
|
166
168
|
}
|
|
167
169
|
if (billId != null) {
|
|
168
170
|
detail = (0, get_1.default)(billTransactionState.transactionById, billId, undefined);
|
|
169
|
-
payload.sync_token = (
|
|
170
|
-
payload.update_time = (
|
|
171
|
+
payload.sync_token = (_20 = detail === null || detail === void 0 ? void 0 : detail.syncToken) !== null && _20 !== void 0 ? _20 : null;
|
|
172
|
+
payload.update_time = (_21 = detail === null || detail === void 0 ? void 0 : detail.updateTime.format('YYYY-MM-DD')) !== null && _21 !== void 0 ? _21 : null;
|
|
171
173
|
//required by platform to clear old recurring details
|
|
172
174
|
if ((detail === null || detail === void 0 ? void 0 : detail.isRecurring) === true &&
|
|
173
175
|
Boolean(billDetail.billDetailLocalData.isRecurring) === false) {
|
|
@@ -178,7 +180,7 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
178
180
|
payload.are_approvals_serialized = true;
|
|
179
181
|
}
|
|
180
182
|
if (billStageCode === 'pending_approval' &&
|
|
181
|
-
((
|
|
183
|
+
((_22 = billDetail.billDetailLocalData.paymentDetailsSection) === null || _22 === void 0 ? void 0 : _22.conversionRate) != null) {
|
|
182
184
|
// required by platform
|
|
183
185
|
payload.exchange_rate =
|
|
184
186
|
1 / billDetail.billDetailLocalData.paymentDetailsSection.conversionRate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.91",
|
|
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",
|