Last active
October 19, 2021 15:17
-
-
Save katelovescode/651c273471495ac7e5971ecd9b4863ae to your computer and use it in GitHub Desktop.
Sequence Diagram - Earned Revenue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sequenceDiagram | |
User->>+ServiceDay: earned_revenue | |
loop attendances | |
Attendance-->>ServiceDay: time_in_care, absence | |
end | |
ServiceDay->>+ServiceDay: duration(attendances.time_in_care) | |
ServiceDay->>+StateDurationRules: duration_type(self) | |
StateDurationRules-->>ServiceDay: duration_type | |
ServiceDay->>+ChildCasePeriod: authorized_units(duration_type) | |
ChildCasePeriod-->>ServiceDay: authorized_units | |
ServiceDay->>+ServiceDay: within_authorized_units?(duration_type, authorized_units) | |
alt No | |
ServiceDay-->>User: 0 | |
else Yes | |
ServiceDay->>+ServiceDay: absences?(attendances.absence) | |
alt Yes | |
ServiceDay->>+Attendance: absences_this_month(date) | |
Attendance-->>ServiceDay: absences_this_month | |
ServiceDay->>+StateAbsenceLimits: absence_limit(absence) | |
StateAbsenceLimits-->>ServiceDay: absence_limit | |
ServiceDay->>+ServiceDay: within_absence_limits?(absences, absences_this_month, absence_limit) | |
alt No | |
ServiceDay-->>User: 0 | |
end | |
end | |
ServiceDay->>+RateConfiguration: rate_configuration(self) | |
RateConfiguration->>+Business: business(ServiceDay) | |
Business-->>RateConfiguration: county, qris_rating | |
RateConfiguration->>+Child: child(ServiceDay) | |
Child-->>RateConfiguration: age | |
RateConfiguration-->>ServiceDay: RateConfiguration | |
ServiceDay->>+Rate: daily_rate(RateConfiguration, self.date, self.duration_type) | |
Rate-->>ServiceDay: Rate | |
ServiceDay-->>User: Rate * self.duration | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment