@kipicore/dbcore 1.1.366 → 1.1.368

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.
@@ -1,11 +1,11 @@
1
1
  import { Document } from 'mongoose';
2
- import { FEE_REMINDER_SETTING_FREQUENCY, FEE_REMINDER_SETTING_TYPE } from '../constants/app';
2
+ import { FEE_REMINDER_SETTING_TYPE } from '../constants/app';
3
3
  import { IDefaultAttributes } from './commonInterface';
4
4
  export interface IFeeReminderTypeModelAttributes extends IDefaultAttributes, Document {
5
5
  id: string;
6
6
  type: FEE_REMINDER_SETTING_TYPE;
7
7
  day: number;
8
- frequency: FEE_REMINDER_SETTING_FREQUENCY;
8
+ frequency: number[];
9
9
  instituteId: string;
10
10
  academicCalendarId?: string;
11
11
  oldId?: string;
@@ -46,8 +46,7 @@ const feeReminderTypeModelSchema = new mongoose_1.Schema({
46
46
  required: true,
47
47
  },
48
48
  frequency: {
49
- type: String,
50
- enum: Object.values(app_1.FEE_REMINDER_SETTING_FREQUENCY),
49
+ type: [Number],
51
50
  },
52
51
  instituteId: {
53
52
  type: String,
@@ -6,7 +6,7 @@ const errorMessages_1 = require("../../constants/errorMessages");
6
6
  const app_1 = require("../../constants/app");
7
7
  class FeeReminderModel extends sequelize_1.Model {
8
8
  static associate(models) {
9
- const { UserModel, InstituteModel, FeesCollectionModel, FeeReminderSettingModel, AcademicCalendarModel, } = models;
9
+ const { UserModel, InstituteModel, StudentFeeCollectionModel, FeeReminderSettingModel, AcademicCalendarModel } = models;
10
10
  FeeReminderModel.belongsTo(UserModel, {
11
11
  foreignKey: { name: 'userId', field: 'user_id' },
12
12
  as: 'reminderUser',
@@ -43,11 +43,11 @@ class FeeReminderModel extends sequelize_1.Model {
43
43
  foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
44
44
  as: 'deletedByUser',
45
45
  });
46
- FeeReminderModel.belongsTo(FeesCollectionModel, {
46
+ FeeReminderModel.belongsTo(StudentFeeCollectionModel, {
47
47
  foreignKey: { name: 'feeCollectionId', field: 'fee_collection_id' },
48
48
  as: 'feeCollection',
49
49
  });
50
- FeesCollectionModel.hasMany(FeeReminderModel, {
50
+ StudentFeeCollectionModel.hasMany(FeeReminderModel, {
51
51
  foreignKey: 'feeCollectionId',
52
52
  as: 'feeReminders',
53
53
  });
@@ -209,7 +209,7 @@ FeeReminderModel.init({
209
209
  academicCalendarId: {
210
210
  type: sequelize_1.DataTypes.UUID,
211
211
  allowNull: true,
212
- field: 'academic_calendar_id'
212
+ field: 'academic_calendar_id',
213
213
  },
214
214
  }, {
215
215
  modelName: 'FeeReminderModel',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.366",
3
+ "version": "1.1.368",
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",