@kipicore/dbcore 1.1.430 → 1.1.432
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/constants/defaultModelAttributes.js +13 -1
- package/dist/db/psql/migrations/20260414112026-add_app_type_and_user_type_coin_an_storage_model.d.ts +2 -0
- package/dist/db/psql/migrations/20260414112026-add_app_type_and_user_type_coin_an_storage_model.js +55 -0
- package/dist/interfaces/cloudStorageInterface.d.ts +3 -1
- package/dist/interfaces/coinPurchaseOfferInterface.d.ts +3 -1
- package/dist/interfaces/subscriptionConfigurationInterface.d.ts +3 -0
- package/dist/models/mongodb/subscriptionConfigurationModel.js +3 -0
- package/dist/models/psql/cloudStorageModel.js +10 -0
- package/dist/models/psql/coinPurchaseOfferModel.js +10 -0
- package/package.json +1 -1
|
@@ -13,7 +13,19 @@ exports.INSTITUTE_WORKING_DAY_DEFAULT_ATTRIBUTES = {
|
|
|
13
13
|
};
|
|
14
14
|
// export const DEFAULT_EXCLUDES_ATTRIBUTES = ['createdBy', 'updatedBy', 'createdAt', 'updatedAt'];
|
|
15
15
|
exports.DEFAULT_EXCLUDES_ATTRIBUTES = ['createdAt', 'updatedAt', 'deletedAt'];
|
|
16
|
-
exports.USER_BASIC_DETAIL = [
|
|
16
|
+
exports.USER_BASIC_DETAIL = [
|
|
17
|
+
'id',
|
|
18
|
+
'uuid',
|
|
19
|
+
'firstName',
|
|
20
|
+
'lastName',
|
|
21
|
+
'emailVerification',
|
|
22
|
+
'email',
|
|
23
|
+
'mobile',
|
|
24
|
+
'type',
|
|
25
|
+
'globalId',
|
|
26
|
+
'dob',
|
|
27
|
+
'bloodGroup',
|
|
28
|
+
];
|
|
17
29
|
exports.SUBJECT_FEE_BASIC_DETAIL = ['id', 'instituteId', 'subjectId', 'fee'];
|
|
18
30
|
exports.FEE_COLLECTION_BASIC_DETAIL = ['id', 'feeAmount', 'discount', 'status', 'paidFee'];
|
|
19
31
|
exports.INSTITUTE_BASIC_DETAIL = ['id', 'name', 'status', 'email', 'addressLine1', 'addressLine2', 'pinCode', 'coverImage', 'profileImage'];
|
package/dist/db/psql/migrations/20260414112026-add_app_type_and_user_type_coin_an_storage_model.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('coin_purchase_offers');
|
|
4
|
+
if (!table.app_type) {
|
|
5
|
+
await queryInterface.addColumn('coin_purchase_offers', 'app_type', {
|
|
6
|
+
type: Sequelize.STRING,
|
|
7
|
+
allowNull: true,
|
|
8
|
+
field: 'app_type',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!table.user_type) {
|
|
12
|
+
await queryInterface.addColumn('coin_purchase_offers', 'user_type', {
|
|
13
|
+
type: Sequelize.STRING,
|
|
14
|
+
allowNull: true,
|
|
15
|
+
field: 'user_type',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const table1 = await queryInterface.describeTable('cloud_storage');
|
|
19
|
+
if (!table1.app_type) {
|
|
20
|
+
await queryInterface.addColumn('cloud_storage', 'app_type', {
|
|
21
|
+
type: Sequelize.STRING,
|
|
22
|
+
allowNull: true,
|
|
23
|
+
field: 'app_type',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (!table1.user_type) {
|
|
27
|
+
await queryInterface.addColumn('cloud_storage', 'user_type', {
|
|
28
|
+
type: Sequelize.STRING,
|
|
29
|
+
allowNull: true,
|
|
30
|
+
field: 'user_type',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const down = async (queryInterface) => {
|
|
35
|
+
const table = await queryInterface.describeTable('coin_purchase_offers');
|
|
36
|
+
// Remove only if column exists
|
|
37
|
+
if (table.app_type) {
|
|
38
|
+
await queryInterface.removeColumn('coin_purchase_offers', 'app_type');
|
|
39
|
+
}
|
|
40
|
+
if (table.user_type) {
|
|
41
|
+
await queryInterface.removeColumn('coin_purchase_offers', 'user_type');
|
|
42
|
+
}
|
|
43
|
+
const table1 = await queryInterface.describeTable('cloud_storage');
|
|
44
|
+
// Remove only if column exists
|
|
45
|
+
if (table1.app_type) {
|
|
46
|
+
await queryInterface.removeColumn('cloud_storage', 'app_type');
|
|
47
|
+
}
|
|
48
|
+
if (table1.user_type) {
|
|
49
|
+
await queryInterface.removeColumn('cloud_storage', 'user_type');
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
module.exports = {
|
|
53
|
+
up,
|
|
54
|
+
down,
|
|
55
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMMAN_STATUS, DISCOUNT_TYPE, VALID_CURRENCY } from '../constants/app';
|
|
1
|
+
import { APP_TYPE, COMMAN_STATUS, DISCOUNT_TYPE, USER_TYPES, VALID_CURRENCY } from '../constants/app';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
3
|
export interface ICloudStorageModelAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
@@ -13,4 +13,6 @@ export interface ICloudStorageModelAttributes extends IDefaultAttributes {
|
|
|
13
13
|
isDefault: boolean;
|
|
14
14
|
status: COMMAN_STATUS;
|
|
15
15
|
validityInDays: number;
|
|
16
|
+
appType: APP_TYPE;
|
|
17
|
+
userType: USER_TYPES;
|
|
16
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMMAN_STATUS, DISCOUNT_TYPE } from '../constants/app';
|
|
1
|
+
import { APP_TYPE, COMMAN_STATUS, DISCOUNT_TYPE, USER_TYPES } from '../constants/app';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
3
|
export interface ICoinPurchaseOfferModelAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
@@ -13,4 +13,6 @@ export interface ICoinPurchaseOfferModelAttributes extends IDefaultAttributes {
|
|
|
13
13
|
gstCharge: number;
|
|
14
14
|
payableAmount: number;
|
|
15
15
|
gstPercentage: number;
|
|
16
|
+
appType: APP_TYPE;
|
|
17
|
+
userType: USER_TYPES;
|
|
16
18
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Document } from 'mongoose';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
|
+
import { APP_TYPE, USER_TYPES } from '../constants';
|
|
3
4
|
export interface ISubscriptionConfigurationBaseInterface {
|
|
4
5
|
uuid: string;
|
|
5
6
|
coinPurchaseGstPercentage: number;
|
|
@@ -8,6 +9,8 @@ export interface ISubscriptionConfigurationBaseInterface {
|
|
|
8
9
|
storageCoinsPerGb: number;
|
|
9
10
|
updatedTime: Date;
|
|
10
11
|
pricePerCoin: number;
|
|
12
|
+
appType: APP_TYPE;
|
|
13
|
+
userType: USER_TYPES;
|
|
11
14
|
}
|
|
12
15
|
export interface ISubscriptionConfigurationModelAttributes extends ISubscriptionConfigurationBaseInterface, IDefaultAttributes, Document {
|
|
13
16
|
id: string;
|
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
const constants_1 = require("../../constants");
|
|
37
38
|
const historySchema = new mongoose_1.Schema({
|
|
38
39
|
coinPurchaseGstPercentage: { type: Number, required: true },
|
|
39
40
|
initialFreeCoin: { type: Number, required: true },
|
|
@@ -50,6 +51,8 @@ const subscriptionConfigurationModelSchema = new mongoose_1.Schema({
|
|
|
50
51
|
storageCoinsPerGb: { type: Number, required: true },
|
|
51
52
|
pricePerCoin: { type: Number, required: true },
|
|
52
53
|
uuid: { type: String, required: true },
|
|
54
|
+
appType: { type: String, enum: constants_1.APP_TYPE, required: true },
|
|
55
|
+
userType: { type: String, enum: constants_1.USER_TYPES, required: true },
|
|
53
56
|
history: {
|
|
54
57
|
type: [historySchema],
|
|
55
58
|
required: false,
|
|
@@ -82,6 +82,16 @@ CloudStorageModel.init({
|
|
|
82
82
|
field: 'validity_in_days',
|
|
83
83
|
allowNull: false,
|
|
84
84
|
},
|
|
85
|
+
appType: {
|
|
86
|
+
type: sequelize_1.DataTypes.STRING,
|
|
87
|
+
allowNull: true,
|
|
88
|
+
field: 'app_type',
|
|
89
|
+
},
|
|
90
|
+
userType: {
|
|
91
|
+
type: sequelize_1.DataTypes.STRING,
|
|
92
|
+
allowNull: true,
|
|
93
|
+
field: 'user_type',
|
|
94
|
+
},
|
|
85
95
|
}, {
|
|
86
96
|
modelName: 'CloudStorageModel',
|
|
87
97
|
tableName: 'cloud_storage',
|
|
@@ -83,6 +83,16 @@ CoinPurchaseOfferModel.init({
|
|
|
83
83
|
field: 'payable_amount',
|
|
84
84
|
allowNull: false,
|
|
85
85
|
},
|
|
86
|
+
appType: {
|
|
87
|
+
type: sequelize_1.DataTypes.STRING,
|
|
88
|
+
allowNull: true,
|
|
89
|
+
field: 'app_type',
|
|
90
|
+
},
|
|
91
|
+
userType: {
|
|
92
|
+
type: sequelize_1.DataTypes.STRING,
|
|
93
|
+
allowNull: true,
|
|
94
|
+
field: 'user_type',
|
|
95
|
+
},
|
|
86
96
|
}, {
|
|
87
97
|
modelName: 'CoinPurchaseOfferModel',
|
|
88
98
|
tableName: 'coin_purchase_offers',
|
package/package.json
CHANGED