forked from jebaGem/AngularRedux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple-asset.ts
More file actions
75 lines (64 loc) · 1.62 KB
/
simple-asset.ts
File metadata and controls
75 lines (64 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { StringConstants } from '../shared/string-constants';
const totalAssetAmount = 0;
export interface ISimpleAssetState {
totalAssetAmount: number;
assets: Asset[];
brandModels: IBrandModel[];
assetTypes: IAssetType[];
resetForm: string;
fieldSetup: string;
loadingState: string;
assetConditionAccepted?: boolean;
displayLockedBubble?: boolean;
}
export interface IAssetType {
id?: string;
name: string;
brandName?: string;
}
export class Asset {
constructor(
public id: string,
public quantity: number,
public unitPrice: number,
public totalAmount: number,
public assetType?: string,
public brandModel?: string,
public year?: string,
public description?: string,
public modelName?: string,
public brandName?: string
) { }
}
export const emptyAsset = new Asset('',
0, 0, 0, '', '', new Date().getFullYear().toString(), '');
export const initialSimpleAssetState: ISimpleAssetState = {
totalAssetAmount,
assets: [emptyAsset],
brandModels: [],
assetTypes: [],
resetForm: '',
fieldSetup: '',
loadingState: StringConstants.loadingState.LOADING
};
export interface IAssetUpdatePayload {
index: number;
asset: Asset;
}
export namespace IAssetAction {
export interface StringPayload {
type: string;
payload: string;
}
}
export interface IBrandModel {
modelId: string;
modelName: string;
modifiedDate?: string;
financialProducts?: IBrandModelFinancialProduct[];
brandName?: string;
}
export interface IBrandModelFinancialProduct {
id: string;
url: string;
}