← All examples

Deep dive

Child Care

A real childcare-provider capability — an ACCS determination application — grown incrementally as an executable model. Explore this once Ordering feels familiar.

Lifecycle

Submit applicationDraftSubmitted

Rule & decision

Active enrolment existsSupporting evidence is heldEligible

RML source

model/context.modeller
rml 1.0
context Child Care
  version 1.0.0
end
model/entities/accs-determination-application.modeller
rml 1.0
entity ACCS determination application
  lifecycle ACCS determination application lifecycle
    stage Draft
    stage Submitted
  end
end
model/entities/booking.modeller
rml 1.0
# A Booking of attendance for a child at a centre for a session.
entity Booking
  field Booking date
    type date
  end
  field Minutes early
    type int32
  end
  field Minutes late
    type int32
  end
  field Session start time
    type time
  end
  field Session end time
    type time
  end
  field Adjusted start time
    type time
    optional
  end
  field Adjusted end time
    type time
    optional
  end
  field Adjusted hours
    type decimal(12,2)
    optional
  end
  field Absence is chargeable
    type boolean
    optional
  end
  field Attending preschool program
    type boolean
    optional
  end
  field Absence document is held
    type boolean
    optional
  end
  field Grace period in minutes
    type int32
  end
  field Booking status
    type enumeration "Booking status"
  end
  field Adjusted reason
    type enumeration "Booking adjusted reason"
  end
  field Arrangement type
    type enumeration "Arrangement type"
  end
  field Booking summary state
    type enumeration "Booking summary state"
  end
  relationship Routine booking session
    target "Routine booking session"
    cardinality one
  end
  relationship Casual booking session
    target "Casual booking session"
    cardinality one
  end
  relationship Arrangement
    target "Arrangement"
    cardinality one
  end
  relationship Absence
    target "Absence"
    cardinality one
    optional
  end
  relationship Session
    target "Session"
    cardinality one
  end
  relationship Room
    target "Room"
    cardinality one
  end
  relationship Room session fee
    target "Room session fee"
    cardinality one
  end
  relationship Child
    target "Child"
    cardinality one
  end
  relationship Absence reason
    target "Absence reason"
    cardinality one
    optional
  end
  relationship Attendances
    target "Attendance"
    cardinality many
  end
end
model/entities/booking-relationship-targets.modeller
rml 1.0
# Identity-only declarations; their structure belongs to later migration slices.
entity Routine booking session
end
entity Casual booking session
end
entity Arrangement
end
entity Absence
end
entity Session
end
entity Room
end
entity Room session fee
end
entity Child
end
entity Absence reason
end
entity Attendance
end
model/enumerations/arrangement-type.modeller
rml 1.0
enumeration Arrangement type
  member CWA
    value 1
  end
  member OA
    value 2
  end
  member RA
    value 3
  end
  member ACCS
    value 4
  end
end
model/enumerations/booking-adjusted-reason.modeller
rml 1.0
enumeration Booking adjusted reason
  member Not adjusted
    value 1
  end
  member Partial public holiday
    value 2
  end
  member Partial room closure
    value 3
  end
end
model/enumerations/booking-status.modeller
rml 1.0
enumeration Booking status
  member Planned
    value 1
  end
  member Missed sign in
    value 2
  end
  member Attending
    value 3
  end
  member Missed sign out
    value 4
  end
  member Attended
    value 5
  end
  member Absence
    value 6
  end
  member Planned holiday
    value 7
  end
  member Public holiday
    value 8
  end
  member Room closure
    value 9
  end
  member Removed
    value 10
  end
  member Conflict
    value 11
  end
  member Absence void
    value 12
  end
end
model/enumerations/booking-summary-state.modeller
rml 1.0
enumeration Booking summary state
  member Planned
    value 1
  end
  member Absent
    value 2
  end
  member Attended
    value 3
  end
  member Error
    value 4
  end
  member Void
    value 5
  end
  member Removed
    value 6
  end
end
model/facts/accs-eligibility.modeller
rml 1.0
fact Active enrolment exists
  type truth
  export
end
fact Supporting evidence is held
  type truth
  export
end
model/rules/determine-accs-eligibility.modeller
rml 1.0
rule Determine ACCS eligibility
  input "Active enrolment exists"
  input "Supporting evidence is held"
  when all
    fact "Active enrolment exists"
    fact "Supporting evidence is held"
  end
  conclusion Eligible
  end
  finding "Active enrolment exists" true accs.active-enrolment-confirmed
  finding "Supporting evidence is held" true accs.supporting-evidence-confirmed
  finding "Active enrolment exists" missing accs.active-enrolment-required
  finding "Supporting evidence is held" missing accs.supporting-evidence-required
  export
end
model/behaviours/submit-accs-determination-application.modeller
rml 1.0
behaviour Submit ACCS determination application
  for "ACCS determination application"
  requires "Determine ACCS eligibility"
  outcome Application submitted
  end
  outcome Application rejected
  end
  transition Submit application
    lifecycle "ACCS determination application lifecycle"
    from "Draft"
    to "Submitted"
    outcome "Application submitted"
  end
end