@zeniai/client-epic-state 4.12.51 → 4.12.53
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/tenant/clearAllEpic.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.js +1 -1
- package/lib/entity/vendor/vendorPayload.d.ts +1 -0
- package/lib/entity/vendor/vendorPayload.js +4 -4
- package/lib/entity/vendor/vendorState.d.ts +1 -0
- package/lib/epic.d.ts +3 -2
- package/lib/epic.js +3 -2
- package/lib/index.d.ts +8 -4
- package/lib/index.js +19 -9
- package/lib/reducer.d.ts +4 -1
- package/lib/reducer.js +4 -1
- package/lib/view/commonVendorView/vendorView/vendorViewPayload.d.ts +8 -0
- package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListMock.d.ts +2 -2
- package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListMock.js +1 -1
- package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListSelectorMock.d.ts +1 -1
- package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.d.ts +98 -0
- package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.js +101 -0
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/fetchVendorsFiling1099ListEpic.d.ts +5 -5
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/fetchVendorsFiling1099ListEpic.js +5 -5
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListPayload.d.ts +3 -3
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListReducer.d.ts +2 -2
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListReducer.js +1 -1
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListSelector.d.ts +6 -6
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListSelector.js +1 -1
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListState.d.ts +3 -3
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListState.js +1 -1
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.d.ts +41 -0
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.js +40 -0
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +21 -0
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +137 -0
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSaveEpic.d.ts +9 -0
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSaveEpic.js +51 -0
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSelector.d.ts +12 -0
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSelector.js +15 -0
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState.d.ts +20 -0
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState.js +2 -0
- package/lib/view/vendorTabView/fetchVendorTabViewEpic.d.ts +1 -1
- package/lib/view/vendorTabView/fetchVendorTabViewEpic.js +2 -2
- package/package.json +1 -1
- /package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/json/vendorFiling1099ListSuccess.json +0 -0
- /package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListSelectorMock.js +0 -0
- /package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListPayload.js +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { VendorFiling1099UploadDetailsState } from '../vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState';
|
|
2
|
+
export declare const vendorFiling1099UploadDetailsSuccessResponse: {
|
|
3
|
+
data: {
|
|
4
|
+
filter: null;
|
|
5
|
+
query: {
|
|
6
|
+
end_date: string;
|
|
7
|
+
group_by: string;
|
|
8
|
+
sort_order: string;
|
|
9
|
+
source_account_type: string;
|
|
10
|
+
start_date: string;
|
|
11
|
+
};
|
|
12
|
+
query_definitions: {};
|
|
13
|
+
report: {
|
|
14
|
+
currency: {
|
|
15
|
+
currency_code: null;
|
|
16
|
+
currency_symbol: null;
|
|
17
|
+
};
|
|
18
|
+
is_vendor_1099_populated: boolean;
|
|
19
|
+
report_id: string;
|
|
20
|
+
report_title: string;
|
|
21
|
+
status: {
|
|
22
|
+
code: number;
|
|
23
|
+
description: string;
|
|
24
|
+
is_filtered_report: boolean;
|
|
25
|
+
last_refresh_attempt_time: string;
|
|
26
|
+
last_refresh_success_time: string;
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
vendors: {
|
|
30
|
+
vendor_id: string;
|
|
31
|
+
qbo_id: string;
|
|
32
|
+
vendor_name: string;
|
|
33
|
+
title: string;
|
|
34
|
+
suffix: string;
|
|
35
|
+
first_name: string;
|
|
36
|
+
middle_name: string;
|
|
37
|
+
last_name: string;
|
|
38
|
+
vendor_type: string;
|
|
39
|
+
logo: {
|
|
40
|
+
url: string;
|
|
41
|
+
base64: string;
|
|
42
|
+
};
|
|
43
|
+
owner: null;
|
|
44
|
+
balance: number;
|
|
45
|
+
is_deleted: boolean;
|
|
46
|
+
qbo_create_time: string;
|
|
47
|
+
qbo_update_time: string;
|
|
48
|
+
create_time: string;
|
|
49
|
+
update_time: string;
|
|
50
|
+
email: string;
|
|
51
|
+
phone: string;
|
|
52
|
+
website_url: string;
|
|
53
|
+
currency_code: string;
|
|
54
|
+
currency_symbol: string;
|
|
55
|
+
country_code: string;
|
|
56
|
+
billing_address_id: string;
|
|
57
|
+
billing_address: {
|
|
58
|
+
address_id: string;
|
|
59
|
+
city: string;
|
|
60
|
+
country: string;
|
|
61
|
+
country_code: null;
|
|
62
|
+
create_time: string;
|
|
63
|
+
hash_value: string;
|
|
64
|
+
latitude: null;
|
|
65
|
+
longitude: null;
|
|
66
|
+
postal_code: string;
|
|
67
|
+
state: string;
|
|
68
|
+
street: string[];
|
|
69
|
+
update_time: string;
|
|
70
|
+
};
|
|
71
|
+
documents: never[];
|
|
72
|
+
vendor_currency_code: string;
|
|
73
|
+
vendor_currency_symbol: string;
|
|
74
|
+
tin: {
|
|
75
|
+
type: string;
|
|
76
|
+
value: string;
|
|
77
|
+
};
|
|
78
|
+
vendor_1099_status: string;
|
|
79
|
+
vendor_1099_ytd_total: number;
|
|
80
|
+
w9_document: never[];
|
|
81
|
+
}[];
|
|
82
|
+
version: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
status: {
|
|
86
|
+
code: number;
|
|
87
|
+
message: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export declare const vendorFiling1099UploadDetailsFailureResponse: {
|
|
91
|
+
status: {
|
|
92
|
+
message: string;
|
|
93
|
+
code: number;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export declare const vendorFiling1099UploadDetailsInProgressState: VendorFiling1099UploadDetailsState;
|
|
97
|
+
export declare const vendorFiling1099UploadDetailsInProgressInitialState: VendorFiling1099UploadDetailsState;
|
|
98
|
+
export declare const vendorFiling1099UploadDetailsSuccessState: VendorFiling1099UploadDetailsState;
|
|
@@ -0,0 +1,101 @@
|
|
|
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.vendorFiling1099UploadDetailsSuccessState = exports.vendorFiling1099UploadDetailsInProgressInitialState = exports.vendorFiling1099UploadDetailsInProgressState = exports.vendorFiling1099UploadDetailsFailureResponse = exports.vendorFiling1099UploadDetailsSuccessResponse = void 0;
|
|
7
|
+
const vendorFiling1099ListSuccess_json_1 = __importDefault(require("./json/vendorFiling1099ListSuccess.json"));
|
|
8
|
+
const apiFailure_json_1 = __importDefault(require("../../../__testHelpers__/apiFailure.json"));
|
|
9
|
+
const vendorFiling1099UploadDetailsPayload_1 = require("../vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload");
|
|
10
|
+
exports.vendorFiling1099UploadDetailsSuccessResponse = vendorFiling1099ListSuccess_json_1.default;
|
|
11
|
+
exports.vendorFiling1099UploadDetailsFailureResponse = apiFailure_json_1.default;
|
|
12
|
+
exports.vendorFiling1099UploadDetailsInProgressState = {
|
|
13
|
+
fetchState: 'In-Progress',
|
|
14
|
+
hasValidState() {
|
|
15
|
+
return this.fetchState == 'Completed';
|
|
16
|
+
},
|
|
17
|
+
error: undefined,
|
|
18
|
+
w9FormUploadStatus: {
|
|
19
|
+
fetchState: 'Not-Started',
|
|
20
|
+
error: undefined,
|
|
21
|
+
},
|
|
22
|
+
w9FormFile: undefined,
|
|
23
|
+
vendor1099DetailsLocalData: {
|
|
24
|
+
vendorId: '123',
|
|
25
|
+
w9Documents: [],
|
|
26
|
+
},
|
|
27
|
+
vendor1099DetailsSaveStatus: {
|
|
28
|
+
fetchState: 'Not-Started',
|
|
29
|
+
error: undefined,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
exports.vendorFiling1099UploadDetailsInProgressInitialState = {
|
|
33
|
+
fetchState: 'Not-Started',
|
|
34
|
+
hasValidState() {
|
|
35
|
+
return this.fetchState == 'Completed';
|
|
36
|
+
},
|
|
37
|
+
error: undefined,
|
|
38
|
+
w9FormUploadStatus: {
|
|
39
|
+
fetchState: 'Not-Started',
|
|
40
|
+
error: undefined,
|
|
41
|
+
},
|
|
42
|
+
w9FormFile: undefined,
|
|
43
|
+
vendor1099DetailsLocalData: {
|
|
44
|
+
vendorId: '123',
|
|
45
|
+
w9Documents: [],
|
|
46
|
+
},
|
|
47
|
+
vendor1099DetailsSaveStatus: {
|
|
48
|
+
fetchState: 'Not-Started',
|
|
49
|
+
error: undefined,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
exports.vendorFiling1099UploadDetailsSuccessState = {
|
|
53
|
+
fetchState: 'Completed',
|
|
54
|
+
hasValidState() {
|
|
55
|
+
return this.fetchState == 'Completed';
|
|
56
|
+
},
|
|
57
|
+
error: undefined,
|
|
58
|
+
w9FormUploadStatus: {
|
|
59
|
+
fetchState: 'Completed',
|
|
60
|
+
error: undefined,
|
|
61
|
+
},
|
|
62
|
+
w9FormFile: (0, vendorFiling1099UploadDetailsPayload_1.mapW9FormFileToAttachment)({
|
|
63
|
+
file_size_unit: 'MB',
|
|
64
|
+
update_time: '2021-01-01T00:00:00Z',
|
|
65
|
+
user_id: '123',
|
|
66
|
+
image_file_ids: ['123'],
|
|
67
|
+
document_side: 'front',
|
|
68
|
+
image_files: [
|
|
69
|
+
{
|
|
70
|
+
file_location: 'location',
|
|
71
|
+
height: 100,
|
|
72
|
+
signed_url: 'url',
|
|
73
|
+
width: 100,
|
|
74
|
+
image_format: 'png',
|
|
75
|
+
image_size_type: 'MB',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
checksum: 'checksum',
|
|
79
|
+
file_size: 100,
|
|
80
|
+
company_id: '123',
|
|
81
|
+
signed_url: 'url',
|
|
82
|
+
extension: 'png',
|
|
83
|
+
create_time: '2021-01-01T00:00:00Z',
|
|
84
|
+
file_id: '123',
|
|
85
|
+
content_type: 'image/png',
|
|
86
|
+
file_name: 'file',
|
|
87
|
+
purpose_id: '123',
|
|
88
|
+
create_userid: '123',
|
|
89
|
+
file_location: 'location',
|
|
90
|
+
document_type: 'type',
|
|
91
|
+
update_userid: '123',
|
|
92
|
+
}),
|
|
93
|
+
vendor1099DetailsLocalData: {
|
|
94
|
+
vendorId: '123',
|
|
95
|
+
w9Documents: [],
|
|
96
|
+
},
|
|
97
|
+
vendor1099DetailsSaveStatus: {
|
|
98
|
+
fetchState: 'Not-Started',
|
|
99
|
+
error: undefined,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { ZeniAPI } from '
|
|
4
|
-
import { RootState } from '
|
|
3
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
+
import { RootState } from '../../../reducer';
|
|
5
5
|
import { updateVendorsFiling1099List, updateVendorFiling1099ListFailure, fetchVendorsFiling1099List } from './vendorFiling1099ListReducer';
|
|
6
|
-
import { updateVendors } from '
|
|
7
|
-
import { updateAddresses } from '
|
|
8
|
-
import { fetchVendorTypeList } from '
|
|
6
|
+
import { updateVendors } from '../../../entity/vendor/vendorReducer';
|
|
7
|
+
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
8
|
+
import { fetchVendorTypeList } from '../../vendorTypeList/vendorTypeListReducer';
|
|
9
9
|
export declare type ActionType = ReturnType<typeof fetchVendorsFiling1099List> | ReturnType<typeof updateVendorFiling1099ListFailure> | ReturnType<typeof updateVendors> | ReturnType<typeof updateVendorsFiling1099List> | ReturnType<typeof fetchVendorTypeList> | ReturnType<typeof updateAddresses>;
|
|
10
10
|
export declare const fetchVendorsFiling1099ListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchVendorsFiling1099ListEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
7
|
const vendorFiling1099ListReducer_1 = require("./vendorFiling1099ListReducer");
|
|
8
|
-
const vendorReducer_1 = require("
|
|
9
|
-
const addressReducer_1 = require("
|
|
10
|
-
const commonVendorViewHelper_1 = require("
|
|
11
|
-
const vendorTypeListReducer_1 = require("
|
|
8
|
+
const vendorReducer_1 = require("../../../entity/vendor/vendorReducer");
|
|
9
|
+
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
10
|
+
const commonVendorViewHelper_1 = require("../../commonVendorView/commonVendorViewHelper");
|
|
11
|
+
const vendorTypeListReducer_1 = require("../../vendorTypeList/vendorTypeListReducer");
|
|
12
12
|
const fetchVendorsFiling1099ListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorFiling1099ListReducer_1.fetchVendorsFiling1099List.match), (0, operators_1.switchMap)(() => {
|
|
13
13
|
const apiUrl = `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/2.0/reports/vendor_1099`;
|
|
14
14
|
return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.switchMap)((response) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReportPayload } from '
|
|
2
|
-
import { VendorPayload } from '
|
|
3
|
-
import { ZeniAPIResponse } from '
|
|
1
|
+
import { ReportPayload } from '../../../commonPayloadTypes/viewAndReportPayload';
|
|
2
|
+
import { VendorPayload } from '../../../entity/vendor/vendorPayload';
|
|
3
|
+
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
4
4
|
export interface FetchVendorFiling1099Payload {
|
|
5
5
|
report: ReportVendorFiling1099Payload;
|
|
6
6
|
query: Record<string, unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SortOrder } from '
|
|
2
|
-
import { ZeniAPIStatus } from '
|
|
1
|
+
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
2
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
3
|
import { VendorFiling1099ListResponse } from './vendorFiling1099ListPayload';
|
|
4
4
|
import { VendorFiling1099ListState, VendorFiling1099ListViewSortKey } from './vendorFiling1099ListState';
|
|
5
5
|
export declare const initialState: VendorFiling1099ListState;
|
|
@@ -3,7 +3,7 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.updateFiling1099SortUiState = exports.updateFiling1099ScrollYOffset = exports.clearVendorsFiling1099List = exports.updateVendorFiling1099ListFailure = exports.updateVendorsFiling1099List = exports.fetchVendorsFiling1099List = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const zeniDayJS_1 = require("
|
|
6
|
+
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
7
7
|
exports.initialState = {
|
|
8
8
|
fetchState: 'Not-Started',
|
|
9
9
|
error: undefined,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SelectorView } from '
|
|
2
|
-
import { Vendor } from '
|
|
3
|
-
import { RootState } from '
|
|
4
|
-
import { ZeniDate } from '
|
|
1
|
+
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
|
+
import { Vendor } from '../../../entity/vendor/vendorState';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniDate } from '../../../zeniDayJS';
|
|
5
5
|
import { VendorFiling1099ListViewSortKey, VendorFiling1099ViewUIState } from './vendorFiling1099ListState';
|
|
6
|
-
import { SortOrder } from '
|
|
7
|
-
import { VendorType } from '
|
|
6
|
+
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
7
|
+
import { VendorType } from '../../vendorTypeList/vendorTypeListPayload';
|
|
8
8
|
export interface VendorFiling1099ListSelectorView extends SelectorView {
|
|
9
9
|
vendors: Vendor[];
|
|
10
10
|
vendorTypeList: VendorType[];
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.sortedVendorFiling1099View = exports.getVendorFiling1099List = void 0;
|
|
7
|
-
const vendorSelector_1 = require("
|
|
7
|
+
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
8
8
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
9
9
|
const getVendorFiling1099List = (state) => {
|
|
10
10
|
var _a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FetchedState, FetchState, ID } from '
|
|
2
|
-
import { SortOrder } from '
|
|
3
|
-
import { ZeniDate } from '
|
|
1
|
+
import { FetchedState, FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
|
+
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
export interface VendorFiling1099ViewUIState {
|
|
5
5
|
sortKey: VendorFiling1099ListViewSortKey;
|
|
6
6
|
sortOrder: SortOrder;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const stringToUnion_1 = require("
|
|
3
|
+
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
4
4
|
const VENDOR_FILING_1099_LIST_VIEW_SORT_KEYS = [
|
|
5
5
|
'vendor_name',
|
|
6
6
|
'tax_classification',
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
|
|
2
|
+
import { FilePayload } from '../../../entity/file/filePayload';
|
|
3
|
+
import { VendorsFiling1099UploadDetailsLocalData } from './vendorFiling1099UploadDetailsState';
|
|
4
|
+
import { RootState } from '../../../reducer';
|
|
5
|
+
import { VendorUpdatePayload } from '../../commonVendorView/vendorView/vendorViewPayload';
|
|
6
|
+
import { ID } from '../../../commonStateTypes/common';
|
|
7
|
+
export interface ImageFile {
|
|
8
|
+
create_time: string;
|
|
9
|
+
file_location: string;
|
|
10
|
+
height: number;
|
|
11
|
+
image_format: string;
|
|
12
|
+
image_size_type: string;
|
|
13
|
+
signed_url: string;
|
|
14
|
+
update_time: string;
|
|
15
|
+
width: number;
|
|
16
|
+
}
|
|
17
|
+
export interface W9Form {
|
|
18
|
+
billing_address: BillingAddress;
|
|
19
|
+
tin: Tin;
|
|
20
|
+
vendor_name: string;
|
|
21
|
+
vendor_type: string;
|
|
22
|
+
}
|
|
23
|
+
export interface BillingAddress {
|
|
24
|
+
city: string;
|
|
25
|
+
country: string | null;
|
|
26
|
+
country_code: string | null;
|
|
27
|
+
postal_code: string;
|
|
28
|
+
state: string;
|
|
29
|
+
street: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface Tin {
|
|
32
|
+
type: string;
|
|
33
|
+
value: string;
|
|
34
|
+
}
|
|
35
|
+
export interface W9FormProcessingPayload {
|
|
36
|
+
files: FilePayload[];
|
|
37
|
+
title: string;
|
|
38
|
+
w9_form: W9Form[];
|
|
39
|
+
}
|
|
40
|
+
export declare const mapW9FormFileToAttachment: (file: FilePayload) => Attachment;
|
|
41
|
+
export declare const prepareEditVendor1099DetailsPayload: (state: RootState, localData: VendorsFiling1099UploadDetailsLocalData, vendorId: ID) => Partial<VendorUpdatePayload>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prepareEditVendor1099DetailsPayload = exports.mapW9FormFileToAttachment = void 0;
|
|
4
|
+
const attachment_1 = require("../../../entity/transaction/stateTypes/attachment");
|
|
5
|
+
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
|
+
const zeniUrl_1 = require("../../../zeniUrl");
|
|
7
|
+
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
8
|
+
const mapW9FormFileToAttachment = (file) => {
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
return ({
|
|
11
|
+
id: file.file_id,
|
|
12
|
+
contentType: (0, attachment_1.toContentTypeStrict)(file.content_type),
|
|
13
|
+
createTime: (0, zeniDayJS_1.date)(file.create_time),
|
|
14
|
+
updateTime: (0, zeniDayJS_1.date)((_a = file.update_time) !== null && _a !== void 0 ? _a : ''),
|
|
15
|
+
fileName: file.file_name,
|
|
16
|
+
fileSizeInBytes: file.file_size,
|
|
17
|
+
fileDownloadUrl: (0, zeniUrl_1.toZeniUrl)((_b = file.signed_url) !== null && _b !== void 0 ? _b : ''),
|
|
18
|
+
fileChecksum: (_c = file.checksum) !== null && _c !== void 0 ? _c : undefined,
|
|
19
|
+
fileId: file.file_id,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.mapW9FormFileToAttachment = mapW9FormFileToAttachment;
|
|
23
|
+
const prepareEditVendor1099DetailsPayload = (state, localData, vendorId) => {
|
|
24
|
+
var _a, _b, _c, _d, _e;
|
|
25
|
+
const { vendorState } = state;
|
|
26
|
+
const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorId);
|
|
27
|
+
return {
|
|
28
|
+
qbo_id: vendor === null || vendor === void 0 ? void 0 : vendor.qboId,
|
|
29
|
+
w9_document_ids: (_a = localData.w9Documents) === null || _a === void 0 ? void 0 : _a.map((doc) => doc.id),
|
|
30
|
+
vendor_name: localData.legalName,
|
|
31
|
+
email: localData.email,
|
|
32
|
+
phone: localData.phone,
|
|
33
|
+
filing1099TaxClassification: localData.filing1099TaxClassification,
|
|
34
|
+
tin: {
|
|
35
|
+
type: (_c = (_b = localData.tin) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : '',
|
|
36
|
+
value: (_e = (_d = localData.tin) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : '',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
exports.prepareEditVendor1099DetailsPayload = prepareEditVendor1099DetailsPayload;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VendorFiling1099UploadDetailsState, VendorsFiling1099UploadDetailsLocalData } from './vendorFiling1099UploadDetailsState';
|
|
2
|
+
import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
|
|
3
|
+
import { FilePayload } from '../../../entity/file/filePayload';
|
|
4
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
5
|
+
import { Vendor } from '../../../entity/vendor/vendorState';
|
|
6
|
+
export declare const initialState: VendorFiling1099UploadDetailsState;
|
|
7
|
+
export declare const updateW9FormUploadFile: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
+
w9FormFile: FilePayload;
|
|
9
|
+
}, string>, updateW9FormUploadFetchState: import("@reduxjs/toolkit").ActionCreatorWithPayload<FetchStateAndError, string>, vendorFiling1099UploadDetailsSave: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string], {
|
|
10
|
+
vendorId: string;
|
|
11
|
+
}, string, never, never>, vendorFiling1099UploadDetailsResetLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string], {
|
|
12
|
+
vendorId: string;
|
|
13
|
+
}, string, never, never>, vendorFiling1099UploadDetailsSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
14
|
+
fetchState: FetchState;
|
|
15
|
+
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
16
|
+
}, string, never, never>, initialiseVendorFiling1099UploadDetailsLocalState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, vendor: Vendor], {
|
|
17
|
+
vendorId: string;
|
|
18
|
+
vendor: Vendor;
|
|
19
|
+
}, string, never, never>, updateVendor1099DetailsLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<VendorsFiling1099UploadDetailsLocalData, string>;
|
|
20
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<VendorFiling1099UploadDetailsState, import("@reduxjs/toolkit").AnyAction>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.updateVendor1099DetailsLocalData = exports.initialiseVendorFiling1099UploadDetailsLocalState = exports.vendorFiling1099UploadDetailsSuccessOrFailure = exports.vendorFiling1099UploadDetailsResetLocalData = exports.vendorFiling1099UploadDetailsSave = exports.updateW9FormUploadFetchState = exports.updateW9FormUploadFile = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const vendorFiling1099UploadDetailsPayload_1 = require("./vendorFiling1099UploadDetailsPayload");
|
|
7
|
+
exports.initialState = {
|
|
8
|
+
fetchState: 'Not-Started',
|
|
9
|
+
hasValidState() {
|
|
10
|
+
return this.fetchState == 'Completed';
|
|
11
|
+
},
|
|
12
|
+
error: undefined,
|
|
13
|
+
w9FormUploadStatus: {
|
|
14
|
+
fetchState: 'Not-Started',
|
|
15
|
+
error: undefined,
|
|
16
|
+
},
|
|
17
|
+
w9FormFile: undefined,
|
|
18
|
+
vendor1099DetailsLocalData: {
|
|
19
|
+
vendorId: '',
|
|
20
|
+
w9Documents: [],
|
|
21
|
+
email: '',
|
|
22
|
+
legalName: '',
|
|
23
|
+
phone: '',
|
|
24
|
+
filing1099TaxClassification: '',
|
|
25
|
+
},
|
|
26
|
+
vendor1099DetailsSaveStatus: {
|
|
27
|
+
fetchState: 'Not-Started',
|
|
28
|
+
error: undefined,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const vendorFiling1099UploadDetails = (0, toolkit_1.createSlice)({
|
|
32
|
+
name: 'vendorFiling1099UploadDetails',
|
|
33
|
+
initialState: exports.initialState,
|
|
34
|
+
reducers: {
|
|
35
|
+
updateW9FormUploadFile(draft, action) {
|
|
36
|
+
if (action.payload.w9FormFile != null) {
|
|
37
|
+
const w9FormFileAttachment = (0, vendorFiling1099UploadDetailsPayload_1.mapW9FormFileToAttachment)(action.payload.w9FormFile);
|
|
38
|
+
draft.vendor1099DetailsLocalData = Object.assign(Object.assign({}, draft.vendor1099DetailsLocalData), { w9Documents: [w9FormFileAttachment] });
|
|
39
|
+
draft.w9FormUploadStatus = {
|
|
40
|
+
fetchState: 'Completed',
|
|
41
|
+
error: undefined,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
updateW9FormUploadFetchState(draft, action) {
|
|
46
|
+
draft.w9FormUploadStatus = {
|
|
47
|
+
fetchState: action.payload.fetchState,
|
|
48
|
+
error: action.payload.error,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
vendorFiling1099UploadDetailsResetLocalData: {
|
|
52
|
+
reducer(
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
54
|
+
draft,
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
56
|
+
action) {
|
|
57
|
+
// reset vendor1099DetailsLocalData
|
|
58
|
+
draft.vendor1099DetailsLocalData = {
|
|
59
|
+
vendorId: action.payload.vendorId,
|
|
60
|
+
w9Documents: [],
|
|
61
|
+
email: '',
|
|
62
|
+
legalName: '',
|
|
63
|
+
phone: '',
|
|
64
|
+
};
|
|
65
|
+
draft.w9FormUploadStatus = {
|
|
66
|
+
fetchState: 'Not-Started',
|
|
67
|
+
error: undefined,
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
prepare(vendorId) {
|
|
71
|
+
return {
|
|
72
|
+
payload: {
|
|
73
|
+
vendorId,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
vendorFiling1099UploadDetailsSave: {
|
|
79
|
+
reducer(draft,
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
81
|
+
_action) {
|
|
82
|
+
draft.vendor1099DetailsSaveStatus = {
|
|
83
|
+
fetchState: 'In-Progress',
|
|
84
|
+
error: undefined,
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
prepare(vendorId) {
|
|
88
|
+
return {
|
|
89
|
+
payload: {
|
|
90
|
+
vendorId,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
vendorFiling1099UploadDetailsSuccessOrFailure: {
|
|
96
|
+
reducer(draft, action) {
|
|
97
|
+
draft.vendor1099DetailsSaveStatus.fetchState =
|
|
98
|
+
action.payload.fetchState;
|
|
99
|
+
draft.vendor1099DetailsSaveStatus.error = action.payload.error;
|
|
100
|
+
},
|
|
101
|
+
prepare(fetchState, error) {
|
|
102
|
+
return {
|
|
103
|
+
payload: {
|
|
104
|
+
fetchState,
|
|
105
|
+
error,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
initialiseVendorFiling1099UploadDetailsLocalState: {
|
|
111
|
+
reducer(draft, action) {
|
|
112
|
+
var _a, _b, _c, _d;
|
|
113
|
+
const vendor = action.payload.vendor;
|
|
114
|
+
const vendor1099DetailsLocalData = draft.vendor1099DetailsLocalData;
|
|
115
|
+
draft.vendor1099DetailsLocalData = Object.assign({ vendorId: action.payload.vendorId, legalName: vendor.name, email: vendor.email, w9Documents: vendor.filing1099W9Files, phone: vendor.phone, filing1099TaxClassification: vendor.filing1099TaxClassification, tin: {
|
|
116
|
+
type: (_b = (_a = vendor.filing1099Tin) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : '',
|
|
117
|
+
value: (_d = (_c = vendor.filing1099Tin) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : '',
|
|
118
|
+
} }, {
|
|
119
|
+
vendor1099DetailsLocalData,
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
prepare(vendorId, vendor) {
|
|
123
|
+
return {
|
|
124
|
+
payload: {
|
|
125
|
+
vendorId,
|
|
126
|
+
vendor,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
updateVendor1099DetailsLocalData(draft, action) {
|
|
132
|
+
draft.vendor1099DetailsLocalData = Object.assign(Object.assign({}, draft.vendor1099DetailsLocalData), action.payload);
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
_a = vendorFiling1099UploadDetails.actions, exports.updateW9FormUploadFile = _a.updateW9FormUploadFile, exports.updateW9FormUploadFetchState = _a.updateW9FormUploadFetchState, exports.vendorFiling1099UploadDetailsSave = _a.vendorFiling1099UploadDetailsSave, exports.vendorFiling1099UploadDetailsResetLocalData = _a.vendorFiling1099UploadDetailsResetLocalData, exports.vendorFiling1099UploadDetailsSuccessOrFailure = _a.vendorFiling1099UploadDetailsSuccessOrFailure, exports.initialiseVendorFiling1099UploadDetailsLocalState = _a.initialiseVendorFiling1099UploadDetailsLocalState, exports.updateVendor1099DetailsLocalData = _a.updateVendor1099DetailsLocalData;
|
|
137
|
+
exports.default = vendorFiling1099UploadDetails.reducer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { vendorFiling1099UploadDetailsSave, vendorFiling1099UploadDetailsResetLocalData, vendorFiling1099UploadDetailsSuccessOrFailure } from './vendorFiling1099UploadDetailsReducer';
|
|
5
|
+
import { updateVendors } from '../../../entity/vendor/vendorReducer';
|
|
6
|
+
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
7
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
8
|
+
export declare type ActionType = ReturnType<typeof vendorFiling1099UploadDetailsSave> | ReturnType<typeof updateVendors> | ReturnType<typeof openSnackbar> | ReturnType<typeof vendorFiling1099UploadDetailsResetLocalData> | ReturnType<typeof updateAddresses> | ReturnType<typeof vendorFiling1099UploadDetailsSuccessOrFailure>;
|
|
9
|
+
export declare const vendorFiling1099UploadDetailsSaveEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vendorFiling1099UploadDetailsSaveEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const vendorFiling1099UploadDetailsPayload_1 = require("../vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload");
|
|
8
|
+
const vendorFiling1099UploadDetailsReducer_1 = require("./vendorFiling1099UploadDetailsReducer");
|
|
9
|
+
const vendorReducer_1 = require("../../../entity/vendor/vendorReducer");
|
|
10
|
+
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
11
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
12
|
+
const commonVendorViewHelper_1 = require("../../commonVendorView/commonVendorViewHelper");
|
|
13
|
+
const vendorFiling1099UploadDetailsSaveEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorFiling1099UploadDetailsReducer_1.vendorFiling1099UploadDetailsSave.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
+
const state = state$.value;
|
|
15
|
+
const vendorFiling1099ViewState = state.vendorFiling1099UploadDetailsState;
|
|
16
|
+
const vendorId = action.payload.vendorId;
|
|
17
|
+
const payload = (0, vendorFiling1099UploadDetailsPayload_1.prepareEditVendor1099DetailsPayload)(state, vendorFiling1099ViewState.vendor1099DetailsLocalData, vendorId);
|
|
18
|
+
const saveVendorApi = zeniAPI.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/vendors/${vendorId}`, payload);
|
|
19
|
+
return saveVendorApi.pipe((0, operators_1.mergeMap)((response) => {
|
|
20
|
+
var _a, _b, _c, _d;
|
|
21
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
22
|
+
const flattenededAddresses = (0, commonVendorViewHelper_1.getFlattenedAddress)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.vendors) !== null && _b !== void 0 ? _b : []);
|
|
23
|
+
const actions = [
|
|
24
|
+
(0, vendorReducer_1.updateVendors)((_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.vendors) !== null && _d !== void 0 ? _d : []),
|
|
25
|
+
(0, addressReducer_1.updateAddresses)(flattenededAddresses),
|
|
26
|
+
];
|
|
27
|
+
actions.push((0, vendorFiling1099UploadDetailsReducer_1.vendorFiling1099UploadDetailsResetLocalData)(action.payload.vendorId));
|
|
28
|
+
actions.push((0, vendorFiling1099UploadDetailsReducer_1.vendorFiling1099UploadDetailsSuccessOrFailure)('Completed'));
|
|
29
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
30
|
+
messageSection: 'update_vendor',
|
|
31
|
+
messageText: 'success',
|
|
32
|
+
type: 'success',
|
|
33
|
+
}));
|
|
34
|
+
return (0, rxjs_1.from)(actions);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return (0, rxjs_1.of)((0, vendorFiling1099UploadDetailsReducer_1.vendorFiling1099UploadDetailsSuccessOrFailure)('Error', response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
38
|
+
messageSection: 'update_vendor',
|
|
39
|
+
messageText: 'failed',
|
|
40
|
+
type: 'error',
|
|
41
|
+
variables: [
|
|
42
|
+
{
|
|
43
|
+
variableName: '_api-error_',
|
|
44
|
+
variableValue: response.status.message,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, vendorFiling1099UploadDetailsReducer_1.vendorFiling1099UploadDetailsSuccessOrFailure)('Error', (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Vendors tab save REST API call errored out ${JSON.stringify(error)}`)))));
|
|
50
|
+
}));
|
|
51
|
+
exports.vendorFiling1099UploadDetailsSaveEpic = vendorFiling1099UploadDetailsSaveEpic;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { Vendor } from '../../../entity/vendor/vendorState';
|
|
4
|
+
import { RootState } from '../../../reducer';
|
|
5
|
+
import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
|
|
6
|
+
import { VendorType } from '../../vendorTypeList/vendorTypeListPayload';
|
|
7
|
+
export interface VendorFiling1099UploadDetailsSelectorView extends SelectorView {
|
|
8
|
+
vendor: Vendor;
|
|
9
|
+
file?: Attachment;
|
|
10
|
+
vendorTypeList?: VendorType[];
|
|
11
|
+
}
|
|
12
|
+
export declare const getVendorDetailbyVendorId: (state: RootState, vendorId: ID) => VendorFiling1099UploadDetailsSelectorView;
|