@kipicore/dbcore 1.1.583 → 1.1.585

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,4 +1,4 @@
1
- import { Document, Types } from 'mongoose';
1
+ import { Document } from 'mongoose';
2
2
  import { IDefaultAttributes } from './commonInterface';
3
3
  import { FINAL_RESULT, GRADE } from '../constants';
4
4
  export interface IUserFinalResultSubjectSchema {
@@ -9,6 +9,7 @@ export interface IUserFinalResultSubjectSchema {
9
9
  grade: GRADE;
10
10
  grMarks?: number;
11
11
  disMarks?: number;
12
+ subjectId: string;
12
13
  [key: string]: any;
13
14
  }
14
15
  export interface IUserFinalResultModelAttributes extends IDefaultAttributes, Document {
@@ -20,11 +21,12 @@ export interface IUserFinalResultModelAttributes extends IDefaultAttributes, Doc
20
21
  rank: number;
21
22
  result: FINAL_RESULT;
22
23
  userId: string;
23
- userInstituteMetaId: Types.ObjectId;
24
+ userInstituteMetaId: string;
24
25
  subjects: IUserFinalResultSubjectSchema[];
25
26
  standard: string;
26
27
  standardId: string;
27
28
  batchId: string;
28
29
  instituteId: string;
29
30
  academicCalendarId: string;
31
+ markSheetConfigurationId: string;
30
32
  }
@@ -41,8 +41,9 @@ const subjectSchema = new mongoose_1.Schema({
41
41
  pass: { type: Number, required: true },
42
42
  obtained: { type: Number, required: true },
43
43
  grade: { type: String, enum: Object.values(constants_1.GRADE), required: true },
44
- grMarks: { type: Number, required: false },
45
- disMarks: { type: Number, required: false },
44
+ grMarks: { type: Number, required: false, default: 0 },
45
+ disMarks: { type: Number, required: false, default: 0 },
46
+ subjectId: { type: String, required: true },
46
47
  }, { _id: false, strict: false });
47
48
  const userFinalResultSchema = new mongoose_1.Schema({
48
49
  totalMarks: { type: Number, required: true },
@@ -53,13 +54,14 @@ const userFinalResultSchema = new mongoose_1.Schema({
53
54
  rank: { type: Number, required: true },
54
55
  result: { type: String, enum: Object.values(constants_1.FINAL_RESULT), required: true },
55
56
  userId: { type: String, required: true },
56
- userInstituteMetaId: { type: mongoose_1.Schema.Types.ObjectId, required: true },
57
+ userInstituteMetaId: { type: String, required: true },
57
58
  subjects: { type: [subjectSchema], required: true },
58
59
  standard: { type: String, required: true },
59
60
  standardId: { type: String, required: true },
60
61
  batchId: { type: String, required: true },
61
62
  instituteId: { type: String, required: true },
62
63
  academicCalendarId: { type: String, required: true },
64
+ markSheetConfigurationId: { type: String, required: true },
63
65
  }, {
64
66
  timestamps: true,
65
67
  versionKey: false,
@@ -44,6 +44,8 @@ export type Subject = {
44
44
  pass: number;
45
45
  obtained: number;
46
46
  grade: GRADE;
47
+ grMarks: number;
48
+ disMarks: number;
47
49
  [key: string]: string | number;
48
50
  };
49
51
  export type Summary = {
@@ -54,6 +56,7 @@ export type Summary = {
54
56
  overallGrade: GRADE;
55
57
  rank: number;
56
58
  result: FINAL_RESULT;
59
+ [key: string]: string | number;
57
60
  };
58
61
  export type Teacher = {
59
62
  classTeacher: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.583",
3
+ "version": "1.1.585",
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",