@kipicore/dbcore 1.1.134 → 1.1.136

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.
@@ -1220,5 +1220,7 @@ export declare enum POLL_SELECTION_ERROR_MESSAGES {
1220
1220
  GET_FAIL = "Unable to retrieve Poll selection data!",
1221
1221
  UPDATE_FAIL = "Unable to update Poll selection data!",
1222
1222
  DELETE_FAIL = "Unable to delete Poll selection data!",
1223
- NOT_FOUND = "Unable to find Poll selection data!"
1223
+ NOT_FOUND = "Unable to find Poll selection data!",
1224
+ EXIST_POLL_OPTION = "You have already selected this option for the poll",
1225
+ MAX_OPTION_ERROR = "You have reached the maximum number of options allowed for this poll."
1224
1226
  }
@@ -1355,4 +1355,6 @@ var POLL_SELECTION_ERROR_MESSAGES;
1355
1355
  POLL_SELECTION_ERROR_MESSAGES["UPDATE_FAIL"] = "Unable to update Poll selection data!";
1356
1356
  POLL_SELECTION_ERROR_MESSAGES["DELETE_FAIL"] = "Unable to delete Poll selection data!";
1357
1357
  POLL_SELECTION_ERROR_MESSAGES["NOT_FOUND"] = "Unable to find Poll selection data!";
1358
+ POLL_SELECTION_ERROR_MESSAGES["EXIST_POLL_OPTION"] = "You have already selected this option for the poll";
1359
+ POLL_SELECTION_ERROR_MESSAGES["MAX_OPTION_ERROR"] = "You have reached the maximum number of options allowed for this poll.";
1358
1360
  })(POLL_SELECTION_ERROR_MESSAGES || (exports.POLL_SELECTION_ERROR_MESSAGES = POLL_SELECTION_ERROR_MESSAGES = {}));
@@ -836,5 +836,6 @@ export declare enum POLL_SELECTION_SUCCESS_MESSAGES {
836
836
  CREATE_SUCCESS = "Poll selection data saved successfully!",
837
837
  GET_SUCCESS = "Poll selection data retrieved successfully!",
838
838
  UPDATE_SUCCESS = "Poll selection data updated successfully!",
839
- DELETE_SUCCESS = "Poll selection data deleted successfully!"
839
+ DELETE_SUCCESS = "Poll selection data deleted successfully!",
840
+ BULK_UPSERT_SUCCESS = "Poll selection bulk upsert successfully!"
840
841
  }
@@ -974,4 +974,5 @@ var POLL_SELECTION_SUCCESS_MESSAGES;
974
974
  POLL_SELECTION_SUCCESS_MESSAGES["GET_SUCCESS"] = "Poll selection data retrieved successfully!";
975
975
  POLL_SELECTION_SUCCESS_MESSAGES["UPDATE_SUCCESS"] = "Poll selection data updated successfully!";
976
976
  POLL_SELECTION_SUCCESS_MESSAGES["DELETE_SUCCESS"] = "Poll selection data deleted successfully!";
977
+ POLL_SELECTION_SUCCESS_MESSAGES["BULK_UPSERT_SUCCESS"] = "Poll selection bulk upsert successfully!";
977
978
  })(POLL_SELECTION_SUCCESS_MESSAGES || (exports.POLL_SELECTION_SUCCESS_MESSAGES = POLL_SELECTION_SUCCESS_MESSAGES = {}));
@@ -34,7 +34,7 @@ const down = async (queryInterface, Sequelize) => {
34
34
  if (table.batch_type) {
35
35
  await queryInterface.removeColumn('subject_has_fee', 'batch_type');
36
36
  }
37
- if (table.academic_calender_id) {
37
+ if (table.academic_calendar_id) {
38
38
  await queryInterface.removeColumn('subject_has_fee', 'academic_calendar_id');
39
39
  }
40
40
  };
@@ -3,7 +3,7 @@ import { IDefaultAttributes } from './commonInterface';
3
3
  export interface IPollSelectionAttributes extends IDefaultAttributes, Document {
4
4
  id: string;
5
5
  pollId: string;
6
- userId: string[];
6
+ userId: string;
7
7
  optionId: string;
8
8
  academicCalendarId: string;
9
9
  instituteId: string;
@@ -40,7 +40,7 @@ const PollSelectionSchema = new mongoose_1.Schema({
40
40
  required: true,
41
41
  },
42
42
  userId: {
43
- type: [String],
43
+ type: String,
44
44
  required: true,
45
45
  },
46
46
  optionId: {
@@ -80,17 +80,16 @@ class TypeManagementModel extends sequelize_1.Model {
80
80
  throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
81
81
  }
82
82
  }
83
- if (type.title && type.instituteId && type.type) {
84
- const typeExist = await TypeManagementModel.findOne({
85
- where: {
86
- title: type.title,
87
- instituteId: type.instituteId,
88
- type: type.type,
89
- },
90
- });
91
- if (typeExist)
92
- throw new Error(errorMessages_1.TYPE_MANAGEMENT_ERROR_MESSAGES.TYPE_ALREADY_EXISTS);
93
- }
83
+ // if (type.title && type.instituteId && type.type) {
84
+ // const typeExist = await TypeManagementModel.findOne({
85
+ // where: {
86
+ // title: type.title,
87
+ // instituteId: type.instituteId,
88
+ // type: type.type,
89
+ // },
90
+ // });
91
+ // if (typeExist) throw new Error(TYPE_MANAGEMENT_ERROR_MESSAGES.TYPE_ALREADY_EXISTS);
92
+ // }
94
93
  };
95
94
  TypeManagementModel.beforeCreate(beforeCreateOrUpdateHook);
96
95
  TypeManagementModel.beforeBulkUpdate(async (options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.134",
3
+ "version": "1.1.136",
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",