@kipicore/dbcore 1.1.474 → 1.1.475
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/interfaces/index.d.ts +0 -1
- package/dist/interfaces/index.js +0 -1
- package/dist/models/psql/index.d.ts +0 -1
- package/dist/models/psql/index.js +2 -4
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/package.json +1 -1
- package/dist/db/psql/migrations/20251009052646-user_payout_history.d.ts +0 -2
- package/dist/db/psql/migrations/20251009052646-user_payout_history.js +0 -242
- package/dist/interfaces/userPayoutHistoryInterface.d.ts +0 -18
- package/dist/interfaces/userPayoutHistoryInterface.js +0 -2
- package/dist/models/psql/userPayoutHistoryModel.d.ts +0 -28
- package/dist/models/psql/userPayoutHistoryModel.js +0 -128
- package/dist/types/userPayoutHistoryType.d.ts +0 -3
- package/dist/types/userPayoutHistoryType.js +0 -2
|
@@ -111,7 +111,6 @@ export * from './userInterface';
|
|
|
111
111
|
export * from './userLeaveRequestInterface';
|
|
112
112
|
export * from './userMetaInterface';
|
|
113
113
|
export * from './userPayoutDetailsInterface';
|
|
114
|
-
export * from './userPayoutHistoryInterface';
|
|
115
114
|
export * from './userPayoutInterface';
|
|
116
115
|
export * from './userProjectAssessmentOptionInterface';
|
|
117
116
|
export * from './userRequiredStepsInterface';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -127,7 +127,6 @@ __exportStar(require("./userInterface"), exports);
|
|
|
127
127
|
__exportStar(require("./userLeaveRequestInterface"), exports);
|
|
128
128
|
__exportStar(require("./userMetaInterface"), exports);
|
|
129
129
|
__exportStar(require("./userPayoutDetailsInterface"), exports);
|
|
130
|
-
__exportStar(require("./userPayoutHistoryInterface"), exports);
|
|
131
130
|
__exportStar(require("./userPayoutInterface"), exports);
|
|
132
131
|
__exportStar(require("./userProjectAssessmentOptionInterface"), exports);
|
|
133
132
|
__exportStar(require("./userRequiredStepsInterface"), exports);
|
|
@@ -84,7 +84,6 @@ export { default as UserHasSubjectFeeModel } from './userHasSubjectFeeModel';
|
|
|
84
84
|
export { default as UserLeaveRequestModel } from './userLeaveRequestModel';
|
|
85
85
|
export { default as UserModel } from './userModel';
|
|
86
86
|
export { default as UserPayoutDetailsModel } from './userPayoutDetailsModel';
|
|
87
|
-
export { default as UserPayoutHistoryModel } from './userPayoutHistoryModel';
|
|
88
87
|
export { default as UserPayoutModel } from './userPayoutModel';
|
|
89
88
|
export { default as UserProjectAssessmentOptionModel } from './userProjectAssessmentOptionModel';
|
|
90
89
|
export { default as UserRequiredStepsModel } from './userRequiredStepsModel';
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
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
|
-
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.
|
|
8
|
-
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 = exports.StudentLeaveRequestModel =
|
|
7
|
+
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.UserPayoutDetailsModel = 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
|
+
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 = exports.StudentLeaveRequestModel = void 0;
|
|
9
9
|
const sequelize_1 = require("sequelize");
|
|
10
10
|
Object.defineProperty(exports, "Sequelize", { enumerable: true, get: function () { return sequelize_1.Sequelize; } });
|
|
11
11
|
const postgresConfig = require('../../configs/postgresConfig');
|
|
@@ -262,8 +262,6 @@ var userModel_1 = require("./userModel");
|
|
|
262
262
|
Object.defineProperty(exports, "UserModel", { enumerable: true, get: function () { return __importDefault(userModel_1).default; } });
|
|
263
263
|
var userPayoutDetailsModel_1 = require("./userPayoutDetailsModel");
|
|
264
264
|
Object.defineProperty(exports, "UserPayoutDetailsModel", { enumerable: true, get: function () { return __importDefault(userPayoutDetailsModel_1).default; } });
|
|
265
|
-
var userPayoutHistoryModel_1 = require("./userPayoutHistoryModel");
|
|
266
|
-
Object.defineProperty(exports, "UserPayoutHistoryModel", { enumerable: true, get: function () { return __importDefault(userPayoutHistoryModel_1).default; } });
|
|
267
265
|
var userPayoutModel_1 = require("./userPayoutModel");
|
|
268
266
|
Object.defineProperty(exports, "UserPayoutModel", { enumerable: true, get: function () { return __importDefault(userPayoutModel_1).default; } });
|
|
269
267
|
var userProjectAssessmentOptionModel_1 = require("./userProjectAssessmentOptionModel");
|
package/dist/types/index.d.ts
CHANGED
|
@@ -102,7 +102,6 @@ export * from './userInstituteMetaType';
|
|
|
102
102
|
export * from './userLeaveRequestType';
|
|
103
103
|
export * from './userMetaType';
|
|
104
104
|
export * from './userPayoutDetailsType';
|
|
105
|
-
export * from './userPayoutHistoryType';
|
|
106
105
|
export * from './userPayoutType';
|
|
107
106
|
export * from './userProjectAssessmentOptionType';
|
|
108
107
|
export * from './userRequiredStepsType';
|
package/dist/types/index.js
CHANGED
|
@@ -118,7 +118,6 @@ __exportStar(require("./userInstituteMetaType"), exports);
|
|
|
118
118
|
__exportStar(require("./userLeaveRequestType"), exports);
|
|
119
119
|
__exportStar(require("./userMetaType"), exports);
|
|
120
120
|
__exportStar(require("./userPayoutDetailsType"), exports);
|
|
121
|
-
__exportStar(require("./userPayoutHistoryType"), exports);
|
|
122
121
|
__exportStar(require("./userPayoutType"), exports);
|
|
123
122
|
__exportStar(require("./userProjectAssessmentOptionType"), exports);
|
|
124
123
|
__exportStar(require("./userRequiredStepsType"), exports);
|
package/package.json
CHANGED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const up = async (queryInterface, Sequelize) => {
|
|
3
|
-
const tableName = 'user_payout_history';
|
|
4
|
-
const tableExists = await queryInterface
|
|
5
|
-
.describeTable(tableName)
|
|
6
|
-
.then(() => true)
|
|
7
|
-
.catch(() => false);
|
|
8
|
-
if (!tableExists) {
|
|
9
|
-
await queryInterface.createTable(tableName, {
|
|
10
|
-
id: {
|
|
11
|
-
type: Sequelize.UUID,
|
|
12
|
-
defaultValue: Sequelize.UUIDV4,
|
|
13
|
-
allowNull: false,
|
|
14
|
-
primaryKey: true,
|
|
15
|
-
},
|
|
16
|
-
userId: {
|
|
17
|
-
type: Sequelize.UUID,
|
|
18
|
-
allowNull: false,
|
|
19
|
-
field: 'user_id',
|
|
20
|
-
},
|
|
21
|
-
userType: {
|
|
22
|
-
type: Sequelize.ENUM('MASTER_ADMIN', 'ADMIN', 'INSTITUTE_MASTER_ADMIN', 'INSTITUTE_ADMIN', 'TEACHER', 'STUDENT', 'PARENTS', 'DRIVER'),
|
|
23
|
-
allowNull: false,
|
|
24
|
-
field: 'user_type',
|
|
25
|
-
},
|
|
26
|
-
instituteId: {
|
|
27
|
-
type: Sequelize.UUID,
|
|
28
|
-
allowNull: false,
|
|
29
|
-
field: 'institute_id',
|
|
30
|
-
},
|
|
31
|
-
userPayoutId: {
|
|
32
|
-
type: Sequelize.UUID,
|
|
33
|
-
allowNull: false,
|
|
34
|
-
field: 'user_payout_id',
|
|
35
|
-
},
|
|
36
|
-
paidAmount: {
|
|
37
|
-
type: Sequelize.FLOAT,
|
|
38
|
-
allowNull: false,
|
|
39
|
-
field: 'paid_amount',
|
|
40
|
-
},
|
|
41
|
-
payableAmount: {
|
|
42
|
-
type: Sequelize.FLOAT,
|
|
43
|
-
allowNull: false,
|
|
44
|
-
field: 'payable_amount',
|
|
45
|
-
},
|
|
46
|
-
bonusAmount: {
|
|
47
|
-
type: Sequelize.FLOAT,
|
|
48
|
-
allowNull: true,
|
|
49
|
-
defaultValue: 0,
|
|
50
|
-
field: 'bonus_amount',
|
|
51
|
-
},
|
|
52
|
-
overtimeAmount: {
|
|
53
|
-
type: Sequelize.FLOAT,
|
|
54
|
-
allowNull: true,
|
|
55
|
-
defaultValue: 0,
|
|
56
|
-
field: 'overtime_amount',
|
|
57
|
-
},
|
|
58
|
-
payoutDate: {
|
|
59
|
-
type: Sequelize.DATE,
|
|
60
|
-
allowNull: false,
|
|
61
|
-
field: 'payout_date',
|
|
62
|
-
},
|
|
63
|
-
payoutStartTime: {
|
|
64
|
-
type: Sequelize.DATE,
|
|
65
|
-
allowNull: false,
|
|
66
|
-
field: 'payout_start_time',
|
|
67
|
-
},
|
|
68
|
-
payoutEndTime: {
|
|
69
|
-
type: Sequelize.DATE,
|
|
70
|
-
allowNull: false,
|
|
71
|
-
field: 'payout_end_time',
|
|
72
|
-
},
|
|
73
|
-
payoutType: {
|
|
74
|
-
type: Sequelize.ENUM('PERCENTAGE', 'HOURLY', 'MONTHLY'),
|
|
75
|
-
allowNull: false,
|
|
76
|
-
field: 'payout_type',
|
|
77
|
-
},
|
|
78
|
-
description: {
|
|
79
|
-
type: Sequelize.STRING,
|
|
80
|
-
allowNull: true,
|
|
81
|
-
},
|
|
82
|
-
createdBy: {
|
|
83
|
-
type: Sequelize.UUID,
|
|
84
|
-
allowNull: true,
|
|
85
|
-
field: 'created_by'
|
|
86
|
-
},
|
|
87
|
-
updatedBy: {
|
|
88
|
-
type: Sequelize.UUID,
|
|
89
|
-
allowNull: true,
|
|
90
|
-
field: 'updated_by'
|
|
91
|
-
},
|
|
92
|
-
deletedBy: {
|
|
93
|
-
type: Sequelize.UUID,
|
|
94
|
-
allowNull: true,
|
|
95
|
-
field: 'deleted_by'
|
|
96
|
-
},
|
|
97
|
-
createdAt: {
|
|
98
|
-
type: Sequelize.DATE,
|
|
99
|
-
allowNull: false,
|
|
100
|
-
field: 'created_at'
|
|
101
|
-
},
|
|
102
|
-
updatedAt: {
|
|
103
|
-
type: Sequelize.DATE,
|
|
104
|
-
allowNull: false,
|
|
105
|
-
field: 'updated_at'
|
|
106
|
-
},
|
|
107
|
-
deletedAt: {
|
|
108
|
-
type: Sequelize.DATE,
|
|
109
|
-
allowNull: true,
|
|
110
|
-
field: 'deleted_at'
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
const tableDefinition = await queryInterface.describeTable(tableName);
|
|
116
|
-
const columnsToAdd = {
|
|
117
|
-
id: {
|
|
118
|
-
type: Sequelize.UUID,
|
|
119
|
-
defaultValue: Sequelize.UUIDV4,
|
|
120
|
-
allowNull: false,
|
|
121
|
-
primaryKey: true,
|
|
122
|
-
},
|
|
123
|
-
userId: {
|
|
124
|
-
type: Sequelize.UUID,
|
|
125
|
-
allowNull: false,
|
|
126
|
-
field: 'user_id',
|
|
127
|
-
},
|
|
128
|
-
userType: {
|
|
129
|
-
type: Sequelize.ENUM('MASTER_ADMIN', 'ADMIN', 'INSTITUTE_MASTER_ADMIN', 'INSTITUTE_ADMIN', 'TEACHER', 'STUDENT', 'PARENTS', 'DRIVER'),
|
|
130
|
-
allowNull: false,
|
|
131
|
-
field: 'user_type',
|
|
132
|
-
},
|
|
133
|
-
instituteId: {
|
|
134
|
-
type: Sequelize.UUID,
|
|
135
|
-
allowNull: false,
|
|
136
|
-
field: 'institute_id',
|
|
137
|
-
},
|
|
138
|
-
userPayoutId: {
|
|
139
|
-
type: Sequelize.UUID,
|
|
140
|
-
allowNull: false,
|
|
141
|
-
field: 'user_payout_id',
|
|
142
|
-
},
|
|
143
|
-
paidAmount: {
|
|
144
|
-
type: Sequelize.FLOAT,
|
|
145
|
-
allowNull: false,
|
|
146
|
-
field: 'paid_amount',
|
|
147
|
-
},
|
|
148
|
-
payableAmount: {
|
|
149
|
-
type: Sequelize.FLOAT,
|
|
150
|
-
allowNull: false,
|
|
151
|
-
field: 'payable_amount',
|
|
152
|
-
},
|
|
153
|
-
bonusAmount: {
|
|
154
|
-
type: Sequelize.FLOAT,
|
|
155
|
-
allowNull: true,
|
|
156
|
-
defaultValue: 0,
|
|
157
|
-
field: 'bonus_amount',
|
|
158
|
-
},
|
|
159
|
-
overtimeAmount: {
|
|
160
|
-
type: Sequelize.FLOAT,
|
|
161
|
-
allowNull: true,
|
|
162
|
-
defaultValue: 0,
|
|
163
|
-
field: 'overtime_amount',
|
|
164
|
-
},
|
|
165
|
-
payoutDate: {
|
|
166
|
-
type: Sequelize.DATE,
|
|
167
|
-
allowNull: false,
|
|
168
|
-
field: 'payout_date',
|
|
169
|
-
},
|
|
170
|
-
payoutStartTime: {
|
|
171
|
-
type: Sequelize.DATE,
|
|
172
|
-
allowNull: false,
|
|
173
|
-
field: 'payout_start_time',
|
|
174
|
-
},
|
|
175
|
-
payoutEndTime: {
|
|
176
|
-
type: Sequelize.DATE,
|
|
177
|
-
allowNull: false,
|
|
178
|
-
field: 'payout_end_time',
|
|
179
|
-
},
|
|
180
|
-
payoutType: {
|
|
181
|
-
type: Sequelize.ENUM('PERCENTAGE', 'HOURLY', 'MONTHLY'),
|
|
182
|
-
allowNull: false,
|
|
183
|
-
field: 'payout_type',
|
|
184
|
-
},
|
|
185
|
-
description: {
|
|
186
|
-
type: Sequelize.STRING,
|
|
187
|
-
allowNull: true,
|
|
188
|
-
},
|
|
189
|
-
createdBy: {
|
|
190
|
-
type: Sequelize.UUID,
|
|
191
|
-
allowNull: true,
|
|
192
|
-
field: 'created_by'
|
|
193
|
-
},
|
|
194
|
-
updatedBy: {
|
|
195
|
-
type: Sequelize.UUID,
|
|
196
|
-
allowNull: true,
|
|
197
|
-
field: 'updated_by'
|
|
198
|
-
},
|
|
199
|
-
deletedBy: {
|
|
200
|
-
type: Sequelize.UUID,
|
|
201
|
-
allowNull: true,
|
|
202
|
-
field: 'deleted_by'
|
|
203
|
-
},
|
|
204
|
-
createdAt: {
|
|
205
|
-
type: Sequelize.DATE,
|
|
206
|
-
allowNull: false,
|
|
207
|
-
field: 'created_at'
|
|
208
|
-
},
|
|
209
|
-
updatedAt: {
|
|
210
|
-
type: Sequelize.DATE,
|
|
211
|
-
allowNull: false,
|
|
212
|
-
field: 'updated_at'
|
|
213
|
-
},
|
|
214
|
-
deletedAt: {
|
|
215
|
-
type: Sequelize.DATE,
|
|
216
|
-
allowNull: true,
|
|
217
|
-
field: 'deleted_at'
|
|
218
|
-
},
|
|
219
|
-
};
|
|
220
|
-
for (const column of Object.keys(columnsToAdd)) {
|
|
221
|
-
const columnToAdd = columnsToAdd[column];
|
|
222
|
-
const tableColumn = columnToAdd.field || column;
|
|
223
|
-
if (!tableDefinition[tableColumn]) {
|
|
224
|
-
await queryInterface.addColumn(tableName, tableColumn, columnToAdd);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
const down = async (queryInterface) => {
|
|
230
|
-
const tableName = 'user_payout_history';
|
|
231
|
-
const tableExists = await queryInterface
|
|
232
|
-
.describeTable(tableName)
|
|
233
|
-
.then(() => true)
|
|
234
|
-
.catch(() => false);
|
|
235
|
-
if (tableExists) {
|
|
236
|
-
await queryInterface.dropTable(tableName);
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
module.exports = {
|
|
240
|
-
up,
|
|
241
|
-
down,
|
|
242
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IDefaultAttributes } from './commonInterface';
|
|
2
|
-
import { USER_PAYOUT_TYPE, USER_TYPES } from '../constants/app';
|
|
3
|
-
export interface IUserPayoutHistoryModelAttributes extends IDefaultAttributes {
|
|
4
|
-
id: string;
|
|
5
|
-
userId?: string;
|
|
6
|
-
userType: USER_TYPES;
|
|
7
|
-
instituteId: string;
|
|
8
|
-
userPayoutId: string;
|
|
9
|
-
payableAmount: number;
|
|
10
|
-
paidAmount: number;
|
|
11
|
-
overtimeAmount?: number;
|
|
12
|
-
bonusAmount?: number;
|
|
13
|
-
payoutDate: Date;
|
|
14
|
-
payoutStartTime: Date;
|
|
15
|
-
payoutEndTime: Date;
|
|
16
|
-
payoutType: USER_PAYOUT_TYPE;
|
|
17
|
-
description?: string;
|
|
18
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Model } from 'sequelize';
|
|
2
|
-
import { IUserPayoutHistoryModelAttributes } from '../../interfaces/userPayoutHistoryInterface';
|
|
3
|
-
import { TUserPayoutHistoryModelCreationAttributes } from '../../types/userPayoutHistoryType';
|
|
4
|
-
import { USER_PAYOUT_TYPE, USER_TYPES } from '../../constants/app';
|
|
5
|
-
declare class UserPayoutHistoryModel extends Model<IUserPayoutHistoryModelAttributes, TUserPayoutHistoryModelCreationAttributes> {
|
|
6
|
-
id: string;
|
|
7
|
-
userId: string;
|
|
8
|
-
userType: USER_TYPES;
|
|
9
|
-
instituteId: string;
|
|
10
|
-
userPayoutId: string;
|
|
11
|
-
paidAmount: number;
|
|
12
|
-
payableAmount: number;
|
|
13
|
-
overtimeAmount: number;
|
|
14
|
-
bonusAmount: number;
|
|
15
|
-
payoutDate: Date;
|
|
16
|
-
payoutStartTime: Date;
|
|
17
|
-
payoutEndTime: Date;
|
|
18
|
-
payoutType: USER_PAYOUT_TYPE;
|
|
19
|
-
description: string;
|
|
20
|
-
createdBy: string;
|
|
21
|
-
updatedBy: string;
|
|
22
|
-
deletedBy: string;
|
|
23
|
-
readonly createdAt: Date;
|
|
24
|
-
readonly deletedAt: Date;
|
|
25
|
-
readonly updatedAt: Date;
|
|
26
|
-
static associate(models: any): void;
|
|
27
|
-
}
|
|
28
|
-
export default UserPayoutHistoryModel;
|
|
@@ -1,128 +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
|
-
const app_1 = require("../../constants/app");
|
|
6
|
-
class UserPayoutHistoryModel extends sequelize_1.Model {
|
|
7
|
-
static associate(models) {
|
|
8
|
-
const { UserModel, InstituteModel, UserPayoutModel } = models;
|
|
9
|
-
UserPayoutHistoryModel.belongsTo(UserModel, {
|
|
10
|
-
foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
|
|
11
|
-
as: 'createdByUser',
|
|
12
|
-
});
|
|
13
|
-
UserPayoutHistoryModel.belongsTo(UserModel, {
|
|
14
|
-
foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
|
|
15
|
-
as: 'updatedByUser',
|
|
16
|
-
});
|
|
17
|
-
UserPayoutHistoryModel.belongsTo(UserModel, {
|
|
18
|
-
foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
|
|
19
|
-
as: 'deletedByUser',
|
|
20
|
-
});
|
|
21
|
-
UserPayoutHistoryModel.belongsTo(InstituteModel, {
|
|
22
|
-
foreignKey: { name: 'instituteId' },
|
|
23
|
-
as: 'institute',
|
|
24
|
-
});
|
|
25
|
-
InstituteModel.hasMany(UserPayoutHistoryModel, {
|
|
26
|
-
foreignKey: { name: 'instituteId' },
|
|
27
|
-
as: 'instituteHasPayoutHistoryList',
|
|
28
|
-
});
|
|
29
|
-
UserPayoutHistoryModel.belongsTo(UserModel, {
|
|
30
|
-
foreignKey: { name: 'userId' },
|
|
31
|
-
as: 'user',
|
|
32
|
-
});
|
|
33
|
-
UserModel.hasMany(UserPayoutHistoryModel, {
|
|
34
|
-
foreignKey: { name: 'userId' },
|
|
35
|
-
as: 'userHasPayoutHistoryList',
|
|
36
|
-
});
|
|
37
|
-
UserPayoutHistoryModel.belongsTo(UserPayoutModel, {
|
|
38
|
-
foreignKey: { name: 'userPayoutId' },
|
|
39
|
-
as: 'userPayout',
|
|
40
|
-
});
|
|
41
|
-
UserPayoutModel.hasMany(UserPayoutHistoryModel, {
|
|
42
|
-
foreignKey: { name: 'userPayoutId' },
|
|
43
|
-
as: 'userPayoutHistoryList',
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
UserPayoutHistoryModel.init({
|
|
48
|
-
id: {
|
|
49
|
-
type: sequelize_1.DataTypes.UUID,
|
|
50
|
-
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
51
|
-
allowNull: false,
|
|
52
|
-
primaryKey: true,
|
|
53
|
-
},
|
|
54
|
-
userId: {
|
|
55
|
-
type: sequelize_1.DataTypes.UUID,
|
|
56
|
-
allowNull: false,
|
|
57
|
-
field: 'user_id',
|
|
58
|
-
},
|
|
59
|
-
userType: {
|
|
60
|
-
type: sequelize_1.DataTypes.ENUM,
|
|
61
|
-
values: Object.values(app_1.USER_TYPES),
|
|
62
|
-
allowNull: false,
|
|
63
|
-
field: 'user_type',
|
|
64
|
-
},
|
|
65
|
-
instituteId: {
|
|
66
|
-
type: sequelize_1.DataTypes.UUID,
|
|
67
|
-
allowNull: false,
|
|
68
|
-
field: 'institute_id',
|
|
69
|
-
},
|
|
70
|
-
userPayoutId: {
|
|
71
|
-
type: sequelize_1.DataTypes.UUID,
|
|
72
|
-
allowNull: false,
|
|
73
|
-
field: 'user_payout_id',
|
|
74
|
-
},
|
|
75
|
-
paidAmount: {
|
|
76
|
-
type: sequelize_1.DataTypes.FLOAT,
|
|
77
|
-
allowNull: false,
|
|
78
|
-
field: 'paid_amount',
|
|
79
|
-
},
|
|
80
|
-
payableAmount: {
|
|
81
|
-
type: sequelize_1.DataTypes.FLOAT,
|
|
82
|
-
allowNull: false,
|
|
83
|
-
field: 'payable_amount',
|
|
84
|
-
},
|
|
85
|
-
bonusAmount: {
|
|
86
|
-
type: sequelize_1.DataTypes.FLOAT,
|
|
87
|
-
allowNull: true,
|
|
88
|
-
defaultValue: 0,
|
|
89
|
-
field: 'bonus_amount',
|
|
90
|
-
},
|
|
91
|
-
overtimeAmount: {
|
|
92
|
-
type: sequelize_1.DataTypes.FLOAT,
|
|
93
|
-
allowNull: true,
|
|
94
|
-
defaultValue: 0,
|
|
95
|
-
field: 'overtime_amount',
|
|
96
|
-
},
|
|
97
|
-
payoutDate: {
|
|
98
|
-
type: sequelize_1.DataTypes.DATE,
|
|
99
|
-
allowNull: false,
|
|
100
|
-
field: 'payout_date',
|
|
101
|
-
},
|
|
102
|
-
payoutStartTime: {
|
|
103
|
-
type: sequelize_1.DataTypes.DATE,
|
|
104
|
-
allowNull: false,
|
|
105
|
-
field: 'payout_start_time',
|
|
106
|
-
},
|
|
107
|
-
payoutEndTime: {
|
|
108
|
-
type: sequelize_1.DataTypes.DATE,
|
|
109
|
-
allowNull: false,
|
|
110
|
-
field: 'payout_end_time',
|
|
111
|
-
},
|
|
112
|
-
payoutType: {
|
|
113
|
-
type: sequelize_1.DataTypes.ENUM,
|
|
114
|
-
values: Object.values(app_1.USER_PAYOUT_TYPE),
|
|
115
|
-
allowNull: false,
|
|
116
|
-
field: 'payout_type',
|
|
117
|
-
},
|
|
118
|
-
description: {
|
|
119
|
-
type: sequelize_1.DataTypes.STRING,
|
|
120
|
-
allowNull: true,
|
|
121
|
-
},
|
|
122
|
-
}, {
|
|
123
|
-
modelName: 'UserPayoutHistoryModel',
|
|
124
|
-
tableName: 'user_payout_history',
|
|
125
|
-
timestamps: true,
|
|
126
|
-
sequelize: index_1.sequelize,
|
|
127
|
-
});
|
|
128
|
-
exports.default = UserPayoutHistoryModel;
|