-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Policy.ts
86 lines (61 loc) · 2.29 KB
/
Policy.ts
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
76
77
78
79
80
81
82
83
84
85
86
import type {ValueOf} from 'type-fest';
import type CONST from '@src/CONST';
import type * as OnyxCommon from './OnyxCommon';
type Unit = 'mi' | 'km';
type Rate = {
name: string;
rate: number;
currency: string;
};
type CustomUnit = {
customUnitID?: string;
name?: string;
attributes: {
unit: Unit;
};
rates?: Record<string, Rate>;
};
type Policy = {
/** The ID of the policy */
id: string;
/** The name of the policy */
name: string;
/** The current user's role in the policy */
role: ValueOf<typeof CONST.POLICY.ROLE>;
/** The policy type */
type: ValueOf<typeof CONST.POLICY.TYPE>;
/** The email of the policy owner */
owner: string;
/** The accountID of the policy owner */
ownerAccountID: number;
/** The output currency for the policy */
outputCurrency: string;
/** The URL for the policy avatar */
avatar?: string;
/** Error objects keyed by field name containing errors keyed by microtime */
errorFields?: OnyxCommon.ErrorFields;
/** Indicates the type of change made to the policy that hasn't been synced with the server yet */
pendingAction?: OnyxCommon.PendingAction;
/** A list of errors keyed by microtime */
errors: OnyxCommon.Errors;
/** Whether this policy was loaded from a policy summary, or loaded completely with all of its values */
isFromFullPolicy?: boolean;
/** When this policy was last modified */
lastModified?: string;
/** The custom units data for this policy */
customUnits?: Record<string, CustomUnit>;
/** Whether policy expense chats can be created and used on this policy. Enabled manually by CQ/JS snippet. Always true for free policies. */
isPolicyExpenseChatEnabled: boolean;
/** Whether the auto reporting is enabled */
autoReporting: boolean;
/** The scheduled submit frequency set up on the this policy */
autoReportingFrequency: ValueOf<typeof CONST.POLICY.AUTO_REPORTING_FREQUENCIES>;
/** Whether the scheduled submit is enabled */
isHarvestingEnabled: boolean;
/** The accountID of manager who the employee submits their expenses to on paid policies */
submitsTo?: number;
/** The employee list of the policy */
employeeList?: [];
};
export default Policy;
export type {Unit};