catchup-library-web 1.21.21 → 2.0.0

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/dist/index.mjs CHANGED
@@ -1245,57 +1245,57 @@ var retrieveStandardExamTypeIcon = (baseReportType) => {
1245
1245
  return "/icons/lgs.webp";
1246
1246
  }
1247
1247
  };
1248
- var retrieveCoterieTypeFromStandardExamCoterieType = (standardExamType, standardExamCoterieType) => {
1249
- if (standardExamCoterieType === "TURKISH") {
1248
+ var retrieveCoterieTypeFromStandardExamCoterieType = (type, coterieType) => {
1249
+ if (coterieType === "TURKISH") {
1250
1250
  return "TURKISH";
1251
- } else if (standardExamCoterieType === "SCIENCE") {
1251
+ } else if (coterieType === "SCIENCE") {
1252
1252
  return "SCIENCE";
1253
- } else if ((standardExamType === "TYT" || standardExamType === "AYT") && standardExamCoterieType === "PHYSICS") {
1253
+ } else if ((type === "TYT" || type === "AYT") && coterieType === "PHYSICS") {
1254
1254
  return "PHYSICS";
1255
- } else if (standardExamType === "LGS" && standardExamCoterieType === "PHYSICS") {
1255
+ } else if (type === "LGS" && coterieType === "PHYSICS") {
1256
1256
  return "SOCIAL_STUDIES";
1257
- } else if ((standardExamType === "TYT" || standardExamType === "AYT") && standardExamCoterieType === "CHEMISTRY") {
1257
+ } else if ((type === "TYT" || type === "AYT") && coterieType === "CHEMISTRY") {
1258
1258
  return "CHEMISTRY";
1259
- } else if (standardExamType === "LGS" && standardExamCoterieType === "CHEMISTRY") {
1259
+ } else if (type === "LGS" && coterieType === "CHEMISTRY") {
1260
1260
  return "SOCIAL_STUDIES";
1261
- } else if ((standardExamType === "TYT" || standardExamType === "AYT") && standardExamCoterieType === "BIOLOGY") {
1261
+ } else if ((type === "TYT" || type === "AYT") && coterieType === "BIOLOGY") {
1262
1262
  return "BIOLOGY";
1263
- } else if (standardExamType === "LGS" && standardExamCoterieType === "BIOLOGY") {
1263
+ } else if (type === "LGS" && coterieType === "BIOLOGY") {
1264
1264
  return "SOCIAL_STUDIES";
1265
- } else if ((standardExamType === "TYT" || standardExamType === "AYT") && standardExamCoterieType === "HISTORY") {
1265
+ } else if ((type === "TYT" || type === "AYT") && coterieType === "HISTORY") {
1266
1266
  return "HISTORY";
1267
- } else if ((standardExamType === "TYT" || standardExamType === "AYT") && standardExamCoterieType === "GEOGRAPHY") {
1267
+ } else if ((type === "TYT" || type === "AYT") && coterieType === "GEOGRAPHY") {
1268
1268
  return "GEOGRAPHY";
1269
- } else if (standardExamType === "LGS" && standardExamCoterieType === "HISTORY" || standardExamType === "LGS" && standardExamCoterieType === "GEOGRAPHY" || standardExamCoterieType === "REVOLUTION_HISTORY") {
1269
+ } else if (type === "LGS" && coterieType === "HISTORY" || type === "LGS" && coterieType === "GEOGRAPHY" || coterieType === "REVOLUTION_HISTORY") {
1270
1270
  return "SOCIAL_STUDIES";
1271
- } else if (standardExamCoterieType === "HISTORY_I" || standardExamCoterieType === "HISTORY_II") {
1271
+ } else if (coterieType === "HISTORY_I" || coterieType === "HISTORY_II") {
1272
1272
  return "HISTORY";
1273
- } else if (standardExamCoterieType === "GEOGRAPHY_I" || standardExamCoterieType === "GEOGRAPHY_II") {
1273
+ } else if (coterieType === "GEOGRAPHY_I" || coterieType === "GEOGRAPHY_II") {
1274
1274
  return "GEOGRAPHY";
1275
- } else if (standardExamCoterieType === "MATHEMATICS" || standardExamCoterieType === "GEOMETRY") {
1275
+ } else if (coterieType === "MATHEMATICS" || coterieType === "GEOMETRY") {
1276
1276
  return "MATHEMATICS";
1277
- } else if (standardExamCoterieType === "PHILOSOPHY" || standardExamCoterieType === "PHILOSOPHY_OR_CULTURE_AND_RELIGION_KNOWLEDGE") {
1277
+ } else if (coterieType === "PHILOSOPHY" || coterieType === "PHILOSOPHY_OR_CULTURE_AND_RELIGION_KNOWLEDGE") {
1278
1278
  return "PHILOSOPHY";
1279
- } else if ((standardExamType === "TYT" || standardExamType === "AYT") && standardExamCoterieType === "CULTURE_AND_RELIGION_KNOWLEDGE") {
1279
+ } else if ((type === "TYT" || type === "AYT") && coterieType === "CULTURE_AND_RELIGION_KNOWLEDGE") {
1280
1280
  return "CULTURE_AND_RELIGION_KNOWLEDGE";
1281
- } else if (standardExamType === "LGS" && standardExamCoterieType === "CULTURE_AND_RELIGION_KNOWLEDGE") {
1281
+ } else if (type === "LGS" && coterieType === "CULTURE_AND_RELIGION_KNOWLEDGE") {
1282
1282
  return "CULTURE_AND_RELIGION_KNOWLEDGE";
1283
- } else if (standardExamCoterieType === "ENGLISH") {
1283
+ } else if (coterieType === "ENGLISH") {
1284
1284
  return "ENGLISH";
1285
- } else if (standardExamCoterieType === "LITERATURE") {
1285
+ } else if (coterieType === "LITERATURE") {
1286
1286
  return "LITERATURE";
1287
1287
  }
1288
1288
  };
1289
- var retrieveStandardExamCoterieTypeOptionListByStandardExamType = (standardExamType) => {
1290
- if (standardExamType === "TYT") {
1289
+ var retrieveStandardExamCoterieTypeOptionListByStandardExamType = (type) => {
1290
+ if (type === "TYT") {
1291
1291
  return retrieveStandardExamCoterieTypeOptionList().filter(
1292
1292
  (item) => item.value === "TURKISH" || item.value === "HISTORY" || item.value === "GEOGRAPHY" || item.value === "PHILOSOPHY" || item.value === "CULTURE_AND_RELIGION_KNOWLEDGE" || item.value === "MATHEMATICS" || item.value === "GEOMETRY" || item.value === "PHYSICS" || item.value === "CHEMISTRY" || item.value === "BIOLOGY"
1293
1293
  );
1294
- } else if (standardExamType === "AYT") {
1294
+ } else if (type === "AYT") {
1295
1295
  return retrieveStandardExamCoterieTypeOptionList().filter(
1296
1296
  (item) => item.value === "LITERATURE" || item.value === "HISTORY_I" || item.value === "HISTORY_II" || item.value === "GEOGRAPHY_I" || item.value === "GEOGRAPHY_II" || item.value === "PHILOSOPHY" || item.value === "PHILOSOPHY_OR_CULTURE_AND_RELIGION_KNOWLEDGE" || item.value === "MATHEMATICS" || item.value === "GEOMETRY" || item.value === "PHYSICS" || item.value === "CHEMISTRY" || item.value === "BIOLOGY" || item.value === "ENGLISH"
1297
1297
  );
1298
- } else if (standardExamType === "LGS") {
1298
+ } else if (type === "LGS") {
1299
1299
  return retrieveStandardExamCoterieTypeOptionList().filter(
1300
1300
  (item) => item.value === "TURKISH" || item.value === "REVOLUTION_HISTORY" || item.value === "CULTURE_AND_RELIGION_KNOWLEDGE" || item.value === "MATHEMATICS" || item.value === "SCIENCE" || item.value === "ENGLISH"
1301
1301
  );
@@ -1458,12 +1458,12 @@ var retrieveValidationRequirementList_LGS = () => {
1458
1458
  }
1459
1459
  ];
1460
1460
  };
1461
- var retrieveValidationRequirementList = (selectedStandardExamType) => {
1462
- if (selectedStandardExamType === "TYT") {
1461
+ var retrieveValidationRequirementList = (type) => {
1462
+ if (type === "TYT") {
1463
1463
  return retrieveValidationRequirementList_TYT();
1464
- } else if (selectedStandardExamType === "AYT") {
1464
+ } else if (type === "AYT") {
1465
1465
  return retrieveValidationRequirementList_AYT();
1466
- } else if (selectedStandardExamType === "LGS") {
1466
+ } else if (type === "LGS") {
1467
1467
  return retrieveValidationRequirementList_LGS();
1468
1468
  }
1469
1469
  return [];
@@ -2421,11 +2421,11 @@ var retrieveFrequencyTypeOptionList = () => {
2421
2421
  }
2422
2422
  ];
2423
2423
  };
2424
- var retrieveDistintCoterieTypeFromCatchtivityApplicationDTO = (catchtivityApplicationDTOList) => {
2424
+ var retrieveDistinctCoterieTypeFromCorporatePersonalizedAssignmentApplicationDTO = (corporatePersonalizedAssignmentApplicationDTOList) => {
2425
2425
  const coterieTypeList = [];
2426
- for (const catchtivityApplicationDTO of catchtivityApplicationDTOList) {
2427
- const { catchtivityDTO } = catchtivityApplicationDTO;
2428
- const { coterieType } = catchtivityDTO;
2426
+ for (const corporatePersonalizedAssignmentApplicationDTO of corporatePersonalizedAssignmentApplicationDTOList) {
2427
+ const { corporatePersonalizedAssignmentDTO } = corporatePersonalizedAssignmentApplicationDTO;
2428
+ const { coterieType } = corporatePersonalizedAssignmentDTO;
2429
2429
  if (coterieTypeList.findIndex(
2430
2430
  (foundCoterieType) => foundCoterieType === coterieType
2431
2431
  ) === -1) {
@@ -2435,7 +2435,7 @@ var retrieveDistintCoterieTypeFromCatchtivityApplicationDTO = (catchtivityApplic
2435
2435
  return coterieTypeList;
2436
2436
  };
2437
2437
  var retrieveClockTimeLeft = (type, value, durationType, durationInMinutes, activityProgressDTOSet, activity) => {
2438
- if (type === "CATCHTIVITY" || type === "CATCHXAM" || type === "CONTEST") {
2438
+ if (type === "CORPORATE_PERSONALIZED_ASSIGNMENT" || type === "CORPORATE_ASSESSMENT_ASSIGNMENT" || type === "CONTEST") {
2439
2439
  if (durationType === "ALL") {
2440
2440
  return durationInMinutes ? durationInMinutes * 60 - retrieveTotalTimeSpentInSeconds(activityProgressDTOSet) : 0;
2441
2441
  } else if (durationType === "EACH") {
@@ -9016,8 +9016,8 @@ var retrieveUserAuthorityGeneralOptionList = () => {
9016
9016
  { text: i18n_default.t("all"), value: "" },
9017
9017
  { text: i18n_default.t("user"), value: "USER" },
9018
9018
  { text: i18n_default.t("activity"), value: "ACTIVITY" },
9019
- { text: i18n_default.t("catchtivity"), value: "CATCHTIVITY" },
9020
- { text: i18n_default.t("catchxam"), value: "CATCHXAM" },
9019
+ { text: i18n_default.t("corporate_personalized_assignment"), value: "CATCHTIVITY" },
9020
+ { text: i18n_default.t("corporate_assessment_assignment"), value: "CATCHXAM" },
9021
9021
  { text: i18n_default.t("label"), value: "LABEL" },
9022
9022
  { text: i18n_default.t("announcement"), value: "NOTIFICATION" },
9023
9023
  { text: i18n_default.t("report"), value: "REPORT" },
@@ -9031,8 +9031,8 @@ var retrieveUserAuthorityGeneralOptionList = () => {
9031
9031
  { text: i18n_default.t("grade"), value: "GRADE" },
9032
9032
  { text: i18n_default.t("branch"), value: "BRANCH" },
9033
9033
  { text: i18n_default.t("plan"), value: "PLAN" },
9034
- { text: i18n_default.t("standard_exam"), value: "STANDARD_EXAM" },
9035
- { text: i18n_default.t("etude"), value: "ETUDE" }
9034
+ { text: i18n_default.t("corporate_standard_exam"), value: "STANDARD_EXAM" },
9035
+ { text: i18n_default.t("completion_assignment"), value: "ETUDE" }
9036
9036
  ];
9037
9037
  };
9038
9038
  var filterGradeLevelOptionList = (institutionDTO, gradeDTO) => {
@@ -9435,19 +9435,19 @@ var filterCategoryVersionCodeOptionListByInstitutionDTO = (categoryVersionCodeOp
9435
9435
  }
9436
9436
  return currentCategoryVersionCodeOptionList;
9437
9437
  };
9438
- var constructCategoryTreeFromParentCode = (categorySet) => {
9438
+ var constructCategoryTreeFromParentCode = (categoryDTOList) => {
9439
9439
  const nodeMap = /* @__PURE__ */ new Map();
9440
9440
  const rootNodes = [];
9441
- categorySet.forEach((item) => {
9442
- const node = __spreadProps(__spreadValues({}, item), {
9441
+ categoryDTOList.forEach((categoryDTO) => {
9442
+ const node = __spreadProps(__spreadValues({}, categoryDTO), {
9443
9443
  subCategoryDTOList: []
9444
9444
  });
9445
- nodeMap.set(item.code, node);
9445
+ nodeMap.set(categoryDTO.code, node);
9446
9446
  });
9447
- categorySet.forEach((item) => {
9448
- const node = nodeMap.get(item.code);
9449
- if (item.parentCode && nodeMap.has(item.parentCode)) {
9450
- const parent = nodeMap.get(item.parentCode);
9447
+ categoryDTOList.forEach((categoryDTO) => {
9448
+ const node = nodeMap.get(categoryDTO.code);
9449
+ if (categoryDTO.parentCode && nodeMap.has(categoryDTO.parentCode)) {
9450
+ const parent = nodeMap.get(categoryDTO.parentCode);
9451
9451
  parent.subCategoryDTOList.push(node);
9452
9452
  } else {
9453
9453
  rootNodes.push(node);
@@ -9760,16 +9760,16 @@ var mergeObjects = (...objects) => {
9760
9760
  var retrieveSourceTypeOptionList = (coterieOnly) => {
9761
9761
  const currentSourceTypeOptionList = [
9762
9762
  {
9763
- value: "CATCHTIVITY",
9764
- text: i18n_default.t("CATCHTIVITY")
9763
+ value: "CORPORATE_PERSONALIZED_ASSIGNMENT",
9764
+ text: i18n_default.t("CORPORATE_PERSONALIZED_ASSIGNMENT")
9765
9765
  },
9766
9766
  {
9767
- value: "CATCHXAM",
9768
- text: i18n_default.t("CATCHXAM")
9767
+ value: "CORPORATE_ASSESSMENT_ASSIGNMENT",
9768
+ text: i18n_default.t("CORPORATE_ASSESSMENT_ASSIGNMENT")
9769
9769
  },
9770
9770
  {
9771
- value: "ETUDE",
9772
- text: i18n_default.t("ETUDE")
9771
+ value: "COMPLETION_ASSIGNMENT",
9772
+ text: i18n_default.t("COMPLETION_ASSIGNMENT")
9773
9773
  },
9774
9774
  {
9775
9775
  value: "CONTEST",
@@ -10116,23 +10116,31 @@ var retrieveBadgeRuleTextByParams = (coterieType, sourceType, trackingType, leve
10116
10116
  } else {
10117
10117
  return i18n_default.t("none_count_activity_time_spent_text");
10118
10118
  }
10119
- } else if (sourceType === "CATCHTIVITY") {
10119
+ } else if (sourceType === "CORPORATE_PERSONALIZED_ASSIGNMENT") {
10120
10120
  if (foundBadgeRule) {
10121
- return `${i18n_default.t("total_count_catchtivity_text_1")}${foundBadgeRule.value}${i18n_default.t("total_count_catchtivity_text_2")}`;
10121
+ return `${i18n_default.t(
10122
+ "total_count_corporate_personalized_assignment_text_1"
10123
+ )}${foundBadgeRule.value}${i18n_default.t(
10124
+ "total_count_corporate_personalized_assignment_text_2"
10125
+ )}`;
10122
10126
  } else {
10123
- return i18n_default.t("none_count_catchtivity_text");
10127
+ return i18n_default.t("none_count_corporate_personalized_assignment_text");
10124
10128
  }
10125
- } else if (sourceType === "CATCHXAM") {
10129
+ } else if (sourceType === "CORPORATE_ASSESSMENT_ASSIGNMENT") {
10126
10130
  if (foundBadgeRule) {
10127
- return `${i18n_default.t("total_count_catchxam_text_1")}${foundBadgeRule.value}${i18n_default.t("total_count_catchxam_text_2")}`;
10131
+ return `${i18n_default.t(
10132
+ "total_count_corporate_assessment_assignment_text_1"
10133
+ )}${foundBadgeRule.value}${i18n_default.t(
10134
+ "total_count_corporate_assessment_assignment_text_2"
10135
+ )}`;
10128
10136
  } else {
10129
- return i18n_default.t("none_count_catchxam_text");
10137
+ return i18n_default.t("none_count_corporate_assessment_assignment_text");
10130
10138
  }
10131
- } else if (sourceType === "ETUDE") {
10139
+ } else if (sourceType === "COMPLETION_ASSIGNMENT") {
10132
10140
  if (foundBadgeRule) {
10133
- return `${i18n_default.t("total_count_etude_text_1")}${foundBadgeRule.value}${i18n_default.t("total_count_etude_text_2")}`;
10141
+ return `${i18n_default.t("total_count_completion_assignment_text_1")}${foundBadgeRule.value}${i18n_default.t("total_count_completion_assignment_text_2")}`;
10134
10142
  } else {
10135
- return i18n_default.t("none_count_etude_text");
10143
+ return i18n_default.t("none_count_completion_assignment_text");
10136
10144
  }
10137
10145
  } else if (sourceType === "CONTEST") {
10138
10146
  if (foundBadgeRule) {
@@ -10172,23 +10180,31 @@ var retrieveBadgeRuleTextByParams = (coterieType, sourceType, trackingType, leve
10172
10180
  } else {
10173
10181
  return i18n_default.t("none_count_activity_time_spent_text");
10174
10182
  }
10175
- } else if (sourceType === "CATCHTIVITY") {
10183
+ } else if (sourceType === "CORPORATE_PERSONALIZED_ASSIGNMENT") {
10176
10184
  if (foundBadgeRule) {
10177
- return `${i18n_default.t("coterie_count_catchtivity_text_1")}${foundBadgeRule.value}${i18n_default.t("coterie_count_catchtivity_text_2")}`;
10185
+ return `${i18n_default.t(
10186
+ "coterie_count_corporate_personalized_assignment_text_1"
10187
+ )}${foundBadgeRule.value}${i18n_default.t(
10188
+ "coterie_count_corporate_personalized_assignment_text_2"
10189
+ )}`;
10178
10190
  } else {
10179
- return i18n_default.t("none_count_catchtivity_text");
10191
+ return i18n_default.t("none_count_corporate_personalized_assignment_text");
10180
10192
  }
10181
- } else if (sourceType === "CATCHXAM") {
10193
+ } else if (sourceType === "CORPORATE_ASSESSMENT_ASSIGNMENT") {
10182
10194
  if (foundBadgeRule) {
10183
- return `${i18n_default.t("coterie_count_catchxam_text_1")}${foundBadgeRule.value}${i18n_default.t("coterie_count_catchxam_text_2")}`;
10195
+ return `${i18n_default.t(
10196
+ "coterie_count_corporate_assessment_assignment_text_1"
10197
+ )}${foundBadgeRule.value}${i18n_default.t(
10198
+ "coterie_count_corporate_assessment_assignment_text_2"
10199
+ )}`;
10184
10200
  } else {
10185
- return i18n_default.t("none_count_catchxam_text");
10201
+ return i18n_default.t("none_count_corporate_assessment_assignment_text");
10186
10202
  }
10187
- } else if (sourceType === "ETUDE") {
10203
+ } else if (sourceType === "COMPLETION_ASSIGNMENT") {
10188
10204
  if (foundBadgeRule) {
10189
- return `${i18n_default.t("coterie_count_etude_text_1")}${foundBadgeRule.value}${i18n_default.t("coterie_count_etude_text_2")}`;
10205
+ return `${i18n_default.t("coterie_count_completion_assignment_text_1")}${foundBadgeRule.value}${i18n_default.t("coterie_count_completion_assignment_text_2")}`;
10190
10206
  } else {
10191
- return i18n_default.t("none_count_etude_text");
10207
+ return i18n_default.t("none_count_completion_assignment_text");
10192
10208
  }
10193
10209
  } else if (sourceType === "CONTEST") {
10194
10210
  if (foundBadgeRule) {
@@ -10445,26 +10461,31 @@ var recursivelyIncludeCategoryActivityAnswerDTOList = (parentCategoryActivityAns
10445
10461
  );
10446
10462
  }
10447
10463
  };
10448
- var constructCombinedCatchxamReportMap = (filteredSelectedLearnerCatchxamReportDTOList) => {
10449
- const combinedCatchxamReportMap = {};
10450
- const copyFilteredSelectedLearnerCatchxamReportDTOList = JSON.parse(
10451
- JSON.stringify(filteredSelectedLearnerCatchxamReportDTOList)
10464
+ var constructCombinedCorporateAssesmentAssignmentReportMap = (filteredSelectedLearnerCorporateAssessmentAssignmentReportDTOList) => {
10465
+ const combinedCorporateAssessmentAssignmentReportMap = {};
10466
+ const copyFilteredSelectedLearnerCorporateAssessmentAssignmentReportDTOList = JSON.parse(
10467
+ JSON.stringify(
10468
+ filteredSelectedLearnerCorporateAssessmentAssignmentReportDTOList
10469
+ )
10452
10470
  );
10453
- for (const learnerCatchxamReportDetailDTO of copyFilteredSelectedLearnerCatchxamReportDTOList) {
10454
- const { catchxamApplicationDTO, categoryActivityAnswerDTOList } = learnerCatchxamReportDetailDTO;
10455
- const { catchxamDTO } = catchxamApplicationDTO;
10456
- const { coterieType } = catchxamDTO;
10457
- const currentCategoryActivityAnswerDTOList = combinedCatchxamReportMap[coterieType];
10471
+ for (const learnerCorporateAssessmentAssignmentReportDetailDTO of copyFilteredSelectedLearnerCorporateAssessmentAssignmentReportDTOList) {
10472
+ const {
10473
+ corporateAssessmentAssignmentApplicationDTO,
10474
+ categoryActivityAnswerDTOList
10475
+ } = learnerCorporateAssessmentAssignmentReportDetailDTO;
10476
+ const { corporateAssessmentAssignmentDTO } = corporateAssessmentAssignmentApplicationDTO;
10477
+ const { coterieType } = corporateAssessmentAssignmentDTO;
10478
+ const currentCategoryActivityAnswerDTOList = combinedCorporateAssessmentAssignmentReportMap[coterieType];
10458
10479
  if (currentCategoryActivityAnswerDTOList) {
10459
10480
  recursivelyIncludeCategoryActivityAnswerDTOList(
10460
10481
  { currentCategoryActivityAnswerDTOList },
10461
10482
  categoryActivityAnswerDTOList
10462
10483
  );
10463
10484
  } else {
10464
- combinedCatchxamReportMap[coterieType] = categoryActivityAnswerDTOList;
10485
+ combinedCorporateAssessmentAssignmentReportMap[coterieType] = categoryActivityAnswerDTOList;
10465
10486
  }
10466
10487
  }
10467
- return combinedCatchxamReportMap;
10488
+ return combinedCorporateAssessmentAssignmentReportMap;
10468
10489
  };
10469
10490
  var constructOutcomeActivityScoreList = (data) => {
10470
10491
  const outcomeActivityScoreList = [];
@@ -10496,13 +10517,15 @@ var constructOutcomeActivityScoreList = (data) => {
10496
10517
  });
10497
10518
  return outcomeActivityScoreList;
10498
10519
  };
10499
- var constructCombinedOutcomeActivityScoreMapFromCombinedReport = (combinedCatchxamReportMap) => {
10520
+ var constructCombinedOutcomeActivityScoreMapFromCombinedReport = (combinedCorporateAssessmentAssignmentReportMap) => {
10500
10521
  const combinedOutcomeActivityScoreMap = {};
10501
- Object.keys(combinedCatchxamReportMap).forEach((coterieType) => {
10502
- const categoryActivityAnswerDTOList = combinedCatchxamReportMap[coterieType];
10503
- const outcomeActivityScoreListFromCoterieType = constructOutcomeActivityScoreList(categoryActivityAnswerDTOList);
10504
- combinedOutcomeActivityScoreMap[coterieType] = outcomeActivityScoreListFromCoterieType;
10505
- });
10522
+ Object.keys(combinedCorporateAssessmentAssignmentReportMap).forEach(
10523
+ (coterieType) => {
10524
+ const categoryActivityAnswerDTOList = combinedCorporateAssessmentAssignmentReportMap[coterieType];
10525
+ const outcomeActivityScoreListFromCoterieType = constructOutcomeActivityScoreList(categoryActivityAnswerDTOList);
10526
+ combinedOutcomeActivityScoreMap[coterieType] = outcomeActivityScoreListFromCoterieType;
10527
+ }
10528
+ );
10506
10529
  return combinedOutcomeActivityScoreMap;
10507
10530
  };
10508
10531
 
@@ -10813,7 +10836,7 @@ export {
10813
10836
  constructBaseNumericIndividualModel,
10814
10837
  constructBaseVerbalIndvidualModel,
10815
10838
  constructCategoryTreeFromParentCode,
10816
- constructCombinedCatchxamReportMap,
10839
+ constructCombinedCorporateAssesmentAssignmentReportMap,
10817
10840
  constructCombinedOutcomeActivityScoreMapFromCombinedReport,
10818
10841
  constructInputWithSpecialExpressionList,
10819
10842
  constructMonthName,
@@ -10877,7 +10900,7 @@ export {
10877
10900
  retrieveDifficultyByActivityTypeFromData,
10878
10901
  retrieveDifficultyOptionList,
10879
10902
  retrieveDiscountAmountTypeOptionList,
10880
- retrieveDistintCoterieTypeFromCatchtivityApplicationDTO,
10903
+ retrieveDistinctCoterieTypeFromCorporatePersonalizedAssignmentApplicationDTO,
10881
10904
  retrieveDocumentTypeFromAcceptedFormat,
10882
10905
  retrieveDocumentTypeFromExtension,
10883
10906
  retrieveDurationInMinutesOptionList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "1.21.21",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -183,100 +183,73 @@ export const retrieveStandardExamTypeIcon = (baseReportType: string) => {
183
183
  };
184
184
 
185
185
  export const retrieveCoterieTypeFromStandardExamCoterieType = (
186
- standardExamType: string,
187
- standardExamCoterieType: string
186
+ type: string,
187
+ coterieType: string
188
188
  ) => {
189
- if (standardExamCoterieType === "TURKISH") {
189
+ if (coterieType === "TURKISH") {
190
190
  return "TURKISH";
191
- } else if (standardExamCoterieType === "SCIENCE") {
191
+ } else if (coterieType === "SCIENCE") {
192
192
  return "SCIENCE";
193
- } else if (
194
- (standardExamType === "TYT" || standardExamType === "AYT") &&
195
- standardExamCoterieType === "PHYSICS"
196
- ) {
193
+ } else if ((type === "TYT" || type === "AYT") && coterieType === "PHYSICS") {
197
194
  return "PHYSICS";
198
- } else if (
199
- standardExamType === "LGS" &&
200
- standardExamCoterieType === "PHYSICS"
201
- ) {
195
+ } else if (type === "LGS" && coterieType === "PHYSICS") {
202
196
  return "SOCIAL_STUDIES";
203
197
  } else if (
204
- (standardExamType === "TYT" || standardExamType === "AYT") &&
205
- standardExamCoterieType === "CHEMISTRY"
198
+ (type === "TYT" || type === "AYT") &&
199
+ coterieType === "CHEMISTRY"
206
200
  ) {
207
201
  return "CHEMISTRY";
208
- } else if (
209
- standardExamType === "LGS" &&
210
- standardExamCoterieType === "CHEMISTRY"
211
- ) {
202
+ } else if (type === "LGS" && coterieType === "CHEMISTRY") {
212
203
  return "SOCIAL_STUDIES";
213
- } else if (
214
- (standardExamType === "TYT" || standardExamType === "AYT") &&
215
- standardExamCoterieType === "BIOLOGY"
216
- ) {
204
+ } else if ((type === "TYT" || type === "AYT") && coterieType === "BIOLOGY") {
217
205
  return "BIOLOGY";
218
- } else if (
219
- standardExamType === "LGS" &&
220
- standardExamCoterieType === "BIOLOGY"
221
- ) {
206
+ } else if (type === "LGS" && coterieType === "BIOLOGY") {
222
207
  return "SOCIAL_STUDIES";
223
- } else if (
224
- (standardExamType === "TYT" || standardExamType === "AYT") &&
225
- standardExamCoterieType === "HISTORY"
226
- ) {
208
+ } else if ((type === "TYT" || type === "AYT") && coterieType === "HISTORY") {
227
209
  return "HISTORY";
228
210
  } else if (
229
- (standardExamType === "TYT" || standardExamType === "AYT") &&
230
- standardExamCoterieType === "GEOGRAPHY"
211
+ (type === "TYT" || type === "AYT") &&
212
+ coterieType === "GEOGRAPHY"
231
213
  ) {
232
214
  return "GEOGRAPHY";
233
215
  } else if (
234
- (standardExamType === "LGS" && standardExamCoterieType === "HISTORY") ||
235
- (standardExamType === "LGS" && standardExamCoterieType === "GEOGRAPHY") ||
236
- standardExamCoterieType === "REVOLUTION_HISTORY"
216
+ (type === "LGS" && coterieType === "HISTORY") ||
217
+ (type === "LGS" && coterieType === "GEOGRAPHY") ||
218
+ coterieType === "REVOLUTION_HISTORY"
237
219
  ) {
238
220
  return "SOCIAL_STUDIES";
239
- } else if (
240
- standardExamCoterieType === "HISTORY_I" ||
241
- standardExamCoterieType === "HISTORY_II"
242
- ) {
221
+ } else if (coterieType === "HISTORY_I" || coterieType === "HISTORY_II") {
243
222
  return "HISTORY";
244
- } else if (
245
- standardExamCoterieType === "GEOGRAPHY_I" ||
246
- standardExamCoterieType === "GEOGRAPHY_II"
247
- ) {
223
+ } else if (coterieType === "GEOGRAPHY_I" || coterieType === "GEOGRAPHY_II") {
248
224
  return "GEOGRAPHY";
249
- } else if (
250
- standardExamCoterieType === "MATHEMATICS" ||
251
- standardExamCoterieType === "GEOMETRY"
252
- ) {
225
+ } else if (coterieType === "MATHEMATICS" || coterieType === "GEOMETRY") {
253
226
  return "MATHEMATICS";
254
227
  } else if (
255
- standardExamCoterieType === "PHILOSOPHY" ||
256
- standardExamCoterieType === "PHILOSOPHY_OR_CULTURE_AND_RELIGION_KNOWLEDGE"
228
+ coterieType === "PHILOSOPHY" ||
229
+ coterieType === "PHILOSOPHY_OR_CULTURE_AND_RELIGION_KNOWLEDGE"
257
230
  ) {
258
231
  return "PHILOSOPHY";
259
232
  } else if (
260
- (standardExamType === "TYT" || standardExamType === "AYT") &&
261
- standardExamCoterieType === "CULTURE_AND_RELIGION_KNOWLEDGE"
233
+ (type === "TYT" || type === "AYT") &&
234
+ coterieType === "CULTURE_AND_RELIGION_KNOWLEDGE"
262
235
  ) {
263
236
  return "CULTURE_AND_RELIGION_KNOWLEDGE";
264
237
  } else if (
265
- standardExamType === "LGS" &&
266
- standardExamCoterieType === "CULTURE_AND_RELIGION_KNOWLEDGE"
238
+ type === "LGS" &&
239
+ coterieType === "CULTURE_AND_RELIGION_KNOWLEDGE"
267
240
  ) {
268
241
  return "CULTURE_AND_RELIGION_KNOWLEDGE";
269
- } else if (standardExamCoterieType === "ENGLISH") {
242
+ } else if (coterieType === "ENGLISH") {
270
243
  return "ENGLISH";
271
- } else if (standardExamCoterieType === "LITERATURE") {
244
+ } else if (coterieType === "LITERATURE") {
272
245
  return "LITERATURE";
273
246
  }
274
247
  };
275
248
 
276
249
  export const retrieveStandardExamCoterieTypeOptionListByStandardExamType = (
277
- standardExamType: string
250
+ type: string
278
251
  ) => {
279
- if (standardExamType === "TYT") {
252
+ if (type === "TYT") {
280
253
  return retrieveStandardExamCoterieTypeOptionList().filter(
281
254
  (item) =>
282
255
  item.value === "TURKISH" ||
@@ -290,7 +263,7 @@ export const retrieveStandardExamCoterieTypeOptionListByStandardExamType = (
290
263
  item.value === "CHEMISTRY" ||
291
264
  item.value === "BIOLOGY"
292
265
  );
293
- } else if (standardExamType === "AYT") {
266
+ } else if (type === "AYT") {
294
267
  return retrieveStandardExamCoterieTypeOptionList().filter(
295
268
  (item) =>
296
269
  item.value === "LITERATURE" ||
@@ -307,7 +280,7 @@ export const retrieveStandardExamCoterieTypeOptionListByStandardExamType = (
307
280
  item.value === "BIOLOGY" ||
308
281
  item.value === "ENGLISH"
309
282
  );
310
- } else if (standardExamType === "LGS") {
283
+ } else if (type === "LGS") {
311
284
  return retrieveStandardExamCoterieTypeOptionList().filter(
312
285
  (item) =>
313
286
  item.value === "TURKISH" ||
@@ -481,14 +454,12 @@ const retrieveValidationRequirementList_LGS = () => {
481
454
  ];
482
455
  };
483
456
 
484
- export const retrieveValidationRequirementList = (
485
- selectedStandardExamType: string
486
- ) => {
487
- if (selectedStandardExamType === "TYT") {
457
+ export const retrieveValidationRequirementList = (type: string) => {
458
+ if (type === "TYT") {
488
459
  return retrieveValidationRequirementList_TYT();
489
- } else if (selectedStandardExamType === "AYT") {
460
+ } else if (type === "AYT") {
490
461
  return retrieveValidationRequirementList_AYT();
491
- } else if (selectedStandardExamType === "LGS") {
462
+ } else if (type === "LGS") {
492
463
  return retrieveValidationRequirementList_LGS();
493
464
  }
494
465
  return [];
@@ -1550,23 +1521,23 @@ export const retrieveFrequencyTypeOptionList = () => {
1550
1521
  ];
1551
1522
  };
1552
1523
 
1553
- export const retrieveDistintCoterieTypeFromCatchtivityApplicationDTO = (
1554
- catchtivityApplicationDTOList: any
1555
- ) => {
1556
- const coterieTypeList = [];
1557
- for (const catchtivityApplicationDTO of catchtivityApplicationDTOList) {
1558
- const { catchtivityDTO } = catchtivityApplicationDTO;
1559
- const { coterieType } = catchtivityDTO;
1560
- if (
1561
- coterieTypeList.findIndex(
1562
- (foundCoterieType) => foundCoterieType === coterieType
1563
- ) === -1
1564
- ) {
1565
- coterieTypeList.push(coterieType);
1524
+ export const retrieveDistinctCoterieTypeFromCorporatePersonalizedAssignmentApplicationDTO =
1525
+ (corporatePersonalizedAssignmentApplicationDTOList: any) => {
1526
+ const coterieTypeList = [];
1527
+ for (const corporatePersonalizedAssignmentApplicationDTO of corporatePersonalizedAssignmentApplicationDTOList) {
1528
+ const { corporatePersonalizedAssignmentDTO } =
1529
+ corporatePersonalizedAssignmentApplicationDTO;
1530
+ const { coterieType } = corporatePersonalizedAssignmentDTO;
1531
+ if (
1532
+ coterieTypeList.findIndex(
1533
+ (foundCoterieType) => foundCoterieType === coterieType
1534
+ ) === -1
1535
+ ) {
1536
+ coterieTypeList.push(coterieType);
1537
+ }
1566
1538
  }
1567
- }
1568
- return coterieTypeList;
1569
- };
1539
+ return coterieTypeList;
1540
+ };
1570
1541
 
1571
1542
  export const retrieveClockTimeLeft = (
1572
1543
  type: string,
@@ -1576,7 +1547,11 @@ export const retrieveClockTimeLeft = (
1576
1547
  activityProgressDTOSet: any,
1577
1548
  activity: any
1578
1549
  ) => {
1579
- if (type === "CATCHTIVITY" || type === "CATCHXAM" || type === "CONTEST") {
1550
+ if (
1551
+ type === "CORPORATE_PERSONALIZED_ASSIGNMENT" ||
1552
+ type === "CORPORATE_ASSESSMENT_ASSIGNMENT" ||
1553
+ type === "CONTEST"
1554
+ ) {
1580
1555
  if (durationType === "ALL") {
1581
1556
  return durationInMinutes
1582
1557
  ? durationInMinutes * 60 -
@@ -326,35 +326,32 @@ export const filterCategoryVersionCodeOptionListByInstitutionDTO = (
326
326
  return currentCategoryVersionCodeOptionList;
327
327
  };
328
328
 
329
- export const constructCategoryTreeFromParentCode = (categorySet: any[]) => {
329
+ export const constructCategoryTreeFromParentCode = (categoryDTOList: any[]) => {
330
330
  const nodeMap = new Map();
331
331
  const rootNodes: any = [];
332
332
 
333
- categorySet.forEach((item) => {
333
+ categoryDTOList.forEach((categoryDTO) => {
334
334
  const node = {
335
- ...item,
335
+ ...categoryDTO,
336
336
  subCategoryDTOList: [],
337
337
  };
338
- nodeMap.set(item.code, node);
338
+ nodeMap.set(categoryDTO.code, node);
339
339
  });
340
340
 
341
- categorySet.forEach((item) => {
342
- const node = nodeMap.get(item.code);
341
+ categoryDTOList.forEach((categoryDTO) => {
342
+ const node = nodeMap.get(categoryDTO.code);
343
343
 
344
- if (item.parentCode && nodeMap.has(item.parentCode)) {
345
- const parent = nodeMap.get(item.parentCode);
344
+ if (categoryDTO.parentCode && nodeMap.has(categoryDTO.parentCode)) {
345
+ const parent = nodeMap.get(categoryDTO.parentCode);
346
346
  parent.subCategoryDTOList.push(node);
347
347
  } else {
348
348
  rootNodes.push(node);
349
349
  }
350
350
  });
351
351
 
352
- // Sort function that can be applied recursively
353
352
  const sortNodesByCode = (nodes: any[]) => {
354
- // Sort the current level
355
353
  nodes.sort((a, b) => a.code.localeCompare(b.code));
356
354
 
357
- // Sort each node's children
358
355
  nodes.forEach((node) => {
359
356
  if (node.subCategoryDTOList && node.subCategoryDTOList.length > 0) {
360
357
  sortNodesByCode(node.subCategoryDTOList);
@@ -364,6 +361,5 @@ export const constructCategoryTreeFromParentCode = (categorySet: any[]) => {
364
361
  return nodes;
365
362
  };
366
363
 
367
- // Apply sorting to the root nodes and all descendants
368
364
  return sortNodesByCode(rootNodes);
369
365
  };