@neutron.co.id/pendidikan-operation 1.26.12 → 1.26.14

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.
@@ -17,7 +17,8 @@ function useImportData(stream) {
17
17
  async function _gradingMapper(stream2, input) {
18
18
  const studentMap = await findStudentsByIdsAndNis(stream2, input.gradings);
19
19
  const operations = [];
20
- for (const grading of input.gradings) {
20
+ const validGradings = input.gradings.filter((grading) => grading.userId);
21
+ for (const grading of validGradings) {
21
22
  const student = studentMap.get(grading?.userId) || studentMap.get(grading?.nis) || studentMap.get(grading?.stageId) || studentMap.get(grading?.branchId);
22
23
  const { userId, nis, name, institution, remark, ...scores } = grading;
23
24
  const parsedScores = Object.fromEntries(
@@ -60,14 +61,12 @@ function useImportData(stream) {
60
61
  }
61
62
  async function findStudentsByIdsAndNis(stream2, gradings) {
62
63
  const allUserIds = gradings.map((grading) => grading?.userId).filter(Boolean);
63
- const allUsernis = gradings.map((grading) => grading?.nis).filter(Boolean);
64
64
  const results = await stream2.actions.data.getMany.execute({
65
65
  model: "neu:akademik:student",
66
66
  query: query.Query.define({
67
67
  filter: {
68
68
  $or: [
69
- { userId: { $in: allUserIds } },
70
- { nis: { $in: allUsernis } }
69
+ { userId: { $in: allUserIds } }
71
70
  ]
72
71
  },
73
72
  limit: constants.LIMIT_INFINITY,
@@ -15,7 +15,8 @@ function useImportData(stream) {
15
15
  async function _gradingMapper(stream2, input) {
16
16
  const studentMap = await findStudentsByIdsAndNis(stream2, input.gradings);
17
17
  const operations = [];
18
- for (const grading of input.gradings) {
18
+ const validGradings = input.gradings.filter((grading) => grading.userId);
19
+ for (const grading of validGradings) {
19
20
  const student = studentMap.get(grading?.userId) || studentMap.get(grading?.nis) || studentMap.get(grading?.stageId) || studentMap.get(grading?.branchId);
20
21
  const { userId, nis, name, institution, remark, ...scores } = grading;
21
22
  const parsedScores = Object.fromEntries(
@@ -58,14 +59,12 @@ function useImportData(stream) {
58
59
  }
59
60
  async function findStudentsByIdsAndNis(stream2, gradings) {
60
61
  const allUserIds = gradings.map((grading) => grading?.userId).filter(Boolean);
61
- const allUsernis = gradings.map((grading) => grading?.nis).filter(Boolean);
62
62
  const results = await stream2.actions.data.getMany.execute({
63
63
  model: "neu:akademik:student",
64
64
  query: Query.define({
65
65
  filter: {
66
66
  $or: [
67
- { userId: { $in: allUserIds } },
68
- { nis: { $in: allUsernis } }
67
+ { userId: { $in: allUserIds } }
69
68
  ]
70
69
  },
71
70
  limit: LIMIT_INFINITY,
@@ -78,7 +78,7 @@ function usePenilaian(stream) {
78
78
  const result = await stream2.actions.data.getMany.execute({
79
79
  model: "neu:penilaian:grading",
80
80
  query: query.Query.define({
81
- 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 } },
82
82
  limit: constants.LIMIT_INFINITY,
83
83
  fields: {
84
84
  id: 1,
@@ -76,7 +76,7 @@ function usePenilaian(stream) {
76
76
  const result = await stream2.actions.data.getMany.execute({
77
77
  model: "neu:penilaian:grading",
78
78
  query: Query.define({
79
- 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 } },
80
80
  limit: LIMIT_INFINITY,
81
81
  fields: {
82
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.12",
3
+ "version": "1.26.14",
4
4
  "description": "Operation package of Neutron Pendidikan.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "contributors": [
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "build": 98
86
+ "build": 100
87
87
  }