-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
executable file
·39 lines (37 loc) · 1.01 KB
/
types.d.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
export type TData = {
status: boolean;
message: string;
data: {
actNumber: string;
dateOfService: string;
dateOfIssue: string;
customer: string;
phoneNumber: string;
nomenclature: string;
serialNumber: string;
additionalInfo: string;
cost: number;
status: string;
repairCompleteDate?: string;
repairResult: boolean;
worksContent: string;
};
};
export type TFormState = {
fetchedData: TData;
actNumber: string;
phoneNumber: string;
actNumberValid: boolean;
phoneNumberValid: boolean;
loading: boolean;
error: any;
};
export type Action =
| { type: "RESET_FORM" }
| { type: "CHANGE_ACT_NUMBER"; payload: string }
| { type: "CHANGE_PHONE_NUMBER"; payload: string }
| { type: "SET_ACT_NUMBER_VALID"; payload: boolean }
| { type: "SET_PHONE_NUMBER_VALID"; payload: boolean }
| { type: "SET_LOADING"; payload: boolean }
| { type: "SET_FETCHED_DATA"; payload: TData }
| { type: "SET_ERROR"; payload: string };