@kipicore/dbcore 1.1.657 → 1.1.659
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/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.d.ts +2 -0
- package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.js +138 -0
- package/dist/interfaces/index.d.ts +2 -1
- package/dist/interfaces/index.js +2 -1
- package/dist/interfaces/sportGroupDataInterface.d.ts +7 -0
- package/dist/models/psql/index.d.ts +1 -1
- package/dist/models/psql/index.js +3 -3
- package/dist/models/psql/sportGroupDataModel.d.ts +13 -0
- package/dist/models/psql/sportGroupDataModel.js +64 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.js +2 -1
- package/dist/types/sportGroupDataType.d.ts +3 -0
- package/package.json +1 -1
- package/dist/interfaces/facilitySportInterface.d.ts +0 -6
- package/dist/models/psql/facilitySportModel.d.ts +0 -12
- package/dist/models/psql/facilitySportModel.js +0 -51
- package/dist/types/facilitySportType.d.ts +0 -2
- /package/dist/interfaces/{facilitySportInterface.js → sportGroupDataInterface.js} +0 -0
- /package/dist/types/{facilitySportType.js → sportGroupDataType.js} +0 -0
package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/** @type {import('sequelize-cli').Migration} */
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up(queryInterface, Sequelize) {
|
|
5
|
+
await queryInterface.dropTable('facility_sports');
|
|
6
|
+
await queryInterface.createTable('sport_group_data', {
|
|
7
|
+
id: {
|
|
8
|
+
allowNull: false,
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
type: Sequelize.UUID,
|
|
11
|
+
defaultValue: Sequelize.UUIDV4
|
|
12
|
+
},
|
|
13
|
+
sport_id: {
|
|
14
|
+
type: Sequelize.UUID,
|
|
15
|
+
allowNull: false,
|
|
16
|
+
references: {
|
|
17
|
+
model: 'sports',
|
|
18
|
+
key: 'id'
|
|
19
|
+
},
|
|
20
|
+
onUpdate: 'CASCADE',
|
|
21
|
+
onDelete: 'CASCADE'
|
|
22
|
+
},
|
|
23
|
+
facility_id: {
|
|
24
|
+
type: Sequelize.UUID,
|
|
25
|
+
allowNull: true,
|
|
26
|
+
references: {
|
|
27
|
+
model: 'facility_masters',
|
|
28
|
+
key: 'id'
|
|
29
|
+
},
|
|
30
|
+
onUpdate: 'CASCADE',
|
|
31
|
+
onDelete: 'CASCADE'
|
|
32
|
+
},
|
|
33
|
+
equipment_id: {
|
|
34
|
+
type: Sequelize.UUID,
|
|
35
|
+
allowNull: true,
|
|
36
|
+
references: {
|
|
37
|
+
model: 'equipments',
|
|
38
|
+
key: 'id'
|
|
39
|
+
},
|
|
40
|
+
onUpdate: 'CASCADE',
|
|
41
|
+
onDelete: 'CASCADE'
|
|
42
|
+
},
|
|
43
|
+
createdAt: {
|
|
44
|
+
allowNull: false,
|
|
45
|
+
type: Sequelize.DATE,
|
|
46
|
+
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
47
|
+
field: 'created_at',
|
|
48
|
+
},
|
|
49
|
+
updatedAt: {
|
|
50
|
+
allowNull: false,
|
|
51
|
+
type: Sequelize.DATE,
|
|
52
|
+
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
53
|
+
field: 'updated_at',
|
|
54
|
+
},
|
|
55
|
+
deletedAt: {
|
|
56
|
+
type: Sequelize.DATE,
|
|
57
|
+
field: 'deleted_at',
|
|
58
|
+
},
|
|
59
|
+
createdBy: {
|
|
60
|
+
type: Sequelize.UUID,
|
|
61
|
+
allowNull: true,
|
|
62
|
+
field: 'created_by',
|
|
63
|
+
},
|
|
64
|
+
updatedBy: {
|
|
65
|
+
type: Sequelize.UUID,
|
|
66
|
+
allowNull: true,
|
|
67
|
+
field: 'updated_by',
|
|
68
|
+
},
|
|
69
|
+
deletedBy: {
|
|
70
|
+
type: Sequelize.UUID,
|
|
71
|
+
allowNull: true,
|
|
72
|
+
field: 'deleted_by',
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
async down(queryInterface, Sequelize) {
|
|
77
|
+
await queryInterface.dropTable('sport_group_data');
|
|
78
|
+
await queryInterface.createTable('facility_sports', {
|
|
79
|
+
id: {
|
|
80
|
+
allowNull: false,
|
|
81
|
+
primaryKey: true,
|
|
82
|
+
type: Sequelize.UUID,
|
|
83
|
+
defaultValue: Sequelize.UUIDV4
|
|
84
|
+
},
|
|
85
|
+
facility_id: {
|
|
86
|
+
type: Sequelize.UUID,
|
|
87
|
+
allowNull: false,
|
|
88
|
+
references: {
|
|
89
|
+
model: 'facility_masters',
|
|
90
|
+
key: 'id'
|
|
91
|
+
},
|
|
92
|
+
onUpdate: 'CASCADE',
|
|
93
|
+
onDelete: 'CASCADE'
|
|
94
|
+
},
|
|
95
|
+
sport_id: {
|
|
96
|
+
type: Sequelize.UUID,
|
|
97
|
+
allowNull: false,
|
|
98
|
+
references: {
|
|
99
|
+
model: 'sports',
|
|
100
|
+
key: 'id'
|
|
101
|
+
},
|
|
102
|
+
onUpdate: 'CASCADE',
|
|
103
|
+
onDelete: 'CASCADE'
|
|
104
|
+
},
|
|
105
|
+
createdAt: {
|
|
106
|
+
allowNull: false,
|
|
107
|
+
type: Sequelize.DATE,
|
|
108
|
+
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
109
|
+
field: 'created_at',
|
|
110
|
+
},
|
|
111
|
+
updatedAt: {
|
|
112
|
+
allowNull: false,
|
|
113
|
+
type: Sequelize.DATE,
|
|
114
|
+
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
115
|
+
field: 'updated_at',
|
|
116
|
+
},
|
|
117
|
+
deletedAt: {
|
|
118
|
+
type: Sequelize.DATE,
|
|
119
|
+
field: 'deleted_at',
|
|
120
|
+
},
|
|
121
|
+
createdBy: {
|
|
122
|
+
type: Sequelize.UUID,
|
|
123
|
+
allowNull: true,
|
|
124
|
+
field: 'created_by',
|
|
125
|
+
},
|
|
126
|
+
updatedBy: {
|
|
127
|
+
type: Sequelize.UUID,
|
|
128
|
+
allowNull: true,
|
|
129
|
+
field: 'updated_by',
|
|
130
|
+
},
|
|
131
|
+
deletedBy: {
|
|
132
|
+
type: Sequelize.UUID,
|
|
133
|
+
allowNull: true,
|
|
134
|
+
field: 'deleted_by',
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
};
|
|
@@ -260,8 +260,9 @@ export * from './sportSubCategoryInterface';
|
|
|
260
260
|
export * from './sportRoleInterface';
|
|
261
261
|
export * from './equipmentInterface';
|
|
262
262
|
export * from './facilityMasterInterface';
|
|
263
|
-
export * from './
|
|
263
|
+
export * from './sportGroupDataInterface';
|
|
264
264
|
export * from './unitInterface';
|
|
265
265
|
export * from './skillInterface';
|
|
266
266
|
export * from './ageGroupInterface';
|
|
267
267
|
export * from './assessmentTestInterface';
|
|
268
|
+
export * from './sportInfoInterface';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -277,8 +277,9 @@ __exportStar(require("./sportSubCategoryInterface"), exports);
|
|
|
277
277
|
__exportStar(require("./sportRoleInterface"), exports);
|
|
278
278
|
__exportStar(require("./equipmentInterface"), exports);
|
|
279
279
|
__exportStar(require("./facilityMasterInterface"), exports);
|
|
280
|
-
__exportStar(require("./
|
|
280
|
+
__exportStar(require("./sportGroupDataInterface"), exports);
|
|
281
281
|
__exportStar(require("./unitInterface"), exports);
|
|
282
282
|
__exportStar(require("./skillInterface"), exports);
|
|
283
283
|
__exportStar(require("./ageGroupInterface"), exports);
|
|
284
284
|
__exportStar(require("./assessmentTestInterface"), exports);
|
|
285
|
+
__exportStar(require("./sportInfoInterface"), exports);
|
|
@@ -181,7 +181,7 @@ export { default as SportSubCategoryModel } from './sportSubCategoryModel';
|
|
|
181
181
|
export { default as SportRoleModel } from './sportRoleModel';
|
|
182
182
|
export { default as EquipmentModel } from './equipmentModel';
|
|
183
183
|
export { default as FacilityMasterModel } from './facilityMasterModel';
|
|
184
|
-
export { default as
|
|
184
|
+
export { default as SportGroupDataModel } from './sportGroupDataModel';
|
|
185
185
|
export { default as UnitModel } from './unitModel';
|
|
186
186
|
export { default as SkillModel } from './skillModel';
|
|
187
187
|
export { default as AgeGroupModel } from './ageGroupModel';
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ProjectAssessmentOptionModel = exports.ProductModel = exports.PincodeModel = exports.PdcHistoryModel = exports.PdcChequeModel = exports.OfferModel = exports.ModuleModel = exports.ModuleFeatureModel = exports.MasterLeaveModel = exports.LectureModel = exports.LectureHistoryModel = exports.InventoryModel = exports.InventoryHistoryModel = exports.InstituteSubscriptionPlanModel = exports.InstituteModel = exports.InstituteEntityTypeModel = exports.InstituteEntityModel = exports.HomeWorkModel = exports.GreetingsModel = exports.FloorManagementModel = exports.FileStorageModel = exports.FeeReminderSettingModel = exports.FeeReminderModel = exports.FeatureActionModel = exports.FacilityModel = exports.EntityGroupModel = exports.DriverModel = exports.CourseModel = exports.CourseHasVisitorsModel = exports.CountryModel = exports.ContactFeedBackModel = exports.CoinPurchaseOfferModel = exports.CloudStorageModel = exports.ClassRoomModel = exports.CityModel = exports.CategoriesModel = exports.BookAssessmentDateModel = exports.BatchSubjectProjectAssessmentModel = exports.BatchSubjectBookAssessmentModel = exports.BatchModel = exports.BannerModel = exports.BankAccountDetailsModel = exports.AreaModel = exports.AnnouncementModel = exports.AccountHasReceiptDetailsModel = exports.AcademicCalendarModel = exports.SubCategoriesModel = exports.Sequelize = exports.db = exports.sequelize = void 0;
|
|
7
7
|
exports.StudentLeaveRequestModel = exports.CloneListModel = exports.IncomeExpenseModel = exports.MaintenanceModel = exports.WorkOffDaysModel = exports.EntityWiseCalendarModel = exports.CampusModel = exports.LostFoundItemModel = exports.WorkingShiftModel = exports.WorkingDayModel = exports.WalletModel = exports.WalletHistoryModel = exports.VendorManagementModel = exports.VehicleModel = exports.UserRequiredStepsModel = exports.UserProjectAssessmentOptionModel = exports.UserPayoutModel = exports.UserModel = exports.UserLeaveRequestModel = exports.UserHasSubjectFeeModel = exports.UserHasStorageModel = exports.UserHasRollNumberModel = exports.UserHasRoleModel = exports.UserHasParentModel = exports.UserHasOfferModel = exports.UserHasLeaveModel = exports.UserHasLeaveHistoryModel = exports.UserHasInventoryModel = exports.UserHasInventoryHistoryModel = exports.UserHasHomeWorkModel = exports.UserHasFileModel = exports.UserHasDeviceModel = exports.UserHasCourseModel = exports.UserHasBatchModel = exports.UserHasAnnouncementModel = exports.UserBookAssessmentModel = exports.TypeManagementModel = exports.TripModel = exports.TokenModel = exports.ToDoModel = exports.TestimonialModel = exports.SyllabusModel = exports.SubjectHasPayFeeHistoryModel = exports.SubjectHasFeeModel = exports.StateModel = exports.SlotModel = exports.SendNotificationModel = exports.SchoolOfferModel = exports.RulesRegulationModel = exports.RoleModel = void 0;
|
|
8
8
|
exports.RmsPurchaseOrderModel = exports.RmsPurchaseRequestItemModel = exports.RmsPurchaseRequestModel = exports.RmsVendorDocumentModel = exports.RmsVendorModel = exports.RmsStockTransactionModel = exports.RmsStockModel = exports.RmsResourceModel = exports.RmsLocationModel = exports.RmsDepartmentModel = exports.ModuleDocsModel = exports.DynamicVariableLabelModel = exports.DynamicVariableModel = exports.CertificateRequestModel = exports.FeeSubmissionTrackModel = exports.UserHasFeeSubmissionModel = exports.AssignSubjectModel = exports.InstitutePartnersModel = exports.InstituteOwnershipHistoryModel = exports.UserHasPenaltyHistoryModel = exports.PastYearRecordModel = exports.PayoutTransactionHistoryModel = exports.AdditionalPayoutModel = exports.LoanEmiModel = exports.UserLoanModel = exports.NoticeboardModel = exports.UserPermissionModel = exports.RoleManagementModel = exports.PermissionModel = exports.DesignationModel = exports.AdditionalPayoutTypeModel = exports.VisitorBookModel = exports.PostalDispatchModel = exports.CallRegisterModel = exports.UserHasOfferAndDiscountModel = exports.UserAcceptedTermsAndCondition = exports.SubjectInternalMarkModel = exports.InternalMarkModel = exports.TermsAndConditionModel = exports.FeeType1Model = exports.StudentFeeTermsModel = exports.UserHasPenaltyModel = exports.PenaltyModel = exports.ClassRoomCollectionModel = exports.ClassRoomEventModel = exports.StudentFeeTypeCollectionModel = exports.SchoolFeeTermsModel = exports.StudentFeeHistoryModel = exports.StudentFeeCollectionModel = exports.UserDirectoryModel = void 0;
|
|
9
|
-
exports.AgeGroupModel = exports.SkillModel = exports.UnitModel = exports.
|
|
9
|
+
exports.AgeGroupModel = exports.SkillModel = exports.UnitModel = exports.SportGroupDataModel = exports.FacilityMasterModel = exports.EquipmentModel = exports.SportRoleModel = exports.SportSubCategoryModel = exports.SportCategoryModel = exports.SportModel = exports.AccountVoucherTypeModel = exports.AccountCostCenterModel = exports.AccountLedgerOpeningModel = exports.AccountLedgerModel = exports.AccountGroupModel = exports.AccountNumberSequenceModel = exports.AccountPeriodLockModel = exports.AccountFinancialYearModel = exports.RmsExpenseEntryModel = exports.RmsBudgetModel = exports.RmsFacilityBookingModel = exports.RmsFacilityModel = exports.RmsMaintenanceActivityModel = exports.RmsMaintenanceTicketModel = exports.RefundCollectionModule = exports.RmsAssetTransactionModel = exports.RmsStorageSlotModel = exports.RmsStorageRackModel = exports.UserHasGraceMarksModel = exports.GraceMarksModel = exports.RmsAssetModel = exports.RmsGrnItemTransactionModel = exports.RmsGrnItemModel = exports.RmsGrnModel = exports.RmsPurchaseOrderItemModel = void 0;
|
|
10
10
|
const sequelize_1 = require("sequelize");
|
|
11
11
|
Object.defineProperty(exports, "Sequelize", { enumerable: true, get: function () { return sequelize_1.Sequelize; } });
|
|
12
12
|
const postgresConfig = require('../../configs/postgresConfig');
|
|
@@ -459,8 +459,8 @@ var equipmentModel_1 = require("./equipmentModel");
|
|
|
459
459
|
Object.defineProperty(exports, "EquipmentModel", { enumerable: true, get: function () { return __importDefault(equipmentModel_1).default; } });
|
|
460
460
|
var facilityMasterModel_1 = require("./facilityMasterModel");
|
|
461
461
|
Object.defineProperty(exports, "FacilityMasterModel", { enumerable: true, get: function () { return __importDefault(facilityMasterModel_1).default; } });
|
|
462
|
-
var
|
|
463
|
-
Object.defineProperty(exports, "
|
|
462
|
+
var sportGroupDataModel_1 = require("./sportGroupDataModel");
|
|
463
|
+
Object.defineProperty(exports, "SportGroupDataModel", { enumerable: true, get: function () { return __importDefault(sportGroupDataModel_1).default; } });
|
|
464
464
|
var unitModel_1 = require("./unitModel");
|
|
465
465
|
Object.defineProperty(exports, "UnitModel", { enumerable: true, get: function () { return __importDefault(unitModel_1).default; } });
|
|
466
466
|
var skillModel_1 = require("./skillModel");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Model } from 'sequelize';
|
|
2
|
+
import { ISportGroupDataModelAttributes } from '../../interfaces/sportGroupDataInterface';
|
|
3
|
+
import { TSportGroupDataModelCreationAttributes } from '../../types/sportGroupDataType';
|
|
4
|
+
export declare class SportGroupDataModel extends Model<ISportGroupDataModelAttributes, TSportGroupDataModelCreationAttributes> {
|
|
5
|
+
id: string;
|
|
6
|
+
sportId: string;
|
|
7
|
+
facilityId?: string | null;
|
|
8
|
+
equipmentId?: string | null;
|
|
9
|
+
readonly createdAt: Date;
|
|
10
|
+
readonly updatedAt: Date;
|
|
11
|
+
static associate(models: any): void;
|
|
12
|
+
}
|
|
13
|
+
export default SportGroupDataModel;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SportGroupDataModel = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
const index_1 = require("./index");
|
|
6
|
+
class SportGroupDataModel extends sequelize_1.Model {
|
|
7
|
+
static associate(models) {
|
|
8
|
+
const { SportModel, FacilityMasterModel, EquipmentModel } = models;
|
|
9
|
+
SportGroupDataModel.belongsTo(SportModel, {
|
|
10
|
+
foreignKey: { name: 'sportId', allowNull: false, field: 'sport_id' },
|
|
11
|
+
as: 'sport',
|
|
12
|
+
});
|
|
13
|
+
SportModel.hasMany(SportGroupDataModel, {
|
|
14
|
+
foreignKey: { name: 'sportId', allowNull: false, field: 'sport_id' },
|
|
15
|
+
as: 'sportGroupDataList',
|
|
16
|
+
});
|
|
17
|
+
SportGroupDataModel.belongsTo(FacilityMasterModel, {
|
|
18
|
+
foreignKey: { name: 'facilityId', allowNull: true, field: 'facility_id' },
|
|
19
|
+
as: 'facility',
|
|
20
|
+
});
|
|
21
|
+
FacilityMasterModel.hasMany(SportGroupDataModel, {
|
|
22
|
+
foreignKey: { name: 'facilityId', allowNull: true, field: 'facility_id' },
|
|
23
|
+
as: 'facilityGroupDataList',
|
|
24
|
+
});
|
|
25
|
+
SportGroupDataModel.belongsTo(EquipmentModel, {
|
|
26
|
+
foreignKey: { name: 'equipmentId', allowNull: true, field: 'equipment_id' },
|
|
27
|
+
as: 'equipment',
|
|
28
|
+
});
|
|
29
|
+
EquipmentModel.hasMany(SportGroupDataModel, {
|
|
30
|
+
foreignKey: { name: 'equipmentId', allowNull: true, field: 'equipment_id' },
|
|
31
|
+
as: 'equipmentGroupDataList',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.SportGroupDataModel = SportGroupDataModel;
|
|
36
|
+
SportGroupDataModel.init({
|
|
37
|
+
id: {
|
|
38
|
+
type: sequelize_1.DataTypes.UUID,
|
|
39
|
+
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
40
|
+
allowNull: false,
|
|
41
|
+
primaryKey: true,
|
|
42
|
+
},
|
|
43
|
+
sportId: {
|
|
44
|
+
type: sequelize_1.DataTypes.UUID,
|
|
45
|
+
field: 'sport_id',
|
|
46
|
+
allowNull: false,
|
|
47
|
+
},
|
|
48
|
+
facilityId: {
|
|
49
|
+
type: sequelize_1.DataTypes.UUID,
|
|
50
|
+
field: 'facility_id',
|
|
51
|
+
allowNull: true,
|
|
52
|
+
},
|
|
53
|
+
equipmentId: {
|
|
54
|
+
type: sequelize_1.DataTypes.UUID,
|
|
55
|
+
field: 'equipment_id',
|
|
56
|
+
allowNull: true,
|
|
57
|
+
},
|
|
58
|
+
}, {
|
|
59
|
+
modelName: 'SportGroupDataModel',
|
|
60
|
+
tableName: 'sport_group_data',
|
|
61
|
+
timestamps: true,
|
|
62
|
+
sequelize: index_1.sequelize,
|
|
63
|
+
});
|
|
64
|
+
exports.default = SportGroupDataModel;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -249,8 +249,9 @@ export * from './sportSubCategoryType';
|
|
|
249
249
|
export * from './sportRoleType';
|
|
250
250
|
export * from './equipmentType';
|
|
251
251
|
export * from './facilityMasterType';
|
|
252
|
-
export * from './
|
|
252
|
+
export * from './sportGroupDataType';
|
|
253
253
|
export * from './unitType';
|
|
254
254
|
export * from './skillType';
|
|
255
255
|
export * from './ageGroupType';
|
|
256
256
|
export * from './assessmentTestType';
|
|
257
|
+
export * from './sportInfoType';
|
package/dist/types/index.js
CHANGED
|
@@ -266,8 +266,9 @@ __exportStar(require("./sportSubCategoryType"), exports);
|
|
|
266
266
|
__exportStar(require("./sportRoleType"), exports);
|
|
267
267
|
__exportStar(require("./equipmentType"), exports);
|
|
268
268
|
__exportStar(require("./facilityMasterType"), exports);
|
|
269
|
-
__exportStar(require("./
|
|
269
|
+
__exportStar(require("./sportGroupDataType"), exports);
|
|
270
270
|
__exportStar(require("./unitType"), exports);
|
|
271
271
|
__exportStar(require("./skillType"), exports);
|
|
272
272
|
__exportStar(require("./ageGroupType"), exports);
|
|
273
273
|
__exportStar(require("./assessmentTestType"), exports);
|
|
274
|
+
__exportStar(require("./sportInfoType"), exports);
|
package/package.json
CHANGED
|
@@ -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;
|
|
File without changes
|
|
File without changes
|