awing-library 2.1.135-beta → 2.1.137-beta
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/ACM-AXN/CampaignPlan/Container.js +19 -6
- package/lib/ACM-AXN/CampaignPlan/Container.test.d.ts +1 -1
- package/lib/ACM-AXN/CampaignPlan/Container.test.js +1 -2
- package/lib/ACM-AXN/CampaignPlan/Detail.js +4 -6
- package/lib/ACM-AXN/CampaignPlan/Detail.test.d.ts +1 -1
- package/lib/ACM-AXN/CampaignPlan/Detail.test.js +2 -3
- package/lib/ACM-AXN/CampaignPlan/Filter.js +11 -4
- package/lib/ACM-AXN/CampaignPlan/Filter.test.d.ts +1 -1
- package/lib/ACM-AXN/CampaignPlan/Filter.test.js +0 -1
- package/lib/ACM-AXN/CampaignPlan/Types.d.ts +6 -74
- package/lib/ACM-AXN/CampaignPlan/Types.js +1 -253
- package/package.json +1 -1
|
@@ -66,10 +66,13 @@ function Container() {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_helmet_async_1.HelmetProvider, { children: (0, jsx_runtime_1.jsx)(react_helmet_async_1.Helmet, { children: (0, jsx_runtime_1.jsx)("title", { children: t('CampaignPlan.Title') }) }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h5", component: "h1", color: "inherit", noWrap: true, fontWeight: 'bold', sx: {
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_helmet_async_1.HelmetProvider, { children: (0, jsx_runtime_1.jsx)(react_helmet_async_1.Helmet, { children: (0, jsx_runtime_1.jsx)("title", { children: t('CampaignPlan.Title') }) }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h5", component: "h1", color: "inherit", noWrap: true, fontWeight: 'bold', sx: { mb: 2 }, children: t('CampaignPlan.Title') }), (0, jsx_runtime_1.jsxs)(material_1.Paper, { elevation: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
70
70
|
display: 'flex',
|
|
71
71
|
justifyContent: 'flex-end',
|
|
72
|
-
|
|
72
|
+
pt: 3,
|
|
73
|
+
pb: 1,
|
|
74
|
+
pl: 2,
|
|
75
|
+
pr: 2,
|
|
73
76
|
}, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
74
77
|
width: '50%',
|
|
75
78
|
display: 'flex',
|
|
@@ -84,7 +87,17 @@ function Container() {
|
|
|
84
87
|
{
|
|
85
88
|
field: 'name',
|
|
86
89
|
headerName: t('CampaignPlan.CampaignName'),
|
|
87
|
-
width:
|
|
90
|
+
width: 260,
|
|
91
|
+
valueGetter: function (row) {
|
|
92
|
+
return ((0, jsx_runtime_1.jsxs)("span", { children: [row.name, (row === null || row === void 0 ? void 0 : row.isNetWork) && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
93
|
+
backgroundColor: '#c49f47',
|
|
94
|
+
color: '#ffffff',
|
|
95
|
+
fontSize: '13px',
|
|
96
|
+
marginLeft: '4px',
|
|
97
|
+
padding: '1px 4px',
|
|
98
|
+
borderRadius: '2px',
|
|
99
|
+
}, children: "Network" }))] }));
|
|
100
|
+
},
|
|
88
101
|
},
|
|
89
102
|
{
|
|
90
103
|
field: 'endDate',
|
|
@@ -96,7 +109,7 @@ function Container() {
|
|
|
96
109
|
},
|
|
97
110
|
{
|
|
98
111
|
field: 'totalRun',
|
|
99
|
-
headerName: "".concat(t('CampaignPlan.HasRun'), " (").concat(t('
|
|
112
|
+
headerName: "".concat(t('CampaignPlan.HasRun'), " (").concat(t('Common.BillingUnit'), ")"),
|
|
100
113
|
valueGetter: function (row) {
|
|
101
114
|
return (0, Helpers_1.formatNumber)(row.totalRun);
|
|
102
115
|
},
|
|
@@ -107,7 +120,7 @@ function Container() {
|
|
|
107
120
|
},
|
|
108
121
|
{
|
|
109
122
|
field: 'totalExpected',
|
|
110
|
-
headerName: "".concat(t('CampaignPlan.WillRun'), " (").concat(t('
|
|
123
|
+
headerName: "".concat(t('CampaignPlan.WillRun'), " (").concat(t('Common.BillingUnit'), ")"),
|
|
111
124
|
valueGetter: function (row) {
|
|
112
125
|
return row.isContainClassB
|
|
113
126
|
? (0, Helpers_1.formatNumber)(row.totalExpected)
|
|
@@ -126,7 +139,7 @@ function Container() {
|
|
|
126
139
|
? (0, Helpers_1.formatNumber)(Number(row.total))
|
|
127
140
|
: 'N/A';
|
|
128
141
|
},
|
|
129
|
-
width:
|
|
142
|
+
width: 190,
|
|
130
143
|
TableCellProps: {
|
|
131
144
|
align: 'right',
|
|
132
145
|
},
|
|
@@ -57,7 +57,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
57
57
|
* @author dauquan1108@gmail.com on 03/12/2024.
|
|
58
58
|
*
|
|
59
59
|
**/
|
|
60
|
-
require("@testing-library/jest-dom");
|
|
61
60
|
var react_router_dom_1 = require("react-router-dom");
|
|
62
61
|
var react_1 = require("@testing-library/react");
|
|
63
62
|
var Container_1 = __importDefault(require("./Container"));
|
|
@@ -137,7 +136,7 @@ jest.mock('./Filter', function () { return function (props) {
|
|
|
137
136
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { children: "Filter component" }), (0, jsx_runtime_1.jsx)("button", { "data-testid": "onUpdateFilterBy", onClick: function () { return props.onUpdateFilterBy('campaignId', '0'); }, children: "onUpdateFilterBy" })] }));
|
|
138
137
|
}; });
|
|
139
138
|
// Mock DataGrid
|
|
140
|
-
jest.mock('
|
|
139
|
+
jest.mock('AWING', function () { return ({
|
|
141
140
|
DataGrid: function (props) { return ((0, jsx_runtime_1.jsxs)("div", { children: [props.columns
|
|
142
141
|
.filter(function (item) { return item.valueGetter; })
|
|
143
142
|
.map(function (getter, idx) { return ((0, jsx_runtime_1.jsx)("span", { children: getter.valueGetter('a', idx, '1') }, idx)); }), (0, jsx_runtime_1.jsx)("span", { children: props.getRowId(mockPagedList.items[0]) }), (0, jsx_runtime_1.jsx)("button", { "data-testid": "onPageIndexChange", onClick: function () { return props.onPageIndexChange(0); } }), (0, jsx_runtime_1.jsx)("button", { "data-testid": "onPageSizeChange", onClick: function () { return props.onPageSizeChange(2); } }), (0, jsx_runtime_1.jsx)("p", { "data-testid": "rowsPaginate", children: JSON.stringify(props.rows) }), (0, jsx_runtime_1.jsx)("button", { "data-testid": "onRowClick", onClick: props.onRowClick, children: "onRowClick" })] })); },
|
|
@@ -70,7 +70,7 @@ function CampaignPlanDetail() {
|
|
|
70
70
|
field: 'name',
|
|
71
71
|
headerName: t('CampaignPlan.Group'),
|
|
72
72
|
valueGetter: function (row) {
|
|
73
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [row.name,
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [row.name, (0, jsx_runtime_1.jsx)(material_1.Typography, { component: 'span', sx: {
|
|
74
74
|
fontFamily: '"Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2" !important',
|
|
75
75
|
fontSize: 18,
|
|
76
76
|
}, children: getCampaignPriority(row.priority) })] }));
|
|
@@ -78,17 +78,15 @@ function CampaignPlanDetail() {
|
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
field: 'totalRun',
|
|
81
|
-
headerName: t('CampaignPlan.HasRun'),
|
|
82
|
-
|
|
83
|
-
return (0, Helpers_1.formatNumber)(row.totalRun);
|
|
84
|
-
},
|
|
81
|
+
headerName: "".concat(t('CampaignPlan.HasRun'), " (").concat(t('Common.BillingUnit'), ")"),
|
|
82
|
+
type: 'number',
|
|
85
83
|
TableCellProps: {
|
|
86
84
|
align: 'right',
|
|
87
85
|
},
|
|
88
86
|
},
|
|
89
87
|
{
|
|
90
88
|
field: 'totalExpected',
|
|
91
|
-
headerName: t('CampaignPlan.WillRun'),
|
|
89
|
+
headerName: "".concat(t('CampaignPlan.WillRun'), " (").concat(t('Common.BillingUnit'), ")"),
|
|
92
90
|
valueGetter: function (row) {
|
|
93
91
|
return row.priority ===
|
|
94
92
|
Utils_1.CAMPAIGN_PRIORITY.CLASS_B
|
|
@@ -58,7 +58,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
58
58
|
**/
|
|
59
59
|
var react_1 = require("@testing-library/react");
|
|
60
60
|
var Detail_1 = __importDefault(require("./Detail"));
|
|
61
|
-
require("@testing-library/jest-dom");
|
|
62
61
|
var mockCampaignPlan = {
|
|
63
62
|
scheduleCampaignPlanModel: {
|
|
64
63
|
campaignId: '5391179157958735137',
|
|
@@ -105,9 +104,9 @@ jest.mock('./Hooks', function () { return ({
|
|
|
105
104
|
// Mock đa ngữ
|
|
106
105
|
jest.mock('react-i18next', function () { return (__assign(__assign({}, jest.requireActual('react-i18next')), { useTranslation: function () { return ({ t: jest.fn(function (key) { return key; }) }); } })); });
|
|
107
106
|
// Mock Drawer
|
|
108
|
-
jest.mock('
|
|
107
|
+
jest.mock('Commons/Components/ClassicDrawer', function () { return function (props) { return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { "data-testid": "title-drawer", children: props.title }), props.children] })); }; });
|
|
109
108
|
// Mock PageManagement
|
|
110
|
-
jest.mock('
|
|
109
|
+
jest.mock('AWING', function () { return ({
|
|
111
110
|
PageManagement: function (props) {
|
|
112
111
|
props.onChangeQueryInput({
|
|
113
112
|
searchString: '',
|
|
@@ -47,7 +47,7 @@ function Filters(props) {
|
|
|
47
47
|
});
|
|
48
48
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
49
|
}, []);
|
|
50
|
-
var reserveTypes = [
|
|
50
|
+
var reserveTypes = (0, react_1.useMemo)(function () { return [
|
|
51
51
|
{
|
|
52
52
|
id: 0,
|
|
53
53
|
name: t('CampaignPlan.AdvanceSearchOptionAll'),
|
|
@@ -63,10 +63,17 @@ function Filters(props) {
|
|
|
63
63
|
name: t('CampaignPlan.NoneReserved'),
|
|
64
64
|
value: Utils_1.CAMPAIGN_RESERVETYPES.NONERESERVED,
|
|
65
65
|
},
|
|
66
|
-
];
|
|
67
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Autocomplete, { fullWidth: true, size: "small", options: campaign, id: Utils_1.FilterByType.campaignId, "data-testid": Utils_1.FilterByType.campaignId, getOptionLabel: function (option) { return (option === null || option === void 0 ? void 0 : option.name) || ''; },
|
|
66
|
+
]; }, [t]);
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Autocomplete, { fullWidth: true, size: "small", options: campaign, id: Utils_1.FilterByType.campaignId, "data-testid": Utils_1.FilterByType.campaignId, getOptionLabel: function (option) { return (option === null || option === void 0 ? void 0 : option.name) || ''; }, renderOption: function (props, option) { return ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ component: "li" }, props, { sx: { width: '100%' }, children: (0, jsx_runtime_1.jsxs)("span", { children: [option.name, option.isNetWork && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
68
|
+
backgroundColor: '#c49f47',
|
|
69
|
+
color: '#ffffff',
|
|
70
|
+
fontSize: '13px',
|
|
71
|
+
marginLeft: '4px',
|
|
72
|
+
padding: '1px 4px',
|
|
73
|
+
borderRadius: '2px',
|
|
74
|
+
}, children: "Network" }))] }) }))); }, onChange: function (event, campaignItem) {
|
|
68
75
|
onUpdateFilterBy(Utils_1.FilterByType.campaignId, (campaignItem === null || campaignItem === void 0 ? void 0 : campaignItem.id) || '0');
|
|
69
|
-
}, renderInput: function (params) { return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({}, params, { label: t('CampaignPlan.CampaignName') }))); }, sx: { marginRight: function (theme) { return theme.spacing(2); } }, value: campaign.find(function (x) { return x.id === filterBy.campaignId; }) }), (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { fullWidth: true, size: "small", options: reserveTypes, id: Utils_1.FilterByType.campaignReserved, "data-testid": Utils_1.FilterByType.campaignReserved, getOptionLabel: function (option) { return (option === null || option === void 0 ? void 0 : option.name) || ''; }, onChange: function (event, campaignItem) {
|
|
76
|
+
}, renderInput: function (params) { return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({}, params, { label: t('CampaignPlan.CampaignName') }))); }, sx: { marginRight: function (theme) { return theme.spacing(2); } }, value: campaign.find(function (x) { return x.id === filterBy.campaignId; }) }), (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { fullWidth: true, size: "small", sx: { maxWidth: 250 }, options: reserveTypes, id: Utils_1.FilterByType.campaignReserved, "data-testid": Utils_1.FilterByType.campaignReserved, getOptionLabel: function (option) { return (option === null || option === void 0 ? void 0 : option.name) || ''; }, onChange: function (event, campaignItem) {
|
|
70
77
|
onUpdateFilterBy(Utils_1.FilterByType.campaignReserved, (campaignItem === null || campaignItem === void 0 ? void 0 : campaignItem.value) || 0);
|
|
71
78
|
}, renderInput: function (params) { return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({}, params, { label: t('CampaignPlan.ReserveType') }))); }, value: reserveTypes.find(function (x) { return x.value === filterBy.campaignReserved; }) })] }));
|
|
72
79
|
}
|
|
@@ -24,7 +24,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
24
24
|
var react_1 = require("@testing-library/react");
|
|
25
25
|
// import { BrowserRouter, useParams } from 'react-router-dom'
|
|
26
26
|
var Filter_1 = __importDefault(require("./Filter"));
|
|
27
|
-
require("@testing-library/jest-dom");
|
|
28
27
|
var mockCampaign = [
|
|
29
28
|
{
|
|
30
29
|
id: '5391179157958735137',
|
|
@@ -32,7 +32,7 @@ export declare enum CampaignReserved {
|
|
|
32
32
|
IsReserved = 1,
|
|
33
33
|
NotReserved = 2
|
|
34
34
|
}
|
|
35
|
-
export interface
|
|
35
|
+
export interface ScheduleCampaignPlanModel {
|
|
36
36
|
campaignId?: string;
|
|
37
37
|
name?: string | undefined;
|
|
38
38
|
endDate?: string;
|
|
@@ -42,21 +42,7 @@ export interface IScheduleCampaignPlanModel {
|
|
|
42
42
|
totalExpected?: number;
|
|
43
43
|
total?: string;
|
|
44
44
|
}
|
|
45
|
-
export
|
|
46
|
-
campaignId?: string;
|
|
47
|
-
name?: string | undefined;
|
|
48
|
-
endDate?: string;
|
|
49
|
-
isNetworkCampaign?: boolean;
|
|
50
|
-
isContainClassB?: boolean;
|
|
51
|
-
totalRun?: number;
|
|
52
|
-
totalExpected?: number;
|
|
53
|
-
total?: string;
|
|
54
|
-
constructor(data?: IScheduleCampaignPlanModel);
|
|
55
|
-
init(_data?: any): void;
|
|
56
|
-
static fromJS(data: any): ScheduleCampaignPlanModel;
|
|
57
|
-
toJSON(data?: any): any;
|
|
58
|
-
}
|
|
59
|
-
export interface IPagedList_1OfScheduleCampaignPlanModel {
|
|
45
|
+
export interface PagedList_1OfScheduleCampaignPlanModel {
|
|
60
46
|
items?: ScheduleCampaignPlanModel[] | undefined;
|
|
61
47
|
pageCount?: number;
|
|
62
48
|
totalItemCount?: number;
|
|
@@ -65,29 +51,7 @@ export interface IPagedList_1OfScheduleCampaignPlanModel {
|
|
|
65
51
|
hasPreviousPage?: boolean;
|
|
66
52
|
hasNextPage?: boolean;
|
|
67
53
|
}
|
|
68
|
-
export
|
|
69
|
-
items?: ScheduleCampaignPlanModel[] | undefined;
|
|
70
|
-
pageCount?: number;
|
|
71
|
-
totalItemCount?: number;
|
|
72
|
-
pageNumber?: number;
|
|
73
|
-
pageSize?: number;
|
|
74
|
-
readonly hasPreviousPage?: boolean;
|
|
75
|
-
readonly hasNextPage?: boolean;
|
|
76
|
-
constructor(data?: IPagedList_1OfScheduleCampaignPlanModel);
|
|
77
|
-
init(_data?: any): void;
|
|
78
|
-
static fromJS(data: any): PagedList_1OfScheduleCampaignPlanModel;
|
|
79
|
-
toJSON(data?: any): any;
|
|
80
|
-
}
|
|
81
|
-
export interface IScheduleCampaignPlanGroupModel {
|
|
82
|
-
groupId?: number;
|
|
83
|
-
name?: string | undefined;
|
|
84
|
-
totalRun?: number;
|
|
85
|
-
totalExpected?: number;
|
|
86
|
-
isReserved?: boolean;
|
|
87
|
-
total?: string;
|
|
88
|
-
priority?: number;
|
|
89
|
-
}
|
|
90
|
-
export declare class ScheduleCampaignPlanGroupModel implements IScheduleCampaignPlanGroupModel {
|
|
54
|
+
export interface ScheduleCampaignPlanGroupModel {
|
|
91
55
|
groupId?: number;
|
|
92
56
|
name?: string | undefined;
|
|
93
57
|
totalRun?: number;
|
|
@@ -95,54 +59,22 @@ export declare class ScheduleCampaignPlanGroupModel implements IScheduleCampaign
|
|
|
95
59
|
isReserved?: boolean;
|
|
96
60
|
total?: string;
|
|
97
61
|
priority?: number;
|
|
98
|
-
constructor(data?: IScheduleCampaignPlanGroupModel);
|
|
99
|
-
init(_data?: any): void;
|
|
100
|
-
static fromJS(data: any): ScheduleCampaignPlanGroupModel;
|
|
101
|
-
toJSON(data?: any): any;
|
|
102
|
-
}
|
|
103
|
-
export interface IScheduleCampaignPlanDetail {
|
|
104
|
-
scheduleCampaignPlanModel?: ScheduleCampaignPlanModel;
|
|
105
|
-
scheduleCampaignPlanGroups?: ScheduleCampaignPlanGroupModel[] | undefined;
|
|
106
|
-
total?: number;
|
|
107
62
|
}
|
|
108
|
-
export
|
|
63
|
+
export interface ScheduleCampaignPlanDetail {
|
|
109
64
|
scheduleCampaignPlanModel?: ScheduleCampaignPlanModel;
|
|
110
65
|
scheduleCampaignPlanGroups?: ScheduleCampaignPlanGroupModel[] | undefined;
|
|
111
66
|
total?: number;
|
|
112
|
-
constructor(data?: IScheduleCampaignPlanDetail);
|
|
113
|
-
init(_data?: any): void;
|
|
114
|
-
static fromJS(data: any): ScheduleCampaignPlanDetail;
|
|
115
|
-
toJSON(data?: any): any;
|
|
116
67
|
}
|
|
117
|
-
export interface
|
|
68
|
+
export interface Timestamp {
|
|
118
69
|
seconds?: string;
|
|
119
70
|
nanos?: number;
|
|
120
71
|
}
|
|
121
|
-
export
|
|
122
|
-
seconds?: string;
|
|
123
|
-
nanos?: number;
|
|
124
|
-
constructor(data?: ITimestamp);
|
|
125
|
-
init(_data?: any): void;
|
|
126
|
-
static fromJS(data: any): Timestamp;
|
|
127
|
-
toJSON(data?: any): any;
|
|
128
|
-
}
|
|
129
|
-
export interface ICampaign {
|
|
130
|
-
id?: string;
|
|
131
|
-
directoryId?: string;
|
|
132
|
-
directoryPath?: string | undefined;
|
|
133
|
-
name?: string | undefined;
|
|
134
|
-
createdDate?: Timestamp;
|
|
135
|
-
}
|
|
136
|
-
export declare class Campaign implements ICampaign {
|
|
72
|
+
export interface Campaign {
|
|
137
73
|
id?: string;
|
|
138
74
|
directoryId?: string;
|
|
139
75
|
directoryPath?: string | undefined;
|
|
140
76
|
name?: string | undefined;
|
|
141
77
|
createdDate?: Timestamp;
|
|
142
|
-
constructor(data?: ICampaign);
|
|
143
|
-
init(_data?: any): void;
|
|
144
|
-
static fromJS(data: any): Campaign;
|
|
145
|
-
toJSON(data?: any): any;
|
|
146
78
|
}
|
|
147
79
|
export interface Cancel {
|
|
148
80
|
message: string | undefined;
|
|
@@ -5,262 +5,10 @@
|
|
|
5
5
|
*
|
|
6
6
|
**/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.CampaignReserved = void 0;
|
|
9
9
|
var CampaignReserved;
|
|
10
10
|
(function (CampaignReserved) {
|
|
11
11
|
CampaignReserved[CampaignReserved["None"] = 0] = "None";
|
|
12
12
|
CampaignReserved[CampaignReserved["IsReserved"] = 1] = "IsReserved";
|
|
13
13
|
CampaignReserved[CampaignReserved["NotReserved"] = 2] = "NotReserved";
|
|
14
14
|
})(CampaignReserved || (exports.CampaignReserved = CampaignReserved = {}));
|
|
15
|
-
var ScheduleCampaignPlanModel = /** @class */ (function () {
|
|
16
|
-
function ScheduleCampaignPlanModel(data) {
|
|
17
|
-
if (data) {
|
|
18
|
-
for (var property in data) {
|
|
19
|
-
if (data.hasOwnProperty(property))
|
|
20
|
-
this[property] = data[property];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
ScheduleCampaignPlanModel.prototype.init = function (_data) {
|
|
25
|
-
if (_data) {
|
|
26
|
-
this.campaignId = _data['campaignId'];
|
|
27
|
-
this.name = _data['name'];
|
|
28
|
-
this.endDate = _data['endDate'];
|
|
29
|
-
this.isNetworkCampaign = _data['isNetworkCampaign'];
|
|
30
|
-
this.isContainClassB = _data['isContainClassB'];
|
|
31
|
-
this.totalRun = _data['totalRun'];
|
|
32
|
-
this.totalExpected = _data['totalExpected'];
|
|
33
|
-
this.total = _data['total'];
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
ScheduleCampaignPlanModel.fromJS = function (data) {
|
|
37
|
-
data = typeof data === 'object' ? data : {};
|
|
38
|
-
var result = new ScheduleCampaignPlanModel();
|
|
39
|
-
result.init(data);
|
|
40
|
-
return result;
|
|
41
|
-
};
|
|
42
|
-
ScheduleCampaignPlanModel.prototype.toJSON = function (data) {
|
|
43
|
-
data = typeof data === 'object' ? data : {};
|
|
44
|
-
data['campaignId'] = this.campaignId;
|
|
45
|
-
data['name'] = this.name;
|
|
46
|
-
data['endDate'] = this.endDate;
|
|
47
|
-
data['isNetworkCampaign'] = this.isNetworkCampaign;
|
|
48
|
-
data['isContainClassB'] = this.isContainClassB;
|
|
49
|
-
data['totalRun'] = this.totalRun;
|
|
50
|
-
data['totalExpected'] = this.totalExpected;
|
|
51
|
-
data['total'] = this.total;
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
return ScheduleCampaignPlanModel;
|
|
55
|
-
}());
|
|
56
|
-
exports.ScheduleCampaignPlanModel = ScheduleCampaignPlanModel;
|
|
57
|
-
var PagedList_1OfScheduleCampaignPlanModel = /** @class */ (function () {
|
|
58
|
-
function PagedList_1OfScheduleCampaignPlanModel(data) {
|
|
59
|
-
if (data) {
|
|
60
|
-
for (var property in data) {
|
|
61
|
-
if (data.hasOwnProperty(property))
|
|
62
|
-
this[property] = data[property];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
PagedList_1OfScheduleCampaignPlanModel.prototype.init = function (_data) {
|
|
67
|
-
if (_data) {
|
|
68
|
-
if (Array.isArray(_data['items'])) {
|
|
69
|
-
this.items = [];
|
|
70
|
-
for (var _i = 0, _a = _data['items']; _i < _a.length; _i++) {
|
|
71
|
-
var item = _a[_i];
|
|
72
|
-
this.items.push(ScheduleCampaignPlanModel.fromJS(item));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
this.pageCount = _data['pageCount'];
|
|
76
|
-
this.totalItemCount = _data['totalItemCount'];
|
|
77
|
-
this.pageNumber = _data['pageNumber'];
|
|
78
|
-
this.pageSize = _data['pageSize'];
|
|
79
|
-
this.hasPreviousPage = _data['hasPreviousPage'];
|
|
80
|
-
this.hasNextPage = _data['hasNextPage'];
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
PagedList_1OfScheduleCampaignPlanModel.fromJS = function (data) {
|
|
84
|
-
data = typeof data === 'object' ? data : {};
|
|
85
|
-
var result = new PagedList_1OfScheduleCampaignPlanModel();
|
|
86
|
-
result.init(data);
|
|
87
|
-
return result;
|
|
88
|
-
};
|
|
89
|
-
PagedList_1OfScheduleCampaignPlanModel.prototype.toJSON = function (data) {
|
|
90
|
-
data = typeof data === 'object' ? data : {};
|
|
91
|
-
if (Array.isArray(this.items)) {
|
|
92
|
-
data['items'] = [];
|
|
93
|
-
for (var _i = 0, _a = this.items; _i < _a.length; _i++) {
|
|
94
|
-
var item = _a[_i];
|
|
95
|
-
data['items'].push(item.toJSON());
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
data['pageCount'] = this.pageCount;
|
|
99
|
-
data['totalItemCount'] = this.totalItemCount;
|
|
100
|
-
data['pageNumber'] = this.pageNumber;
|
|
101
|
-
data['pageSize'] = this.pageSize;
|
|
102
|
-
data['hasPreviousPage'] = this.hasPreviousPage;
|
|
103
|
-
data['hasNextPage'] = this.hasNextPage;
|
|
104
|
-
return data;
|
|
105
|
-
};
|
|
106
|
-
return PagedList_1OfScheduleCampaignPlanModel;
|
|
107
|
-
}());
|
|
108
|
-
exports.PagedList_1OfScheduleCampaignPlanModel = PagedList_1OfScheduleCampaignPlanModel;
|
|
109
|
-
var ScheduleCampaignPlanGroupModel = /** @class */ (function () {
|
|
110
|
-
function ScheduleCampaignPlanGroupModel(data) {
|
|
111
|
-
if (data) {
|
|
112
|
-
for (var property in data) {
|
|
113
|
-
if (data.hasOwnProperty(property))
|
|
114
|
-
this[property] = data[property];
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
ScheduleCampaignPlanGroupModel.prototype.init = function (_data) {
|
|
119
|
-
if (_data) {
|
|
120
|
-
this.groupId = _data['groupId'];
|
|
121
|
-
this.name = _data['name'];
|
|
122
|
-
this.totalRun = _data['totalRun'];
|
|
123
|
-
this.totalExpected = _data['totalExpected'];
|
|
124
|
-
this.isReserved = _data['isReserved'];
|
|
125
|
-
this.total = _data['total'];
|
|
126
|
-
this.priority = _data['priority'];
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
ScheduleCampaignPlanGroupModel.fromJS = function (data) {
|
|
130
|
-
data = typeof data === 'object' ? data : {};
|
|
131
|
-
var result = new ScheduleCampaignPlanGroupModel();
|
|
132
|
-
result.init(data);
|
|
133
|
-
return result;
|
|
134
|
-
};
|
|
135
|
-
ScheduleCampaignPlanGroupModel.prototype.toJSON = function (data) {
|
|
136
|
-
data = typeof data === 'object' ? data : {};
|
|
137
|
-
data['groupId'] = this.groupId;
|
|
138
|
-
data['name'] = this.name;
|
|
139
|
-
data['totalRun'] = this.totalRun;
|
|
140
|
-
data['totalExpected'] = this.totalExpected;
|
|
141
|
-
data['isReserved'] = this.isReserved;
|
|
142
|
-
data['total'] = this.total;
|
|
143
|
-
data['priority'] = this.priority;
|
|
144
|
-
return data;
|
|
145
|
-
};
|
|
146
|
-
return ScheduleCampaignPlanGroupModel;
|
|
147
|
-
}());
|
|
148
|
-
exports.ScheduleCampaignPlanGroupModel = ScheduleCampaignPlanGroupModel;
|
|
149
|
-
var ScheduleCampaignPlanDetail = /** @class */ (function () {
|
|
150
|
-
function ScheduleCampaignPlanDetail(data) {
|
|
151
|
-
if (data) {
|
|
152
|
-
for (var property in data) {
|
|
153
|
-
if (data.hasOwnProperty(property))
|
|
154
|
-
this[property] = data[property];
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
ScheduleCampaignPlanDetail.prototype.init = function (_data) {
|
|
159
|
-
if (_data) {
|
|
160
|
-
this.scheduleCampaignPlanModel = _data['scheduleCampaignPlanModel']
|
|
161
|
-
? ScheduleCampaignPlanModel.fromJS(_data['scheduleCampaignPlanModel'])
|
|
162
|
-
: undefined;
|
|
163
|
-
if (Array.isArray(_data['scheduleCampaignPlanGroups'])) {
|
|
164
|
-
this.scheduleCampaignPlanGroups = [];
|
|
165
|
-
for (var _i = 0, _a = _data['scheduleCampaignPlanGroups']; _i < _a.length; _i++) {
|
|
166
|
-
var item = _a[_i];
|
|
167
|
-
this.scheduleCampaignPlanGroups.push(ScheduleCampaignPlanGroupModel.fromJS(item));
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
this.total = _data['total'];
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
ScheduleCampaignPlanDetail.fromJS = function (data) {
|
|
174
|
-
data = typeof data === 'object' ? data : {};
|
|
175
|
-
var result = new ScheduleCampaignPlanDetail();
|
|
176
|
-
result.init(data);
|
|
177
|
-
return result;
|
|
178
|
-
};
|
|
179
|
-
ScheduleCampaignPlanDetail.prototype.toJSON = function (data) {
|
|
180
|
-
data = typeof data === 'object' ? data : {};
|
|
181
|
-
data['scheduleCampaignPlanModel'] = this.scheduleCampaignPlanModel
|
|
182
|
-
? this.scheduleCampaignPlanModel.toJSON()
|
|
183
|
-
: undefined;
|
|
184
|
-
if (Array.isArray(this.scheduleCampaignPlanGroups)) {
|
|
185
|
-
data['scheduleCampaignPlanGroups'] = [];
|
|
186
|
-
for (var _i = 0, _a = this.scheduleCampaignPlanGroups; _i < _a.length; _i++) {
|
|
187
|
-
var item = _a[_i];
|
|
188
|
-
data['scheduleCampaignPlanGroups'].push(item.toJSON());
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
data['total'] = this.total;
|
|
192
|
-
return data;
|
|
193
|
-
};
|
|
194
|
-
return ScheduleCampaignPlanDetail;
|
|
195
|
-
}());
|
|
196
|
-
exports.ScheduleCampaignPlanDetail = ScheduleCampaignPlanDetail;
|
|
197
|
-
var Timestamp = /** @class */ (function () {
|
|
198
|
-
function Timestamp(data) {
|
|
199
|
-
if (data) {
|
|
200
|
-
for (var property in data) {
|
|
201
|
-
if (data.hasOwnProperty(property))
|
|
202
|
-
this[property] = data[property];
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
Timestamp.prototype.init = function (_data) {
|
|
207
|
-
if (_data) {
|
|
208
|
-
this.seconds = _data['seconds'];
|
|
209
|
-
this.nanos = _data['nanos'];
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
Timestamp.fromJS = function (data) {
|
|
213
|
-
data = typeof data === 'object' ? data : {};
|
|
214
|
-
var result = new Timestamp();
|
|
215
|
-
result.init(data);
|
|
216
|
-
return result;
|
|
217
|
-
};
|
|
218
|
-
Timestamp.prototype.toJSON = function (data) {
|
|
219
|
-
data = typeof data === 'object' ? data : {};
|
|
220
|
-
data['seconds'] = this.seconds;
|
|
221
|
-
data['nanos'] = this.nanos;
|
|
222
|
-
return data;
|
|
223
|
-
};
|
|
224
|
-
return Timestamp;
|
|
225
|
-
}());
|
|
226
|
-
exports.Timestamp = Timestamp;
|
|
227
|
-
var Campaign = /** @class */ (function () {
|
|
228
|
-
function Campaign(data) {
|
|
229
|
-
if (data) {
|
|
230
|
-
for (var property in data) {
|
|
231
|
-
if (data.hasOwnProperty(property))
|
|
232
|
-
this[property] = data[property];
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
Campaign.prototype.init = function (_data) {
|
|
237
|
-
if (_data) {
|
|
238
|
-
this.id = _data['id'];
|
|
239
|
-
this.directoryId = _data['directoryId'];
|
|
240
|
-
this.directoryPath = _data['directoryPath'];
|
|
241
|
-
this.name = _data['name'];
|
|
242
|
-
this.createdDate = _data['createdDate']
|
|
243
|
-
? Timestamp.fromJS(_data['createdDate'])
|
|
244
|
-
: undefined;
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
Campaign.fromJS = function (data) {
|
|
248
|
-
data = typeof data === 'object' ? data : {};
|
|
249
|
-
var result = new Campaign();
|
|
250
|
-
result.init(data);
|
|
251
|
-
return result;
|
|
252
|
-
};
|
|
253
|
-
Campaign.prototype.toJSON = function (data) {
|
|
254
|
-
data = typeof data === 'object' ? data : {};
|
|
255
|
-
data['id'] = this.id;
|
|
256
|
-
data['directoryId'] = this.directoryId;
|
|
257
|
-
data['directoryPath'] = this.directoryPath;
|
|
258
|
-
data['name'] = this.name;
|
|
259
|
-
data['createdDate'] = this.createdDate
|
|
260
|
-
? this.createdDate.toJSON()
|
|
261
|
-
: undefined;
|
|
262
|
-
return data;
|
|
263
|
-
};
|
|
264
|
-
return Campaign;
|
|
265
|
-
}());
|
|
266
|
-
exports.Campaign = Campaign;
|