@kipicore/dbcore 1.1.384 → 1.1.385
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/20260404071933-validity_in_days-to-coin-model.d.ts +2 -0
- package/dist/db/psql/migrations/20260404071933-validity_in_days-to-coin-model.js +22 -0
- package/dist/interfaces/coinPurchaseOfferInterface.d.ts +1 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/modulePriceInterface.d.ts +15 -0
- package/dist/interfaces/modulePriceInterface.js +2 -0
- package/dist/models/mongodb/index.d.ts +1 -0
- package/dist/models/mongodb/index.js +3 -1
- package/dist/models/mongodb/modulePriceModel.d.ts +4 -0
- package/dist/models/mongodb/modulePriceModel.js +79 -0
- package/dist/models/psql/coinPurchaseOfferModel.d.ts +1 -0
- package/dist/models/psql/coinPurchaseOfferModel.js +5 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/modulePriceType.d.ts +2 -0
- package/dist/types/modulePriceType.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('coin_purchase_offers');
|
|
4
|
+
if (!table.validity_in_days) {
|
|
5
|
+
await queryInterface.addColumn('coin_purchase_offers', 'validity_in_days', {
|
|
6
|
+
type: Sequelize.NUMBER,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
defaultValue: 0,
|
|
9
|
+
field: 'validity_in_days',
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const down = async (queryInterface) => {
|
|
14
|
+
const table = await queryInterface.describeTable('coin_purchase_offers');
|
|
15
|
+
if (table.validity_in_days) {
|
|
16
|
+
await queryInterface.removeColumn('coin_purchase_offers', 'validity_in_days');
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
module.exports = {
|
|
20
|
+
up,
|
|
21
|
+
down,
|
|
22
|
+
};
|
package/dist/interfaces/index.js
CHANGED
|
@@ -190,3 +190,4 @@ __exportStar(require("./internalMarkInterface"), exports);
|
|
|
190
190
|
__exportStar(require("./finalMarkSheetInterface"), exports);
|
|
191
191
|
__exportStar(require("./subjectInternalMarkInterface"), exports);
|
|
192
192
|
__exportStar(require("./pdcChequeConfigurationInterface"), exports);
|
|
193
|
+
__exportStar(require("./modulePriceInterface"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Document } from 'mongoose';
|
|
2
|
+
import { IDefaultAttributes } from './commonInterface';
|
|
3
|
+
import { APP_TYPE } from '../constants';
|
|
4
|
+
export interface IModulePriceList {
|
|
5
|
+
moduleId: string;
|
|
6
|
+
price: number;
|
|
7
|
+
validityInDays: number;
|
|
8
|
+
expiredDate?: Date;
|
|
9
|
+
}
|
|
10
|
+
export interface IModulePriceModelAttributes extends IDefaultAttributes, Document {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
moduleList: IModulePriceList[];
|
|
14
|
+
appType: APP_TYPE;
|
|
15
|
+
}
|
|
@@ -59,3 +59,4 @@ export { default as AppAnalyticsEventModel } from './appAnalyticsEventModel';
|
|
|
59
59
|
export { default as MarkSheetConfigurationModel } from './markSheetConfigurationModel';
|
|
60
60
|
export { default as FinalMarkSheetModel } from './finalMarkSheetModel';
|
|
61
61
|
export { default as PdcChequeConfigurationModel } from './pdcChequeConfigurationModel';
|
|
62
|
+
export { default as ModulePriceModel } from './modulePriceModel';
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PollSelectionModel = 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.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.PdcChequeConfigurationModel = exports.FinalMarkSheetModel = exports.MarkSheetConfigurationModel = exports.AppAnalyticsEventModel = exports.GrantAndDonationModel = exports.TicketRaiseModel = exports.EducationOfficerModel = exports.InstituteFeeModel = exports.SchoolFee1Model = exports.FeeConfigModel = exports.EventTemplatesModel = void 0;
|
|
7
|
+
exports.ModulePriceModel = exports.PdcChequeConfigurationModel = exports.FinalMarkSheetModel = exports.MarkSheetConfigurationModel = exports.AppAnalyticsEventModel = exports.GrantAndDonationModel = exports.TicketRaiseModel = exports.EducationOfficerModel = exports.InstituteFeeModel = exports.SchoolFee1Model = exports.FeeConfigModel = exports.EventTemplatesModel = 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"));
|
|
@@ -145,3 +145,5 @@ var finalMarkSheetModel_1 = require("./finalMarkSheetModel");
|
|
|
145
145
|
Object.defineProperty(exports, "FinalMarkSheetModel", { enumerable: true, get: function () { return __importDefault(finalMarkSheetModel_1).default; } });
|
|
146
146
|
var pdcChequeConfigurationModel_1 = require("./pdcChequeConfigurationModel");
|
|
147
147
|
Object.defineProperty(exports, "PdcChequeConfigurationModel", { enumerable: true, get: function () { return __importDefault(pdcChequeConfigurationModel_1).default; } });
|
|
148
|
+
var modulePriceModel_1 = require("./modulePriceModel");
|
|
149
|
+
Object.defineProperty(exports, "ModulePriceModel", { enumerable: true, get: function () { return __importDefault(modulePriceModel_1).default; } });
|
|
@@ -0,0 +1,79 @@
|
|
|
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 constants_1 = require("../../constants");
|
|
38
|
+
const psql_1 = require("../psql");
|
|
39
|
+
const modulePriceModelSchema = new mongoose_1.Schema({
|
|
40
|
+
title: { type: String, required: true },
|
|
41
|
+
moduleList: [
|
|
42
|
+
{
|
|
43
|
+
moduleId: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: true,
|
|
46
|
+
validate: {
|
|
47
|
+
validator: async function (value) {
|
|
48
|
+
const appType = this.ownerDocument().appType;
|
|
49
|
+
const module = await psql_1.ModuleModel.findOne({
|
|
50
|
+
where: {
|
|
51
|
+
id: value,
|
|
52
|
+
isDefault: true,
|
|
53
|
+
roleId: null,
|
|
54
|
+
appType,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
return !!module;
|
|
58
|
+
},
|
|
59
|
+
message: 'Invalid moduleId: module not found or not allowed',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
price: { type: Number, required: true },
|
|
63
|
+
validityInDays: { type: Number, required: true },
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
appType: {
|
|
67
|
+
type: String,
|
|
68
|
+
enum: Object.values(constants_1.APP_TYPE),
|
|
69
|
+
required: true,
|
|
70
|
+
},
|
|
71
|
+
createdBy: { type: String, required: false },
|
|
72
|
+
updatedBy: { type: String, required: false },
|
|
73
|
+
deletedBy: { type: String, required: false },
|
|
74
|
+
}, {
|
|
75
|
+
timestamps: true,
|
|
76
|
+
versionKey: false,
|
|
77
|
+
});
|
|
78
|
+
const ModulePriceModel = mongoose_1.default.model('module_price', modulePriceModelSchema);
|
|
79
|
+
exports.default = ModulePriceModel;
|
|
@@ -83,6 +83,11 @@ CoinPurchaseOfferModel.init({
|
|
|
83
83
|
field: 'payable_amount',
|
|
84
84
|
allowNull: false,
|
|
85
85
|
},
|
|
86
|
+
validityInDays: {
|
|
87
|
+
type: sequelize_1.DataTypes.NUMBER,
|
|
88
|
+
field: 'validity_in_days',
|
|
89
|
+
allowNull: false,
|
|
90
|
+
},
|
|
86
91
|
}, {
|
|
87
92
|
modelName: 'CoinPurchaseOfferModel',
|
|
88
93
|
tableName: 'coin_purchase_offers',
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -181,3 +181,4 @@ __exportStar(require("./internalMarkType"), exports);
|
|
|
181
181
|
__exportStar(require("./finalMarkSheetType"), exports);
|
|
182
182
|
__exportStar(require("./subjectInternalMarkType"), exports);
|
|
183
183
|
__exportStar(require("./pdcChequeConfigurationType"), exports);
|
|
184
|
+
__exportStar(require("./modulePriceType"), exports);
|
package/package.json
CHANGED