@admc-go-th/admc-library 1.0.35 → 1.0.37

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 (32) hide show
  1. package/{authAssignment-eMrfAv9f.d.ts → authAssignment-CH2vUEr8.d.ts} +22 -1
  2. package/databases/models/authAssignment.ts +24 -0
  3. package/databases/models/userRoleV.ts +3 -3
  4. package/databases/schema/mdFaq.ts +26 -4
  5. package/databases/schema/userRoleV.ts +46 -45
  6. package/databases/schema/users.ts +242 -236
  7. package/databases/schema/usersVerify.ts +74 -69
  8. package/databases/tables/authAssignment.d.ts +1 -1
  9. package/databases/tables/authAssignment.js +181 -112
  10. package/databases/tables/authRole.d.ts +1 -1
  11. package/databases/tables/authRole.js +181 -112
  12. package/databases/tables/authRoleChild.d.ts +1 -1
  13. package/databases/tables/authRoleChild.js +181 -112
  14. package/databases/tables/index.d.ts +1 -2
  15. package/databases/tables/index.js +686 -657
  16. package/databases/tables/mdContent.d.ts +1 -1
  17. package/databases/tables/mdContent.js +203 -134
  18. package/databases/tables/mdContentGroup.d.ts +1 -1
  19. package/databases/tables/mdContentGroup.js +203 -134
  20. package/databases/tables/mdFaq.d.ts +10 -4
  21. package/databases/tables/mdFaq.js +21 -2
  22. package/databases/tables/mdQuestionnaire.d.ts +1 -1
  23. package/databases/tables/mdQuestionnaire.js +169 -100
  24. package/databases/tables/userRoleV.js +3 -2
  25. package/databases/tables/users.d.ts +1 -1
  26. package/databases/tables/users.js +128 -59
  27. package/databases/tables/usersVerify.d.ts +2 -22
  28. package/databases/tables/usersVerify.js +792 -15
  29. package/package.json +1 -1
  30. package/databases/schema/usersRoleV.ts +0 -48
  31. package/databases/tables/usersRoleV.d.ts +0 -16
  32. package/databases/tables/usersRoleV.js +0 -75
@@ -119,6 +119,26 @@ declare class mdQuestionnaire extends Model<mdQuestionnaireAttributes, mdQuestio
119
119
  user?: users;
120
120
  }
121
121
 
122
+ interface usersVerifyAttributes {
123
+ id?: number;
124
+ userId?: number;
125
+ type?: number;
126
+ code?: string;
127
+ reference?: string;
128
+ status?: number;
129
+ createdDate?: Date;
130
+ }
131
+ declare class usersVerify extends Model<usersVerifyAttributes, usersVerifyAttributes> implements usersVerifyAttributes {
132
+ id?: number;
133
+ userId?: number;
134
+ type?: number;
135
+ code?: string;
136
+ reference?: string;
137
+ status?: number;
138
+ createdDate?: Date;
139
+ user?: users;
140
+ }
141
+
122
142
  interface usersAttributes {
123
143
  id?: number;
124
144
  uuid: string;
@@ -179,6 +199,7 @@ declare class users extends Model<usersAttributes, usersAttributes> implements u
179
199
  authAssignments?: authAssignment[];
180
200
  mdContents?: mdContent[];
181
201
  mdQuestionnaires?: mdQuestionnaire[];
202
+ usersVerifies?: usersVerify[];
182
203
  }
183
204
 
184
205
  interface authRoleChildAttributes {
@@ -237,4 +258,4 @@ declare class authAssignment extends Model<authAssignmentAttributes, authAssignm
237
258
  authRole?: authRole;
238
259
  }
239
260
 
240
- export { type authAssignmentAttributes as a, authAssignment as b, type authRoleAttributes as c, authRole as d, type authRoleChildAttributes as e, authRoleChild as f, mdContent as g, type mdContentGroupAttributes as h, mdContentGroup as i, type mdQuestionnaireAttributes as j, mdQuestionnaire as k, users as l, type mdContentAttributes as m, type usersAttributes as u };
261
+ export { type authAssignmentAttributes as a, authAssignment as b, type authRoleAttributes as c, authRole as d, type authRoleChildAttributes as e, authRoleChild as f, mdContent as g, type mdContentGroupAttributes as h, mdContentGroup as i, type mdQuestionnaireAttributes as j, mdQuestionnaire as k, users as l, type mdContentAttributes as m, type usersVerifyAttributes as n, usersVerify as o, type usersAttributes as u };
@@ -0,0 +1,24 @@
1
+ import { FindOptions } from "sequelize/types/model";
2
+ import { authAssignment as AuthAssignment } from "../tables";
3
+
4
+ export class authAssignment extends AuthAssignment {
5
+ static async findByUserId(
6
+ userId: string,
7
+ options?: Omit<FindOptions, 'where'>
8
+ ): Promise<AuthAssignment | null> {
9
+ return await this.findOne({
10
+ where: { userId: userId },
11
+ ...options,
12
+ });
13
+ }
14
+
15
+ static async findByRoleId(
16
+ roleId: string,
17
+ options?: Omit<FindOptions, 'where'>
18
+ ): Promise<AuthAssignment | null> {
19
+ return await this.findOne({
20
+ where: { roleId: roleId },
21
+ ...options,
22
+ });
23
+ }
24
+ }
@@ -1,10 +1,10 @@
1
- import { usersRoleV as UsersRoleV } from "../tables";
1
+ import { userRoleV as UserRoleV } from "../tables";
2
2
  import { FindOptions, Op } from "sequelize";
3
3
 
4
- export class userRoleV extends UsersRoleV {
4
+ export class userRoleV extends UserRoleV {
5
5
  static async findByUUID(
6
6
  options?: Omit<FindOptions, 'where'>
7
- ): Promise<UsersRoleV | null> {
7
+ ): Promise<UserRoleV | null> {
8
8
  return await this.findOne({
9
9
  ...options,
10
10
  });
@@ -6,9 +6,12 @@ export interface mdFaqAttributes {
6
6
  id?: number;
7
7
  uuid?: string;
8
8
  keyName?: string;
9
+ userId?: number;
9
10
  groupId?: number;
10
- question?: string;
11
- answer?: string;
11
+ title?: string;
12
+ description?: string;
13
+ detail?: string;
14
+ attachments?: object;
12
15
  sort?: number;
13
16
  status?: number;
14
17
  hasExpire?: number;
@@ -46,6 +49,13 @@ export class mdFaq extends Model<mdFaqAttributes, mdFaqAttributes> implements md
46
49
  })
47
50
  declare keyName?: string;
48
51
 
52
+ @Column({
53
+ field: "user_id",
54
+ allowNull: true,
55
+ type: DataType.INTEGER
56
+ })
57
+ declare userId?: number;
58
+
49
59
  @Column({
50
60
  field: "group_id",
51
61
  allowNull: true,
@@ -57,13 +67,25 @@ export class mdFaq extends Model<mdFaqAttributes, mdFaqAttributes> implements md
57
67
  allowNull: true,
58
68
  type: DataType.STRING(255)
59
69
  })
60
- declare question?: string;
70
+ declare title?: string;
71
+
72
+ @Column({
73
+ allowNull: true,
74
+ type: DataType.STRING(255)
75
+ })
76
+ declare description?: string;
61
77
 
62
78
  @Column({
63
79
  allowNull: true,
64
80
  type: DataType.STRING
65
81
  })
66
- declare answer?: string;
82
+ declare detail?: string;
83
+
84
+ @Column({
85
+ allowNull: true,
86
+ type: DataType.JSON
87
+ })
88
+ declare attachments?: object;
67
89
 
68
90
  @Column({
69
91
  allowNull: true,
@@ -1,46 +1,47 @@
1
- import {
2
- Model, Table, Column, DataType, Index, Sequelize, ForeignKey
3
- } from "sequelize-typescript";
4
-
5
- export interface userRoleVAttributes {
6
- id?: number;
7
- websiteTh?: string;
8
- websiteEn?: string;
9
- websiteFr?: string;
10
- }
11
-
12
- @Table({
13
- tableName: "user_role_v",
14
- timestamps: false,
15
- comment: "VIEW"
16
- })
17
- export class userRoleV extends Model<userRoleVAttributes, userRoleVAttributes> implements userRoleVAttributes {
18
-
19
- @Column({
20
- type: DataType.INTEGER,
21
- defaultValue: "0"
22
- })
23
- declare id?: number;
24
-
25
- @Column({
26
- field: "website_th",
27
- allowNull: true,
28
- type: DataType.STRING(60)
29
- })
30
- declare websiteTh?: string;
31
-
32
- @Column({
33
- field: "website_en",
34
- allowNull: true,
35
- type: DataType.STRING(60)
36
- })
37
- declare websiteEn?: string;
38
-
39
- @Column({
40
- field: "website_fr",
41
- allowNull: true,
42
- type: DataType.STRING(60)
43
- })
44
- declare websiteFr?: string;
45
-
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey
3
+ } from "sequelize-typescript";
4
+
5
+ export interface userRoleVAttributes {
6
+ id?: number;
7
+ websiteTh?: string;
8
+ websiteEn?: string;
9
+ websiteFr?: string;
10
+ }
11
+
12
+ @Table({
13
+ tableName: "user_role_v",
14
+ timestamps: false,
15
+ comment: "VIEW"
16
+ })
17
+ export class userRoleV extends Model<userRoleVAttributes, userRoleVAttributes> implements userRoleVAttributes {
18
+
19
+ @Column({
20
+ primaryKey: true,
21
+ autoIncrement: true,
22
+ type: DataType.INTEGER
23
+ })
24
+ declare id?: number;
25
+
26
+ @Column({
27
+ field: "website_th",
28
+ allowNull: true,
29
+ type: DataType.STRING(60)
30
+ })
31
+ declare websiteTh?: string;
32
+
33
+ @Column({
34
+ field: "website_en",
35
+ allowNull: true,
36
+ type: DataType.STRING(60)
37
+ })
38
+ declare websiteEn?: string;
39
+
40
+ @Column({
41
+ field: "website_fr",
42
+ allowNull: true,
43
+ type: DataType.STRING(60)
44
+ })
45
+ declare websiteFr?: string;
46
+
46
47
  }