@managemint-solutions/entities 1.0.4

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.
File without changes
@@ -0,0 +1,4 @@
1
+ export type GetTokensResponse = {
2
+ access_token: string;
3
+ refresh_token: string;
4
+ };
@@ -0,0 +1,4 @@
1
+ export type GetTokensResponse = {
2
+ access_token: string;
3
+ refresh_token: string;
4
+ };
File without changes
@@ -0,0 +1,38 @@
1
+ import { UUID } from 'crypto';
2
+ import { ShorthandUser } from '../users';
3
+ import { Status } from '../status';
4
+ export type ClientShorthand = {
5
+ mms_id: UUID;
6
+ name: string;
7
+ };
8
+ export type ClientList = {
9
+ mms_id: UUID;
10
+ created_at: Date;
11
+ name: string;
12
+ email: string;
13
+ status: Status | null;
14
+ created_by: ShorthandUser | null;
15
+ }[];
16
+ export type Client = {
17
+ mms_id: UUID;
18
+ created_at: Date;
19
+ name: string;
20
+ email: string;
21
+ phone: string;
22
+ status: Status | null;
23
+ contract_client: boolean;
24
+ contracted_hours: number | null;
25
+ updated_at: Date | null;
26
+ last_updated_by: ShorthandUser | null;
27
+ created_by: ShorthandUser | null;
28
+ archived: boolean;
29
+ archived_at: Date | null;
30
+ archived_by: ShorthandUser | null;
31
+ unarchived_at: Date | null;
32
+ unarchived_by: ShorthandUser | null;
33
+ deleted: boolean;
34
+ deleted_at: Date | null;
35
+ deleted_by: ShorthandUser | null;
36
+ restored_at: Date | null;
37
+ restored_by: ShorthandUser | null;
38
+ };
@@ -0,0 +1,38 @@
1
+ import { UUID } from 'crypto';
2
+ import { ShorthandUser } from './user.types';
3
+ import { Status } from './status.types';
4
+ export type ClientShorthand = {
5
+ mms_id: UUID;
6
+ name: string;
7
+ };
8
+ export type ClientList = {
9
+ mms_id: UUID;
10
+ created_at: Date;
11
+ name: string;
12
+ email: string;
13
+ status: Status | null;
14
+ created_by: ShorthandUser | null;
15
+ }[];
16
+ export type Client = {
17
+ mms_id: UUID;
18
+ created_at: Date;
19
+ name: string;
20
+ email: string;
21
+ phone: string;
22
+ status: Status | null;
23
+ contract_client: boolean;
24
+ contracted_hours: number | null;
25
+ updated_at: Date | null;
26
+ last_updated_by: ShorthandUser | null;
27
+ created_by: ShorthandUser | null;
28
+ archived: boolean;
29
+ archived_at: Date | null;
30
+ archived_by: ShorthandUser | null;
31
+ unarchived_at: Date | null;
32
+ unarchived_by: ShorthandUser | null;
33
+ deleted: boolean;
34
+ deleted_at: Date | null;
35
+ deleted_by: ShorthandUser | null;
36
+ restored_at: Date | null;
37
+ restored_by: ShorthandUser | null;
38
+ };
@@ -0,0 +1,4 @@
1
+ export * from './user.types';
2
+ export * from './auth.types';
3
+ export * from './clients.types';
4
+ export * from './/status.types';
File without changes
@@ -0,0 +1,6 @@
1
+ import { UUID } from 'crypto';
2
+ export type Status = {
3
+ mms_id: UUID;
4
+ label: string;
5
+ colour: string;
6
+ };
@@ -0,0 +1,6 @@
1
+ import { UUID } from 'crypto';
2
+ export type Status = {
3
+ mms_id: UUID;
4
+ label: string;
5
+ colour: string;
6
+ };
@@ -0,0 +1,174 @@
1
+ import type { UUID } from 'crypto';
2
+ export interface ShorthandUser {
3
+ mms_id: UUID;
4
+ name: string;
5
+ surname: string;
6
+ email: string;
7
+ profile_image: string | null;
8
+ }
9
+ export interface UserEntity {
10
+ id: number;
11
+ mms_id: string;
12
+ created_at: Date;
13
+ created_by: string | null;
14
+ profile_image: string | null;
15
+ name: string;
16
+ surname: string;
17
+ email: string;
18
+ phone: string;
19
+ last_logged_in: Date | null;
20
+ organization_id: UUID;
21
+ updated_at: Date | null;
22
+ last_updated_by: string | null;
23
+ country_code: string | null;
24
+ manager_id: string | null;
25
+ active: boolean;
26
+ start_date: Date;
27
+ end_date: Date | null;
28
+ job_title: string | null;
29
+ employment_type: string;
30
+ birthday: Date | null;
31
+ social_facebook: string | null;
32
+ social_linkedin: string | null;
33
+ social_twitter: string | null;
34
+ social_instagram: string | null;
35
+ social_github: string | null;
36
+ social_website: string | null;
37
+ emergency_contact_name: string | null;
38
+ emergency_contact_relationship: string | null;
39
+ emergency_contact_phone: string | null;
40
+ emergency_contact_email: string | null;
41
+ supporting_files: string[];
42
+ }
43
+ export interface User {
44
+ mms_id: string;
45
+ name: string;
46
+ surname: string;
47
+ email: string;
48
+ phone: string;
49
+ profile_image: string | null;
50
+ active: boolean;
51
+ created_at: Date;
52
+ created_by: ShorthandUser | null;
53
+ last_logged_in: Date | null;
54
+ country_code: string | null;
55
+ updated_at: Date | null;
56
+ last_updated_by: ShorthandUser | null;
57
+ manager: ShorthandUser | null;
58
+ birthday: Date | null;
59
+ employment_type: string;
60
+ job_title: string | null;
61
+ start_date: Date;
62
+ end_date: Date | null;
63
+ social_facebook: string | null;
64
+ social_linkedin: string | null;
65
+ social_twitter: string | null;
66
+ social_instagram: string | null;
67
+ social_github: string | null;
68
+ social_website: string | null;
69
+ emergency_contact_name: string | null;
70
+ emergency_contact_relationship: string | null;
71
+ emergency_contact_phone: string | null;
72
+ emergency_contact_email: string | null;
73
+ }
74
+ export interface CrudPermission {
75
+ read: boolean;
76
+ create: boolean;
77
+ update: boolean;
78
+ delete: boolean;
79
+ }
80
+ export interface PermissionsEntity {
81
+ id: number;
82
+ mms_id: string;
83
+ user_id: string;
84
+ organization_id: string;
85
+ is_admin: boolean;
86
+ is_owner: boolean;
87
+ view_dashboard: boolean;
88
+ create_clients: boolean;
89
+ read_clients: boolean;
90
+ update_clients: boolean;
91
+ delete_clients: boolean;
92
+ create_projects: boolean;
93
+ read_projects: boolean;
94
+ update_projects: boolean;
95
+ delete_projects: boolean;
96
+ create_budgets: boolean;
97
+ read_budgets: boolean;
98
+ update_budgets: boolean;
99
+ delete_budgets: boolean;
100
+ create_tasks: boolean;
101
+ read_tasks: boolean;
102
+ update_tasks: boolean;
103
+ delete_tasks: boolean;
104
+ create_timesheets: boolean;
105
+ read_timesheets: boolean;
106
+ update_timesheets: boolean;
107
+ delete_timesheets: boolean;
108
+ create_documents: boolean;
109
+ read_docuemnts: boolean;
110
+ update_documents: boolean;
111
+ delete_documents: boolean;
112
+ create_leave: boolean;
113
+ read_leave: boolean;
114
+ update_leave: boolean;
115
+ delete_leave: boolean;
116
+ create_leave_types: boolean;
117
+ read_leave_types: boolean;
118
+ update_leave_types: boolean;
119
+ delete_leave_types: boolean;
120
+ create_leave_requests: boolean;
121
+ read_leave_requests: boolean;
122
+ update_leave_requests: boolean;
123
+ delete_leave_requests: boolean;
124
+ create_invoices: boolean;
125
+ read_invoices: boolean;
126
+ update_invoices: boolean;
127
+ delete_invoices: boolean;
128
+ create_users: boolean;
129
+ read_users: boolean;
130
+ update_users: boolean;
131
+ delete_users: boolean;
132
+ create_user_permissions: boolean;
133
+ read_user_permissions: boolean;
134
+ update_user_permissions: boolean;
135
+ delete_user_permissions: boolean;
136
+ create_organizations: boolean;
137
+ read_organizations: boolean;
138
+ update_organizations: boolean;
139
+ delete_organizations: boolean;
140
+ create_payments: boolean;
141
+ read_payments: boolean;
142
+ update_payments: boolean;
143
+ delete_payments: boolean;
144
+ create_notifications: boolean;
145
+ read_notifications: boolean;
146
+ update_notifications: boolean;
147
+ delete_notifications: boolean;
148
+ create_subscriptions: boolean;
149
+ read_subscriptions: boolean;
150
+ update_subscriptions: boolean;
151
+ delete_subscriptions: boolean;
152
+ }
153
+ export interface Permissions {
154
+ permissions: {
155
+ dashboard: Omit<CrudPermission, 'create' | 'update' | 'delete'>;
156
+ clients: CrudPermission;
157
+ projects: CrudPermission;
158
+ project_budgets: CrudPermission;
159
+ tasks: CrudPermission;
160
+ invoices: Omit<CrudPermission, 'create' | 'update' | 'delete'>;
161
+ users: CrudPermission;
162
+ user_permissions: Omit<CrudPermission, 'create' | 'delete'>;
163
+ organization: Omit<CrudPermission, 'create' | 'delete'>;
164
+ subscription: Omit<CrudPermission, 'read' | 'create' | 'delete'>;
165
+ payments: Omit<CrudPermission, 'read' | 'update' | 'delete'>;
166
+ };
167
+ roles: {
168
+ admin: boolean;
169
+ owner: boolean;
170
+ };
171
+ }
172
+ export interface LoggedInUser extends User, Permissions {
173
+ alerts: Record<string, boolean>;
174
+ }
File without changes
@@ -0,0 +1,174 @@
1
+ import type { UUID } from 'crypto';
2
+ export interface ShorthandUser {
3
+ mms_id: UUID;
4
+ name: string;
5
+ surname: string;
6
+ email: string;
7
+ profile_image: string | null;
8
+ }
9
+ export interface UserEntity {
10
+ id: number;
11
+ mms_id: string;
12
+ created_at: Date;
13
+ created_by: string | null;
14
+ profile_image: string | null;
15
+ name: string;
16
+ surname: string;
17
+ email: string;
18
+ phone: string;
19
+ last_logged_in: Date | null;
20
+ organization_id: UUID;
21
+ updated_at: Date | null;
22
+ last_updated_by: string | null;
23
+ country_code: string | null;
24
+ manager_id: string | null;
25
+ active: boolean;
26
+ start_date: Date;
27
+ end_date: Date | null;
28
+ job_title: string | null;
29
+ employment_type: string;
30
+ birthday: Date | null;
31
+ social_facebook: string | null;
32
+ social_linkedin: string | null;
33
+ social_twitter: string | null;
34
+ social_instagram: string | null;
35
+ social_github: string | null;
36
+ social_website: string | null;
37
+ emergency_contact_name: string | null;
38
+ emergency_contact_relationship: string | null;
39
+ emergency_contact_phone: string | null;
40
+ emergency_contact_email: string | null;
41
+ supporting_files: string[];
42
+ }
43
+ export interface User {
44
+ mms_id: string;
45
+ name: string;
46
+ surname: string;
47
+ email: string;
48
+ phone: string;
49
+ profile_image: string | null;
50
+ active: boolean;
51
+ created_at: Date;
52
+ created_by: ShorthandUser | null;
53
+ last_logged_in: Date | null;
54
+ country_code: string | null;
55
+ updated_at: Date | null;
56
+ last_updated_by: ShorthandUser | null;
57
+ manager: ShorthandUser | null;
58
+ birthday: Date | null;
59
+ employment_type: string;
60
+ job_title: string | null;
61
+ start_date: Date;
62
+ end_date: Date | null;
63
+ social_facebook: string | null;
64
+ social_linkedin: string | null;
65
+ social_twitter: string | null;
66
+ social_instagram: string | null;
67
+ social_github: string | null;
68
+ social_website: string | null;
69
+ emergency_contact_name: string | null;
70
+ emergency_contact_relationship: string | null;
71
+ emergency_contact_phone: string | null;
72
+ emergency_contact_email: string | null;
73
+ }
74
+ export interface CrudPermission {
75
+ read: boolean;
76
+ create: boolean;
77
+ update: boolean;
78
+ delete: boolean;
79
+ }
80
+ export interface PermissionsEntity {
81
+ id: number;
82
+ mms_id: string;
83
+ user_id: string;
84
+ organization_id: string;
85
+ is_admin: boolean;
86
+ is_owner: boolean;
87
+ view_dashboard: boolean;
88
+ create_clients: boolean;
89
+ read_clients: boolean;
90
+ update_clients: boolean;
91
+ delete_clients: boolean;
92
+ create_projects: boolean;
93
+ read_projects: boolean;
94
+ update_projects: boolean;
95
+ delete_projects: boolean;
96
+ create_budgets: boolean;
97
+ read_budgets: boolean;
98
+ update_budgets: boolean;
99
+ delete_budgets: boolean;
100
+ create_tasks: boolean;
101
+ read_tasks: boolean;
102
+ update_tasks: boolean;
103
+ delete_tasks: boolean;
104
+ create_timesheets: boolean;
105
+ read_timesheets: boolean;
106
+ update_timesheets: boolean;
107
+ delete_timesheets: boolean;
108
+ create_documents: boolean;
109
+ read_docuemnts: boolean;
110
+ update_documents: boolean;
111
+ delete_documents: boolean;
112
+ create_leave: boolean;
113
+ read_leave: boolean;
114
+ update_leave: boolean;
115
+ delete_leave: boolean;
116
+ create_leave_types: boolean;
117
+ read_leave_types: boolean;
118
+ update_leave_types: boolean;
119
+ delete_leave_types: boolean;
120
+ create_leave_requests: boolean;
121
+ read_leave_requests: boolean;
122
+ update_leave_requests: boolean;
123
+ delete_leave_requests: boolean;
124
+ create_invoices: boolean;
125
+ read_invoices: boolean;
126
+ update_invoices: boolean;
127
+ delete_invoices: boolean;
128
+ create_users: boolean;
129
+ read_users: boolean;
130
+ update_users: boolean;
131
+ delete_users: boolean;
132
+ create_user_permissions: boolean;
133
+ read_user_permissions: boolean;
134
+ update_user_permissions: boolean;
135
+ delete_user_permissions: boolean;
136
+ create_organizations: boolean;
137
+ read_organizations: boolean;
138
+ update_organizations: boolean;
139
+ delete_organizations: boolean;
140
+ create_payments: boolean;
141
+ read_payments: boolean;
142
+ update_payments: boolean;
143
+ delete_payments: boolean;
144
+ create_notifications: boolean;
145
+ read_notifications: boolean;
146
+ update_notifications: boolean;
147
+ delete_notifications: boolean;
148
+ create_subscriptions: boolean;
149
+ read_subscriptions: boolean;
150
+ update_subscriptions: boolean;
151
+ delete_subscriptions: boolean;
152
+ }
153
+ export interface Permissions {
154
+ permissions: {
155
+ dashboard: Omit<CrudPermission, 'create' | 'update' | 'delete'>;
156
+ clients: CrudPermission;
157
+ projects: CrudPermission;
158
+ project_budgets: CrudPermission;
159
+ tasks: CrudPermission;
160
+ invoices: Omit<CrudPermission, 'create' | 'update' | 'delete'>;
161
+ users: CrudPermission;
162
+ user_permissions: Omit<CrudPermission, 'create' | 'delete'>;
163
+ organization: Omit<CrudPermission, 'create' | 'delete'>;
164
+ subscription: Omit<CrudPermission, 'read' | 'create' | 'delete'>;
165
+ payments: Omit<CrudPermission, 'read' | 'update' | 'delete'>;
166
+ };
167
+ roles: {
168
+ admin: boolean;
169
+ owner: boolean;
170
+ };
171
+ }
172
+ export interface LoggedInUser extends User, Permissions {
173
+ alerts: Record<string, boolean>;
174
+ }
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@managemint-solutions/entities",
3
+ "version": "1.0.4",
4
+ "description": "Entity types used by both the api and portal",
5
+ "homepage": "https://github.com/ManageMint-Solutions/managemint-solutions-entities#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/ManageMint-Solutions/managemint-solutions-entities/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/ManageMint-Solutions/managemint-solutions-entities.git"
12
+ },
13
+ "license": "UNLICENSED",
14
+ "author": "Scott Bebington <scottbebington@gmail.com>",
15
+ "type": "commonjs",
16
+ "exports": {
17
+ "./auth": {
18
+ "types": "./dist/auth/index.d.ts",
19
+ "default": "./dist/auth/index.js"
20
+ },
21
+ "./auth/dto": {
22
+ "types": "./dist/auth/dto/index.d.ts",
23
+ "default": "./dist/auth/dto/index.js"
24
+ },
25
+ "./clients": {
26
+ "types": "./dist/clients/index.d.ts",
27
+ "default": "./dist/clients/index.js"
28
+ },
29
+ "./clients/dto": {
30
+ "types": "./dist/clients/dto/index.d.ts",
31
+ "default": "./dist/clients/dto/index.js"
32
+ },
33
+ "./status": {
34
+ "types": "./dist/status/index.d.ts",
35
+ "default": "./dist/status/index.js"
36
+ },
37
+ "./status/dto": {
38
+ "types": "./dist/status/dto/index.d.ts",
39
+ "default": "./dist/status/dto/index.js"
40
+ },
41
+ "./users": {
42
+ "types": "./dist/users/index.d.ts",
43
+ "default": "./dist/users/index.js"
44
+ },
45
+ "./users/dto": {
46
+ "types": "./dist/users/dto/index.d.ts",
47
+ "default": "./dist/users/dto/index.js"
48
+ }
49
+ },
50
+ "scripts": {
51
+ "test": "echo \"Error: no test specified\" && exit 1",
52
+ "build": "tsc",
53
+ "release": "npm run build && npm publish --access public"
54
+ },
55
+ "files": [
56
+ "dist"
57
+ ],
58
+ "devDependencies": {
59
+ "@types/node": "^25.6.0"
60
+ }
61
+ }