bhms

module
v0.0.0-...-c2300e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2023 License: Apache-2.0

README

bhms

Boarding house management system developed with Go, Flutter, Postgres, and Kubernetes.

Minimum Viable Product (MVP)

Development Plan
  • Define features for the MVP and design the database
  • Design and develop APIs for the mobile application ←
  • Design and develop Android, iOS applications
Features for Landlords
  • Create boarding areas and manage room lists
  • Create contracts for tenants
  • Manage utilities such as electricity, water, and other services
  • Manage payment information (bank accounts)
  • Create and share invoices for each room.
Database Design
Table users

The users table stores essential information about users.

Column Name Data Type Required Description
id uuid Primary key
first_name text First name
last_name text Last name
phone text Used for login, unique
password_hash text Encrypted password
roles text[] Roles: USER, ADMIN
status text User status: CREATED, ACTIVE, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table divisions

The divisions table stores information about administrative divisions in Vietnam.

Column Name Data Type Required Description
id serial Primary key, auto-increment
name text Name of the administrative division
code integer Administrative division code
level smallint Level of administrative division - 1: Province, 2: District, 3: Ward
parent_id serial ID of the higher-level division
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table properties

The properties table stores essential information about boarding areas.

Column Name Data Type Required Description
id uuid Primary key
name text Boarding area name
address_level_1_id serial ID of province
address_level_2_id serial ID of district
address_level_3_id serial ID of ward
street text House number and street name
manager_id uuid ID of the landlord
status text Boarding area status: CREATED, ACTIVE, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table blocks

The blocks table stores information about the blocks within the boarding area.

Column Name Data Type Required Description
id uuid Primary key
name text Block name
property_id uuid ID of the boarding area
status text Block status: ACTIVE, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table floors

The floors table stores information about the floors within the boarding area.

Column Name Data Type Required Description
id uuid Primary key
name text Floor name
block_id uuid ID of the block
property_id uuid ID of the boarding area
status text Floor status: ACTIVE, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table units

The units table stores information about the rooms within the boarding area.

Column Name Data Type Required Description
id uuid Primary key
name text Room name
property_id uuid ID of the boarding area
block_id uuid ID of the block
floor_id uuid ID of the floor
status text Room status: ACTIVE, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table payment_methods

The payment_methods table stores payment information (bank accounts) of landlords.

Column Name Data Type Required Description
id bigserial Primary key
name text Bank name
account_name text Account holder's name
account_number text Account number
note text Note
enabled boolean Enable/disable status of the payment method
property_id uuid ID of the boarding area
status text Status: ACTIVE, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table sessions

The sessions table stores information about room rentals over time in contracts.

Column Name Data Type Required Description
id uuid Primary key
unit_id uuid ID of the room
start_at timestamp Start time of occupancy
duration_in_days smallint Contract duration in days
rental_fee bigint Rental fee (VND)
num_of_members smallint Number of members
renew_times smallint Number of contract renewals
note text Note
status text Status: ACTIVE, ENDED, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table services

The services table stores information about the services provided in the boarding area.

Column Name Data Type Required Description
id uuid Primary key
property_id uuid ID of the boarding area
name text Service name
service_fee bigint Service fee (VND)
unit text Unit: kwh, m3, room, member, piece, time
invoice_type text Billing unit: PER_USAGE, PER_ROOM, PER_MEMBER, PER_PIECE, PER_TIME
status text Status: ACTIVE, DELETED
enabled boolean Enable/disable status of the service
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table session_services

The session_services table stores information about the services registered for each session.

Column Name Data Type Required Description
id bigserial ID of the session-service
session_id uuid ID of the session
service_id uuid ID of the service
status text Status: ACTIVE, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table session_invoices

The session_invoices table stores information about invoices for each session.

Column Name Data Type Required Description
id uuid Primary key
session_id uuid ID of the session
start_at timestamp Start time for calculating charges
rental_fee bigint Rental fee (VND)
additional_fee bigint Additional charges (VND)
discount bigint Discount (VND)
additional_fee_reason text Reason for additional charges
discount_reason text Reason for discount
note text Note
status text Status: ACTIVE, PAID, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp
Table session_service_invoices

The session_service_invoices table stores information about service invoices for each session.

Column Name Data Type Required Description
id uuid Primary key
invoice_id uuid ID of the invoice
session_service_id bigserial ID of the session-service
service_name text Service name
service_unit text Unit: kwh, m3, room, member, piece, time
service_invoice_type text Billing unit: PER_USAGE, PER_ROOM, PER_MEMBER, PER_PIECE, PER_TIME
service_fee bigint Service fee (VND)
latest_index integer Previous recorded index
current_index integer Current recorded index
quantity integer Quantity
note integer Note
total bigint Total amount (VND)
status text Status: ACTIVE, DELETED
created_at timestamp Creation timestamp
updated_at timestamp Update timestamp

Directories

Path Synopsis
app
business
foundation
zarf

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL