@neutron.co.id/pendidikan-operation 1.26.7 → 1.26.8
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.
- package/build/actions/penilaian/index.d.ts +1 -0
- package/build/actions/penilaian/refreshManyGrading/index.d.ts +2 -0
- package/build/actions/penilaian/refreshManyGrading/refreshManyGrading.action.cjs +44 -0
- package/build/actions/penilaian/refreshManyGrading/refreshManyGrading.action.d.ts +12 -0
- package/build/actions/penilaian/refreshManyGrading/refreshManyGrading.action.mjs +42 -0
- package/build/actions/penilaian/refreshManyGrading/refreshManyGrading.schema.cjs +9 -0
- package/build/actions/penilaian/refreshManyGrading/refreshManyGrading.schema.d.ts +8 -0
- package/build/actions/penilaian/refreshManyGrading/refreshManyGrading.schema.mjs +7 -0
- package/build/index.cjs +5 -0
- package/build/index.d.ts +3 -0
- package/build/index.mjs +4 -1
- package/build/providers/penilaian/usePenilaian.cjs +50 -2
- package/build/providers/penilaian/usePenilaian.d.ts +3 -0
- package/build/providers/penilaian/usePenilaian.mjs +50 -2
- package/package.json +10 -10
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const core = require('@neon.id/core');
|
|
4
|
+
const operation = require('@neon.id/operation');
|
|
5
|
+
const utils = require('@neon.id/utils');
|
|
6
|
+
const refreshManyGrading_schema = require('./refreshManyGrading.schema.cjs');
|
|
7
|
+
const usePenilaian = require('../../../providers/penilaian/usePenilaian.cjs');
|
|
8
|
+
|
|
9
|
+
const refreshManyGrading = operation.Action.define({
|
|
10
|
+
key: "refreshManyGrading",
|
|
11
|
+
name: "Refresh Many Grading",
|
|
12
|
+
type: "command",
|
|
13
|
+
category: "domain",
|
|
14
|
+
execute: async (input, stream) => {
|
|
15
|
+
const { getActorId } = operation.useStream(stream);
|
|
16
|
+
const { validate } = operation.useValidation(stream, refreshManyGrading_schema.RefreshManyGradingSchema);
|
|
17
|
+
try {
|
|
18
|
+
const actorId = getActorId({ throw: true });
|
|
19
|
+
const data = validate(input);
|
|
20
|
+
const { prepareManyGradingScore } = usePenilaian.usePenilaian(stream);
|
|
21
|
+
actorId;
|
|
22
|
+
data;
|
|
23
|
+
utils.guard(stream, "streamRequired");
|
|
24
|
+
utils.guard(data.gradingTypeId, "gradingIdRequired");
|
|
25
|
+
await prepareManyGradingScore(stream, { gradingTypeId: data.gradingTypeId });
|
|
26
|
+
return core.Result.ok({
|
|
27
|
+
state: "refreshManyGrading",
|
|
28
|
+
message: "Refresh Grading has been sucessfully executedt.",
|
|
29
|
+
data: {}
|
|
30
|
+
});
|
|
31
|
+
} catch (error) {
|
|
32
|
+
if (error?.isFailure)
|
|
33
|
+
throw error;
|
|
34
|
+
console.error(error);
|
|
35
|
+
return core.Result.fail({
|
|
36
|
+
state: `refreshManyGradingFailed`,
|
|
37
|
+
message: `Failed to set refreshManyGrading.`,
|
|
38
|
+
error: error?.toString()
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
exports.refreshManyGrading = refreshManyGrading;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action } from '@neon.id/operation';
|
|
2
|
+
import type { z } from '@neon.id/z';
|
|
3
|
+
import { RefreshManyGradingSchema } from './refreshManyGrading.schema';
|
|
4
|
+
export type RefreshManyGradingInput = z.parse<typeof RefreshManyGradingSchema>;
|
|
5
|
+
export interface RefreshManyGradingOutput {
|
|
6
|
+
}
|
|
7
|
+
export interface RefreshManyGradingMeta {
|
|
8
|
+
}
|
|
9
|
+
export declare const refreshManyGrading: Action<"refreshManyGrading", {
|
|
10
|
+
gradingTypeId?: string | undefined;
|
|
11
|
+
}, RefreshManyGradingOutput, RefreshManyGradingMeta>;
|
|
12
|
+
export type RefreshManyGradingAction = typeof refreshManyGrading;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Result } from '@neon.id/core';
|
|
2
|
+
import { Action, useStream, useValidation } from '@neon.id/operation';
|
|
3
|
+
import { guard } from '@neon.id/utils';
|
|
4
|
+
import { RefreshManyGradingSchema } from './refreshManyGrading.schema.mjs';
|
|
5
|
+
import { usePenilaian } from '../../../providers/penilaian/usePenilaian.mjs';
|
|
6
|
+
|
|
7
|
+
const refreshManyGrading = Action.define({
|
|
8
|
+
key: "refreshManyGrading",
|
|
9
|
+
name: "Refresh Many Grading",
|
|
10
|
+
type: "command",
|
|
11
|
+
category: "domain",
|
|
12
|
+
execute: async (input, stream) => {
|
|
13
|
+
const { getActorId } = useStream(stream);
|
|
14
|
+
const { validate } = useValidation(stream, RefreshManyGradingSchema);
|
|
15
|
+
try {
|
|
16
|
+
const actorId = getActorId({ throw: true });
|
|
17
|
+
const data = validate(input);
|
|
18
|
+
const { prepareManyGradingScore } = usePenilaian(stream);
|
|
19
|
+
actorId;
|
|
20
|
+
data;
|
|
21
|
+
guard(stream, "streamRequired");
|
|
22
|
+
guard(data.gradingTypeId, "gradingIdRequired");
|
|
23
|
+
await prepareManyGradingScore(stream, { gradingTypeId: data.gradingTypeId });
|
|
24
|
+
return Result.ok({
|
|
25
|
+
state: "refreshManyGrading",
|
|
26
|
+
message: "Refresh Grading has been sucessfully executedt.",
|
|
27
|
+
data: {}
|
|
28
|
+
});
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (error?.isFailure)
|
|
31
|
+
throw error;
|
|
32
|
+
console.error(error);
|
|
33
|
+
return Result.fail({
|
|
34
|
+
state: `refreshManyGradingFailed`,
|
|
35
|
+
message: `Failed to set refreshManyGrading.`,
|
|
36
|
+
error: error?.toString()
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export { refreshManyGrading };
|
package/build/index.cjs
CHANGED
|
@@ -30,6 +30,7 @@ const setTravelWageSessions_action = require('./actions/jadwal/setTravelWageSess
|
|
|
30
30
|
const action_customSaveOneClassSession = require('./actions/jadwal/action.customSaveOneClassSession.cjs');
|
|
31
31
|
const action_getGradingCount = require('./actions/penilaian/getGradingCount/action.getGradingCount.cjs');
|
|
32
32
|
const refreshGrading_action = require('./actions/penilaian/refreshGrading/refreshGrading.action.cjs');
|
|
33
|
+
const refreshManyGrading_action = require('./actions/penilaian/refreshManyGrading/refreshManyGrading.action.cjs');
|
|
33
34
|
const action_addManyGradingComponent = require('./actions/rasionalisasi/action.addManyGradingComponent.cjs');
|
|
34
35
|
const action_calculateGrading = require('./actions/rasionalisasi/action.calculateGrading.cjs');
|
|
35
36
|
const action_calculateManyComparator = require('./actions/rasionalisasi/action.calculateManyComparator.cjs');
|
|
@@ -57,6 +58,7 @@ const setTravelWageSessions_schema = require('./actions/jadwal/setTravelWageSess
|
|
|
57
58
|
const importData_schema = require('./actions/importData/importData.schema.cjs');
|
|
58
59
|
const prepareMediaScanterGradingInsert_schema = require('./actions/mediaScanter/prepareMediaScanterGradingInsert/prepareMediaScanterGradingInsert.schema.cjs');
|
|
59
60
|
const refreshGrading_schema = require('./actions/penilaian/refreshGrading/refreshGrading.schema.cjs');
|
|
61
|
+
const refreshManyGrading_schema = require('./actions/penilaian/refreshManyGrading/refreshManyGrading.schema.cjs');
|
|
60
62
|
const prepareExperience_schema = require('./actions/prepareExperience/prepareExperience.schema.cjs');
|
|
61
63
|
const replaceModuleAccess_schema = require('./actions/replaceModuleAccess/replaceModuleAccess.schema.cjs');
|
|
62
64
|
const refreshModuleAccess_schema = require('./actions/refreshModuleAccess/refreshModuleAccess.schema.cjs');
|
|
@@ -97,6 +99,7 @@ const actions = {
|
|
|
97
99
|
// Penilaian
|
|
98
100
|
getGradingCount: action_getGradingCount.getGradingCount,
|
|
99
101
|
refreshGrading: refreshGrading_action.refreshGrading,
|
|
102
|
+
refreshManyGrading: refreshManyGrading_action.refreshManyGrading,
|
|
100
103
|
// Rasionalisasi
|
|
101
104
|
addManyGradingComponent: action_addManyGradingComponent.addManyGradingComponent,
|
|
102
105
|
calculateGrading: action_calculateGrading.calculateGrading,
|
|
@@ -153,6 +156,7 @@ exports.setTravelWageSessions = setTravelWageSessions_action.setTravelWageSessio
|
|
|
153
156
|
exports.customSaveOneClassSession = action_customSaveOneClassSession.customSaveOneClassSession;
|
|
154
157
|
exports.getGradingCount = action_getGradingCount.getGradingCount;
|
|
155
158
|
exports.refreshGrading = refreshGrading_action.refreshGrading;
|
|
159
|
+
exports.refreshManyGrading = refreshManyGrading_action.refreshManyGrading;
|
|
156
160
|
exports.addManyGradingComponent = action_addManyGradingComponent.addManyGradingComponent;
|
|
157
161
|
exports.calculateGrading = action_calculateGrading.calculateGrading;
|
|
158
162
|
exports._calculateComparison = action_calculateManyComparator._calculateComparison;
|
|
@@ -182,6 +186,7 @@ exports.SetTravelWageSessionsSchema = setTravelWageSessions_schema.SetTravelWage
|
|
|
182
186
|
exports.ImportDataSchema = importData_schema.ImportDataSchema;
|
|
183
187
|
exports.PrepareMediaScanterGradingInsertSchema = prepareMediaScanterGradingInsert_schema.PrepareMediaScanterGradingInsertSchema;
|
|
184
188
|
exports.RefreshGradingSchema = refreshGrading_schema.RefreshGradingSchema;
|
|
189
|
+
exports.RefreshManyGradingSchema = refreshManyGrading_schema.RefreshManyGradingSchema;
|
|
185
190
|
exports.PrepareExperienceSchema = prepareExperience_schema.PrepareExperienceSchema;
|
|
186
191
|
exports.ReplaceModuleAccessSchema = replaceModuleAccess_schema.ReplaceModuleAccessSchema;
|
|
187
192
|
exports.RefreshModuleAccessSchema = refreshModuleAccess_schema.RefreshModuleAccessSchema;
|
package/build/index.d.ts
CHANGED
|
@@ -59,6 +59,9 @@ export declare const actions: {
|
|
|
59
59
|
refreshGrading: import("@neon.id/operation").Action<"refreshGrading", {
|
|
60
60
|
gradingId?: string | undefined;
|
|
61
61
|
}, import("./actions").RefreshGradingOutput, import("./actions").RefreshGradingMeta>;
|
|
62
|
+
refreshManyGrading: import("@neon.id/operation").Action<"refreshManyGrading", {
|
|
63
|
+
gradingTypeId?: string | undefined;
|
|
64
|
+
}, import("./actions").RefreshManyGradingOutput, import("./actions").RefreshManyGradingMeta>;
|
|
62
65
|
addManyGradingComponent: import("@neon.id/operation").Action<"addManyGradingComponent", import("./actions").AddManyGradingComponentInput, import("./actions").AddManyGradingComponentOutput, import("./actions").AddManyGradingComponentMeta>;
|
|
63
66
|
calculateGrading: import("@neon.id/operation").Action<"calculateGrading", import("./actions").CalculateGradingInput, import("./actions").CalculateGradingOutput, import("./actions").CalculateGradingMeta>;
|
|
64
67
|
calculateManyComparator: import("@neon.id/operation").Action<"calculateManyComparator", import("./actions").CalculateManyComparatorInput, import("./actions").CalculateManyComparatorOutput, import("./actions").CalculateManyComparatorMeta>;
|
package/build/index.mjs
CHANGED
|
@@ -28,6 +28,7 @@ import { setTravelWageSessions } from './actions/jadwal/setTravelWageSessions/se
|
|
|
28
28
|
import { customSaveOneClassSession } from './actions/jadwal/action.customSaveOneClassSession.mjs';
|
|
29
29
|
import { getGradingCount } from './actions/penilaian/getGradingCount/action.getGradingCount.mjs';
|
|
30
30
|
import { refreshGrading } from './actions/penilaian/refreshGrading/refreshGrading.action.mjs';
|
|
31
|
+
import { refreshManyGrading } from './actions/penilaian/refreshManyGrading/refreshManyGrading.action.mjs';
|
|
31
32
|
import { addManyGradingComponent } from './actions/rasionalisasi/action.addManyGradingComponent.mjs';
|
|
32
33
|
import { calculateGrading } from './actions/rasionalisasi/action.calculateGrading.mjs';
|
|
33
34
|
import { calculateManyComparator } from './actions/rasionalisasi/action.calculateManyComparator.mjs';
|
|
@@ -57,6 +58,7 @@ export { SetTravelWageSessionsSchema } from './actions/jadwal/setTravelWageSessi
|
|
|
57
58
|
export { ImportDataSchema } from './actions/importData/importData.schema.mjs';
|
|
58
59
|
export { PrepareMediaScanterGradingInsertSchema } from './actions/mediaScanter/prepareMediaScanterGradingInsert/prepareMediaScanterGradingInsert.schema.mjs';
|
|
59
60
|
export { RefreshGradingSchema } from './actions/penilaian/refreshGrading/refreshGrading.schema.mjs';
|
|
61
|
+
export { RefreshManyGradingSchema } from './actions/penilaian/refreshManyGrading/refreshManyGrading.schema.mjs';
|
|
60
62
|
export { PrepareExperienceSchema } from './actions/prepareExperience/prepareExperience.schema.mjs';
|
|
61
63
|
export { ReplaceModuleAccessSchema } from './actions/replaceModuleAccess/replaceModuleAccess.schema.mjs';
|
|
62
64
|
export { RefreshModuleAccessSchema } from './actions/refreshModuleAccess/refreshModuleAccess.schema.mjs';
|
|
@@ -97,6 +99,7 @@ const actions = {
|
|
|
97
99
|
// Penilaian
|
|
98
100
|
getGradingCount,
|
|
99
101
|
refreshGrading,
|
|
102
|
+
refreshManyGrading,
|
|
100
103
|
// Rasionalisasi
|
|
101
104
|
addManyGradingComponent,
|
|
102
105
|
calculateGrading,
|
|
@@ -123,4 +126,4 @@ const actions = {
|
|
|
123
126
|
importData
|
|
124
127
|
};
|
|
125
128
|
|
|
126
|
-
export { acceptQuestion, actions, addManyGradingComponent, allConflict, calculateGrading, calculateManyComparator, calculateOneComparator, checkClassAttendance, classSessionInventoryOccurs, classSessionInventoryPreparation, clearAllOverrides, clearGrading, clearOneOverrides, createGradingAndScores, createManySession, customSaveOneClassSession, deleteManySession, editAnswer, generateGrading, getClassSessionConflicts, getGradingCount, getQuestionCount, getStaffId, getStaffPoint, getStudentId, getStudentPoint, getTeacherPoint, hasUnderstand, importData, notUnderstand, prepareConflict, prepareExperience, prepareMediaScanterGradingInsert, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, refreshGrading, refreshModuleAccess, replaceModuleAccess, sendAnswer, sendQuestion, setTravelWageSessions, syncClassSessions, syncCommitment, syncStudentAdmisi, syncStudentBranch, syncStudentInformation, syncStudentReport, updateGradingAndScores, updateMany, userCountStats };
|
|
129
|
+
export { acceptQuestion, actions, addManyGradingComponent, allConflict, calculateGrading, calculateManyComparator, calculateOneComparator, checkClassAttendance, classSessionInventoryOccurs, classSessionInventoryPreparation, clearAllOverrides, clearGrading, clearOneOverrides, createGradingAndScores, createManySession, customSaveOneClassSession, deleteManySession, editAnswer, generateGrading, getClassSessionConflicts, getGradingCount, getQuestionCount, getStaffId, getStaffPoint, getStudentId, getStudentPoint, getTeacherPoint, hasUnderstand, importData, notUnderstand, prepareConflict, prepareExperience, prepareMediaScanterGradingInsert, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, refreshGrading, refreshManyGrading, refreshModuleAccess, replaceModuleAccess, sendAnswer, sendQuestion, setTravelWageSessions, syncClassSessions, syncCommitment, syncStudentAdmisi, syncStudentBranch, syncStudentInformation, syncStudentReport, updateGradingAndScores, updateMany, userCountStats };
|
|
@@ -12,6 +12,17 @@ function usePenilaian(stream) {
|
|
|
12
12
|
const grading = await _getOneGrading(stream2, input);
|
|
13
13
|
await prepareScoreComponentMapper(stream2, grading);
|
|
14
14
|
}
|
|
15
|
+
async function prepareManyGradingScore(stream2, input) {
|
|
16
|
+
utils.guard(stream2, "streamRequired");
|
|
17
|
+
utils.guard(input.gradingTypeId, "gradingIdRequired");
|
|
18
|
+
const gradings = await _getManyGrading(stream2, input);
|
|
19
|
+
const gradingUpdates = [];
|
|
20
|
+
for (const grading of gradings) {
|
|
21
|
+
await prepareScoreComponentMapper(stream2, grading);
|
|
22
|
+
gradingUpdates.push(grading);
|
|
23
|
+
}
|
|
24
|
+
await updateManyGradings(stream2, gradingUpdates);
|
|
25
|
+
}
|
|
15
26
|
async function prepareScoreComponentMapper(stream2, grading) {
|
|
16
27
|
utils.guard(stream2, "streamRequired");
|
|
17
28
|
const score = grading?.data?.import?.scores;
|
|
@@ -22,6 +33,21 @@ function usePenilaian(stream) {
|
|
|
22
33
|
}));
|
|
23
34
|
await _generateScoreComponentMapper(stream2, gradingComponentMap, grading);
|
|
24
35
|
}
|
|
36
|
+
async function updateManyGradings(stream2, gradings) {
|
|
37
|
+
utils.guard(stream2, "streamRequired");
|
|
38
|
+
for (const grading of gradings) {
|
|
39
|
+
await stream2?.actions.data.updateOne.execute(
|
|
40
|
+
{
|
|
41
|
+
model: "neu:penilaian:grading",
|
|
42
|
+
id: grading.id || "",
|
|
43
|
+
data: {
|
|
44
|
+
refreshAmount: (grading.refreshAmount || 0) + 1
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
stream2
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
25
51
|
async function _getOneGrading(stream2, input) {
|
|
26
52
|
utils.guard(stream2, "streamRequired");
|
|
27
53
|
const result = await stream2.actions.data.getOne.execute({
|
|
@@ -40,9 +66,29 @@ function usePenilaian(stream) {
|
|
|
40
66
|
throw result;
|
|
41
67
|
return result.value;
|
|
42
68
|
}
|
|
69
|
+
async function _getManyGrading(stream2, input) {
|
|
70
|
+
utils.guard(stream2, "streamRequired");
|
|
71
|
+
const result = await stream2.actions.data.getMany.execute({
|
|
72
|
+
model: "neu:penilaian:grading",
|
|
73
|
+
query: query.Query.define({
|
|
74
|
+
filter: { gradingTypeId: input.gradingTypeId, refreshAmount: null },
|
|
75
|
+
fields: {
|
|
76
|
+
id: 1,
|
|
77
|
+
data: 1,
|
|
78
|
+
gradingTypeId: 1,
|
|
79
|
+
refreshAmount: 1,
|
|
80
|
+
branchId: 1
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
}, stream2);
|
|
84
|
+
if (result.isFailure)
|
|
85
|
+
throw result;
|
|
86
|
+
return result.value;
|
|
87
|
+
}
|
|
43
88
|
async function _getManyGradingComponents(stream2, input) {
|
|
44
89
|
utils.guard(stream2, "streamRequired");
|
|
45
|
-
const
|
|
90
|
+
const score = input.score ?? {};
|
|
91
|
+
const scoreKeys = Object.keys(score);
|
|
46
92
|
const result = await stream2.actions.data.getMany.execute({
|
|
47
93
|
model: "neu:penilaian:gradingComponent",
|
|
48
94
|
query: query.Query.define({
|
|
@@ -65,6 +111,7 @@ function usePenilaian(stream) {
|
|
|
65
111
|
gradingId: grading?.id ? new core.ObjectId(grading?.id) : null,
|
|
66
112
|
gradingComponentId: gradingComponent?.id ? new core.ObjectId(gradingComponent.id) : null,
|
|
67
113
|
quantitative: gradingComponent?.quantitative ? gradingComponent.quantitative : null,
|
|
114
|
+
studentScoreId: Array.isArray(gradingComponent?.studentScoreId) ? gradingComponent.studentScoreId : [gradingComponent.studentScoreId],
|
|
68
115
|
createdAt: /* @__PURE__ */ new Date()
|
|
69
116
|
}
|
|
70
117
|
}
|
|
@@ -85,7 +132,8 @@ function usePenilaian(stream) {
|
|
|
85
132
|
);
|
|
86
133
|
}
|
|
87
134
|
return {
|
|
88
|
-
prepareGradingScore
|
|
135
|
+
prepareGradingScore,
|
|
136
|
+
prepareManyGradingScore
|
|
89
137
|
};
|
|
90
138
|
}
|
|
91
139
|
|
|
@@ -3,4 +3,7 @@ export declare function usePenilaian(stream: NStream.Stream | undefined): {
|
|
|
3
3
|
prepareGradingScore: (stream: NStream.Stream, input: {
|
|
4
4
|
gradingId: string | undefined;
|
|
5
5
|
}) => Promise<void>;
|
|
6
|
+
prepareManyGradingScore: (stream: NStream.Stream, input: {
|
|
7
|
+
gradingTypeId: string | undefined;
|
|
8
|
+
}) => Promise<void>;
|
|
6
9
|
};
|
|
@@ -10,6 +10,17 @@ function usePenilaian(stream) {
|
|
|
10
10
|
const grading = await _getOneGrading(stream2, input);
|
|
11
11
|
await prepareScoreComponentMapper(stream2, grading);
|
|
12
12
|
}
|
|
13
|
+
async function prepareManyGradingScore(stream2, input) {
|
|
14
|
+
guard(stream2, "streamRequired");
|
|
15
|
+
guard(input.gradingTypeId, "gradingIdRequired");
|
|
16
|
+
const gradings = await _getManyGrading(stream2, input);
|
|
17
|
+
const gradingUpdates = [];
|
|
18
|
+
for (const grading of gradings) {
|
|
19
|
+
await prepareScoreComponentMapper(stream2, grading);
|
|
20
|
+
gradingUpdates.push(grading);
|
|
21
|
+
}
|
|
22
|
+
await updateManyGradings(stream2, gradingUpdates);
|
|
23
|
+
}
|
|
13
24
|
async function prepareScoreComponentMapper(stream2, grading) {
|
|
14
25
|
guard(stream2, "streamRequired");
|
|
15
26
|
const score = grading?.data?.import?.scores;
|
|
@@ -20,6 +31,21 @@ function usePenilaian(stream) {
|
|
|
20
31
|
}));
|
|
21
32
|
await _generateScoreComponentMapper(stream2, gradingComponentMap, grading);
|
|
22
33
|
}
|
|
34
|
+
async function updateManyGradings(stream2, gradings) {
|
|
35
|
+
guard(stream2, "streamRequired");
|
|
36
|
+
for (const grading of gradings) {
|
|
37
|
+
await stream2?.actions.data.updateOne.execute(
|
|
38
|
+
{
|
|
39
|
+
model: "neu:penilaian:grading",
|
|
40
|
+
id: grading.id || "",
|
|
41
|
+
data: {
|
|
42
|
+
refreshAmount: (grading.refreshAmount || 0) + 1
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
stream2
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
23
49
|
async function _getOneGrading(stream2, input) {
|
|
24
50
|
guard(stream2, "streamRequired");
|
|
25
51
|
const result = await stream2.actions.data.getOne.execute({
|
|
@@ -38,9 +64,29 @@ function usePenilaian(stream) {
|
|
|
38
64
|
throw result;
|
|
39
65
|
return result.value;
|
|
40
66
|
}
|
|
67
|
+
async function _getManyGrading(stream2, input) {
|
|
68
|
+
guard(stream2, "streamRequired");
|
|
69
|
+
const result = await stream2.actions.data.getMany.execute({
|
|
70
|
+
model: "neu:penilaian:grading",
|
|
71
|
+
query: Query.define({
|
|
72
|
+
filter: { gradingTypeId: input.gradingTypeId, refreshAmount: null },
|
|
73
|
+
fields: {
|
|
74
|
+
id: 1,
|
|
75
|
+
data: 1,
|
|
76
|
+
gradingTypeId: 1,
|
|
77
|
+
refreshAmount: 1,
|
|
78
|
+
branchId: 1
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
}, stream2);
|
|
82
|
+
if (result.isFailure)
|
|
83
|
+
throw result;
|
|
84
|
+
return result.value;
|
|
85
|
+
}
|
|
41
86
|
async function _getManyGradingComponents(stream2, input) {
|
|
42
87
|
guard(stream2, "streamRequired");
|
|
43
|
-
const
|
|
88
|
+
const score = input.score ?? {};
|
|
89
|
+
const scoreKeys = Object.keys(score);
|
|
44
90
|
const result = await stream2.actions.data.getMany.execute({
|
|
45
91
|
model: "neu:penilaian:gradingComponent",
|
|
46
92
|
query: Query.define({
|
|
@@ -63,6 +109,7 @@ function usePenilaian(stream) {
|
|
|
63
109
|
gradingId: grading?.id ? new ObjectId(grading?.id) : null,
|
|
64
110
|
gradingComponentId: gradingComponent?.id ? new ObjectId(gradingComponent.id) : null,
|
|
65
111
|
quantitative: gradingComponent?.quantitative ? gradingComponent.quantitative : null,
|
|
112
|
+
studentScoreId: Array.isArray(gradingComponent?.studentScoreId) ? gradingComponent.studentScoreId : [gradingComponent.studentScoreId],
|
|
66
113
|
createdAt: /* @__PURE__ */ new Date()
|
|
67
114
|
}
|
|
68
115
|
}
|
|
@@ -83,7 +130,8 @@ function usePenilaian(stream) {
|
|
|
83
130
|
);
|
|
84
131
|
}
|
|
85
132
|
return {
|
|
86
|
-
prepareGradingScore
|
|
133
|
+
prepareGradingScore,
|
|
134
|
+
prepareManyGradingScore
|
|
87
135
|
};
|
|
88
136
|
}
|
|
89
137
|
|
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.8",
|
|
4
4
|
"description": "Operation package of Neutron Pendidikan.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"contributors": [
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@neon.id/types": "^1.69.0",
|
|
40
40
|
"@neon.id/utils": "^1.52.0",
|
|
41
41
|
"@neon.id/z": "^1.16.0",
|
|
42
|
-
"@neutron.co.id/akademik-models": "^1.19.
|
|
43
|
-
"@neutron.co.id/jadwal-models": "^1.19.
|
|
44
|
-
"@neutron.co.id/pendidikan-types": "^1.22.
|
|
45
|
-
"@neutron.co.id/penilaian-models": "^1.17.
|
|
42
|
+
"@neutron.co.id/akademik-models": "^1.19.9",
|
|
43
|
+
"@neutron.co.id/jadwal-models": "^1.19.4",
|
|
44
|
+
"@neutron.co.id/pendidikan-types": "^1.22.8",
|
|
45
|
+
"@neutron.co.id/penilaian-models": "^1.17.4",
|
|
46
46
|
"@neutron.co.id/personalia-models": "^1.11.6",
|
|
47
47
|
"@neutron.co.id/tanya-models": "^1.13.1"
|
|
48
48
|
},
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"@neon.id/types": "^1.69.0",
|
|
74
74
|
"@neon.id/utils": "^1.52.0",
|
|
75
75
|
"@neon.id/z": "^1.16.0",
|
|
76
|
-
"@neutron.co.id/akademik-models": "^1.19.
|
|
77
|
-
"@neutron.co.id/jadwal-models": "^1.19.
|
|
78
|
-
"@neutron.co.id/pendidikan-types": "^1.22.
|
|
79
|
-
"@neutron.co.id/penilaian-models": "^1.17.
|
|
76
|
+
"@neutron.co.id/akademik-models": "^1.19.9",
|
|
77
|
+
"@neutron.co.id/jadwal-models": "^1.19.4",
|
|
78
|
+
"@neutron.co.id/pendidikan-types": "^1.22.8",
|
|
79
|
+
"@neutron.co.id/penilaian-models": "^1.17.4",
|
|
80
80
|
"@neutron.co.id/personalia-models": "^1.11.6",
|
|
81
81
|
"@neutron.co.id/tanya-models": "^1.13.1"
|
|
82
82
|
},
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"build":
|
|
86
|
+
"build": 94
|
|
87
87
|
}
|