@neutron.co.id/pendidikan-operation 1.4.0-beta.3 → 1.4.0-beta.5

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/index.cjs CHANGED
@@ -1011,7 +1011,8 @@ const sendAnswer = operation.Action.define({
1011
1011
  teacher: { id: 1 },
1012
1012
  detail: 1,
1013
1013
  images: 1,
1014
- acceptedAt: 1
1014
+ acceptedAt: 1,
1015
+ answeredAt: 1
1015
1016
  }
1016
1017
  })
1017
1018
  },
@@ -1033,16 +1034,27 @@ const sendAnswer = operation.Action.define({
1033
1034
  answeredImages: dataAnswer.images
1034
1035
  }
1035
1036
  );
1036
- await dbAnswer.updateOne(
1037
- {
1038
- _id: dataAnswer.id
1039
- },
1040
- {
1041
- status: "answered",
1042
- answeredAt: new Date(),
1043
- duration: Math.round(durationResult)
1044
- }
1045
- );
1037
+ if (!dataAnswer.answeredAt) {
1038
+ await dbAnswer.updateOne(
1039
+ {
1040
+ _id: dataAnswer.id
1041
+ },
1042
+ {
1043
+ status: "answered",
1044
+ answeredAt: new Date(),
1045
+ duration: Math.round(durationResult)
1046
+ }
1047
+ );
1048
+ } else {
1049
+ await dbAnswer.updateOne(
1050
+ {
1051
+ _id: dataAnswer.id
1052
+ },
1053
+ {
1054
+ status: "answered"
1055
+ }
1056
+ );
1057
+ }
1046
1058
  return core.Result.ok({
1047
1059
  state: "sendAnswer",
1048
1060
  message: "Jawaban berhasil dikirim"
@@ -1132,6 +1144,70 @@ const sendQuestion = operation.Action.define({
1132
1144
  }
1133
1145
  });
1134
1146
 
1147
+ const notUnderstand = operation.Action.define({
1148
+ key: "notUnderstand",
1149
+ name: "Not Understand",
1150
+ type: "command",
1151
+ category: "domain",
1152
+ execute: async (input, stream) => {
1153
+ const dbs = stream.core.dbs;
1154
+ const dbQuestion = dbs["neu-tanya"].models["neu:tanya:question"];
1155
+ const dbAnswer = dbs["neu-tanya"].models["neu:tanya:answer"];
1156
+ await dbQuestion.updateOne(
1157
+ {
1158
+ _id: input.questionId
1159
+ },
1160
+ {
1161
+ status: "answering"
1162
+ }
1163
+ );
1164
+ await dbAnswer.updateOne(
1165
+ {
1166
+ questionId: input.questionId
1167
+ },
1168
+ {
1169
+ status: "answering"
1170
+ }
1171
+ );
1172
+ return core.Result.ok({
1173
+ state: "notUnderstand",
1174
+ message: "Pertanyaan berhasil diterima"
1175
+ });
1176
+ }
1177
+ });
1178
+
1179
+ const hasUnderstand = operation.Action.define({
1180
+ key: "hasUnderstand",
1181
+ name: "Has Understand",
1182
+ type: "command",
1183
+ category: "domain",
1184
+ execute: async (input, stream) => {
1185
+ const dbs = stream.core.dbs;
1186
+ const dbQuestion = dbs["neu-tanya"].models["neu:tanya:question"];
1187
+ const dbAnswer = dbs["neu-tanya"].models["neu:tanya:answer"];
1188
+ await dbQuestion.updateOne(
1189
+ {
1190
+ _id: input.questionId
1191
+ },
1192
+ {
1193
+ status: "done"
1194
+ }
1195
+ );
1196
+ await dbAnswer.updateOne(
1197
+ {
1198
+ questionId: input.questionId
1199
+ },
1200
+ {
1201
+ status: "done"
1202
+ }
1203
+ );
1204
+ return core.Result.ok({
1205
+ state: "hasUnderstand",
1206
+ message: "Pertanyaan berhasil diterima"
1207
+ });
1208
+ }
1209
+ });
1210
+
1135
1211
  const index = {
1136
1212
  __proto__: null,
1137
1213
  _calculateComparison: _calculateComparison,
@@ -1144,6 +1220,8 @@ const index = {
1144
1220
  createGradingAndScores: createGradingAndScores,
1145
1221
  editAnswer: editAnswer,
1146
1222
  generateGrading: generateGrading,
1223
+ hasUnderstand: hasUnderstand,
1224
+ notUnderstand: notUnderstand,
1147
1225
  prepareConflict: prepareConflict,
1148
1226
  presenceSessionStudent: presenceSessionStudent,
1149
1227
  presenceSessionTeacher: presenceSessionTeacher,
@@ -1166,6 +1244,8 @@ exports.clearGrading = clearGrading;
1166
1244
  exports.createGradingAndScores = createGradingAndScores;
1167
1245
  exports.editAnswer = editAnswer;
1168
1246
  exports.generateGrading = generateGrading;
1247
+ exports.hasUnderstand = hasUnderstand;
1248
+ exports.notUnderstand = notUnderstand;
1169
1249
  exports.prepareConflict = prepareConflict;
1170
1250
  exports.presenceSessionStudent = presenceSessionStudent;
1171
1251
  exports.presenceSessionTeacher = presenceSessionTeacher;
package/build/index.d.ts CHANGED
@@ -218,6 +218,28 @@ interface SendQuestionMeta {
218
218
  declare const sendQuestion: Action<"sendQuestion", SendQuestionInput, SendQuestionOutput, SendQuestionMeta>;
219
219
  type SendQuestionAction = typeof sendQuestion;
220
220
 
221
+ interface NotUnderstandInput {
222
+ questionId: string;
223
+ }
224
+ interface NotUnderstandOutput {
225
+ code: number;
226
+ }
227
+ interface NotUnderstandMeta {
228
+ }
229
+ declare const notUnderstand: Action<"notUnderstand", NotUnderstandInput, NotUnderstandOutput, NotUnderstandMeta>;
230
+ type NotUnderstandAction = typeof notUnderstand;
231
+
232
+ interface HasUnderstandInput {
233
+ questionId: string;
234
+ }
235
+ interface HasUnderstandOutput {
236
+ code: number;
237
+ }
238
+ interface HasUnderstandMeta {
239
+ }
240
+ declare const hasUnderstand: Action<"hasUnderstand", HasUnderstandInput, HasUnderstandOutput, HasUnderstandMeta>;
241
+ type HasUnderstandAction = typeof hasUnderstand;
242
+
221
243
  type index_AcceptQuestionAction = AcceptQuestionAction;
222
244
  type index_AcceptQuestionInput = AcceptQuestionInput;
223
245
  type index_AcceptQuestionMeta = AcceptQuestionMeta;
@@ -256,6 +278,14 @@ type index_GenerateGradingMeta = GenerateGradingMeta;
256
278
  type index_GenerateGradingOutput = GenerateGradingOutput;
257
279
  type index_GradingComparator = GradingComparator;
258
280
  type index_GradingComparatorComparison = GradingComparatorComparison;
281
+ type index_HasUnderstandAction = HasUnderstandAction;
282
+ type index_HasUnderstandInput = HasUnderstandInput;
283
+ type index_HasUnderstandMeta = HasUnderstandMeta;
284
+ type index_HasUnderstandOutput = HasUnderstandOutput;
285
+ type index_NotUnderstandAction = NotUnderstandAction;
286
+ type index_NotUnderstandInput = NotUnderstandInput;
287
+ type index_NotUnderstandMeta = NotUnderstandMeta;
288
+ type index_NotUnderstandOutput = NotUnderstandOutput;
259
289
  type index_PrepareConflictAction = PrepareConflictAction;
260
290
  type index_PrepareConflictInput = PrepareConflictInput;
261
291
  type index_PrepareConflictMeta = PrepareConflictMeta;
@@ -302,6 +332,8 @@ declare const index_clearGrading: typeof clearGrading;
302
332
  declare const index_createGradingAndScores: typeof createGradingAndScores;
303
333
  declare const index_editAnswer: typeof editAnswer;
304
334
  declare const index_generateGrading: typeof generateGrading;
335
+ declare const index_hasUnderstand: typeof hasUnderstand;
336
+ declare const index_notUnderstand: typeof notUnderstand;
305
337
  declare const index_prepareConflict: typeof prepareConflict;
306
338
  declare const index_presenceSessionStudent: typeof presenceSessionStudent;
307
339
  declare const index_presenceSessionTeacher: typeof presenceSessionTeacher;
@@ -351,6 +383,14 @@ declare namespace index {
351
383
  index_GenerateGradingOutput as GenerateGradingOutput,
352
384
  index_GradingComparator as GradingComparator,
353
385
  index_GradingComparatorComparison as GradingComparatorComparison,
386
+ index_HasUnderstandAction as HasUnderstandAction,
387
+ index_HasUnderstandInput as HasUnderstandInput,
388
+ index_HasUnderstandMeta as HasUnderstandMeta,
389
+ index_HasUnderstandOutput as HasUnderstandOutput,
390
+ index_NotUnderstandAction as NotUnderstandAction,
391
+ index_NotUnderstandInput as NotUnderstandInput,
392
+ index_NotUnderstandMeta as NotUnderstandMeta,
393
+ index_NotUnderstandOutput as NotUnderstandOutput,
354
394
  index_PrepareConflictAction as PrepareConflictAction,
355
395
  index_PrepareConflictInput as PrepareConflictInput,
356
396
  index_PrepareConflictMeta as PrepareConflictMeta,
@@ -397,6 +437,8 @@ declare namespace index {
397
437
  index_createGradingAndScores as createGradingAndScores,
398
438
  index_editAnswer as editAnswer,
399
439
  index_generateGrading as generateGrading,
440
+ index_hasUnderstand as hasUnderstand,
441
+ index_notUnderstand as notUnderstand,
400
442
  index_prepareConflict as prepareConflict,
401
443
  index_presenceSessionStudent as presenceSessionStudent,
402
444
  index_presenceSessionTeacher as presenceSessionTeacher,
@@ -409,4 +451,4 @@ declare namespace index {
409
451
  };
410
452
  }
411
453
 
412
- export { AcceptQuestionAction, AcceptQuestionInput, AcceptQuestionMeta, AcceptQuestionOutput, CalculateGradingAction, CalculateGradingInput, CalculateGradingMeta, CalculateGradingOutput, CalculateManyComparatorAction, CalculateManyComparatorInput, CalculateManyComparatorMeta, CalculateManyComparatorOutput, CalculateOneComparatorAction, CalculateOneComparatorInput, CalculateOneComparatorMeta, CalculateOneComparatorOutput, ClearAllOverridesAction, ClearAllOverridesInput, ClearAllOverridesMeta, ClearAllOverridesOutput, ClearGradingAction, ClearGradingInput, ClearGradingMeta, ClearGradingOutput, CreateGradingAndScoresAction, CreateGradingAndScoresInput, CreateGradingAndScoresMeta, CreateGradingAndScoresOutput, EditAnswerAction, EditAnswerInput, EditAnswerMeta, EditAnswerOutput, GenerateGradingAction, GenerateGradingInput, GenerateGradingMeta, GenerateGradingOutput, GradingComparator, GradingComparatorComparison, PrepareConflictAction, PrepareConflictInput, PrepareConflictMeta, PrepareConflictOutput, PresenceSessionStudentAction, PresenceSessionStudentInput, PresenceSessionStudentMeta, PresenceSessionStudentOutput, PresenceSessionTeacherAction, PresenceSessionTeacherInput, PresenceSessionTeacherMeta, PresenceSessionTeacherOutput, RasionalizeGradingAction, RasionalizeGradingInput, RasionalizeGradingMeta, RasionalizeGradingOutput, SendAnswerAction, SendAnswerInput, SendAnswerMeta, SendAnswerOutput, SendQuestionAction, SendQuestionInput, SendQuestionMeta, SendQuestionOutput, SetSomethingAction, SetSomethingInput, SetSomethingMeta, SetSomethingOutput, SyncCommitmentAction, SyncCommitmentInput, SyncCommitmentMeta, SyncCommitmentOutput, UpdateGradingAndScoresAction, UpdateGradingAndScoresInput, UpdateGradingAndScoresMeta, UpdateGradingAndScoresOutput, _calculateComparison, acceptQuestion, index as actions, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, editAnswer, generateGrading, prepareConflict, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, sendAnswer, sendQuestion, setSomething, syncCommitment, updateGradingAndScores };
454
+ export { AcceptQuestionAction, AcceptQuestionInput, AcceptQuestionMeta, AcceptQuestionOutput, CalculateGradingAction, CalculateGradingInput, CalculateGradingMeta, CalculateGradingOutput, CalculateManyComparatorAction, CalculateManyComparatorInput, CalculateManyComparatorMeta, CalculateManyComparatorOutput, CalculateOneComparatorAction, CalculateOneComparatorInput, CalculateOneComparatorMeta, CalculateOneComparatorOutput, ClearAllOverridesAction, ClearAllOverridesInput, ClearAllOverridesMeta, ClearAllOverridesOutput, ClearGradingAction, ClearGradingInput, ClearGradingMeta, ClearGradingOutput, CreateGradingAndScoresAction, CreateGradingAndScoresInput, CreateGradingAndScoresMeta, CreateGradingAndScoresOutput, EditAnswerAction, EditAnswerInput, EditAnswerMeta, EditAnswerOutput, GenerateGradingAction, GenerateGradingInput, GenerateGradingMeta, GenerateGradingOutput, GradingComparator, GradingComparatorComparison, HasUnderstandAction, HasUnderstandInput, HasUnderstandMeta, HasUnderstandOutput, NotUnderstandAction, NotUnderstandInput, NotUnderstandMeta, NotUnderstandOutput, PrepareConflictAction, PrepareConflictInput, PrepareConflictMeta, PrepareConflictOutput, PresenceSessionStudentAction, PresenceSessionStudentInput, PresenceSessionStudentMeta, PresenceSessionStudentOutput, PresenceSessionTeacherAction, PresenceSessionTeacherInput, PresenceSessionTeacherMeta, PresenceSessionTeacherOutput, RasionalizeGradingAction, RasionalizeGradingInput, RasionalizeGradingMeta, RasionalizeGradingOutput, SendAnswerAction, SendAnswerInput, SendAnswerMeta, SendAnswerOutput, SendQuestionAction, SendQuestionInput, SendQuestionMeta, SendQuestionOutput, SetSomethingAction, SetSomethingInput, SetSomethingMeta, SetSomethingOutput, SyncCommitmentAction, SyncCommitmentInput, SyncCommitmentMeta, SyncCommitmentOutput, UpdateGradingAndScoresAction, UpdateGradingAndScoresInput, UpdateGradingAndScoresMeta, UpdateGradingAndScoresOutput, _calculateComparison, acceptQuestion, index as actions, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, editAnswer, generateGrading, hasUnderstand, notUnderstand, prepareConflict, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, sendAnswer, sendQuestion, setSomething, syncCommitment, updateGradingAndScores };
package/build/index.mjs CHANGED
@@ -1009,7 +1009,8 @@ const sendAnswer = Action.define({
1009
1009
  teacher: { id: 1 },
1010
1010
  detail: 1,
1011
1011
  images: 1,
1012
- acceptedAt: 1
1012
+ acceptedAt: 1,
1013
+ answeredAt: 1
1013
1014
  }
1014
1015
  })
1015
1016
  },
@@ -1031,16 +1032,27 @@ const sendAnswer = Action.define({
1031
1032
  answeredImages: dataAnswer.images
1032
1033
  }
1033
1034
  );
1034
- await dbAnswer.updateOne(
1035
- {
1036
- _id: dataAnswer.id
1037
- },
1038
- {
1039
- status: "answered",
1040
- answeredAt: new Date(),
1041
- duration: Math.round(durationResult)
1042
- }
1043
- );
1035
+ if (!dataAnswer.answeredAt) {
1036
+ await dbAnswer.updateOne(
1037
+ {
1038
+ _id: dataAnswer.id
1039
+ },
1040
+ {
1041
+ status: "answered",
1042
+ answeredAt: new Date(),
1043
+ duration: Math.round(durationResult)
1044
+ }
1045
+ );
1046
+ } else {
1047
+ await dbAnswer.updateOne(
1048
+ {
1049
+ _id: dataAnswer.id
1050
+ },
1051
+ {
1052
+ status: "answered"
1053
+ }
1054
+ );
1055
+ }
1044
1056
  return Result.ok({
1045
1057
  state: "sendAnswer",
1046
1058
  message: "Jawaban berhasil dikirim"
@@ -1130,6 +1142,70 @@ const sendQuestion = Action.define({
1130
1142
  }
1131
1143
  });
1132
1144
 
1145
+ const notUnderstand = Action.define({
1146
+ key: "notUnderstand",
1147
+ name: "Not Understand",
1148
+ type: "command",
1149
+ category: "domain",
1150
+ execute: async (input, stream) => {
1151
+ const dbs = stream.core.dbs;
1152
+ const dbQuestion = dbs["neu-tanya"].models["neu:tanya:question"];
1153
+ const dbAnswer = dbs["neu-tanya"].models["neu:tanya:answer"];
1154
+ await dbQuestion.updateOne(
1155
+ {
1156
+ _id: input.questionId
1157
+ },
1158
+ {
1159
+ status: "answering"
1160
+ }
1161
+ );
1162
+ await dbAnswer.updateOne(
1163
+ {
1164
+ questionId: input.questionId
1165
+ },
1166
+ {
1167
+ status: "answering"
1168
+ }
1169
+ );
1170
+ return Result.ok({
1171
+ state: "notUnderstand",
1172
+ message: "Pertanyaan berhasil diterima"
1173
+ });
1174
+ }
1175
+ });
1176
+
1177
+ const hasUnderstand = Action.define({
1178
+ key: "hasUnderstand",
1179
+ name: "Has Understand",
1180
+ type: "command",
1181
+ category: "domain",
1182
+ execute: async (input, stream) => {
1183
+ const dbs = stream.core.dbs;
1184
+ const dbQuestion = dbs["neu-tanya"].models["neu:tanya:question"];
1185
+ const dbAnswer = dbs["neu-tanya"].models["neu:tanya:answer"];
1186
+ await dbQuestion.updateOne(
1187
+ {
1188
+ _id: input.questionId
1189
+ },
1190
+ {
1191
+ status: "done"
1192
+ }
1193
+ );
1194
+ await dbAnswer.updateOne(
1195
+ {
1196
+ questionId: input.questionId
1197
+ },
1198
+ {
1199
+ status: "done"
1200
+ }
1201
+ );
1202
+ return Result.ok({
1203
+ state: "hasUnderstand",
1204
+ message: "Pertanyaan berhasil diterima"
1205
+ });
1206
+ }
1207
+ });
1208
+
1133
1209
  const index = {
1134
1210
  __proto__: null,
1135
1211
  _calculateComparison: _calculateComparison,
@@ -1142,6 +1218,8 @@ const index = {
1142
1218
  createGradingAndScores: createGradingAndScores,
1143
1219
  editAnswer: editAnswer,
1144
1220
  generateGrading: generateGrading,
1221
+ hasUnderstand: hasUnderstand,
1222
+ notUnderstand: notUnderstand,
1145
1223
  prepareConflict: prepareConflict,
1146
1224
  presenceSessionStudent: presenceSessionStudent,
1147
1225
  presenceSessionTeacher: presenceSessionTeacher,
@@ -1153,4 +1231,4 @@ const index = {
1153
1231
  updateGradingAndScores: updateGradingAndScores
1154
1232
  };
1155
1233
 
1156
- export { _calculateComparison, acceptQuestion, index as actions, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, editAnswer, generateGrading, prepareConflict, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, sendAnswer, sendQuestion, setSomething, syncCommitment, updateGradingAndScores };
1234
+ export { _calculateComparison, acceptQuestion, index as actions, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, editAnswer, generateGrading, hasUnderstand, notUnderstand, prepareConflict, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, sendAnswer, sendQuestion, setSomething, syncCommitment, updateGradingAndScores };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neutron.co.id/pendidikan-operation",
3
- "version": "1.4.0-beta.3",
3
+ "version": "1.4.0-beta.5",
4
4
  "description": "Operation package of Neutron Pendidikan.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "contributors": [
@@ -29,19 +29,19 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@bluelibs/nova": "1.4.2",
32
- "@neon.id/core": "1.25.0",
32
+ "@neon.id/core": "1.25.1",
33
33
  "@neon.id/gerbang-js": "0.6.2",
34
- "@neon.id/model": "0.56.3",
35
- "@neon.id/operation": "0.32.1",
36
- "@neon.id/permit": "0.16.0",
37
- "@neon.id/query": "0.39.0",
38
- "@neon.id/types": "1.36.3",
39
- "@neon.id/utils": "0.36.0",
40
- "@neutron.co.id/akademik-models": "1.2.0",
41
- "@neutron.co.id/jadwal-models": "1.2.1-beta.1",
42
- "@neutron.co.id/penilaian-models": "1.4.0-beta.1",
34
+ "@neon.id/model": "0.58.0",
35
+ "@neon.id/operation": "0.33.0",
36
+ "@neon.id/permit": "0.16.1",
37
+ "@neon.id/query": "0.40.0",
38
+ "@neon.id/types": "1.37.0",
39
+ "@neon.id/utils": "0.37.0",
40
+ "@neutron.co.id/akademik-models": "1.2.1-beta.2",
41
+ "@neutron.co.id/jadwal-models": "1.2.1-beta.2",
42
+ "@neutron.co.id/penilaian-models": "1.4.0-beta.2",
43
43
  "@neutron.co.id/personalia-models": "1.1.0",
44
- "@neutron.co.id/tanya-models": "1.1.1-beta.1",
44
+ "@neutron.co.id/tanya-models": "1.1.1-beta.3",
45
45
  "mongoose": "6.9.1",
46
46
  "nanoid": "4.0.1",
47
47
  "ofetch": "1.0.0"
@@ -59,23 +59,23 @@
59
59
  },
60
60
  "peerDependencies": {
61
61
  "@bluelibs/nova": "1.4.2",
62
- "@neon.id/core": "^1.25.0",
62
+ "@neon.id/core": "^1.25.1",
63
63
  "@neon.id/gerbang-js": "^0.6.2",
64
- "@neon.id/model": "^0.56.3",
65
- "@neon.id/operation": "^0.32.1",
66
- "@neon.id/permit": "^0.16.0",
67
- "@neon.id/query": "^0.39.0",
68
- "@neon.id/types": "^1.36.3",
69
- "@neon.id/utils": "^0.36.0",
70
- "@neutron.co.id/akademik-models": "^1.2.0",
71
- "@neutron.co.id/jadwal-models": "^1.2.1-beta.1",
72
- "@neutron.co.id/penilaian-models": "^1.4.0-beta.1",
73
- "@neutron.co.id/tanya-models": "^1.1.1-beta.1",
64
+ "@neon.id/model": "^0.58.0",
65
+ "@neon.id/operation": "^0.33.0",
66
+ "@neon.id/permit": "^0.16.1",
67
+ "@neon.id/query": "^0.40.0",
68
+ "@neon.id/types": "^1.37.0",
69
+ "@neon.id/utils": "^0.37.0",
70
+ "@neutron.co.id/akademik-models": "^1.2.1-beta.2",
71
+ "@neutron.co.id/jadwal-models": "^1.2.1-beta.2",
72
+ "@neutron.co.id/penilaian-models": "^1.4.0-beta.2",
73
+ "@neutron.co.id/tanya-models": "^1.1.1-beta.3",
74
74
  "mongoose": "^6.9.1",
75
75
  "ofetch": "^1.0.0"
76
76
  },
77
77
  "publishConfig": {
78
78
  "access": "public"
79
79
  },
80
- "build": 18
80
+ "build": 20
81
81
  }