Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domain Model Design #13

Closed
codecakes opened this issue Jun 19, 2022 · 0 comments · Fixed by #14 or #16
Closed

Domain Model Design #13

codecakes opened this issue Jun 19, 2022 · 0 comments · Fixed by #14 or #16

Comments

@codecakes
Copy link
Contributor

codecakes commented Jun 19, 2022

Domain Design

Core domain: Registrations
Generic domain: Google Places API, healthsites.io
Supporting domain: TBD

Refer to this form use case:

Image

Scenario: Hospitals want to register.

Entity: Unverified Hospital
Required Fields:

  • Organization_name
  • Ownership Type (Organization Type): Government | Public | Private | Public-Private
  • Address fields (Look ahead searchable) (Value Object)
  • Phone Number (Validator)
  • Key Contact (Embedded Value Object)
    • Name
    • Phone Number (Validator)
    • Email (Optional) (Validator)

Business Rules

  • Check if organization_name already exists for the given address. Register only if not. Otherwise return already registered unverified entity and offer to claim the page and fill in verifiable details.

Validations

  • ValidatePhoneNumberOrigin: Validate the phone number belongs to the country which has this address.
  • Validate the Key contact's email domain and store for future verification.
  • VerifyKeyContactNumber: Generate TOTP to send via sms using SendSMS infra service; Validate the key contact's phone number by sending them a TOTP and matching it user input recvd via sms as the TOTP.

Calculations

  • Calculate entity's geolocation using Places API (Generic);
  • Generate TOTP (Generic)

Business Logic

  • Fetch geolocation data & store metadata from places api and healthsites.io;
  • Register hospital only when VerifyKeyContactNumber and VerifyKeyContactEmailDomain and ValidatePhoneNumberOrigin are true else return errors on required fields.

Scenario: Hospital wants to claim an unverified registered page;

Entity: Unverified Hospital
Fields:

  • verification_status (value object): unverified | verified | verification_pending

Scenario: Hospital wants to update the additional detail;

Entity: Unverified Hospital
Additional Fields:

  • Incorporation Date (DATE_FOUNDED value object)
  • Icu beds (Value object)
  • Non Icu beds (Value object)
  • Ventillator beds( Value object)
  • Non Ventilator beds (Value object)
  • OPD Departments in Hospital (Value object )

Business Rules

Validations

Calculations

Business Logic

@codecakes codecakes linked a pull request Jul 13, 2022 that will close this issue
@codecakes codecakes linked a pull request Jul 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant