@neutron.co.id/pendidikan-operation 1.5.4 → 1.5.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
@@ -3,6 +3,7 @@
3
3
  const core = require('@neon.id/core');
4
4
  const operation = require('@neon.id/operation');
5
5
  const query = require('@neon.id/query');
6
+ const dayjs = require('dayjs');
6
7
  const value = require('@neon.id/utils/value');
7
8
 
8
9
  const setSomething = operation.Action.define({
@@ -250,6 +251,26 @@ const getStudentId = operation.Action.define({
250
251
  }
251
252
  });
252
253
 
254
+ const getStaffId = operation.Action.define({
255
+ key: "getStaffId",
256
+ name: "Get StaffId",
257
+ type: "command",
258
+ category: "domain",
259
+ execute: async (input, stream) => {
260
+ const dbs = stream.core.dbs;
261
+ const dbStaff = dbs["neu-personalia"].models["neu:personalia:staff"];
262
+ const findStaff = await dbStaff.findOne({ userId: input.userId });
263
+ return core.Result.ok({
264
+ state: "StaffIdGet",
265
+ message: "StaffId has been get.",
266
+ data: {
267
+ staffId: findStaff.id,
268
+ branchIds: findStaff.branchIds
269
+ }
270
+ });
271
+ }
272
+ });
273
+
253
274
  const prepareConflict = operation.Action.define({
254
275
  key: "prepareConflict",
255
276
  name: "Prepare Conflict",
@@ -382,6 +403,38 @@ const allConflict = operation.Action.define({
382
403
  }
383
404
  });
384
405
 
406
+ const createManySession = operation.Action.define({
407
+ key: "createManySession",
408
+ name: "Create ManySession",
409
+ type: "command",
410
+ category: "domain",
411
+ execute: async (input, stream) => {
412
+ const dbs = stream.core.dbs;
413
+ const dbSession = dbs["neu-jadwal"].models["neu:jadwal:classSession"];
414
+ const sekarang = dayjs(/* @__PURE__ */ new Date());
415
+ let besok = dayjs();
416
+ let intervalCount = 0;
417
+ for (let i = 0; i < input.frequency; i++) {
418
+ intervalCount += input.interval;
419
+ besok = sekarang.add(intervalCount, "d");
420
+ await dbSession.create({
421
+ status: "draft",
422
+ isTeacherShown: true,
423
+ isTeacherSubtituted: false,
424
+ startedAt: besok.minute(0).second(0).millisecond(0).toISOString(),
425
+ endedAt: besok.add(1, "h").minute(30).second(0).millisecond(0).toISOString()
426
+ });
427
+ }
428
+ return core.Result.ok({
429
+ state: "manySessionCreate",
430
+ message: "Many Session has been create.",
431
+ data: {
432
+ code: 1
433
+ }
434
+ });
435
+ }
436
+ });
437
+
385
438
  const generateGrading = operation.Action.define({
386
439
  key: "generateGrading",
387
440
  name: "Create Penilaian dan Score",
@@ -1376,8 +1429,10 @@ const index = {
1376
1429
  clearAllOverrides: clearAllOverrides,
1377
1430
  clearGrading: clearGrading,
1378
1431
  createGradingAndScores: createGradingAndScores,
1432
+ createManySession: createManySession,
1379
1433
  editAnswer: editAnswer,
1380
1434
  generateGrading: generateGrading,
1435
+ getStaffId: getStaffId,
1381
1436
  getStudentId: getStudentId,
1382
1437
  hasUnderstand: hasUnderstand,
1383
1438
  notUnderstand: notUnderstand,
@@ -1402,8 +1457,10 @@ exports.calculateOneComparator = calculateOneComparator;
1402
1457
  exports.clearAllOverrides = clearAllOverrides;
1403
1458
  exports.clearGrading = clearGrading;
1404
1459
  exports.createGradingAndScores = createGradingAndScores;
1460
+ exports.createManySession = createManySession;
1405
1461
  exports.editAnswer = editAnswer;
1406
1462
  exports.generateGrading = generateGrading;
1463
+ exports.getStaffId = getStaffId;
1407
1464
  exports.getStudentId = getStudentId;
1408
1465
  exports.hasUnderstand = hasUnderstand;
1409
1466
  exports.notUnderstand = notUnderstand;
package/build/index.d.ts CHANGED
@@ -67,6 +67,18 @@ interface GetStudentIdMeta {
67
67
  declare const getStudentId: Action<"getStudentId", GetStudentIdInput, GetStudentIdOutput, GetStudentIdMeta>;
68
68
  type GetStudentIdAction = typeof getStudentId;
69
69
 
70
+ interface GetStaffIdInput {
71
+ userId: any;
72
+ }
73
+ interface GetStaffIdOutput {
74
+ staffId: any;
75
+ branchIds: any;
76
+ }
77
+ interface GetStaffIdMeta {
78
+ }
79
+ declare const getStaffId: Action<"getStaffId", GetStaffIdInput, GetStaffIdOutput, GetStaffIdMeta>;
80
+ type GetStaffIdAction = typeof getStaffId;
81
+
70
82
  interface PrepareConflictInput {
71
83
  userId: string;
72
84
  startedAt: string;
@@ -96,6 +108,18 @@ interface AllConflictMeta {
96
108
  declare const allConflict: Action<"allConflict", AllConflictInput, AllConflictOutput, AllConflictMeta>;
97
109
  type AllConflictAction = typeof allConflict;
98
110
 
111
+ interface CreateManySessionInput {
112
+ frequency: number;
113
+ interval: number;
114
+ }
115
+ interface CreateManySessionOutput {
116
+ code: number;
117
+ }
118
+ interface CreateManySessionMeta {
119
+ }
120
+ declare const createManySession: Action<"createManySession", CreateManySessionInput, CreateManySessionOutput, CreateManySessionMeta>;
121
+ type CreateManySessionAction = typeof createManySession;
122
+
99
123
  interface CalculateGradingInput {
100
124
  gradingInsertId: string;
101
125
  gradingContextIds: string[];
@@ -311,6 +335,10 @@ type index_CreateGradingAndScoresAction = CreateGradingAndScoresAction;
311
335
  type index_CreateGradingAndScoresInput = CreateGradingAndScoresInput;
312
336
  type index_CreateGradingAndScoresMeta = CreateGradingAndScoresMeta;
313
337
  type index_CreateGradingAndScoresOutput = CreateGradingAndScoresOutput;
338
+ type index_CreateManySessionAction = CreateManySessionAction;
339
+ type index_CreateManySessionInput = CreateManySessionInput;
340
+ type index_CreateManySessionMeta = CreateManySessionMeta;
341
+ type index_CreateManySessionOutput = CreateManySessionOutput;
314
342
  type index_EditAnswerAction = EditAnswerAction;
315
343
  type index_EditAnswerInput = EditAnswerInput;
316
344
  type index_EditAnswerMeta = EditAnswerMeta;
@@ -319,6 +347,10 @@ type index_GenerateGradingAction = GenerateGradingAction;
319
347
  type index_GenerateGradingInput = GenerateGradingInput;
320
348
  type index_GenerateGradingMeta = GenerateGradingMeta;
321
349
  type index_GenerateGradingOutput = GenerateGradingOutput;
350
+ type index_GetStaffIdAction = GetStaffIdAction;
351
+ type index_GetStaffIdInput = GetStaffIdInput;
352
+ type index_GetStaffIdMeta = GetStaffIdMeta;
353
+ type index_GetStaffIdOutput = GetStaffIdOutput;
322
354
  type index_GetStudentIdAction = GetStudentIdAction;
323
355
  type index_GetStudentIdInput = GetStudentIdInput;
324
356
  type index_GetStudentIdMeta = GetStudentIdMeta;
@@ -378,8 +410,10 @@ declare const index_calculateOneComparator: typeof calculateOneComparator;
378
410
  declare const index_clearAllOverrides: typeof clearAllOverrides;
379
411
  declare const index_clearGrading: typeof clearGrading;
380
412
  declare const index_createGradingAndScores: typeof createGradingAndScores;
413
+ declare const index_createManySession: typeof createManySession;
381
414
  declare const index_editAnswer: typeof editAnswer;
382
415
  declare const index_generateGrading: typeof generateGrading;
416
+ declare const index_getStaffId: typeof getStaffId;
383
417
  declare const index_getStudentId: typeof getStudentId;
384
418
  declare const index_hasUnderstand: typeof hasUnderstand;
385
419
  declare const index_notUnderstand: typeof notUnderstand;
@@ -426,6 +460,10 @@ declare namespace index {
426
460
  index_CreateGradingAndScoresInput as CreateGradingAndScoresInput,
427
461
  index_CreateGradingAndScoresMeta as CreateGradingAndScoresMeta,
428
462
  index_CreateGradingAndScoresOutput as CreateGradingAndScoresOutput,
463
+ index_CreateManySessionAction as CreateManySessionAction,
464
+ index_CreateManySessionInput as CreateManySessionInput,
465
+ index_CreateManySessionMeta as CreateManySessionMeta,
466
+ index_CreateManySessionOutput as CreateManySessionOutput,
429
467
  index_EditAnswerAction as EditAnswerAction,
430
468
  index_EditAnswerInput as EditAnswerInput,
431
469
  index_EditAnswerMeta as EditAnswerMeta,
@@ -434,6 +472,10 @@ declare namespace index {
434
472
  index_GenerateGradingInput as GenerateGradingInput,
435
473
  index_GenerateGradingMeta as GenerateGradingMeta,
436
474
  index_GenerateGradingOutput as GenerateGradingOutput,
475
+ index_GetStaffIdAction as GetStaffIdAction,
476
+ index_GetStaffIdInput as GetStaffIdInput,
477
+ index_GetStaffIdMeta as GetStaffIdMeta,
478
+ index_GetStaffIdOutput as GetStaffIdOutput,
437
479
  index_GetStudentIdAction as GetStudentIdAction,
438
480
  index_GetStudentIdInput as GetStudentIdInput,
439
481
  index_GetStudentIdMeta as GetStudentIdMeta,
@@ -493,8 +535,10 @@ declare namespace index {
493
535
  index_clearAllOverrides as clearAllOverrides,
494
536
  index_clearGrading as clearGrading,
495
537
  index_createGradingAndScores as createGradingAndScores,
538
+ index_createManySession as createManySession,
496
539
  index_editAnswer as editAnswer,
497
540
  index_generateGrading as generateGrading,
541
+ index_getStaffId as getStaffId,
498
542
  index_getStudentId as getStudentId,
499
543
  index_hasUnderstand as hasUnderstand,
500
544
  index_notUnderstand as notUnderstand,
@@ -510,4 +554,4 @@ declare namespace index {
510
554
  };
511
555
  }
512
556
 
513
- export { AcceptQuestionAction, AcceptQuestionInput, AcceptQuestionMeta, AcceptQuestionOutput, AllConflictAction, AllConflictInput, AllConflictMeta, AllConflictOutput, 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, GetStudentIdAction, GetStudentIdInput, GetStudentIdMeta, GetStudentIdOutput, 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, allConflict, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, editAnswer, generateGrading, getStudentId, hasUnderstand, notUnderstand, prepareConflict, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, sendAnswer, sendQuestion, setSomething, syncCommitment, updateGradingAndScores };
557
+ export { AcceptQuestionAction, AcceptQuestionInput, AcceptQuestionMeta, AcceptQuestionOutput, AllConflictAction, AllConflictInput, AllConflictMeta, AllConflictOutput, CalculateGradingAction, CalculateGradingInput, CalculateGradingMeta, CalculateGradingOutput, CalculateManyComparatorAction, CalculateManyComparatorInput, CalculateManyComparatorMeta, CalculateManyComparatorOutput, CalculateOneComparatorAction, CalculateOneComparatorInput, CalculateOneComparatorMeta, CalculateOneComparatorOutput, ClearAllOverridesAction, ClearAllOverridesInput, ClearAllOverridesMeta, ClearAllOverridesOutput, ClearGradingAction, ClearGradingInput, ClearGradingMeta, ClearGradingOutput, CreateGradingAndScoresAction, CreateGradingAndScoresInput, CreateGradingAndScoresMeta, CreateGradingAndScoresOutput, CreateManySessionAction, CreateManySessionInput, CreateManySessionMeta, CreateManySessionOutput, EditAnswerAction, EditAnswerInput, EditAnswerMeta, EditAnswerOutput, GenerateGradingAction, GenerateGradingInput, GenerateGradingMeta, GenerateGradingOutput, GetStaffIdAction, GetStaffIdInput, GetStaffIdMeta, GetStaffIdOutput, GetStudentIdAction, GetStudentIdInput, GetStudentIdMeta, GetStudentIdOutput, 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, allConflict, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, createManySession, editAnswer, generateGrading, getStaffId, getStudentId, hasUnderstand, notUnderstand, prepareConflict, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, sendAnswer, sendQuestion, setSomething, syncCommitment, updateGradingAndScores };
package/build/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Result } from '@neon.id/core';
2
2
  import { Action } from '@neon.id/operation';
3
3
  import { Query } from '@neon.id/query';
4
+ import dayjs from 'dayjs';
4
5
  import { ValueUtil } from '@neon.id/utils/value';
5
6
 
6
7
  const setSomething = Action.define({
@@ -248,6 +249,26 @@ const getStudentId = Action.define({
248
249
  }
249
250
  });
250
251
 
252
+ const getStaffId = Action.define({
253
+ key: "getStaffId",
254
+ name: "Get StaffId",
255
+ type: "command",
256
+ category: "domain",
257
+ execute: async (input, stream) => {
258
+ const dbs = stream.core.dbs;
259
+ const dbStaff = dbs["neu-personalia"].models["neu:personalia:staff"];
260
+ const findStaff = await dbStaff.findOne({ userId: input.userId });
261
+ return Result.ok({
262
+ state: "StaffIdGet",
263
+ message: "StaffId has been get.",
264
+ data: {
265
+ staffId: findStaff.id,
266
+ branchIds: findStaff.branchIds
267
+ }
268
+ });
269
+ }
270
+ });
271
+
251
272
  const prepareConflict = Action.define({
252
273
  key: "prepareConflict",
253
274
  name: "Prepare Conflict",
@@ -380,6 +401,38 @@ const allConflict = Action.define({
380
401
  }
381
402
  });
382
403
 
404
+ const createManySession = Action.define({
405
+ key: "createManySession",
406
+ name: "Create ManySession",
407
+ type: "command",
408
+ category: "domain",
409
+ execute: async (input, stream) => {
410
+ const dbs = stream.core.dbs;
411
+ const dbSession = dbs["neu-jadwal"].models["neu:jadwal:classSession"];
412
+ const sekarang = dayjs(/* @__PURE__ */ new Date());
413
+ let besok = dayjs();
414
+ let intervalCount = 0;
415
+ for (let i = 0; i < input.frequency; i++) {
416
+ intervalCount += input.interval;
417
+ besok = sekarang.add(intervalCount, "d");
418
+ await dbSession.create({
419
+ status: "draft",
420
+ isTeacherShown: true,
421
+ isTeacherSubtituted: false,
422
+ startedAt: besok.minute(0).second(0).millisecond(0).toISOString(),
423
+ endedAt: besok.add(1, "h").minute(30).second(0).millisecond(0).toISOString()
424
+ });
425
+ }
426
+ return Result.ok({
427
+ state: "manySessionCreate",
428
+ message: "Many Session has been create.",
429
+ data: {
430
+ code: 1
431
+ }
432
+ });
433
+ }
434
+ });
435
+
383
436
  const generateGrading = Action.define({
384
437
  key: "generateGrading",
385
438
  name: "Create Penilaian dan Score",
@@ -1374,8 +1427,10 @@ const index = {
1374
1427
  clearAllOverrides: clearAllOverrides,
1375
1428
  clearGrading: clearGrading,
1376
1429
  createGradingAndScores: createGradingAndScores,
1430
+ createManySession: createManySession,
1377
1431
  editAnswer: editAnswer,
1378
1432
  generateGrading: generateGrading,
1433
+ getStaffId: getStaffId,
1379
1434
  getStudentId: getStudentId,
1380
1435
  hasUnderstand: hasUnderstand,
1381
1436
  notUnderstand: notUnderstand,
@@ -1390,4 +1445,4 @@ const index = {
1390
1445
  updateGradingAndScores: updateGradingAndScores
1391
1446
  };
1392
1447
 
1393
- export { _calculateComparison, acceptQuestion, index as actions, allConflict, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, editAnswer, generateGrading, getStudentId, hasUnderstand, notUnderstand, prepareConflict, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, sendAnswer, sendQuestion, setSomething, syncCommitment, updateGradingAndScores };
1448
+ export { _calculateComparison, acceptQuestion, index as actions, allConflict, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, createManySession, editAnswer, generateGrading, getStaffId, getStudentId, 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.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "Operation package of Neutron Pendidikan.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "contributors": [
@@ -37,11 +37,12 @@
37
37
  "@neon.id/query": "0.41.0",
38
38
  "@neon.id/types": "1.38.0",
39
39
  "@neon.id/utils": "0.39.0",
40
- "@neutron.co.id/akademik-models": "1.3.3",
41
- "@neutron.co.id/jadwal-models": "1.3.3",
42
- "@neutron.co.id/penilaian-models": "1.5.3",
40
+ "@neutron.co.id/akademik-models": "1.3.4",
41
+ "@neutron.co.id/jadwal-models": "1.3.4",
42
+ "@neutron.co.id/penilaian-models": "1.5.4",
43
43
  "@neutron.co.id/personalia-models": "1.4.0",
44
- "@neutron.co.id/tanya-models": "1.2.3",
44
+ "@neutron.co.id/tanya-models": "1.2.4",
45
+ "dayjs": "1.11.7",
45
46
  "mongoose": "6.10.0",
46
47
  "nanoid": "4.0.1",
47
48
  "ofetch": "1.0.1"
@@ -67,15 +68,16 @@
67
68
  "@neon.id/query": "^0.41.0",
68
69
  "@neon.id/types": "^1.38.0",
69
70
  "@neon.id/utils": "^0.39.0",
70
- "@neutron.co.id/akademik-models": "^1.3.3",
71
- "@neutron.co.id/jadwal-models": "^1.3.3",
72
- "@neutron.co.id/penilaian-models": "^1.5.3",
73
- "@neutron.co.id/tanya-models": "^1.2.3",
71
+ "@neutron.co.id/akademik-models": "^1.3.4",
72
+ "@neutron.co.id/jadwal-models": "^1.3.4",
73
+ "@neutron.co.id/penilaian-models": "^1.5.4",
74
+ "@neutron.co.id/tanya-models": "^1.2.4",
75
+ "dayjs": "1.11.7",
74
76
  "mongoose": "^6.10.0",
75
77
  "ofetch": "^1.0.1"
76
78
  },
77
79
  "publishConfig": {
78
80
  "access": "public"
79
81
  },
80
- "build": 36
82
+ "build": 38
81
83
  }