@kipicore/dbcore 1.1.320 → 1.1.322

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 (29) hide show
  1. package/dist/db/psql/migrations/20260318093506-internal_marks.d.ts +2 -0
  2. package/dist/db/psql/migrations/20260318093506-internal_marks.js +184 -0
  3. package/dist/interfaces/finalMarkSheetInterface.d.ts +13 -0
  4. package/dist/interfaces/finalMarkSheetInterface.js +2 -0
  5. package/dist/interfaces/index.d.ts +3 -0
  6. package/dist/interfaces/index.js +3 -0
  7. package/dist/interfaces/internalMarkInterface.d.ts +11 -0
  8. package/dist/interfaces/internalMarkInterface.js +2 -0
  9. package/dist/interfaces/markSheetConfigurationInterface.d.ts +22 -0
  10. package/dist/interfaces/markSheetConfigurationInterface.js +2 -0
  11. package/dist/models/mongodb/finalMarkSheetModel.d.ts +4 -0
  12. package/dist/models/mongodb/finalMarkSheetModel.js +54 -0
  13. package/dist/models/mongodb/index.d.ts +2 -0
  14. package/dist/models/mongodb/index.js +5 -1
  15. package/dist/models/mongodb/markSheetConfigurationModel.d.ts +4 -0
  16. package/dist/models/mongodb/markSheetConfigurationModel.js +63 -0
  17. package/dist/models/psql/index.d.ts +1 -0
  18. package/dist/models/psql/index.js +3 -1
  19. package/dist/models/psql/internalMarkModel.d.ts +22 -0
  20. package/dist/models/psql/internalMarkModel.js +157 -0
  21. package/dist/types/finalMarkSheetType.d.ts +2 -0
  22. package/dist/types/finalMarkSheetType.js +2 -0
  23. package/dist/types/index.d.ts +3 -0
  24. package/dist/types/index.js +3 -0
  25. package/dist/types/internalMarkType.d.ts +9 -0
  26. package/dist/types/internalMarkType.js +2 -0
  27. package/dist/types/markSheetConfigurationType.d.ts +2 -0
  28. package/dist/types/markSheetConfigurationType.js +2 -0
  29. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any): Promise<void>;
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const tableName = 'internal_marks';
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
+ academicCalendarId: {
17
+ type: Sequelize.UUID,
18
+ field: 'academic_calendar_id',
19
+ allowNull: true,
20
+ },
21
+ instituteId: {
22
+ type: Sequelize.UUID,
23
+ field: 'institute_id',
24
+ allowNull: true,
25
+ },
26
+ userId: {
27
+ type: Sequelize.UUID,
28
+ field: 'user_id',
29
+ allowNull: true,
30
+ },
31
+ subjectId: {
32
+ type: Sequelize.UUID,
33
+ field: 'subject_id',
34
+ allowNull: true,
35
+ },
36
+ batchId: {
37
+ type: Sequelize.UUID,
38
+ field: 'batch_id',
39
+ allowNull: true,
40
+ },
41
+ totalMark: {
42
+ type: Sequelize.INTEGER,
43
+ field: 'total_mark',
44
+ allowNull: true,
45
+ defaultValue: 0,
46
+ },
47
+ obtainedMarks: {
48
+ type: Sequelize.INTEGER,
49
+ field: 'obtained_marks',
50
+ allowNull: true,
51
+ defaultValue: 0,
52
+ },
53
+ createdBy: {
54
+ type: Sequelize.UUID,
55
+ allowNull: true,
56
+ field: 'created_by',
57
+ },
58
+ updatedBy: {
59
+ type: Sequelize.UUID,
60
+ allowNull: true,
61
+ field: 'updated_by',
62
+ },
63
+ deletedBy: {
64
+ type: Sequelize.UUID,
65
+ allowNull: true,
66
+ field: 'deleted_by',
67
+ },
68
+ createdAt: {
69
+ type: Sequelize.DATE,
70
+ allowNull: false,
71
+ field: 'created_at',
72
+ },
73
+ updatedAt: {
74
+ type: Sequelize.DATE,
75
+ allowNull: false,
76
+ field: 'updated_at',
77
+ },
78
+ deletedAt: {
79
+ type: Sequelize.DATE,
80
+ allowNull: true,
81
+ field: 'deleted_at',
82
+ },
83
+ });
84
+ }
85
+ else {
86
+ const tableDefinition = await queryInterface.describeTable(tableName);
87
+ const columnsToAdd = {
88
+ id: {
89
+ type: Sequelize.UUID,
90
+ defaultValue: Sequelize.UUIDV4,
91
+ allowNull: false,
92
+ primaryKey: true,
93
+ },
94
+ academicCalendarId: {
95
+ type: Sequelize.UUID,
96
+ field: 'academic_calendar_id',
97
+ allowNull: true,
98
+ },
99
+ instituteId: {
100
+ type: Sequelize.UUID,
101
+ field: 'institute_id',
102
+ allowNull: true,
103
+ },
104
+ userId: {
105
+ type: Sequelize.UUID,
106
+ field: 'user_id',
107
+ allowNull: true,
108
+ },
109
+ subjectId: {
110
+ type: Sequelize.UUID,
111
+ field: 'subject_id',
112
+ allowNull: true,
113
+ },
114
+ batchId: {
115
+ type: Sequelize.UUID,
116
+ field: 'batch_id',
117
+ allowNull: true,
118
+ },
119
+ totalMark: {
120
+ type: Sequelize.INTEGER,
121
+ field: 'total_mark',
122
+ allowNull: true,
123
+ defaultValue: 0,
124
+ },
125
+ obtainedMarks: {
126
+ type: Sequelize.INTEGER,
127
+ field: 'obtained_marks',
128
+ allowNull: true,
129
+ defaultValue: 0,
130
+ },
131
+ createdBy: {
132
+ type: Sequelize.UUID,
133
+ allowNull: true,
134
+ field: 'created_by',
135
+ },
136
+ updatedBy: {
137
+ type: Sequelize.UUID,
138
+ allowNull: true,
139
+ field: 'updated_by',
140
+ },
141
+ deletedBy: {
142
+ type: Sequelize.UUID,
143
+ allowNull: true,
144
+ field: 'deleted_by',
145
+ },
146
+ createdAt: {
147
+ type: Sequelize.DATE,
148
+ allowNull: false,
149
+ field: 'created_at',
150
+ },
151
+ updatedAt: {
152
+ type: Sequelize.DATE,
153
+ allowNull: false,
154
+ field: 'updated_at',
155
+ },
156
+ deletedAt: {
157
+ type: Sequelize.DATE,
158
+ allowNull: true,
159
+ field: 'deleted_at',
160
+ },
161
+ };
162
+ for (const column of Object.keys(columnsToAdd)) {
163
+ const columnToAdd = columnsToAdd[column];
164
+ const tableColumn = columnToAdd.field || column;
165
+ if (!tableDefinition[tableColumn]) {
166
+ await queryInterface.addColumn(tableName, tableColumn, columnToAdd);
167
+ }
168
+ }
169
+ }
170
+ };
171
+ const down = async (queryInterface) => {
172
+ const tableName = 'internal_marks';
173
+ const tableExists = await queryInterface
174
+ .describeTable(tableName)
175
+ .then(() => true)
176
+ .catch(() => false);
177
+ if (tableExists) {
178
+ await queryInterface.dropTable(tableName);
179
+ }
180
+ };
181
+ module.exports = {
182
+ up,
183
+ down,
184
+ };
@@ -0,0 +1,13 @@
1
+ import { Document } from 'mongoose';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IFinalMarkSheetModelAttributes extends IDefaultAttributes, Document {
4
+ id: string;
5
+ date: Date;
6
+ resultId: string;
7
+ userIds: string[];
8
+ instituteId: string;
9
+ academicCalendarId?: string;
10
+ markSheetConfigurationId: string;
11
+ stdId: string;
12
+ batchId: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -180,3 +180,6 @@ export * from './termsAndConditionInterface';
180
180
  export * from './ticketRaiseInterface';
181
181
  export * from './grantAndDonationInterface';
182
182
  export * from './appAnalyticsEventInterface';
183
+ export * from './markSheetConfigurationInterface';
184
+ export * from './internalMarkInterface';
185
+ export * from './finalMarkSheetInterface';
@@ -196,3 +196,6 @@ __exportStar(require("./termsAndConditionInterface"), exports);
196
196
  __exportStar(require("./ticketRaiseInterface"), exports);
197
197
  __exportStar(require("./grantAndDonationInterface"), exports);
198
198
  __exportStar(require("./appAnalyticsEventInterface"), exports);
199
+ __exportStar(require("./markSheetConfigurationInterface"), exports);
200
+ __exportStar(require("./internalMarkInterface"), exports);
201
+ __exportStar(require("./finalMarkSheetInterface"), exports);
@@ -0,0 +1,11 @@
1
+ import { IDefaultAttributes } from './commonInterface';
2
+ export interface IInternalMarkModelAttributes extends IDefaultAttributes {
3
+ id: string;
4
+ instituteId: string;
5
+ academicCalendarId: string;
6
+ userId: string;
7
+ subjectId: string;
8
+ totalMark: number;
9
+ obtainedMarks: number;
10
+ batchId: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { Document } from 'mongoose';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IExamList {
4
+ examId: string;
5
+ number: number;
6
+ }
7
+ export interface IMarkSheetArrangement {
8
+ srNumber: number;
9
+ subjectId: string;
10
+ markConsiderType: string[];
11
+ totalMark: number;
12
+ }
13
+ export interface IMarkSheetConfigurationModelAttributes extends IDefaultAttributes, Document {
14
+ id: string;
15
+ stdId: string;
16
+ title: string;
17
+ typeIds: string[];
18
+ instituteId: string;
19
+ academicCalendarId?: string;
20
+ examList: IExamList[];
21
+ markSheetArrangement: IMarkSheetArrangement[];
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { Model } from 'mongoose';
2
+ import { IFinalMarkSheetModelAttributes } from '../../interfaces/finalMarkSheetInterface';
3
+ declare const FinalMarkSheetModel: Model<IFinalMarkSheetModelAttributes>;
4
+ export default FinalMarkSheetModel;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const mongoose_1 = __importStar(require("mongoose"));
37
+ const finalMarkSheetModelSchema = new mongoose_1.Schema({
38
+ instituteId: { type: String, required: false },
39
+ academicCalendarId: { type: String, required: false },
40
+ resultId: { type: String, required: false },
41
+ markSheetConfigurationId: { type: String, required: false },
42
+ stdId: { type: String, required: false },
43
+ batchId: { type: String, required: false },
44
+ userIds: { type: [String], default: [] },
45
+ date: { type: Date, required: false },
46
+ createdBy: { type: String, required: false },
47
+ updatedBy: { type: String, required: false },
48
+ deletedBy: { type: String, required: false },
49
+ }, {
50
+ timestamps: true,
51
+ versionKey: false,
52
+ });
53
+ const FinalMarkSheetModel = mongoose_1.default.model('final_mark_sheet', finalMarkSheetModelSchema);
54
+ exports.default = FinalMarkSheetModel;
@@ -57,3 +57,5 @@ export { default as EducationOfficerModel } from './educationOfficerModel';
57
57
  export { default as TicketRaiseModel } from './ticketRaiseModel';
58
58
  export { default as GrantAndDonationModel } from './grantAndDonationModel';
59
59
  export { default as AppAnalyticsEventModel } from './appAnalyticsEventModel';
60
+ export { default as MarkSheetConfigurationModel } from './markSheetConfigurationModel';
61
+ export { default as FinalMarkSheetModel } from './finalMarkSheetModel';
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CreatePollModel = exports.SheetFieldMappingModel = exports.FileUploadUserDetails = exports.CompetitionUsersModel = exports.CompetitionGroupModel = exports.CompetitionModel = exports.CampusCarnivalModel = exports.AppointmentHistoryModel = exports.AppointmentModel = exports.SeatingArrangementModel = exports.AssignFileModel = exports.ThemeModel = exports.BDayWishModel = exports.AdditionalDetailModel = exports.CanteenModel = exports.WalletTransactionModel = exports.VideoAnalystModel = exports.UserSchoolMetaModel = exports.UserInstituteMetaModel = exports.UserDetailsModel = exports.UniqueNumberCounterModel = exports.TaskManagementModel = exports.SubscriptionPlanModel = exports.SubjectIndexModel = exports.SchoolFeeModel = exports.ReplaceTeacherModel = exports.PlannerModel = exports.PhotosGalleryModel = exports.JobApplyModel = exports.InvoiceModel = exports.InquiryModel = exports.InformationSupportModel = exports.HolidayModel = exports.GenerateIdCardModel = exports.FeedBackModel = exports.FeeReminderTypeModel = exports.ExamModel = exports.ExamHasAnswerSheetModel = exports.ExamGroupModel = exports.EventModel = exports.DashboardManagementModel = exports.DailyBookModel = exports.ColumnModel = exports.CertificatesManagementModel = exports.CertificatesHistoryModel = exports.CareerModel = exports.BlogModel = exports.AttendanceModel = exports.ApprovalRequestModel = exports.connectMongoDb = void 0;
7
- exports.AppAnalyticsEventModel = exports.GrantAndDonationModel = exports.TicketRaiseModel = exports.EducationOfficerModel = exports.InstituteFeeModel = exports.SchoolFee1Model = exports.FeeConfigModel = exports.EventTemplatesModel = exports.PollSelectionModel = void 0;
7
+ exports.FinalMarkSheetModel = exports.MarkSheetConfigurationModel = exports.AppAnalyticsEventModel = exports.GrantAndDonationModel = exports.TicketRaiseModel = exports.EducationOfficerModel = exports.InstituteFeeModel = exports.SchoolFee1Model = exports.FeeConfigModel = exports.EventTemplatesModel = exports.PollSelectionModel = void 0;
8
8
  const mongoose_1 = __importDefault(require("mongoose"));
9
9
  const env_1 = require("../../configs/env");
10
10
  const transformIdInQueryPlugin_1 = __importDefault(require("./plugin/transformIdInQueryPlugin"));
@@ -141,3 +141,7 @@ var grantAndDonationModel_1 = require("./grantAndDonationModel");
141
141
  Object.defineProperty(exports, "GrantAndDonationModel", { enumerable: true, get: function () { return __importDefault(grantAndDonationModel_1).default; } });
142
142
  var appAnalyticsEventModel_1 = require("./appAnalyticsEventModel");
143
143
  Object.defineProperty(exports, "AppAnalyticsEventModel", { enumerable: true, get: function () { return __importDefault(appAnalyticsEventModel_1).default; } });
144
+ var markSheetConfigurationModel_1 = require("./markSheetConfigurationModel");
145
+ Object.defineProperty(exports, "MarkSheetConfigurationModel", { enumerable: true, get: function () { return __importDefault(markSheetConfigurationModel_1).default; } });
146
+ var finalMarkSheetModel_1 = require("./finalMarkSheetModel");
147
+ Object.defineProperty(exports, "FinalMarkSheetModel", { enumerable: true, get: function () { return __importDefault(finalMarkSheetModel_1).default; } });
@@ -0,0 +1,4 @@
1
+ import { Model } from 'mongoose';
2
+ import { IMarkSheetConfigurationModelAttributes } from '../../interfaces/markSheetConfigurationInterface';
3
+ declare const MarkConfigurationModel: Model<IMarkSheetConfigurationModelAttributes>;
4
+ export default MarkConfigurationModel;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const mongoose_1 = __importStar(require("mongoose"));
37
+ const examListSchema = new mongoose_1.Schema({
38
+ examId: { type: String, required: false },
39
+ number: { type: Number, required: false },
40
+ }, { _id: false });
41
+ const markSheetArrangementSchema = new mongoose_1.Schema({
42
+ srNumber: { type: Number, required: false },
43
+ subjectId: { type: String, required: false },
44
+ markConsiderType: { type: [String], default: [] },
45
+ totalMark: { type: Number, required: false },
46
+ }, { _id: false });
47
+ const marksConfigurationModelSchema = new mongoose_1.Schema({
48
+ instituteId: { type: String, required: false },
49
+ academicCalendarId: { type: String, required: false },
50
+ stdId: { type: String, required: true },
51
+ title: { type: String, required: true },
52
+ typeIds: { type: [String], default: [] },
53
+ examList: { type: [examListSchema], default: [] },
54
+ markSheetArrangement: { type: [markSheetArrangementSchema], default: [] },
55
+ createdBy: { type: String, required: false },
56
+ updatedBy: { type: String, required: false },
57
+ deletedBy: { type: String, required: false },
58
+ }, {
59
+ timestamps: true,
60
+ versionKey: false,
61
+ });
62
+ const MarkConfigurationModel = mongoose_1.default.model('mark_configuration', marksConfigurationModelSchema);
63
+ exports.default = MarkConfigurationModel;
@@ -125,3 +125,4 @@ export { default as UserHasPenaltyModel } from './userHasPenaltyModel';
125
125
  export { default as StudentFeeTermsModel } from './studentFeeTermsModel';
126
126
  export { default as FeeType1Model } from './feeType1Model';
127
127
  export { default as TermsAndConditionModel } from './termsAndConditionModel';
128
+ export { default as InternalMarkModel } from './internalMarkModel';
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  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.FeesCollectionModel = exports.FeeTypeModel = exports.FeeTypeHasTermsModel = exports.FeeReminderSettingModel = exports.FeeReminderModel = exports.FeeHistoryModel = exports.FeeHistoryDetailsModel = 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.VendorManagementModel = exports.VehicleModel = exports.UserRequiredStepsModel = exports.UserProjectAssessmentOptionModel = exports.UserPayoutModel = exports.UserPayoutHistoryModel = 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.UserHasFeeTermsModel = exports.UserHasDeviceModel = exports.UserHasCourseModel = exports.UserHasBatchModel = exports.UserHasAnnouncementModel = exports.UserFeeTypeModel = exports.UserFeeTypeByAccountModel = 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.SchoolFeeCollectionModel = exports.RulesRegulationModel = exports.RoleModel = exports.ProjectAssessmentOptionModel = exports.ProductModel = exports.PincodeModel = exports.PdcHistoryModel = exports.PdcChequeModel = exports.PaymentTermsModel = void 0;
8
- 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 = exports.CloneListModel = exports.IncomeExpenseModel = exports.MaintenanceModel = exports.AdvertisementModel = exports.WorkOffDaysModel = exports.EntityWiseCalendarModel = exports.CampusModel = exports.LostFoundItemModel = exports.WorkingShiftModel = exports.WorkingDayModel = exports.WalletModel = exports.WalletHistoryModel = void 0;
8
+ 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 = exports.CloneListModel = exports.IncomeExpenseModel = exports.MaintenanceModel = exports.AdvertisementModel = exports.WorkOffDaysModel = exports.EntityWiseCalendarModel = exports.CampusModel = exports.LostFoundItemModel = exports.WorkingShiftModel = exports.WorkingDayModel = exports.WalletModel = exports.WalletHistoryModel = 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');
@@ -344,3 +344,5 @@ var feeType1Model_1 = require("./feeType1Model");
344
344
  Object.defineProperty(exports, "FeeType1Model", { enumerable: true, get: function () { return __importDefault(feeType1Model_1).default; } });
345
345
  var termsAndConditionModel_1 = require("./termsAndConditionModel");
346
346
  Object.defineProperty(exports, "TermsAndConditionModel", { enumerable: true, get: function () { return __importDefault(termsAndConditionModel_1).default; } });
347
+ var internalMarkModel_1 = require("./internalMarkModel");
348
+ Object.defineProperty(exports, "InternalMarkModel", { enumerable: true, get: function () { return __importDefault(internalMarkModel_1).default; } });
@@ -0,0 +1,22 @@
1
+ import { Model } from 'sequelize';
2
+ import { IInternalMarkModelAttributes } from '../../interfaces/internalMarkInterface';
3
+ import { TInternalMarkModelCreationAttributes } from '../../types/internalMarkType';
4
+ declare class InternalMarkModel extends Model<IInternalMarkModelAttributes, TInternalMarkModelCreationAttributes> {
5
+ id: string;
6
+ instituteId?: string;
7
+ academicCalendarId: string;
8
+ userId: string;
9
+ subjectId: string;
10
+ totalMark: number;
11
+ obtainedMarks: number;
12
+ batchId: string;
13
+ createdBy: string;
14
+ updatedBy: string;
15
+ deletedBy: string;
16
+ readonly createdAt: Date;
17
+ readonly updatedAt: Date;
18
+ readonly deletedAt?: Date;
19
+ static associate(models: any): void;
20
+ static addHooks(models: any): void;
21
+ }
22
+ export default InternalMarkModel;
@@ -0,0 +1,157 @@
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
+ const errorMessages_1 = require("../../constants/errorMessages");
7
+ class InternalMarkModel extends sequelize_1.Model {
8
+ static associate(models) {
9
+ const { UserModel, InstituteModel, BatchModel, InstituteEntityModel } = models;
10
+ InternalMarkModel.belongsTo(UserModel, {
11
+ foreignKey: {
12
+ name: 'createdBy',
13
+ allowNull: true,
14
+ field: 'created_by',
15
+ },
16
+ as: 'createdByUser',
17
+ });
18
+ InternalMarkModel.belongsTo(UserModel, {
19
+ foreignKey: {
20
+ name: 'updatedBy',
21
+ allowNull: true,
22
+ field: 'updated_by',
23
+ },
24
+ as: 'updatedByUser',
25
+ });
26
+ InternalMarkModel.belongsTo(UserModel, {
27
+ foreignKey: {
28
+ name: 'deletedBy',
29
+ allowNull: true,
30
+ field: 'deleted_by',
31
+ },
32
+ as: 'deletedByUser',
33
+ });
34
+ InternalMarkModel.belongsTo(InstituteModel, {
35
+ foreignKey: 'instituteId',
36
+ as: 'internalMarkInstitute',
37
+ });
38
+ InstituteModel.hasMany(InternalMarkModel, {
39
+ foreignKey: 'instituteId',
40
+ as: 'instituteHasInternalMark',
41
+ });
42
+ InternalMarkModel.belongsTo(UserModel, {
43
+ foreignKey: 'userId',
44
+ as: 'internalMarkUser',
45
+ });
46
+ UserModel.hasMany(InternalMarkModel, {
47
+ foreignKey: 'userId',
48
+ as: 'userHasInternalMark',
49
+ });
50
+ InternalMarkModel.belongsTo(BatchModel, {
51
+ foreignKey: 'batchId',
52
+ as: 'internalMarkBatch',
53
+ });
54
+ BatchModel.hasMany(InternalMarkModel, {
55
+ foreignKey: 'batchId',
56
+ as: 'batchHasInternalMark',
57
+ });
58
+ InternalMarkModel.belongsTo(InstituteEntityModel, {
59
+ foreignKey: 'subjectId',
60
+ as: 'internalMarkSubject',
61
+ });
62
+ InstituteEntityModel.hasMany(InternalMarkModel, {
63
+ foreignKey: 'subjectId',
64
+ as: 'subjectHasInternalMark',
65
+ });
66
+ }
67
+ static addHooks(models) {
68
+ const { InstituteModel, UserModel } = models;
69
+ const beforeCreateOrUpdateHook = async (internalMark) => {
70
+ if (internalMark.instituteId) {
71
+ const institute = await InstituteModel.findByPk(internalMark.instituteId);
72
+ if (!institute) {
73
+ throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
74
+ }
75
+ }
76
+ if (internalMark.userId) {
77
+ const user = await UserModel.findByPk(internalMark.userId);
78
+ if (!user) {
79
+ throw new Error(errorMessages_1.USER_ERROR_MESSAGES.NOT_FOUND);
80
+ }
81
+ }
82
+ if (internalMark.batchId) {
83
+ const batch = await index_1.BatchModel.findByPk(internalMark.batchId);
84
+ if (!batch) {
85
+ throw new Error(errorMessages_1.BATCH_ERROR_MESSAGES.NOT_FOUND);
86
+ }
87
+ }
88
+ if (internalMark.subjectId) {
89
+ const subject = await index_1.InstituteEntityModel.findByPk(internalMark.subjectId, {
90
+ include: [
91
+ {
92
+ association: 'entityType',
93
+ },
94
+ ],
95
+ });
96
+ if (subject.entityType?.sequence !== app_1.INSTITUTE_ENTITY_TYPE_SEQUENCE.LAST || !subject) {
97
+ throw new Error('plz select valid subject');
98
+ }
99
+ }
100
+ };
101
+ InternalMarkModel.beforeCreate(beforeCreateOrUpdateHook);
102
+ InternalMarkModel.beforeBulkUpdate(async (options) => {
103
+ await beforeCreateOrUpdateHook(options.attributes);
104
+ });
105
+ }
106
+ }
107
+ InternalMarkModel.init({
108
+ id: {
109
+ type: sequelize_1.DataTypes.UUID,
110
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
111
+ allowNull: false,
112
+ primaryKey: true,
113
+ },
114
+ academicCalendarId: {
115
+ type: sequelize_1.DataTypes.UUID,
116
+ field: 'academic_calendar_id',
117
+ allowNull: true,
118
+ },
119
+ instituteId: {
120
+ type: sequelize_1.DataTypes.UUID,
121
+ field: 'institute_id',
122
+ allowNull: true,
123
+ },
124
+ userId: {
125
+ type: sequelize_1.DataTypes.UUID,
126
+ field: 'user_id',
127
+ allowNull: true,
128
+ },
129
+ subjectId: {
130
+ type: sequelize_1.DataTypes.UUID,
131
+ field: 'subject_id',
132
+ allowNull: true,
133
+ },
134
+ totalMark: {
135
+ type: sequelize_1.DataTypes.INTEGER,
136
+ field: 'total_mark',
137
+ allowNull: true,
138
+ defaultValue: 0,
139
+ },
140
+ obtainedMarks: {
141
+ type: sequelize_1.DataTypes.INTEGER,
142
+ field: 'obtained_marks',
143
+ allowNull: true,
144
+ defaultValue: 0,
145
+ },
146
+ batchId: {
147
+ type: sequelize_1.DataTypes.UUID,
148
+ field: 'batch_id',
149
+ allowNull: true,
150
+ },
151
+ }, {
152
+ modelName: 'InternalMarkModel',
153
+ tableName: 'internal_marks',
154
+ timestamps: true,
155
+ sequelize: index_1.sequelize,
156
+ });
157
+ exports.default = InternalMarkModel;
@@ -0,0 +1,2 @@
1
+ import { IFinalMarkSheetModelAttributes } from '../interfaces/finalMarkSheetInterface';
2
+ export type TFinalMarkSheetModelCreationAttributes = Omit<IFinalMarkSheetModelAttributes, 'id'>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -171,3 +171,6 @@ export * from './termsAndConditionType';
171
171
  export * from './ticketRaiseType';
172
172
  export * from './grantAndDonationType';
173
173
  export * from './appAnalyticsEventType';
174
+ export * from './markSheetConfigurationType';
175
+ export * from './internalMarkType';
176
+ export * from './finalMarkSheetType';
@@ -187,3 +187,6 @@ __exportStar(require("./termsAndConditionType"), exports);
187
187
  __exportStar(require("./ticketRaiseType"), exports);
188
188
  __exportStar(require("./grantAndDonationType"), exports);
189
189
  __exportStar(require("./appAnalyticsEventType"), exports);
190
+ __exportStar(require("./markSheetConfigurationType"), exports);
191
+ __exportStar(require("./internalMarkType"), exports);
192
+ __exportStar(require("./finalMarkSheetType"), exports);
@@ -0,0 +1,9 @@
1
+ import { IBatchModelAttributes, IInstituteAttributes, IInstituteEntityAttributes, IUserAttributes } from '../interfaces';
2
+ import { IInternalMarkModelAttributes } from '../interfaces/internalMarkInterface';
3
+ export type TInternalMarkModelCreationAttributes = Partial<IInternalMarkModelAttributes>;
4
+ export type TInternalMarkWithAssociation = IInternalMarkModelAttributes & {
5
+ internalMarkBatch?: IBatchModelAttributes;
6
+ internalMarkSubject?: IInstituteEntityAttributes;
7
+ internalMarkUser?: IUserAttributes;
8
+ internalMarkInstitute?: IInstituteAttributes;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { IMarkSheetConfigurationModelAttributes } from '../interfaces/markSheetConfigurationInterface';
2
+ export type TMarkSheetConfigurationModelCreationAttributes = Omit<IMarkSheetConfigurationModelAttributes, 'id'>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.320",
3
+ "version": "1.1.322",
4
4
  "description": "Reusable DB core package with Postgres, MongoDB, models, services, interfaces, and types",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",