Skip to content

Commit

Permalink
avniproject/avni-client#1448 - total standard report card type support.
Browse files Browse the repository at this point in the history
  • Loading branch information
petmongrels committed Jul 5, 2024
1 parent 396d849 commit eebbd0a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/ReportCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,22 @@ class ReportCard extends BaseEntity {
isRecentType() {
return this.isStandardReportType() && this.standardReportCardType.isRecentType();
}

hasInputForSubject() {
return this.standardReportCardInputSubjectTypes.length > 0;
}

hasInputForEnrolment() {
return this.standardReportCardInputPrograms.length > 0;
}

hasInputForProgramEncounter() {
return this.hasInputForEnrolment() && this.standardReportCardInputEncounterTypes.length > 0;
}

hasInputForGeneralEncounter() {
return this.standardReportCardInputEncounterTypes.length > 0;
}
}

export default ReportCard;
3 changes: 2 additions & 1 deletion src/StandardReportCardType.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class StandardReportCardType extends BaseEntity {
Comments: "Comments",
CallTasks: "Call tasks",
OpenSubjectTasks: "Open subject tasks",
DueChecklist: "Due checklist",
DueChecklist: "Due checklist"
};

static recentCardDurationUnits = [
Expand Down Expand Up @@ -144,6 +144,7 @@ class StandardReportCardType extends BaseEntity {
StandardReportCardType.type.RecentRegistrations,
StandardReportCardType.type.RecentEnrolments,
StandardReportCardType.type.RecentVisits,
StandardReportCardType.type.Total,
].includes(this.name);
}

Expand Down

0 comments on commit eebbd0a

Please sign in to comment.