@platform-modules/civil-aviation-authority 1.0.0 → 1.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.
- package/.env +5 -0
- package/.gitkeep +0 -0
- package/package.json +24 -24
- package/src/data-source.ts +20 -19
- package/src/helpers/utils/enum.ts +94 -94
- package/src/models/BaseModel.ts +61 -61
- package/src/models/ITHelpDeskModel.ts +61 -0
- package/src/models/role.ts +36 -36
- package/src/models/user-sessions.ts +37 -37
- package/src/models/user.ts +100 -100
- package/src/scripts.ts +10 -10
- package/tsconfig.json +16 -16
- package/dist/data-source.d.ts +0 -4
- package/dist/data-source.js +0 -21
- package/dist/helpers/utils/enum.d.ts +0 -75
- package/dist/helpers/utils/enum.js +0 -53
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -28
- package/dist/models/BaseModel.d.ts +0 -16
- package/dist/models/BaseModel.js +0 -80
- package/dist/models/db.d.ts +0 -2
- package/dist/models/db.js +0 -40
- package/dist/models/role.d.ts +0 -22
- package/dist/models/role.js +0 -44
- package/dist/models/user-sessions.d.ts +0 -18
- package/dist/models/user-sessions.js +0 -54
- package/dist/models/user.d.ts +0 -19
- package/dist/models/user.js +0 -104
- package/dist/scripts.d.ts +0 -1
- package/dist/scripts.js +0 -11
- package/src/index.ts +0 -13
- package/src/models/db.ts +0 -37
package/.env
ADDED
package/.gitkeep
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@platform-modules/civil-aviation-authority",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "dist/index.js",
|
|
5
|
-
"types": "dist/index.d.ts",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "tsc",
|
|
8
|
-
"
|
|
9
|
-
},
|
|
10
|
-
"publishConfig": {
|
|
11
|
-
"access": "public"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"moment-timezone": "^0.6.0",
|
|
15
|
-
"pg": "^8.16.0",
|
|
16
|
-
"typeorm": "^0.3.17"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@types/moment-timezone": "^0.5.30",
|
|
20
|
-
"dotenv": "^16.5.0",
|
|
21
|
-
"ts-node": "^10.9.2",
|
|
22
|
-
"typescript": "^5.2.0"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@platform-modules/civil-aviation-authority",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"dev": "ts-node src/scripts.ts"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"moment-timezone": "^0.6.0",
|
|
15
|
+
"pg": "^8.16.0",
|
|
16
|
+
"typeorm": "^0.3.17"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/moment-timezone": "^0.5.30",
|
|
20
|
+
"dotenv": "^16.5.0",
|
|
21
|
+
"ts-node": "^10.9.2",
|
|
22
|
+
"typescript": "^5.2.0"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/src/data-source.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
// src/data-source.ts
|
|
2
|
-
import 'reflect-metadata';
|
|
3
|
-
import { DataSource } from 'typeorm';
|
|
4
|
-
import 'dotenv/config';
|
|
5
|
-
import { User } from './models/user'; // import all entities here
|
|
6
|
-
import { userSessions } from './models/user-sessions';
|
|
7
|
-
import { Role } from './models/role';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
// src/data-source.ts
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
import { DataSource } from 'typeorm';
|
|
4
|
+
import 'dotenv/config';
|
|
5
|
+
import { User } from './models/user'; // import all entities here
|
|
6
|
+
import { userSessions } from './models/user-sessions';
|
|
7
|
+
import { Role } from './models/role';
|
|
8
|
+
import { ITHelpDeskRequests } from './models/ITHelpDeskModel';
|
|
9
|
+
|
|
10
|
+
export const AppDataSource = new DataSource({
|
|
11
|
+
type: 'postgres',
|
|
12
|
+
host: process.env.DB_HOST || 'localhost',
|
|
13
|
+
port: +(process.env.DB_PORT || 5432),
|
|
14
|
+
username: process.env.DB_USER || 'postgres',
|
|
15
|
+
password: process.env.DB_PASS || 'postgres',
|
|
16
|
+
database: process.env.DB_NAME || 'common_models',
|
|
17
|
+
synchronize: true, // auto-create tables (disable in prod)
|
|
18
|
+
logging: false,
|
|
19
|
+
entities: [User,userSessions,Role, ITHelpDeskRequests],
|
|
20
|
+
});
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
//import enums
|
|
2
|
-
|
|
3
|
-
export enum ImportStatusType {
|
|
4
|
-
NotStarted = 1,
|
|
5
|
-
InProgress = 2,
|
|
6
|
-
Completed = 3,
|
|
7
|
-
Error = 4,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const enum EmployeeType {
|
|
11
|
-
Permanent = 'Permanent',
|
|
12
|
-
Contract = 'Contract',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const enum MaritalType {
|
|
16
|
-
Single = 'Single',
|
|
17
|
-
Married = 'Married',
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const enum genderType {
|
|
21
|
-
Male = 'Male',
|
|
22
|
-
Female = 'Female',
|
|
23
|
-
Others = 'Others',
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const enum ActionItemStatusType {
|
|
28
|
-
Not_Yet_Started = 'Not Yet Started',
|
|
29
|
-
InProgress = 'InProgress',
|
|
30
|
-
Completed = 'Completed',
|
|
31
|
-
Cancelled = 'Cancelled',
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const enum CampaignStatusType {
|
|
35
|
-
Not_Yet_Started = 'Not Yet Started',
|
|
36
|
-
InProgress = 'InProgress',
|
|
37
|
-
Completed = 'Completed',
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const enum platformType {
|
|
41
|
-
web = 'Web',
|
|
42
|
-
mobile = 'Mobile'
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const enum contextType {
|
|
46
|
-
ADMIN = 'Admin',
|
|
47
|
-
BUSINESS_PARTNER = 'Business Partner',
|
|
48
|
-
CLIENT = 'Client'
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export enum ImportType {
|
|
52
|
-
admin = 1,
|
|
53
|
-
business_partner = 2,
|
|
54
|
-
client = 3
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export enum userType {
|
|
58
|
-
admin = 1,
|
|
59
|
-
business_partner = 2,
|
|
60
|
-
client = 3
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export enum ReportColumnDataType {
|
|
64
|
-
Int = 1,
|
|
65
|
-
String = 2,
|
|
66
|
-
Date = 3,
|
|
67
|
-
Time = 4,
|
|
68
|
-
DateTime = 5,
|
|
69
|
-
Money = 6,
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export enum CONSTANTS {
|
|
73
|
-
READ = 'READ',
|
|
74
|
-
DELETE = 'DELETE',
|
|
75
|
-
SEND = 'SEND',
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export enum NotificationRequestType {
|
|
79
|
-
request_raised = 'request raised',
|
|
80
|
-
request_approve = 'request approve',
|
|
81
|
-
request_reject = 'request reject',
|
|
82
|
-
request_withdraw = 'request withdraw',
|
|
83
|
-
reminder = 'reminder',
|
|
84
|
-
import = 'import',
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export enum RequestGroup {
|
|
88
|
-
ADMIN = 'Admin',
|
|
89
|
-
BUSINESS_PARTNER = 'Business Partner',
|
|
90
|
-
CLIENT = 'Client'
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
1
|
+
//import enums
|
|
2
|
+
|
|
3
|
+
export enum ImportStatusType {
|
|
4
|
+
NotStarted = 1,
|
|
5
|
+
InProgress = 2,
|
|
6
|
+
Completed = 3,
|
|
7
|
+
Error = 4,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const enum EmployeeType {
|
|
11
|
+
Permanent = 'Permanent',
|
|
12
|
+
Contract = 'Contract',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const enum MaritalType {
|
|
16
|
+
Single = 'Single',
|
|
17
|
+
Married = 'Married',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const enum genderType {
|
|
21
|
+
Male = 'Male',
|
|
22
|
+
Female = 'Female',
|
|
23
|
+
Others = 'Others',
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const enum ActionItemStatusType {
|
|
28
|
+
Not_Yet_Started = 'Not Yet Started',
|
|
29
|
+
InProgress = 'InProgress',
|
|
30
|
+
Completed = 'Completed',
|
|
31
|
+
Cancelled = 'Cancelled',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const enum CampaignStatusType {
|
|
35
|
+
Not_Yet_Started = 'Not Yet Started',
|
|
36
|
+
InProgress = 'InProgress',
|
|
37
|
+
Completed = 'Completed',
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const enum platformType {
|
|
41
|
+
web = 'Web',
|
|
42
|
+
mobile = 'Mobile'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const enum contextType {
|
|
46
|
+
ADMIN = 'Admin',
|
|
47
|
+
BUSINESS_PARTNER = 'Business Partner',
|
|
48
|
+
CLIENT = 'Client'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export enum ImportType {
|
|
52
|
+
admin = 1,
|
|
53
|
+
business_partner = 2,
|
|
54
|
+
client = 3
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export enum userType {
|
|
58
|
+
admin = 1,
|
|
59
|
+
business_partner = 2,
|
|
60
|
+
client = 3
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export enum ReportColumnDataType {
|
|
64
|
+
Int = 1,
|
|
65
|
+
String = 2,
|
|
66
|
+
Date = 3,
|
|
67
|
+
Time = 4,
|
|
68
|
+
DateTime = 5,
|
|
69
|
+
Money = 6,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export enum CONSTANTS {
|
|
73
|
+
READ = 'READ',
|
|
74
|
+
DELETE = 'DELETE',
|
|
75
|
+
SEND = 'SEND',
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export enum NotificationRequestType {
|
|
79
|
+
request_raised = 'request raised',
|
|
80
|
+
request_approve = 'request approve',
|
|
81
|
+
request_reject = 'request reject',
|
|
82
|
+
request_withdraw = 'request withdraw',
|
|
83
|
+
reminder = 'reminder',
|
|
84
|
+
import = 'import',
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export enum RequestGroup {
|
|
88
|
+
ADMIN = 'Admin',
|
|
89
|
+
BUSINESS_PARTNER = 'Business Partner',
|
|
90
|
+
CLIENT = 'Client'
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
package/src/models/BaseModel.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import moment from "moment-timezone";
|
|
2
|
-
import {
|
|
3
|
-
Column,
|
|
4
|
-
CreateDateColumn,
|
|
5
|
-
UpdateDateColumn,
|
|
6
|
-
BeforeInsert,
|
|
7
|
-
PrimaryGeneratedColumn
|
|
8
|
-
} from 'typeorm';
|
|
9
|
-
|
|
10
|
-
export abstract class Model0 {
|
|
11
|
-
jsonIgnore: string[] = ['logicalDelete', 'is_deleted', 'jsonIgnore'];
|
|
12
|
-
|
|
13
|
-
@Column({ nullable: false })
|
|
14
|
-
created_by?: string = '';
|
|
15
|
-
|
|
16
|
-
@CreateDateColumn({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
|
|
17
|
-
created_at?: Date;
|
|
18
|
-
|
|
19
|
-
@Column({ nullable: true })
|
|
20
|
-
updated_by?: string = '';
|
|
21
|
-
|
|
22
|
-
@UpdateDateColumn({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
|
|
23
|
-
updated_at?: Date;
|
|
24
|
-
|
|
25
|
-
@BeforeInsert()
|
|
26
|
-
insertCreated() {
|
|
27
|
-
const currentTime = moment().utc().tz('Asia/Kolkata').toDate();
|
|
28
|
-
this.created_at = currentTime;
|
|
29
|
-
this.updated_at = currentTime;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@Column({ nullable: true, default: false })
|
|
33
|
-
is_deleted?: boolean = false;
|
|
34
|
-
|
|
35
|
-
logicalDelete: boolean;
|
|
36
|
-
|
|
37
|
-
constructor() {
|
|
38
|
-
this.logicalDelete = true;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Don't serialize some fields
|
|
42
|
-
toJSON() {
|
|
43
|
-
const result: Record<string, any> = {};
|
|
44
|
-
for (const x in this) {
|
|
45
|
-
if (!this.jsonIgnore.includes(x)) {
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
result[x] = this[x];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return result;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export abstract class BaseModel extends Model0 {
|
|
55
|
-
@PrimaryGeneratedColumn()
|
|
56
|
-
id: number;
|
|
57
|
-
|
|
58
|
-
constructor() {
|
|
59
|
-
super();
|
|
60
|
-
this.id = 0; // This will be set by the database when the entity is saved
|
|
61
|
-
}
|
|
1
|
+
import moment from "moment-timezone";
|
|
2
|
+
import {
|
|
3
|
+
Column,
|
|
4
|
+
CreateDateColumn,
|
|
5
|
+
UpdateDateColumn,
|
|
6
|
+
BeforeInsert,
|
|
7
|
+
PrimaryGeneratedColumn
|
|
8
|
+
} from 'typeorm';
|
|
9
|
+
|
|
10
|
+
export abstract class Model0 {
|
|
11
|
+
jsonIgnore: string[] = ['logicalDelete', 'is_deleted', 'jsonIgnore'];
|
|
12
|
+
|
|
13
|
+
@Column({ nullable: false })
|
|
14
|
+
created_by?: string = '';
|
|
15
|
+
|
|
16
|
+
@CreateDateColumn({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
|
|
17
|
+
created_at?: Date;
|
|
18
|
+
|
|
19
|
+
@Column({ nullable: true })
|
|
20
|
+
updated_by?: string = '';
|
|
21
|
+
|
|
22
|
+
@UpdateDateColumn({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
|
|
23
|
+
updated_at?: Date;
|
|
24
|
+
|
|
25
|
+
@BeforeInsert()
|
|
26
|
+
insertCreated() {
|
|
27
|
+
const currentTime = moment().utc().tz('Asia/Kolkata').toDate();
|
|
28
|
+
this.created_at = currentTime;
|
|
29
|
+
this.updated_at = currentTime;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Column({ nullable: true, default: false })
|
|
33
|
+
is_deleted?: boolean = false;
|
|
34
|
+
|
|
35
|
+
logicalDelete: boolean;
|
|
36
|
+
|
|
37
|
+
constructor() {
|
|
38
|
+
this.logicalDelete = true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Don't serialize some fields
|
|
42
|
+
toJSON() {
|
|
43
|
+
const result: Record<string, any> = {};
|
|
44
|
+
for (const x in this) {
|
|
45
|
+
if (!this.jsonIgnore.includes(x)) {
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
result[x] = this[x];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export abstract class BaseModel extends Model0 {
|
|
55
|
+
@PrimaryGeneratedColumn()
|
|
56
|
+
id: number;
|
|
57
|
+
|
|
58
|
+
constructor() {
|
|
59
|
+
super();
|
|
60
|
+
this.id = 0; // This will be set by the database when the entity is saved
|
|
61
|
+
}
|
|
62
62
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
import { Column, Entity } from "typeorm";
|
|
3
|
+
import { BaseModel } from './BaseModel';
|
|
4
|
+
export enum ProblemLevel {
|
|
5
|
+
HIGH = "High",
|
|
6
|
+
MEDIUM = "Medium",
|
|
7
|
+
LOW = "Low",
|
|
8
|
+
}
|
|
9
|
+
@Entity({ name: 'IT_Help_Desk_Requests' })
|
|
10
|
+
export class ITHelpDeskRequests extends BaseModel {
|
|
11
|
+
|
|
12
|
+
@Column({ nullable: false })
|
|
13
|
+
department: string;
|
|
14
|
+
|
|
15
|
+
@Column({ nullable: false })
|
|
16
|
+
service_type: string;
|
|
17
|
+
|
|
18
|
+
@Column({
|
|
19
|
+
type: "enum",
|
|
20
|
+
enum: ProblemLevel,
|
|
21
|
+
default: ProblemLevel.MEDIUM,
|
|
22
|
+
nullable: false,
|
|
23
|
+
})
|
|
24
|
+
problem: ProblemLevel;
|
|
25
|
+
|
|
26
|
+
@Column({ nullable: false })
|
|
27
|
+
description: string;
|
|
28
|
+
|
|
29
|
+
@Column({ nullable: false })
|
|
30
|
+
extn_num: string;
|
|
31
|
+
|
|
32
|
+
@Column({ nullable: false })
|
|
33
|
+
contact_num: string;
|
|
34
|
+
|
|
35
|
+
@Column({ type: "date", nullable: false })
|
|
36
|
+
request_date: Date;
|
|
37
|
+
|
|
38
|
+
@Column({ nullable: true })
|
|
39
|
+
attachment_url: string;
|
|
40
|
+
|
|
41
|
+
constructor(
|
|
42
|
+
department: string,
|
|
43
|
+
service_type: string,
|
|
44
|
+
problem: ProblemLevel,
|
|
45
|
+
description: string,
|
|
46
|
+
extn_num: string,
|
|
47
|
+
contact_num: string,
|
|
48
|
+
request_date: Date,
|
|
49
|
+
attachment_url: string
|
|
50
|
+
) {
|
|
51
|
+
super();
|
|
52
|
+
this.department = department,
|
|
53
|
+
this.service_type = service_type,
|
|
54
|
+
this.problem = problem ,
|
|
55
|
+
this.description = description,
|
|
56
|
+
this.extn_num = extn_num,
|
|
57
|
+
this.contact_num = contact_num,
|
|
58
|
+
this.request_date = request_date,
|
|
59
|
+
this.attachment_url = attachment_url
|
|
60
|
+
}
|
|
61
|
+
}
|
package/src/models/role.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/** *
|
|
2
|
-
@author
|
|
3
|
-
Amnet Digital
|
|
4
|
-
@date
|
|
5
|
-
2024-05-20
|
|
6
|
-
@Model
|
|
7
|
-
Role
|
|
8
|
-
@usage
|
|
9
|
-
Userrole Information will store
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { Column, Entity } from "typeorm";
|
|
13
|
-
import { BaseModel } from './BaseModel';
|
|
14
|
-
|
|
15
|
-
export interface Irole {
|
|
16
|
-
name: string;
|
|
17
|
-
id?: number;
|
|
18
|
-
is_deleted?: boolean;
|
|
19
|
-
created_by?: number;
|
|
20
|
-
}
|
|
21
|
-
@Entity({ name: 'role' })
|
|
22
|
-
export class Role extends BaseModel {
|
|
23
|
-
|
|
24
|
-
@Column({ nullable: true })
|
|
25
|
-
name: string;
|
|
26
|
-
|
|
27
|
-
@Column({ nullable: true })
|
|
28
|
-
is_deleted?: boolean;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
constructor(name: string,is_deleted:boolean,userId: number) {
|
|
32
|
-
super();
|
|
33
|
-
this.name = name
|
|
34
|
-
this.is_deleted = is_deleted
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
/** *
|
|
2
|
+
@author
|
|
3
|
+
Amnet Digital
|
|
4
|
+
@date
|
|
5
|
+
2024-05-20
|
|
6
|
+
@Model
|
|
7
|
+
Role
|
|
8
|
+
@usage
|
|
9
|
+
Userrole Information will store
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { Column, Entity } from "typeorm";
|
|
13
|
+
import { BaseModel } from './BaseModel';
|
|
14
|
+
|
|
15
|
+
export interface Irole {
|
|
16
|
+
name: string;
|
|
17
|
+
id?: number;
|
|
18
|
+
is_deleted?: boolean;
|
|
19
|
+
created_by?: number;
|
|
20
|
+
}
|
|
21
|
+
@Entity({ name: 'role' })
|
|
22
|
+
export class Role extends BaseModel {
|
|
23
|
+
|
|
24
|
+
@Column({ nullable: true })
|
|
25
|
+
name: string;
|
|
26
|
+
|
|
27
|
+
@Column({ nullable: true })
|
|
28
|
+
is_deleted?: boolean;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
constructor(name: string,is_deleted:boolean,userId: number) {
|
|
32
|
+
super();
|
|
33
|
+
this.name = name
|
|
34
|
+
this.is_deleted = is_deleted
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
/** *
|
|
3
|
-
@author
|
|
4
|
-
Amnet Digital
|
|
5
|
-
@date
|
|
6
|
-
2024-05-20
|
|
7
|
-
@Model
|
|
8
|
-
Role
|
|
9
|
-
@usage
|
|
10
|
-
Roles Information will store
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
14
|
-
import { BaseModel} from './BaseModel';
|
|
15
|
-
|
|
16
|
-
@Entity({ name: 'user_sessions' })
|
|
17
|
-
export class userSessions extends BaseModel {
|
|
18
|
-
@Column({ nullable: true })
|
|
19
|
-
last_active_at: Date;
|
|
20
|
-
|
|
21
|
-
@Column({ nullable: true, default: true })
|
|
22
|
-
is_active: boolean;
|
|
23
|
-
|
|
24
|
-
@Column({ nullable: true })
|
|
25
|
-
expires_at: Date;
|
|
26
|
-
|
|
27
|
-
@Column({ nullable: true })
|
|
28
|
-
user_id: number;
|
|
29
|
-
|
|
30
|
-
constructor(last_active_at: Date, expires_at: Date, user_id: number, is_active: boolean) {
|
|
31
|
-
super();
|
|
32
|
-
this.last_active_at = last_active_at,
|
|
33
|
-
this.expires_at = expires_at,
|
|
34
|
-
this.user_id = user_id,
|
|
35
|
-
this.is_active = is_active
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
|
|
2
|
+
/** *
|
|
3
|
+
@author
|
|
4
|
+
Amnet Digital
|
|
5
|
+
@date
|
|
6
|
+
2024-05-20
|
|
7
|
+
@Model
|
|
8
|
+
Role
|
|
9
|
+
@usage
|
|
10
|
+
Roles Information will store
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
14
|
+
import { BaseModel} from './BaseModel';
|
|
15
|
+
|
|
16
|
+
@Entity({ name: 'user_sessions' })
|
|
17
|
+
export class userSessions extends BaseModel {
|
|
18
|
+
@Column({ nullable: true })
|
|
19
|
+
last_active_at: Date;
|
|
20
|
+
|
|
21
|
+
@Column({ nullable: true, default: true })
|
|
22
|
+
is_active: boolean;
|
|
23
|
+
|
|
24
|
+
@Column({ nullable: true })
|
|
25
|
+
expires_at: Date;
|
|
26
|
+
|
|
27
|
+
@Column({ nullable: true })
|
|
28
|
+
user_id: number;
|
|
29
|
+
|
|
30
|
+
constructor(last_active_at: Date, expires_at: Date, user_id: number, is_active: boolean) {
|
|
31
|
+
super();
|
|
32
|
+
this.last_active_at = last_active_at,
|
|
33
|
+
this.expires_at = expires_at,
|
|
34
|
+
this.user_id = user_id,
|
|
35
|
+
this.is_active = is_active
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
38
|
|