@neutron.co.id/pendidikan-operation 1.29.5 → 1.29.6
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/checkProgramExistance/checkProgramExistance.action.cjs +64 -0
- package/build/actions/checkProgramExistance/checkProgramExistance.action.d.ts +13 -0
- package/build/actions/checkProgramExistance/checkProgramExistance.action.mjs +62 -0
- package/build/actions/checkProgramExistance/checkProgramExistance.schema.cjs +10 -0
- package/build/actions/checkProgramExistance/checkProgramExistance.schema.d.ts +11 -0
- package/build/actions/checkProgramExistance/checkProgramExistance.schema.mjs +8 -0
- package/build/actions/checkProgramExistance/index.d.ts +2 -0
- package/build/actions/index.d.ts +1 -0
- package/build/index.cjs +5 -0
- package/build/index.d.ts +4 -0
- package/build/index.mjs +4 -1
- package/package.json +4 -4
|
@@ -0,0 +1,64 @@
|
|
|
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 query = require('@neon.id/query');
|
|
7
|
+
const checkProgramExistance_schema = require('./checkProgramExistance.schema.cjs');
|
|
8
|
+
const useTelemetry = require('../../providers/useTelemetry.cjs');
|
|
9
|
+
|
|
10
|
+
const checkProgramExistance = operation.Action.define({
|
|
11
|
+
key: "checkProgramExistance",
|
|
12
|
+
name: "Import Data",
|
|
13
|
+
type: "command",
|
|
14
|
+
category: "domain",
|
|
15
|
+
execute: async (input, stream) => {
|
|
16
|
+
utils.guard(stream, "streamRequired");
|
|
17
|
+
const { validate } = operation.useValidation(stream, checkProgramExistance_schema.CheckProgramExistanceSchema);
|
|
18
|
+
const actions = stream.actions.data;
|
|
19
|
+
const data = validate(input);
|
|
20
|
+
return useTelemetry.useTelemetry(stream, "importData", {
|
|
21
|
+
userId: stream.context.identitas.userId,
|
|
22
|
+
data
|
|
23
|
+
}, async () => {
|
|
24
|
+
const { getActorId } = operation.useStream(stream);
|
|
25
|
+
try {
|
|
26
|
+
getActorId({ throw: true });
|
|
27
|
+
console.log("data", data);
|
|
28
|
+
const programs = await actions.getMany.execute({
|
|
29
|
+
model: "neu:akademik:program",
|
|
30
|
+
query: query.Query.define({
|
|
31
|
+
filter: {
|
|
32
|
+
$or: [
|
|
33
|
+
{ name: data.name },
|
|
34
|
+
{ code: data.code }
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
fields: {
|
|
38
|
+
id: 1
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
}, stream);
|
|
42
|
+
const isExist = programs?.value?.length > 0;
|
|
43
|
+
return core.Result.ok({
|
|
44
|
+
state: "checkProgramExistance",
|
|
45
|
+
message: "Check Program Existance",
|
|
46
|
+
data: {
|
|
47
|
+
isExist
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
} catch (error) {
|
|
51
|
+
if (error?.isFailure)
|
|
52
|
+
throw error;
|
|
53
|
+
console.error(error);
|
|
54
|
+
return core.Result.fail({
|
|
55
|
+
state: `checkProgramExistanceFailed`,
|
|
56
|
+
message: `Failed to check existance program.`,
|
|
57
|
+
error: error?.toString()
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
exports.checkProgramExistance = checkProgramExistance;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from '@neon.id/operation';
|
|
2
|
+
import type { z } from '@neon.id/z';
|
|
3
|
+
import { CheckProgramExistanceSchema } from './checkProgramExistance.schema';
|
|
4
|
+
export type CheckProgramExistanceInput = z.parse<typeof CheckProgramExistanceSchema>;
|
|
5
|
+
export interface CheckProgramExistanceOutput {
|
|
6
|
+
}
|
|
7
|
+
export interface CheckProgramExistanceMeta {
|
|
8
|
+
}
|
|
9
|
+
export declare const checkProgramExistance: Action<"checkProgramExistance", {
|
|
10
|
+
name: string;
|
|
11
|
+
code: string;
|
|
12
|
+
}, CheckProgramExistanceOutput, CheckProgramExistanceMeta>;
|
|
13
|
+
export type CheckProgramExistanceAction = typeof checkProgramExistance;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Result } from '@neon.id/core';
|
|
2
|
+
import { Action, useValidation, useStream } from '@neon.id/operation';
|
|
3
|
+
import { guard } from '@neon.id/utils';
|
|
4
|
+
import { Query } from '@neon.id/query';
|
|
5
|
+
import { CheckProgramExistanceSchema } from './checkProgramExistance.schema.mjs';
|
|
6
|
+
import { useTelemetry } from '../../providers/useTelemetry.mjs';
|
|
7
|
+
|
|
8
|
+
const checkProgramExistance = Action.define({
|
|
9
|
+
key: "checkProgramExistance",
|
|
10
|
+
name: "Import Data",
|
|
11
|
+
type: "command",
|
|
12
|
+
category: "domain",
|
|
13
|
+
execute: async (input, stream) => {
|
|
14
|
+
guard(stream, "streamRequired");
|
|
15
|
+
const { validate } = useValidation(stream, CheckProgramExistanceSchema);
|
|
16
|
+
const actions = stream.actions.data;
|
|
17
|
+
const data = validate(input);
|
|
18
|
+
return useTelemetry(stream, "importData", {
|
|
19
|
+
userId: stream.context.identitas.userId,
|
|
20
|
+
data
|
|
21
|
+
}, async () => {
|
|
22
|
+
const { getActorId } = useStream(stream);
|
|
23
|
+
try {
|
|
24
|
+
getActorId({ throw: true });
|
|
25
|
+
console.log("data", data);
|
|
26
|
+
const programs = await actions.getMany.execute({
|
|
27
|
+
model: "neu:akademik:program",
|
|
28
|
+
query: Query.define({
|
|
29
|
+
filter: {
|
|
30
|
+
$or: [
|
|
31
|
+
{ name: data.name },
|
|
32
|
+
{ code: data.code }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
fields: {
|
|
36
|
+
id: 1
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
}, stream);
|
|
40
|
+
const isExist = programs?.value?.length > 0;
|
|
41
|
+
return Result.ok({
|
|
42
|
+
state: "checkProgramExistance",
|
|
43
|
+
message: "Check Program Existance",
|
|
44
|
+
data: {
|
|
45
|
+
isExist
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error?.isFailure)
|
|
50
|
+
throw error;
|
|
51
|
+
console.error(error);
|
|
52
|
+
return Result.fail({
|
|
53
|
+
state: `checkProgramExistanceFailed`,
|
|
54
|
+
message: `Failed to check existance program.`,
|
|
55
|
+
error: error?.toString()
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export { checkProgramExistance };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const z = require('@neon.id/z');
|
|
4
|
+
|
|
5
|
+
const CheckProgramExistanceSchema = z.z.object({
|
|
6
|
+
name: z.z.string().explain({ label: "Program Name" }),
|
|
7
|
+
code: z.z.string().explain({ label: "Program Code" })
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
exports.CheckProgramExistanceSchema = CheckProgramExistanceSchema;
|
package/build/actions/index.d.ts
CHANGED
package/build/index.cjs
CHANGED
|
@@ -53,6 +53,7 @@ const action_notUnderstand = require('./actions/tanya/action.notUnderstand.cjs')
|
|
|
53
53
|
const action_sendAnswer = require('./actions/tanya/action.sendAnswer.cjs');
|
|
54
54
|
const action_sendQuestion = require('./actions/tanya/action.sendQuestion.cjs');
|
|
55
55
|
const action_reminderQuestions = require('./actions/tanya/action.reminderQuestions.cjs');
|
|
56
|
+
const checkProgramExistance_action = require('./actions/checkProgramExistance/checkProgramExistance.action.cjs');
|
|
56
57
|
const prepareMediaScanterGradingInsert_action = require('./actions/mediaScanter/prepareMediaScanterGradingInsert/prepareMediaScanterGradingInsert.action.cjs');
|
|
57
58
|
const importData_action = require('./actions/importData/importData.action.cjs');
|
|
58
59
|
const updateReportStudent_action = require('./actions/akademik/updateReportStudent/updateReportStudent.action.cjs');
|
|
@@ -85,6 +86,7 @@ const replaceModuleAccess_schema = require('./actions/replaceModuleAccess/replac
|
|
|
85
86
|
const refreshModuleAccess_schema = require('./actions/refreshModuleAccess/refreshModuleAccess.schema.cjs');
|
|
86
87
|
const replaceModuleAccessManyStudent_schema = require('./actions/replaceModuleAccessManyStudent/replaceModuleAccessManyStudent.schema.cjs');
|
|
87
88
|
const updateMany_schema = require('./actions/updateMany/updateMany.schema.cjs');
|
|
89
|
+
const checkProgramExistance_schema = require('./actions/checkProgramExistance/checkProgramExistance.schema.cjs');
|
|
88
90
|
const hook_officePendidikan = require('./hooks/hook.officePendidikan.cjs');
|
|
89
91
|
|
|
90
92
|
const actions = {
|
|
@@ -153,6 +155,7 @@ const actions = {
|
|
|
153
155
|
sendAnswer: action_sendAnswer.sendAnswer,
|
|
154
156
|
sendQuestion: action_sendQuestion.sendQuestion,
|
|
155
157
|
reminderQuestions: action_reminderQuestions.reminderQuestions,
|
|
158
|
+
checkProgramExistance: checkProgramExistance_action.checkProgramExistance,
|
|
156
159
|
// Media Scanter
|
|
157
160
|
prepareMediaScanterGradingInsert: prepareMediaScanterGradingInsert_action.prepareMediaScanterGradingInsert,
|
|
158
161
|
// Import Data
|
|
@@ -219,6 +222,7 @@ exports.notUnderstand = action_notUnderstand.notUnderstand;
|
|
|
219
222
|
exports.sendAnswer = action_sendAnswer.sendAnswer;
|
|
220
223
|
exports.sendQuestion = action_sendQuestion.sendQuestion;
|
|
221
224
|
exports.reminderQuestions = action_reminderQuestions.reminderQuestions;
|
|
225
|
+
exports.checkProgramExistance = checkProgramExistance_action.checkProgramExistance;
|
|
222
226
|
exports.prepareMediaScanterGradingInsert = prepareMediaScanterGradingInsert_action.prepareMediaScanterGradingInsert;
|
|
223
227
|
exports.importData = importData_action.importData;
|
|
224
228
|
exports.updateReportStudent = updateReportStudent_action.updateReportStudent;
|
|
@@ -251,5 +255,6 @@ exports.ReplaceModuleAccessSchema = replaceModuleAccess_schema.ReplaceModuleAcce
|
|
|
251
255
|
exports.RefreshModuleAccessSchema = refreshModuleAccess_schema.RefreshModuleAccessSchema;
|
|
252
256
|
exports.ReplaceModuleAccessManyStudentSchema = replaceModuleAccessManyStudent_schema.ReplaceModuleAccessManyStudentSchema;
|
|
253
257
|
exports.UpdateManySchema = updateMany_schema.UpdateManySchema;
|
|
258
|
+
exports.CheckProgramExistanceSchema = checkProgramExistance_schema.CheckProgramExistanceSchema;
|
|
254
259
|
exports.registerOfficePendidikanHooks = hook_officePendidikan.registerOfficePendidikanHooks;
|
|
255
260
|
exports.actions = actions;
|
package/build/index.d.ts
CHANGED
|
@@ -115,6 +115,10 @@ export declare const actions: {
|
|
|
115
115
|
sendAnswer: import("@neon.id/operation").Action<"sendAnswer", import("./actions").SendAnswerInput, import("./actions").SendAnswerOutput, import("./actions").SendAnswerMeta>;
|
|
116
116
|
sendQuestion: import("@neon.id/operation").Action<"sendQuestion", import("./actions").SendQuestionInput, import("./actions").SendQuestionOutput, import("./actions").SendQuestionMeta>;
|
|
117
117
|
reminderQuestions: typeof reminderQuestions;
|
|
118
|
+
checkProgramExistance: import("@neon.id/operation").Action<"checkProgramExistance", {
|
|
119
|
+
name: string;
|
|
120
|
+
code: string;
|
|
121
|
+
}, import("./actions").CheckProgramExistanceOutput, import("./actions").CheckProgramExistanceMeta>;
|
|
118
122
|
prepareMediaScanterGradingInsert: import("@neon.id/operation").Action<"prepareMediaScanterGradingInsert", {
|
|
119
123
|
eventId?: string | undefined;
|
|
120
124
|
}, import("./actions").PrepareMediaScanterGradingInsertOutput, import("./actions").PrepareMediaScanterGradingInsertMeta>;
|
package/build/index.mjs
CHANGED
|
@@ -53,6 +53,7 @@ import { notUnderstand } from './actions/tanya/action.notUnderstand.mjs';
|
|
|
53
53
|
import { sendAnswer } from './actions/tanya/action.sendAnswer.mjs';
|
|
54
54
|
import { sendQuestion } from './actions/tanya/action.sendQuestion.mjs';
|
|
55
55
|
import { reminderQuestions } from './actions/tanya/action.reminderQuestions.mjs';
|
|
56
|
+
import { checkProgramExistance } from './actions/checkProgramExistance/checkProgramExistance.action.mjs';
|
|
56
57
|
import { prepareMediaScanterGradingInsert } from './actions/mediaScanter/prepareMediaScanterGradingInsert/prepareMediaScanterGradingInsert.action.mjs';
|
|
57
58
|
import { importData } from './actions/importData/importData.action.mjs';
|
|
58
59
|
import { updateReportStudent } from './actions/akademik/updateReportStudent/updateReportStudent.action.mjs';
|
|
@@ -85,6 +86,7 @@ export { ReplaceModuleAccessSchema } from './actions/replaceModuleAccess/replace
|
|
|
85
86
|
export { RefreshModuleAccessSchema } from './actions/refreshModuleAccess/refreshModuleAccess.schema.mjs';
|
|
86
87
|
export { ReplaceModuleAccessManyStudentSchema } from './actions/replaceModuleAccessManyStudent/replaceModuleAccessManyStudent.schema.mjs';
|
|
87
88
|
export { UpdateManySchema } from './actions/updateMany/updateMany.schema.mjs';
|
|
89
|
+
export { CheckProgramExistanceSchema } from './actions/checkProgramExistance/checkProgramExistance.schema.mjs';
|
|
88
90
|
export { registerOfficePendidikanHooks } from './hooks/hook.officePendidikan.mjs';
|
|
89
91
|
|
|
90
92
|
const actions = {
|
|
@@ -153,6 +155,7 @@ const actions = {
|
|
|
153
155
|
sendAnswer,
|
|
154
156
|
sendQuestion,
|
|
155
157
|
reminderQuestions,
|
|
158
|
+
checkProgramExistance,
|
|
156
159
|
// Media Scanter
|
|
157
160
|
prepareMediaScanterGradingInsert,
|
|
158
161
|
// Import Data
|
|
@@ -164,4 +167,4 @@ const actions = {
|
|
|
164
167
|
syncStudents
|
|
165
168
|
};
|
|
166
169
|
|
|
167
|
-
export { acceptQuestion, actions, addManyGradingComponent, allConflict, bulkDeleteSession, bulkUpdateSession, 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, reminderQuestions, replaceModuleAccess, replaceModuleAccessManyStudent, sendAnswer, sendClassConsultationNotification, sendClassSessionNotification, sendPointNotification, sendQuestion, sendScoreNotification, setAksesModulSiswaDiClassGroup, setClassSessionDependencies, setTravelWageSessions, syncClassGroups, syncClassSessions, syncCommitment, syncStudentAdmisi, syncStudentBranch, syncStudentInformation, syncStudentReport, syncStudents, updateGradingAndScores, updateMany, updateReportStudent, userCountStats };
|
|
170
|
+
export { acceptQuestion, actions, addManyGradingComponent, allConflict, bulkDeleteSession, bulkUpdateSession, calculateGrading, calculateManyComparator, calculateOneComparator, checkClassAttendance, checkProgramExistance, 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, reminderQuestions, replaceModuleAccess, replaceModuleAccessManyStudent, sendAnswer, sendClassConsultationNotification, sendClassSessionNotification, sendPointNotification, sendQuestion, sendScoreNotification, setAksesModulSiswaDiClassGroup, setClassSessionDependencies, setTravelWageSessions, syncClassGroups, syncClassSessions, syncCommitment, syncStudentAdmisi, syncStudentBranch, syncStudentInformation, syncStudentReport, syncStudents, updateGradingAndScores, updateMany, updateReportStudent, userCountStats };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neutron.co.id/pendidikan-operation",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.6",
|
|
4
4
|
"description": "Operation package of Neutron Pendidikan.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"contributors": [
|
|
@@ -39,7 +39,7 @@
|
|
|
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.21.5
|
|
42
|
+
"@neutron.co.id/akademik-models": "^1.21.5",
|
|
43
43
|
"@neutron.co.id/jadwal-models": "^1.19.13",
|
|
44
44
|
"@neutron.co.id/pendidikan-types": "^1.24.1",
|
|
45
45
|
"@neutron.co.id/penilaian-models": "^1.19.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@neon.id/types": "^1.69.0",
|
|
76
76
|
"@neon.id/utils": "^1.52.0",
|
|
77
77
|
"@neon.id/z": "^1.16.0",
|
|
78
|
-
"@neutron.co.id/akademik-models": "^1.21.5
|
|
78
|
+
"@neutron.co.id/akademik-models": "^1.21.5",
|
|
79
79
|
"@neutron.co.id/jadwal-models": "^1.19.13",
|
|
80
80
|
"@neutron.co.id/pendidikan-types": "^1.24.1",
|
|
81
81
|
"@neutron.co.id/penilaian-models": "^1.19.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"build":
|
|
89
|
+
"build": 162
|
|
90
90
|
}
|