@neutron.co.id/pendidikan-operation 1.26.10 → 1.26.13
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.
|
@@ -20,12 +20,18 @@ function useImportData(stream) {
|
|
|
20
20
|
for (const grading of input.gradings) {
|
|
21
21
|
const student = studentMap.get(grading?.userId) || studentMap.get(grading?.nis) || studentMap.get(grading?.stageId) || studentMap.get(grading?.branchId);
|
|
22
22
|
const { userId, nis, name, institution, remark, ...scores } = grading;
|
|
23
|
+
const parsedScores = Object.fromEntries(
|
|
24
|
+
Object.entries(scores).map(([key, value]) => {
|
|
25
|
+
const normalizedValue = Number.parseFloat(String(value).replace(",", "."));
|
|
26
|
+
return [key, Number.isNaN(normalizedValue) ? null : normalizedValue];
|
|
27
|
+
})
|
|
28
|
+
);
|
|
23
29
|
const scoreImport = {
|
|
24
30
|
userId,
|
|
25
31
|
nis,
|
|
26
32
|
name,
|
|
27
33
|
institution,
|
|
28
|
-
scores
|
|
34
|
+
scores: parsedScores
|
|
29
35
|
};
|
|
30
36
|
const description = utils.StringUtil.joinIfDefined([student?.name || name, institution, remark], " | ");
|
|
31
37
|
const note = utils.StringUtil.joinIfDefined([student?.name || name, student?.nis || nis, institution, remark, ...Object.entries(scores).map((score) => {
|
|
@@ -18,12 +18,18 @@ function useImportData(stream) {
|
|
|
18
18
|
for (const grading of input.gradings) {
|
|
19
19
|
const student = studentMap.get(grading?.userId) || studentMap.get(grading?.nis) || studentMap.get(grading?.stageId) || studentMap.get(grading?.branchId);
|
|
20
20
|
const { userId, nis, name, institution, remark, ...scores } = grading;
|
|
21
|
+
const parsedScores = Object.fromEntries(
|
|
22
|
+
Object.entries(scores).map(([key, value]) => {
|
|
23
|
+
const normalizedValue = Number.parseFloat(String(value).replace(",", "."));
|
|
24
|
+
return [key, Number.isNaN(normalizedValue) ? null : normalizedValue];
|
|
25
|
+
})
|
|
26
|
+
);
|
|
21
27
|
const scoreImport = {
|
|
22
28
|
userId,
|
|
23
29
|
nis,
|
|
24
30
|
name,
|
|
25
31
|
institution,
|
|
26
|
-
scores
|
|
32
|
+
scores: parsedScores
|
|
27
33
|
};
|
|
28
34
|
const description = StringUtil.joinIfDefined([student?.name || name, institution, remark], " | ");
|
|
29
35
|
const note = StringUtil.joinIfDefined([student?.name || name, student?.nis || nis, institution, remark, ...Object.entries(scores).map((score) => {
|
|
@@ -22,12 +22,17 @@ function usePenilaian(stream) {
|
|
|
22
22
|
await prepareScoreComponentMapper(stream2, grading);
|
|
23
23
|
gradingUpdates.push(grading);
|
|
24
24
|
}
|
|
25
|
-
console.log("grading", gradings);
|
|
26
25
|
await updateManyGradings(stream2, gradingUpdates);
|
|
27
26
|
}
|
|
28
27
|
async function prepareScoreComponentMapper(stream2, grading) {
|
|
29
28
|
utils.guard(stream2, "streamRequired");
|
|
30
|
-
const
|
|
29
|
+
const parsedScores = Object.fromEntries(
|
|
30
|
+
Object.entries(grading?.data?.import?.scores).map(([key, value]) => {
|
|
31
|
+
const normalizedValue = Number.parseFloat(String(value).replace(",", "."));
|
|
32
|
+
return [key, Number.isNaN(normalizedValue) ? null : normalizedValue];
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
const score = parsedScores;
|
|
31
36
|
const gradingComponent = await _getManyGradingComponents(stream2, { gradingTypeId: grading?.gradingTypeId, score });
|
|
32
37
|
const gradingComponentMap = gradingComponent.map((item) => ({
|
|
33
38
|
...item,
|
|
@@ -73,7 +78,7 @@ function usePenilaian(stream) {
|
|
|
73
78
|
const result = await stream2.actions.data.getMany.execute({
|
|
74
79
|
model: "neu:penilaian:grading",
|
|
75
80
|
query: query.Query.define({
|
|
76
|
-
filter: { gradingTypeId: input.gradingTypeId, createdAt: { $gt: /* @__PURE__ */ new Date("2024-12-27T00:00:00Z") }, refreshAmount: null },
|
|
81
|
+
filter: { gradingTypeId: input.gradingTypeId, createdAt: { $gt: /* @__PURE__ */ new Date("2024-12-27T00:00:00Z") }, refreshAmount: null, data: { $exists: true } },
|
|
77
82
|
limit: constants.LIMIT_INFINITY,
|
|
78
83
|
fields: {
|
|
79
84
|
id: 1,
|
|
@@ -20,12 +20,17 @@ function usePenilaian(stream) {
|
|
|
20
20
|
await prepareScoreComponentMapper(stream2, grading);
|
|
21
21
|
gradingUpdates.push(grading);
|
|
22
22
|
}
|
|
23
|
-
console.log("grading", gradings);
|
|
24
23
|
await updateManyGradings(stream2, gradingUpdates);
|
|
25
24
|
}
|
|
26
25
|
async function prepareScoreComponentMapper(stream2, grading) {
|
|
27
26
|
guard(stream2, "streamRequired");
|
|
28
|
-
const
|
|
27
|
+
const parsedScores = Object.fromEntries(
|
|
28
|
+
Object.entries(grading?.data?.import?.scores).map(([key, value]) => {
|
|
29
|
+
const normalizedValue = Number.parseFloat(String(value).replace(",", "."));
|
|
30
|
+
return [key, Number.isNaN(normalizedValue) ? null : normalizedValue];
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
const score = parsedScores;
|
|
29
34
|
const gradingComponent = await _getManyGradingComponents(stream2, { gradingTypeId: grading?.gradingTypeId, score });
|
|
30
35
|
const gradingComponentMap = gradingComponent.map((item) => ({
|
|
31
36
|
...item,
|
|
@@ -71,7 +76,7 @@ function usePenilaian(stream) {
|
|
|
71
76
|
const result = await stream2.actions.data.getMany.execute({
|
|
72
77
|
model: "neu:penilaian:grading",
|
|
73
78
|
query: Query.define({
|
|
74
|
-
filter: { gradingTypeId: input.gradingTypeId, createdAt: { $gt: /* @__PURE__ */ new Date("2024-12-27T00:00:00Z") }, refreshAmount: null },
|
|
79
|
+
filter: { gradingTypeId: input.gradingTypeId, createdAt: { $gt: /* @__PURE__ */ new Date("2024-12-27T00:00:00Z") }, refreshAmount: null, data: { $exists: true } },
|
|
75
80
|
limit: LIMIT_INFINITY,
|
|
76
81
|
fields: {
|
|
77
82
|
id: 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neutron.co.id/pendidikan-operation",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.13",
|
|
4
4
|
"description": "Operation package of Neutron Pendidikan.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"contributors": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@neon.id/utils": "^1.52.0",
|
|
41
41
|
"@neon.id/z": "^1.16.0",
|
|
42
42
|
"@neutron.co.id/akademik-models": "^1.19.9",
|
|
43
|
-
"@neutron.co.id/jadwal-models": "^1.19.
|
|
43
|
+
"@neutron.co.id/jadwal-models": "^1.19.5",
|
|
44
44
|
"@neutron.co.id/pendidikan-types": "^1.22.8",
|
|
45
45
|
"@neutron.co.id/penilaian-models": "^1.17.5",
|
|
46
46
|
"@neutron.co.id/personalia-models": "^1.11.6",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@neon.id/utils": "^1.52.0",
|
|
75
75
|
"@neon.id/z": "^1.16.0",
|
|
76
76
|
"@neutron.co.id/akademik-models": "^1.19.9",
|
|
77
|
-
"@neutron.co.id/jadwal-models": "^1.19.
|
|
77
|
+
"@neutron.co.id/jadwal-models": "^1.19.5",
|
|
78
78
|
"@neutron.co.id/pendidikan-types": "^1.22.8",
|
|
79
79
|
"@neutron.co.id/penilaian-models": "^1.17.5",
|
|
80
80
|
"@neutron.co.id/personalia-models": "^1.11.6",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"build":
|
|
86
|
+
"build": 99
|
|
87
87
|
}
|