Skip to content

Commit

Permalink
Merge pull request tekdi#31 from ManojNathIC/main
Browse files Browse the repository at this point in the history
de-duplication fixes
  • Loading branch information
ManojNathIC authored Dec 16, 2024
2 parents b34fe72 + 27f53ec commit e2a2e97
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 207 deletions.
67 changes: 34 additions & 33 deletions schemas/Examiner.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": { "Examiner": { "$ref": "#/definitions/Examiner" } },
"required": ["Examiner"],
"title": "Examiner",
"definitions": {
"Examiner": {
"$id": "#/properties/Examiner",
"type": "object",
"title": "Examinerschema",
"required": ["name", "email", "phoneNumber", "password"],
"uniqueIndexFields": ["email"],
"properties": {
"name": {"type": "string", "title": "Name"},
"email": { "type": "string", "title": "Email" },
"phoneNumber": { "type": "string", "title": "Phone Number" },
"status": { "type": "string", "title": "Status" },
"password": { "type": "string", "minLength": 8, "title": "Password" }
}
}
},
"_osConfig": {
"ownershipAttributes": [
{
"email": "/email",
"mobile": "/phoneNumber",
"userId": "/email",
"password": "/password"
}
],
"inviteRoles": ["anonymous"]
}
}
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": { "Examiner": { "$ref": "#/definitions/Examiner" } },
"required": ["Examiner"],
"title": "Examiner",
"definitions": {
"Examiner": {
"$id": "#/properties/Examiner",
"type": "object",
"title": "Examinerschema",
"required": ["name", "email", "phoneNumber", "password"],
"uniqueIndexFields": ["email"],
"properties": {
"name": { "type": "string", "title": "Name" },
"email": { "type": "string", "title": "Email" },
"phoneNumber": { "type": "string", "title": "Phone Number" },
"status": { "type": "string", "title": "Status" },
"password": { "type": "string", "minLength": 8, "title": "Password" }
}
}
},
"_osConfig": {
"ownershipAttributes": [
{
"email": "/email",
"mobile": "/phoneNumber",
"userId": "/email",
"password": "/password"
}
],
"inviteRoles": ["anonymous"],
"uniqueIndexFields": ["email"]
}
}
66 changes: 33 additions & 33 deletions schemas/Inspector.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": { "Inspector": { "$ref": "#/definitions/Inspector" } },
"required": ["Inspector"],
"title": "Inspector",
"definitions": {
"Inspector": {
"$id": "#/properties/Inspector",
"type": "object",
"title": "Inspectorschema",
"required": ["name", "email", "phoneNumber", "password"],
"uniqueIndexFields": ["email"],
"properties": {
"name": {"type": "string", "title": "Name"},
"email": { "type": "string", "title": "Email" },
"phoneNumber": { "type": "string", "title": "Phone Number" },
"status": { "type": "string", "title": "Status" },
"password": { "type": "string", "minLength": 8, "title": "Password" }
}
}
},
"_osConfig": {
"ownershipAttributes": [
{
"email": "/email",
"mobile": "/phoneNumber",
"userId": "/email",
"password": "/password"
}
],
"inviteRoles": ["anonymous"]
}
}
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": { "Inspector": { "$ref": "#/definitions/Inspector" } },
"required": ["Inspector"],
"title": "Inspector",
"definitions": {
"Inspector": {
"$id": "#/properties/Inspector",
"type": "object",
"title": "Inspectorschema",
"required": ["name", "email", "phoneNumber", "password"],
"properties": {
"name": { "type": "string", "title": "Name" },
"email": { "type": "string", "title": "Email" },
"phoneNumber": { "type": "string", "title": "Phone Number" },
"status": { "type": "string", "title": "Status" },
"password": { "type": "string", "minLength": 8, "title": "Password" }
}
}
},
"_osConfig": {
"ownershipAttributes": [
{
"email": "/email",
"mobile": "/phoneNumber",
"userId": "/email",
"password": "/password"
}
],
"inviteRoles": ["anonymous"],
"uniqueIndexFields": ["email"]
}
}
6 changes: 4 additions & 2 deletions schemas/Student.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"school",
"password"
],
"uniqueIndexFields": ["email", "nin"],

"properties": {
"uniqueId": { "type": "string", "title": "Student unique Id" },
"studentId": { "type": "string", "title": "Student Id" },
"studentJssId": {
"type": "string",
Expand Down Expand Up @@ -50,6 +51,7 @@
"password": "/password"
}
],
"inviteRoles": ["anonymous"]
"inviteRoles": ["anonymous"],
"uniqueIndexFields": ["uniqueId"]
}
}
7 changes: 4 additions & 3 deletions schemas/casteCertificate.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"dateOfIssuance",
"certificateNumber"
],
"uniqueIndexFields": ["studentId"],
"properties": {
"uniqueId": { "type": "string", "title": "Student unique Id" },
"studentId": {
"type": "string",
"title": "Student Identifier"
Expand All @@ -39,7 +39,7 @@
"relationWithApplicant": {
"type": "string",
"title": "Relation with Applicant"
},
},
"firstName": {
"type": "string",
"title": "First Name"
Expand Down Expand Up @@ -136,6 +136,7 @@
}
},
"_osConfig": {
"inviteRoles": ["anonymous"]
"inviteRoles": ["anonymous"],
"uniqueIndexFields": ["uniqueId"]
}
}
22 changes: 15 additions & 7 deletions schemas/marksheet.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,34 @@
}
},
"required": ["marksheet"],
"title": "Marksheet",
"title": "marksheet",
"definitions": {
"marksheet": {
"$id": "#/properties/marksheet",
"type": "object",
"title": "marksheetSchema",
"required": [
"uniqueId",
"studentId",
"firstName",
"schoolUniqueCode",
"schoolId",
"schoolName",
"examDate",
"academicYear",
"issuerName"
],
"uniqueIndexFields": ["studentId"],

"properties": {
"studentId": {
"type": "string",
"title": "Student Identifier"
},
"SchoolId": {
"uniqueId": {
"type": "string",
"title": "School Identifier"
"title": "Unique ID",
"unique": true
},

"firstName": {
"type": "string",
"title": "First Name"
Expand All @@ -44,7 +47,7 @@
"type": "string",
"title": "Last Name"
},
"schoolUniqueCode": {
"schoolId": {
"type": "string",
"title": "School Identifier"
},
Expand Down Expand Up @@ -96,6 +99,10 @@
"type": "string",
"title": "Name of Issuer"
},
"issuanceDate": {
"type": "string",
"title": "Issuance Date"
},
"certificateId": {
"type": "string",
"title": "Certificate Id"
Expand All @@ -108,6 +115,7 @@
}
},
"_osConfig": {
"inviteRoles": ["anonymous"]
"inviteRoles": ["anonymous"],
"uniqueIndexFields": ["uniqueId"]
}
}
18 changes: 18 additions & 0 deletions src/Helper/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export const tenMarksheetTransformer = (data) => {
export const marksheet = (data) => {
return data?.map((record) => {
return {
uniqueId: `${record.schoolId?.trim() || ''}-${
record.studentUniqueId?.trim() || ''
}-${record.class?.trim() || ''}`,
studentId: record.studentUniqueId,
firstName: record.firstName,
middleName: record.middleName,
Expand Down Expand Up @@ -85,6 +88,9 @@ export const marksheet = (data) => {
export const enrollmentCertificate = (data) => {
return data.map((record) => {
return {
uniqueId: `${record.schoolId?.trim() || ''}-${
record.studentUniqueId?.trim() || ''
}-${record.class?.trim() || ''}`,
studentId: record.studentUniqueId,
schoolId: record.schoolId,
firstName: record.firstName,
Expand Down Expand Up @@ -123,6 +129,9 @@ export const enrollmentCertificate = (data) => {
export const casteCertificate = (data) => {
return data.map((record) => {
return {
uniqueId: `${record.schoolId?.trim() || ''}-${
record.studentUniqueId?.trim() || ''
}`,
familyLeaderBhamashahNumber: record.familyLeaderBhamashahNumber,
relationWithApplicant: record.relationWithApplicant,
studentId: record.studentUniqueId,
Expand Down Expand Up @@ -174,6 +183,9 @@ export const casteCertificate = (data) => {
export const sportsParticipationCertificate = (data) => {
return data.map((record) => {
return {
uniqueId: `${record.schoolId?.trim() || ''}-${
record.studentUniqueId?.trim() || ''
}-${record.class?.trim() || ''}`,
studentId: record.studentUniqueId,
schoolId: record.schoolId,
firstName: record.firstName,
Expand Down Expand Up @@ -224,6 +236,9 @@ export const sportsParticipationCertificate = (data) => {
export const janAadharCertificate = (data) => {
return data.map((record) => {
return {
uniqueId: `${record.schoolId?.trim() || ''}-${
record.studentUniqueId?.trim() || ''
}`,
studentId: record.studentUniqueId,
schoolId: record.schoolId,
schoolName: record.schoolName,
Expand Down Expand Up @@ -260,6 +275,9 @@ export const janAadharCertificate = (data) => {
export const incomeCertificate = (data) => {
return data?.map((record) => {
return {
uniqueId: `${record.schoolId?.trim() || ''}-${
record.studentUniqueId?.trim() || ''
}`,
studentId: record.studentUniqueId,
schoolId: record.schoolId,
schoolName: record.schoolName,
Expand Down
1 change: 1 addition & 0 deletions src/examiner/examiner.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class ExaminerController {
})
.on('end', async () => {
const data = await this.examinerService.uploadResult(
authToken,
results,
documentType,
);
Expand Down
Loading

0 comments on commit e2a2e97

Please sign in to comment.