@mcdylanproperenterprise/nodejs-proper-sunsoontaat-types 0.0.1

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.
Files changed (3) hide show
  1. package/enum.ts +27 -0
  2. package/package.json +12 -0
  3. package/types.d.ts +155 -0
package/enum.ts ADDED
@@ -0,0 +1,27 @@
1
+ export enum EActivityType {
2
+ order = "order",
3
+ customer = "customer",
4
+ product = "product",
5
+ }
6
+
7
+ export enum EOrderStatus {
8
+ pending = "pending",
9
+ process = "process",
10
+ onhold = "onhold",
11
+ completed = "completed",
12
+ cancelled = "cancelled",
13
+ }
14
+
15
+ export enum EMachine {
16
+ a = "A",
17
+ b = "B",
18
+ r = "R",
19
+ t = "T",
20
+ f = "F",
21
+ }
22
+
23
+ export enum EProductStatus {
24
+ ready = "ready",
25
+ attached = "attached",
26
+ sold = "sold",
27
+ }
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@mcdylanproperenterprise/nodejs-proper-sunsoontaat-types",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "",
6
+ "types": "index.d.ts",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
12
+ }
package/types.d.ts ADDED
@@ -0,0 +1,155 @@
1
+ import { EMachine, EOrderStatus, EProductStatus } from "./enum";
2
+
3
+ export type TJwtTokenObject = {
4
+ id: string;
5
+ };
6
+
7
+ export type TJwtToken = {
8
+ accessToken: string;
9
+ refreshToken: string;
10
+ };
11
+
12
+ export type TActivity = {
13
+ _id: string;
14
+ type: EActivityType;
15
+ referenceId: string;
16
+ description: string;
17
+ images: string[];
18
+ adminId: string;
19
+ createdAt: Date;
20
+ };
21
+
22
+ export type TAdmin = {
23
+ _id: string;
24
+ username: string;
25
+ password: string;
26
+ isDeleted: boolean;
27
+ isBlocked: boolean;
28
+ permissions: string[];
29
+ updatedAt: Date;
30
+ createdAt: Date;
31
+ };
32
+
33
+ export type PartialTAdmin = Partial<TAdmin>;
34
+
35
+ export type TGetAdminQuery = {
36
+ limit: number;
37
+ page: number;
38
+ q: string;
39
+ };
40
+
41
+ export type TGetAdminResponse = {
42
+ data: TAdmin[];
43
+ pagination: {
44
+ last_visible_page: number;
45
+ has_next_page: boolean;
46
+ total_items: number;
47
+ };
48
+ };
49
+
50
+ export type TGetAdminDetailQuery = {
51
+ id: string;
52
+ };
53
+
54
+ export type TGetAdminDetailResponse = TAdmin;
55
+
56
+ export type TPostAdminSignInBody = {
57
+ username: string;
58
+ password: string;
59
+ };
60
+
61
+ export type TPostAdminSignInResponse = {
62
+ profile: TAdmin;
63
+ tokens: TJwtToken;
64
+ };
65
+
66
+ export type TPostAdminUpdateBody = {
67
+ id: string;
68
+ password: string;
69
+ isBlocked: boolean;
70
+ permissions: string[];
71
+ isDeleted: boolean;
72
+ };
73
+
74
+ export type TPostAdminUpdateResponse = {
75
+ id: string;
76
+ };
77
+
78
+ export type TPostAdminCreateBody = {
79
+ username: string;
80
+ password: string;
81
+ isBlocked: boolean;
82
+ permissions: string[];
83
+ };
84
+
85
+ export type TPostAdminCreateResponse = {
86
+ id: string;
87
+ };
88
+
89
+ export type TCustomer = {
90
+ _id: string;
91
+ accountNo: string;
92
+ companyName: string;
93
+ isDeleted: boolean;
94
+ updatedAt: Date | null;
95
+ createdAt: Date | null;
96
+ };
97
+
98
+ export type PartialTCustomer = Partial<TCustomer>;
99
+
100
+ export type TGetCustomerQuery = {
101
+ limit: number;
102
+ page: number;
103
+ q: string;
104
+ };
105
+
106
+ export type TPostCustomerCreateBody = {
107
+ accountNo: string;
108
+ companyName: string;
109
+ };
110
+
111
+ export type TPostCustomerCreateResponse = {
112
+ _id: string;
113
+ };
114
+
115
+ export type TPostCustomerUpdateBody = {
116
+ id: string;
117
+ accountNo: string;
118
+ companyName: string;
119
+ };
120
+
121
+ export type TPostCustomerUpdateResponse = {
122
+ id: string;
123
+ };
124
+
125
+ export type TOrder = {
126
+ _id: string;
127
+ purchaseOrderNo: string;
128
+ customerId: string;
129
+ products: string[]; //PCS, BUN, TON
130
+ addOn: string | null;
131
+ isOwnDelivery: boolean;
132
+ deliveryAddress: string;
133
+ status: EOrderStatus;
134
+ isDeleted: boolean;
135
+ updatedAt: Date | null;
136
+ createdAt: Date;
137
+ };
138
+
139
+ export type TLength = {
140
+ length: number;
141
+ quantity: number;
142
+ };
143
+
144
+ export type TProduct = {
145
+ _id: string;
146
+ no: string;
147
+ status: EProductStatus;
148
+ machine: EMachine;
149
+ height: number;
150
+ width: number;
151
+ lengths: TLength[];
152
+ isDeleted: boolean;
153
+ updatedAt: Date | null;
154
+ createdAt: Date;
155
+ };