Skip to content

Commit df8cfac

Browse files
committed
feat: add update academic score
1 parent 508ab5e commit df8cfac

2 files changed

Lines changed: 32 additions & 5 deletions

File tree

src/modules/staff-total-score/calculate-score.service.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export class CalculateScoreService {
1717
const calRegis = await this.calculateRegisScore(appId).catch((e) => {
1818
throw e;
1919
});
20-
// const calAcademic = await this.calculateAcademicScore(appId).catch((e) => {
21-
// throw e;
22-
// });
20+
const calAcademic = await this.calculateAcademicScore(appId).catch((e) => {
21+
throw e;
22+
});
2323
const calAcademicChaos = await this.calculateAcademicChaosScore(appId).catch((e) => {
2424
throw e;
2525
});
@@ -33,19 +33,28 @@ export class CalculateScoreService {
3333
},
3434
update: {
3535
std_regis_score: calRegis,
36-
// std_academic_score: calAcademic,
36+
std_academic_score: calAcademic,
3737
std_academic_chaos_score: calAcademicChaos,
3838
std_total_score: calTotal,
3939
},
4040
create: {
4141
std_application_id: appId,
4242
std_regis_score: calRegis,
43-
// std_academic_score: calAcademic,
43+
std_academic_score: calAcademic,
4444
std_academic_chaos_score: calAcademicChaos,
4545
std_total_score: calTotal,
4646
},
4747
});
4848

49+
// const updateAcademicScore = await this.prisma.applicationTotalScore.update({
50+
// where: {
51+
// std_application_id: appId
52+
// },
53+
// data: {
54+
// std_academic_score: calAcademic
55+
// }
56+
// })
57+
4958
return updateTotalScore;
5059
} catch (e) {
5160
this.logger.error(e);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { PrismaConnector } from "test/PrismaConnector";
2+
3+
class UpdateAcademicScore extends PrismaConnector {
4+
async run() {
5+
const getConfirmed = await this.prisma.studentApplication.findMany({
6+
where: {
7+
std_application_confirm: true,
8+
},
9+
select: {
10+
std_application_id: true,
11+
},
12+
});
13+
14+
// const updateScore = await
15+
}
16+
}
17+
18+
new UpdateAcademicScore().run();

0 commit comments

Comments
 (0)