@kipicore/dbcore 1.1.644 → 1.1.645

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 (77) hide show
  1. package/dist/constants/app.d.ts +2 -14
  2. package/dist/constants/app.js +2 -17
  3. package/dist/interfaces/index.d.ts +0 -11
  4. package/dist/interfaces/index.js +0 -12
  5. package/dist/models/mongodb/index.d.ts +0 -1
  6. package/dist/models/mongodb/index.js +1 -4
  7. package/dist/models/psql/index.d.ts +0 -10
  8. package/dist/models/psql/index.js +1 -22
  9. package/dist/types/index.d.ts +0 -11
  10. package/dist/types/index.js +0 -12
  11. package/package.json +1 -1
  12. package/dist/interfaces/ageGroupInterface.d.ts +0 -9
  13. package/dist/interfaces/ageGroupInterface.js +0 -2
  14. package/dist/interfaces/assessmentTestInterface.d.ts +0 -24
  15. package/dist/interfaces/assessmentTestInterface.js +0 -2
  16. package/dist/interfaces/equipmentInterface.d.ts +0 -10
  17. package/dist/interfaces/equipmentInterface.js +0 -2
  18. package/dist/interfaces/facilityMasterInterface.d.ts +0 -9
  19. package/dist/interfaces/facilityMasterInterface.js +0 -2
  20. package/dist/interfaces/facilitySportInterface.d.ts +0 -6
  21. package/dist/interfaces/facilitySportInterface.js +0 -2
  22. package/dist/interfaces/skillInterface.d.ts +0 -15
  23. package/dist/interfaces/skillInterface.js +0 -2
  24. package/dist/interfaces/sportCategoryInterface.d.ts +0 -9
  25. package/dist/interfaces/sportCategoryInterface.js +0 -2
  26. package/dist/interfaces/sportInterface.d.ts +0 -10
  27. package/dist/interfaces/sportInterface.js +0 -2
  28. package/dist/interfaces/sportRoleInterface.d.ts +0 -11
  29. package/dist/interfaces/sportRoleInterface.js +0 -2
  30. package/dist/interfaces/sportSubCategoryInterface.d.ts +0 -10
  31. package/dist/interfaces/sportSubCategoryInterface.js +0 -2
  32. package/dist/interfaces/unitInterface.d.ts +0 -10
  33. package/dist/interfaces/unitInterface.js +0 -2
  34. package/dist/models/mongodb/assessmentTestModel.d.ts +0 -4
  35. package/dist/models/mongodb/assessmentTestModel.js +0 -72
  36. package/dist/models/psql/ageGroupModel.d.ts +0 -19
  37. package/dist/models/psql/ageGroupModel.js +0 -53
  38. package/dist/models/psql/equipmentModel.d.ts +0 -20
  39. package/dist/models/psql/equipmentModel.js +0 -57
  40. package/dist/models/psql/facilityMasterModel.d.ts +0 -18
  41. package/dist/models/psql/facilityMasterModel.js +0 -64
  42. package/dist/models/psql/facilitySportModel.d.ts +0 -12
  43. package/dist/models/psql/facilitySportModel.js +0 -51
  44. package/dist/models/psql/skillModel.d.ts +0 -25
  45. package/dist/models/psql/skillModel.js +0 -99
  46. package/dist/models/psql/sportCategoryModel.d.ts +0 -19
  47. package/dist/models/psql/sportCategoryModel.js +0 -53
  48. package/dist/models/psql/sportModel.d.ts +0 -20
  49. package/dist/models/psql/sportModel.js +0 -57
  50. package/dist/models/psql/sportRoleModel.d.ts +0 -21
  51. package/dist/models/psql/sportRoleModel.js +0 -70
  52. package/dist/models/psql/sportSubCategoryModel.d.ts +0 -20
  53. package/dist/models/psql/sportSubCategoryModel.js +0 -75
  54. package/dist/models/psql/unitModel.d.ts +0 -20
  55. package/dist/models/psql/unitModel.js +0 -57
  56. package/dist/types/ageGroupType.d.ts +0 -2
  57. package/dist/types/ageGroupType.js +0 -2
  58. package/dist/types/assessmentTestType.d.ts +0 -2
  59. package/dist/types/assessmentTestType.js +0 -2
  60. package/dist/types/equipmentType.d.ts +0 -2
  61. package/dist/types/equipmentType.js +0 -2
  62. package/dist/types/facilityMasterType.d.ts +0 -3
  63. package/dist/types/facilityMasterType.js +0 -2
  64. package/dist/types/facilitySportType.d.ts +0 -2
  65. package/dist/types/facilitySportType.js +0 -2
  66. package/dist/types/skillType.d.ts +0 -2
  67. package/dist/types/skillType.js +0 -2
  68. package/dist/types/sportCategoryType.d.ts +0 -2
  69. package/dist/types/sportCategoryType.js +0 -2
  70. package/dist/types/sportRoleType.d.ts +0 -2
  71. package/dist/types/sportRoleType.js +0 -2
  72. package/dist/types/sportSubCategoryType.d.ts +0 -2
  73. package/dist/types/sportSubCategoryType.js +0 -2
  74. package/dist/types/sportType.d.ts +0 -2
  75. package/dist/types/sportType.js +0 -2
  76. package/dist/types/unitType.d.ts +0 -2
  77. package/dist/types/unitType.js +0 -2
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EquipmentModel = void 0;
4
- const sequelize_1 = require("sequelize");
5
- const index_1 = require("./index");
6
- class EquipmentModel extends sequelize_1.Model {
7
- static associate(models) {
8
- const { UserModel } = models;
9
- EquipmentModel.belongsTo(UserModel, {
10
- foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
11
- as: 'createdByUser',
12
- });
13
- EquipmentModel.belongsTo(UserModel, {
14
- foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
15
- as: 'updatedByUser',
16
- });
17
- EquipmentModel.belongsTo(UserModel, {
18
- foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
19
- as: 'deletedByUser',
20
- });
21
- }
22
- }
23
- exports.EquipmentModel = EquipmentModel;
24
- EquipmentModel.init({
25
- id: {
26
- type: sequelize_1.DataTypes.UUID,
27
- defaultValue: sequelize_1.DataTypes.UUIDV4,
28
- allowNull: false,
29
- primaryKey: true,
30
- },
31
- name: {
32
- type: sequelize_1.DataTypes.STRING,
33
- allowNull: true,
34
- },
35
- code: {
36
- type: sequelize_1.DataTypes.STRING,
37
- allowNull: true,
38
- },
39
- category: {
40
- type: sequelize_1.DataTypes.STRING,
41
- allowNull: true,
42
- },
43
- description: {
44
- type: sequelize_1.DataTypes.TEXT,
45
- allowNull: true,
46
- },
47
- status: {
48
- type: sequelize_1.DataTypes.STRING,
49
- allowNull: true,
50
- },
51
- }, {
52
- modelName: 'EquipmentModel',
53
- tableName: 'equipments',
54
- timestamps: true,
55
- sequelize: index_1.sequelize,
56
- });
57
- exports.default = EquipmentModel;
@@ -1,18 +0,0 @@
1
- import { Model } from 'sequelize';
2
- import { IFacilityMasterModelAttributes } from '../../interfaces/facilityMasterInterface';
3
- import { TFacilityMasterModelCreationAttributes } from '../../types/facilityMasterType';
4
- import { COMMAN_STATUS, FACILITY_PLACE_TYPE } from '../../constants/app';
5
- export default class FacilityMasterModel extends Model<IFacilityMasterModelAttributes, TFacilityMasterModelCreationAttributes> {
6
- id: string;
7
- name: string;
8
- code: string;
9
- type: FACILITY_PLACE_TYPE;
10
- status: COMMAN_STATUS;
11
- createdBy?: string;
12
- updatedBy?: string;
13
- deletedBy?: string;
14
- readonly createdAt: Date;
15
- readonly updatedAt: Date;
16
- readonly deletedAt?: string;
17
- static associate(models: any): void;
18
- }
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const sequelize_1 = require("sequelize");
4
- const index_1 = require("./index");
5
- class FacilityMasterModel extends sequelize_1.Model {
6
- static associate(models) {
7
- const { UserModel } = models;
8
- FacilityMasterModel.belongsTo(UserModel, {
9
- foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
10
- as: 'createdByUser',
11
- });
12
- FacilityMasterModel.belongsTo(UserModel, {
13
- foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
14
- as: 'updatedByUser',
15
- });
16
- FacilityMasterModel.belongsTo(UserModel, {
17
- foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
18
- as: 'deletedByUser',
19
- });
20
- // FacilityMasterModel.belongsToMany(SportModel, {
21
- // through: FacilitySportModel,
22
- // foreignKey: 'facilityId',
23
- // otherKey: 'sportId',
24
- // as: 'facilitySportsList',
25
- // });
26
- // SportModel.belongsToMany(FacilityMasterModel, {
27
- // through: FacilitySportModel,
28
- // foreignKey: 'sportId',
29
- // otherKey: 'facilityId',
30
- // as: 'sportFacilitiesList',
31
- // });
32
- }
33
- }
34
- exports.default = FacilityMasterModel;
35
- FacilityMasterModel.init({
36
- id: {
37
- type: sequelize_1.DataTypes.UUID,
38
- defaultValue: sequelize_1.DataTypes.UUIDV4,
39
- allowNull: false,
40
- primaryKey: true,
41
- },
42
- name: {
43
- type: sequelize_1.DataTypes.STRING,
44
- allowNull: true,
45
- },
46
- code: {
47
- type: sequelize_1.DataTypes.STRING,
48
- allowNull: true,
49
- },
50
- type: {
51
- type: sequelize_1.DataTypes.STRING,
52
- allowNull: true,
53
- },
54
- status: {
55
- type: sequelize_1.DataTypes.STRING,
56
- allowNull: true,
57
- },
58
- }, {
59
- sequelize: index_1.sequelize,
60
- modelName: 'FacilityMasterModel',
61
- tableName: 'facility_masters',
62
- paranoid: true,
63
- timestamps: true,
64
- });
@@ -1,12 +0,0 @@
1
- import { Model } from 'sequelize';
2
- import { IFacilitySportModelAttributes } from '../../interfaces/facilitySportInterface';
3
- import { TFacilitySportModelCreationAttributes } from '../../types/facilitySportType';
4
- export declare class FacilitySportModel extends Model<IFacilitySportModelAttributes, TFacilitySportModelCreationAttributes> {
5
- id: string;
6
- facilityId: string;
7
- sportId: string;
8
- readonly createdAt: Date;
9
- readonly updatedAt: Date;
10
- static associate(models: any): void;
11
- }
12
- export default FacilitySportModel;
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FacilitySportModel = void 0;
4
- const sequelize_1 = require("sequelize");
5
- const index_1 = require("./index");
6
- class FacilitySportModel extends sequelize_1.Model {
7
- static associate(models) {
8
- const { FacilityMasterModel, SportModel } = models;
9
- FacilitySportModel.belongsTo(FacilityMasterModel, {
10
- foreignKey: { name: 'facilityId', allowNull: false, field: 'facility_id' },
11
- as: 'facilitySportFacility',
12
- });
13
- FacilityMasterModel.hasMany(FacilitySportModel, {
14
- foreignKey: { name: 'facilityId', allowNull: false, field: 'facility_id' },
15
- as: 'facilitySportsList',
16
- });
17
- FacilitySportModel.belongsTo(SportModel, {
18
- foreignKey: { name: 'sportId', allowNull: false, field: 'sport_id' },
19
- as: 'facilitySportSport',
20
- });
21
- SportModel.hasMany(FacilitySportModel, {
22
- foreignKey: { name: 'sportId', allowNull: false, field: 'sport_id' },
23
- as: 'sportFacilitiesList',
24
- });
25
- }
26
- }
27
- exports.FacilitySportModel = FacilitySportModel;
28
- FacilitySportModel.init({
29
- id: {
30
- type: sequelize_1.DataTypes.UUID,
31
- defaultValue: sequelize_1.DataTypes.UUIDV4,
32
- allowNull: false,
33
- primaryKey: true,
34
- },
35
- facilityId: {
36
- type: sequelize_1.DataTypes.UUID,
37
- field: 'facility_id',
38
- allowNull: false,
39
- },
40
- sportId: {
41
- type: sequelize_1.DataTypes.UUID,
42
- field: 'sport_id',
43
- allowNull: false,
44
- },
45
- }, {
46
- modelName: 'FacilitySportModel',
47
- tableName: 'facility_sports',
48
- timestamps: true,
49
- sequelize: index_1.sequelize,
50
- });
51
- exports.default = FacilitySportModel;
@@ -1,25 +0,0 @@
1
- import { Model } from 'sequelize';
2
- import { ISkillModelAttributes } from '../../interfaces/skillInterface';
3
- import { TSkillModelCreationAttributes } from '../../types/skillType';
4
- import { BETTER_VALUE_TYPE, COMMAN_STATUS } from '../../constants/app';
5
- export declare class SkillModel extends Model<ISkillModelAttributes, TSkillModelCreationAttributes> {
6
- id: string;
7
- sportId: string;
8
- unitId?: string;
9
- name: string;
10
- code: string;
11
- description?: string;
12
- minValue?: number;
13
- maxValue?: number;
14
- betterValueType?: BETTER_VALUE_TYPE;
15
- valueSide?: string[];
16
- status: COMMAN_STATUS;
17
- createdBy?: string;
18
- updatedBy?: string;
19
- deletedBy?: string;
20
- readonly createdAt: Date;
21
- readonly updatedAt: Date;
22
- readonly deletedAt?: string;
23
- static associate(models: any): void;
24
- }
25
- export default SkillModel;
@@ -1,99 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SkillModel = void 0;
4
- const sequelize_1 = require("sequelize");
5
- const index_1 = require("./index");
6
- class SkillModel extends sequelize_1.Model {
7
- static associate(models) {
8
- const { UserModel, SportModel, UnitModel } = models;
9
- SkillModel.belongsTo(UserModel, {
10
- foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
11
- as: 'createdByUser',
12
- });
13
- SkillModel.belongsTo(UserModel, {
14
- foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
15
- as: 'updatedByUser',
16
- });
17
- SkillModel.belongsTo(UserModel, {
18
- foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
19
- as: 'deletedByUser',
20
- });
21
- SkillModel.belongsTo(SportModel, {
22
- foreignKey: { name: 'sportId', allowNull: true, field: 'sport_id' },
23
- as: 'skillSport',
24
- });
25
- SportModel.hasMany(SkillModel, {
26
- foreignKey: { name: 'sportId', allowNull: true, field: 'sport_id' },
27
- as: 'sportHasSkillList',
28
- });
29
- SkillModel.belongsTo(UnitModel, {
30
- foreignKey: { name: 'unitId', allowNull: true, field: 'unit_id' },
31
- as: 'skillUnit',
32
- });
33
- UnitModel.hasMany(SkillModel, {
34
- foreignKey: { name: 'unitId', allowNull: true, field: 'unit_id' },
35
- as: 'unitHasSkillList',
36
- });
37
- }
38
- }
39
- exports.SkillModel = SkillModel;
40
- SkillModel.init({
41
- id: {
42
- type: sequelize_1.DataTypes.UUID,
43
- defaultValue: sequelize_1.DataTypes.UUIDV4,
44
- allowNull: false,
45
- primaryKey: true,
46
- },
47
- sportId: {
48
- type: sequelize_1.DataTypes.UUID,
49
- field: 'sport_id',
50
- allowNull: true,
51
- },
52
- unitId: {
53
- type: sequelize_1.DataTypes.UUID,
54
- field: 'unit_id',
55
- allowNull: true,
56
- },
57
- name: {
58
- type: sequelize_1.DataTypes.STRING,
59
- allowNull: true,
60
- },
61
- code: {
62
- type: sequelize_1.DataTypes.STRING,
63
- allowNull: true,
64
- },
65
- description: {
66
- type: sequelize_1.DataTypes.TEXT,
67
- allowNull: true,
68
- },
69
- minValue: {
70
- type: sequelize_1.DataTypes.FLOAT,
71
- field: 'min_value',
72
- allowNull: true,
73
- },
74
- maxValue: {
75
- type: sequelize_1.DataTypes.FLOAT,
76
- field: 'max_value',
77
- allowNull: true,
78
- },
79
- betterValueType: {
80
- type: sequelize_1.DataTypes.STRING,
81
- field: 'better_value_type',
82
- allowNull: true,
83
- },
84
- valueSide: {
85
- type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.STRING),
86
- field: 'value_side',
87
- allowNull: true,
88
- },
89
- status: {
90
- type: sequelize_1.DataTypes.STRING,
91
- allowNull: true,
92
- },
93
- }, {
94
- modelName: 'SkillModel',
95
- tableName: 'skills',
96
- timestamps: true,
97
- sequelize: index_1.sequelize,
98
- });
99
- exports.default = SkillModel;
@@ -1,19 +0,0 @@
1
- import { Model } from 'sequelize';
2
- import { ISportCategoryModelAttributes } from '../../interfaces/sportCategoryInterface';
3
- import { TSportCategoryModelCreationAttributes } from '../../types/sportCategoryType';
4
- import { COMMAN_STATUS } from '../../constants/app';
5
- export declare class SportCategoryModel extends Model<ISportCategoryModelAttributes, TSportCategoryModelCreationAttributes> {
6
- id: string;
7
- name: string;
8
- code: string;
9
- description?: string;
10
- status: COMMAN_STATUS;
11
- createdBy?: string;
12
- updatedBy?: string;
13
- deletedBy?: string;
14
- readonly createdAt: Date;
15
- readonly updatedAt: Date;
16
- readonly deletedAt?: string;
17
- static associate(models: any): void;
18
- }
19
- export default SportCategoryModel;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SportCategoryModel = void 0;
4
- const sequelize_1 = require("sequelize");
5
- const index_1 = require("./index");
6
- class SportCategoryModel extends sequelize_1.Model {
7
- static associate(models) {
8
- const { UserModel } = models;
9
- SportCategoryModel.belongsTo(UserModel, {
10
- foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
11
- as: 'createdByUser',
12
- });
13
- SportCategoryModel.belongsTo(UserModel, {
14
- foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
15
- as: 'updatedByUser',
16
- });
17
- SportCategoryModel.belongsTo(UserModel, {
18
- foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
19
- as: 'deletedByUser',
20
- });
21
- }
22
- }
23
- exports.SportCategoryModel = SportCategoryModel;
24
- SportCategoryModel.init({
25
- id: {
26
- type: sequelize_1.DataTypes.UUID,
27
- defaultValue: sequelize_1.DataTypes.UUIDV4,
28
- allowNull: false,
29
- primaryKey: true,
30
- },
31
- name: {
32
- type: sequelize_1.DataTypes.STRING,
33
- allowNull: true,
34
- },
35
- code: {
36
- type: sequelize_1.DataTypes.STRING,
37
- allowNull: true,
38
- },
39
- description: {
40
- type: sequelize_1.DataTypes.TEXT,
41
- allowNull: true,
42
- },
43
- status: {
44
- type: sequelize_1.DataTypes.STRING,
45
- allowNull: true,
46
- },
47
- }, {
48
- modelName: 'SportCategoryModel',
49
- tableName: 'sport_categories',
50
- timestamps: true,
51
- sequelize: index_1.sequelize,
52
- });
53
- exports.default = SportCategoryModel;
@@ -1,20 +0,0 @@
1
- import { Model } from 'sequelize';
2
- import { ISportModelAttributes } from '../../interfaces/sportInterface';
3
- import { TSportModelCreationAttributes } from '../../types/sportType';
4
- import { COMMAN_STATUS } from '../../constants/app';
5
- export declare class SportModel extends Model<ISportModelAttributes, TSportModelCreationAttributes> {
6
- id: string;
7
- name: string;
8
- code: string;
9
- description?: string;
10
- icon?: string;
11
- status: COMMAN_STATUS;
12
- createdBy?: string;
13
- updatedBy?: string;
14
- deletedBy?: string;
15
- readonly createdAt: Date;
16
- readonly updatedAt: Date;
17
- readonly deletedAt?: string;
18
- static associate(models: any): void;
19
- }
20
- export default SportModel;
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SportModel = void 0;
4
- const sequelize_1 = require("sequelize");
5
- const index_1 = require("./index");
6
- class SportModel extends sequelize_1.Model {
7
- static associate(models) {
8
- const { UserModel } = models;
9
- SportModel.belongsTo(UserModel, {
10
- foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
11
- as: 'createdByUser',
12
- });
13
- SportModel.belongsTo(UserModel, {
14
- foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
15
- as: 'updatedByUser',
16
- });
17
- SportModel.belongsTo(UserModel, {
18
- foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
19
- as: 'deletedByUser',
20
- });
21
- }
22
- }
23
- exports.SportModel = SportModel;
24
- SportModel.init({
25
- id: {
26
- type: sequelize_1.DataTypes.UUID,
27
- defaultValue: sequelize_1.DataTypes.UUIDV4,
28
- allowNull: false,
29
- primaryKey: true,
30
- },
31
- name: {
32
- type: sequelize_1.DataTypes.STRING,
33
- allowNull: true,
34
- },
35
- code: {
36
- type: sequelize_1.DataTypes.STRING,
37
- allowNull: true,
38
- },
39
- description: {
40
- type: sequelize_1.DataTypes.TEXT,
41
- allowNull: true,
42
- },
43
- icon: {
44
- type: sequelize_1.DataTypes.STRING,
45
- allowNull: true,
46
- },
47
- status: {
48
- type: sequelize_1.DataTypes.STRING,
49
- allowNull: true,
50
- },
51
- }, {
52
- modelName: 'SportModel',
53
- tableName: 'sports',
54
- timestamps: true,
55
- sequelize: index_1.sequelize,
56
- });
57
- exports.default = SportModel;
@@ -1,21 +0,0 @@
1
- import { Model } from 'sequelize';
2
- import { ISportRoleModelAttributes } from '../../interfaces/sportRoleInterface';
3
- import { TSportRoleModelCreationAttributes } from '../../types/sportRoleType';
4
- import { COMMAN_STATUS } from '../../constants/app';
5
- export declare class SportRoleModel extends Model<ISportRoleModelAttributes, TSportRoleModelCreationAttributes> {
6
- id: string;
7
- sportId: string;
8
- name: string;
9
- code: string;
10
- description?: string;
11
- icon?: string;
12
- status: COMMAN_STATUS;
13
- createdBy?: string;
14
- updatedBy?: string;
15
- deletedBy?: string;
16
- readonly createdAt: Date;
17
- readonly updatedAt: Date;
18
- readonly deletedAt?: string;
19
- static associate(models: any): void;
20
- }
21
- export default SportRoleModel;
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SportRoleModel = void 0;
4
- const sequelize_1 = require("sequelize");
5
- const index_1 = require("./index");
6
- class SportRoleModel extends sequelize_1.Model {
7
- static associate(models) {
8
- const { UserModel, SportModel } = models;
9
- SportRoleModel.belongsTo(UserModel, {
10
- foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
11
- as: 'createdByUser',
12
- });
13
- SportRoleModel.belongsTo(UserModel, {
14
- foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
15
- as: 'updatedByUser',
16
- });
17
- SportRoleModel.belongsTo(UserModel, {
18
- foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
19
- as: 'deletedByUser',
20
- });
21
- SportRoleModel.belongsTo(SportModel, {
22
- foreignKey: { name: 'sportId', allowNull: true, field: 'sport_id' },
23
- as: 'sportRoleSport',
24
- });
25
- SportModel.hasMany(SportRoleModel, {
26
- foreignKey: { name: 'sportId', allowNull: true, field: 'sport_id' },
27
- as: 'sportHasSportRoleList',
28
- });
29
- }
30
- }
31
- exports.SportRoleModel = SportRoleModel;
32
- SportRoleModel.init({
33
- id: {
34
- type: sequelize_1.DataTypes.UUID,
35
- defaultValue: sequelize_1.DataTypes.UUIDV4,
36
- allowNull: false,
37
- primaryKey: true,
38
- },
39
- sportId: {
40
- type: sequelize_1.DataTypes.UUID,
41
- field: 'sport_id',
42
- allowNull: true,
43
- },
44
- name: {
45
- type: sequelize_1.DataTypes.STRING,
46
- allowNull: true,
47
- },
48
- code: {
49
- type: sequelize_1.DataTypes.STRING,
50
- allowNull: true,
51
- },
52
- description: {
53
- type: sequelize_1.DataTypes.TEXT,
54
- allowNull: true,
55
- },
56
- icon: {
57
- type: sequelize_1.DataTypes.STRING,
58
- allowNull: true,
59
- },
60
- status: {
61
- type: sequelize_1.DataTypes.STRING,
62
- allowNull: true,
63
- },
64
- }, {
65
- modelName: 'SportRoleModel',
66
- tableName: 'sport_roles',
67
- timestamps: true,
68
- sequelize: index_1.sequelize,
69
- });
70
- exports.default = SportRoleModel;
@@ -1,20 +0,0 @@
1
- import { Model } from 'sequelize';
2
- import { ISportSubCategoryModelAttributes } from '../../interfaces/sportSubCategoryInterface';
3
- import { TSportSubCategoryModelCreationAttributes } from '../../types/sportSubCategoryType';
4
- import { COMMAN_STATUS } from '../../constants/app';
5
- export declare class SportSubCategoryModel extends Model<ISportSubCategoryModelAttributes, TSportSubCategoryModelCreationAttributes> {
6
- id: string;
7
- sportId: string;
8
- categoryId: string;
9
- name: string;
10
- code: string;
11
- status: COMMAN_STATUS;
12
- createdBy?: string;
13
- updatedBy?: string;
14
- deletedBy?: string;
15
- readonly createdAt: Date;
16
- readonly updatedAt: Date;
17
- readonly deletedAt?: string;
18
- static associate(models: any): void;
19
- }
20
- export default SportSubCategoryModel;
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SportSubCategoryModel = void 0;
4
- const sequelize_1 = require("sequelize");
5
- const index_1 = require("./index");
6
- class SportSubCategoryModel extends sequelize_1.Model {
7
- static associate(models) {
8
- const { UserModel, SportModel, SportCategoryModel } = models;
9
- SportSubCategoryModel.belongsTo(UserModel, {
10
- foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
11
- as: 'createdByUser',
12
- });
13
- SportSubCategoryModel.belongsTo(UserModel, {
14
- foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
15
- as: 'updatedByUser',
16
- });
17
- SportSubCategoryModel.belongsTo(UserModel, {
18
- foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
19
- as: 'deletedByUser',
20
- });
21
- SportSubCategoryModel.belongsTo(SportModel, {
22
- foreignKey: { name: 'sportId', allowNull: true, field: 'sport_id' },
23
- as: 'sportSubCategorySport',
24
- });
25
- SportModel.hasMany(SportSubCategoryModel, {
26
- foreignKey: { name: 'sportId', allowNull: true, field: 'sport_id' },
27
- as: 'sportHasSportSubCategoryList',
28
- });
29
- SportSubCategoryModel.belongsTo(SportCategoryModel, {
30
- foreignKey: { name: 'categoryId', allowNull: true, field: 'category_id' },
31
- as: 'sportSubCategoryCategory',
32
- });
33
- SportCategoryModel.hasMany(SportSubCategoryModel, {
34
- foreignKey: { name: 'categoryId', allowNull: true, field: 'category_id' },
35
- as: 'categoryHasSportSubCategoryList',
36
- });
37
- }
38
- }
39
- exports.SportSubCategoryModel = SportSubCategoryModel;
40
- SportSubCategoryModel.init({
41
- id: {
42
- type: sequelize_1.DataTypes.UUID,
43
- defaultValue: sequelize_1.DataTypes.UUIDV4,
44
- allowNull: false,
45
- primaryKey: true,
46
- },
47
- sportId: {
48
- type: sequelize_1.DataTypes.UUID,
49
- field: 'sport_id',
50
- allowNull: true,
51
- },
52
- categoryId: {
53
- type: sequelize_1.DataTypes.UUID,
54
- field: 'category_id',
55
- allowNull: true,
56
- },
57
- name: {
58
- type: sequelize_1.DataTypes.STRING,
59
- allowNull: true,
60
- },
61
- code: {
62
- type: sequelize_1.DataTypes.STRING,
63
- allowNull: true,
64
- },
65
- status: {
66
- type: sequelize_1.DataTypes.STRING,
67
- allowNull: true,
68
- },
69
- }, {
70
- modelName: 'SportSubCategoryModel',
71
- tableName: 'sport_sub_categories',
72
- timestamps: true,
73
- sequelize: index_1.sequelize,
74
- });
75
- exports.default = SportSubCategoryModel;