Some checks failed
System Monitoring / Health Checks (push) Has been cancelled
System Monitoring / Performance Monitoring (push) Has been cancelled
System Monitoring / Database Monitoring (push) Has been cancelled
System Monitoring / Cache Monitoring (push) Has been cancelled
System Monitoring / Log Monitoring (push) Has been cancelled
System Monitoring / Resource Monitoring (push) Has been cancelled
System Monitoring / Uptime Monitoring (push) Has been cancelled
System Monitoring / Backup Monitoring (push) Has been cancelled
System Monitoring / Security Monitoring (push) Has been cancelled
System Monitoring / Monitoring Dashboard (push) Has been cancelled
System Monitoring / Alerting (push) Has been cancelled
Security Scanning / Dependency Scanning (push) Has been cancelled
Security Scanning / Code Security Scanning (push) Has been cancelled
Security Scanning / Secrets Scanning (push) Has been cancelled
Security Scanning / Container Security Scanning (push) Has been cancelled
Security Scanning / Compliance Checking (push) Has been cancelled
Security Scanning / Security Dashboard (push) Has been cancelled
Security Scanning / Security Remediation (push) Has been cancelled
13 KiB
13 KiB
Data Model
Core Entities
Tenant
Purpose: Represents a business organization with isolated data and workspace
Fields:
id(UUID): Primary keyname(String): Business nameslug(String): URL-friendly identifieremail(String): Primary contact emailphone(String): Business phone numberaddress(JSON): Business address (Malaysian format)business_type(Enum): RETAIL, HEALTHCARE, EDUCATION, LOGISTICS, BEAUTYsubscription_plan(Enum): STARTER, GROWTH, PRO, ENTERPRISEpricing_model(Enum): SUBSCRIPTION, PERPETUALstatus(Enum): PENDING, ACTIVE, SUSPENDED, TERMINATEDlogo_url(String): Company logosettings(JSON): Tenant-specific settingscreated_at(DateTime): Tenant creation timestampupdated_at(DateTime): Last update timestamptrial_ends_at(DateTime): Trial period endsubscription_ends_at(DateTime): Current subscription end
Relationships:
- Has many Users
- Has many Subscriptions
- Has many Modules (through subscriptions)
- Has many Business Data entities
User
Purpose: Individuals within tenant organizations with roles and permissions
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantemail(String): User email (unique within tenant)first_name(String): User first namelast_name(String): User last namephone(String): User phone numberrole(Enum): ADMIN, MANAGER, STAFF, VIEWERstatus(Enum): PENDING, ACTIVE, INACTIVE, DISABLEDlast_login(DateTime): Last login timestampcreated_at(DateTime): User creation timestampupdated_at(DateTime): Last update timestampauth_methods(JSON): Enabled authentication methodsmfa_enabled(Boolean): Multi-factor authentication statuspassword_hash(String): Encrypted password
Relationships:
- Belongs to Tenant
- Has many Permissions
- Has many Audit Logs
Subscription
Purpose: Defines pricing plan, billing cycle, and module access for tenants
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantplan_type(Enum): STARTER, GROWTH, PRO, ENTERPRISEbilling_cycle(Enum): MONTHLY, YEARLY, ONE_TIMEstatus(Enum): ACTIVE, CANCELLED, EXPIRED, PENDINGstarts_at(DateTime): Subscription start dateends_at(DateTime): Subscription end daterenews_at(DateTime): Next renewal dateamount(Decimal): Subscription amountcurrency(String): Currency code (MYR)payment_method(String): Payment method tokenmodule_limit(Integer): Number of modules alloweduser_limit(Integer): Number of users allowedfeatures(JSON): Enabled featurescreated_at(DateTime): Subscription creation timestampupdated_at(DateTime): Last update timestamp
Relationships:
- Belongs to Tenant
- Has many Subscription Modules
- Has many Payment Transactions
Module
Purpose: Industry-specific business functionality packages
Fields:
id(UUID): Primary keyname(String): Module nameslug(String): URL-friendly identifierdescription(String): Module descriptionindustry(Enum): RETAIL, HEALTHCARE, EDUCATION, LOGISTICS, BEAUTYversion(String): Module versionstatus(Enum): ACTIVE, INACTIVE, BETAfeatures(JSON): Module featuresrequirements(JSON): System requirementscreated_at(DateTime): Module creation timestampupdated_at(DateTime): Last update timestamp
Relationships:
- Has many Subscription Modules
- Has many Module Permissions
Subscription Module
Purpose: Links subscriptions to specific modules
Fields:
id(UUID): Primary keysubscription_id(UUID): Foreign key to Subscriptionmodule_id(UUID): Foreign key to Modulestatus(Enum): ACTIVE, INACTIVE, EXPIREDactivated_at(DateTime): Activation timestampexpires_at(DateTime): Expiration timestampsettings(JSON): Module-specific settings
Relationships:
- Belongs to Subscription
- Belongs to Module
Payment Transaction
Purpose: Records of billing and payments
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantsubscription_id(UUID): Foreign key to Subscriptiontype(Enum): CHARGE, REFUND, CREDIT, ADJUSTMENTamount(Decimal): Transaction amountcurrency(String): Currency code (MYR)status(Enum): PENDING, COMPLETED, FAILED, REFUNDEDpayment_method(String): Payment method usedtransaction_id(String): External transaction IDdescription(String): Transaction descriptioncreated_at(DateTime): Transaction creation timestampupdated_at(DateTime): Last update timestamp
Relationships:
- Belongs to Tenant
- Belongs to Subscription
Industry-Specific Models
Retail Module
Product
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantname(String): Product namesku(String): Stock keeping unitdescription(String): Product descriptioncategory(String): Product categoryprice(Decimal): Product pricecost(Decimal): Product coststock_quantity(Integer): Current stockreorder_point(Integer): Reorder thresholdsupplier_id(UUID): Supplier referencestatus(Enum): ACTIVE, INACTIVE, DISCONTINUEDcreated_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Sale
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantinvoice_number(String): Invoice numbercustomer_id(UUID): Customer referencesubtotal(Decimal): Sale subtotaltax(Decimal): Tax amounttotal(Decimal): Sale totalpayment_method(String): Payment methodstatus(Enum): PENDING, COMPLETED, REFUNDEDcreated_at(DateTime): Sale timestampupdated_at(DateTime): Last update timestamp
Healthcare Module
Patient
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantmedical_record_number(String): Medical record numberfirst_name(String): Patient first namelast_name(String): Patient last nameic_number(String): Malaysian IC numberdate_of_birth(Date): Date of birthgender(Enum): MALE, FEMALE, OTHERphone(String): Phone numberemail(String): Email addressaddress(JSON): Patient addressblood_type(String): Blood typeallergies(JSON): Known allergiesmedical_conditions(JSON): Medical conditionscreated_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Appointment
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantpatient_id(UUID): Foreign key to Patientdoctor_id(UUID): Foreign key to User (doctor)appointment_date(DateTime): Appointment date and timeduration(Integer): Duration in minutesstatus(Enum): SCHEDULED, CONFIRMED, COMPLETED, CANCELLED, NO_SHOWtype(Enum): CONSULTATION, FOLLOW_UP, PROCEDUREnotes(Text): Appointment notesreminder_sent(Boolean): Reminder sent statuscreated_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Education Module
Student
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantstudent_id(String): Student IDfirst_name(String): Student first namelast_name(String): Student last namedate_of_birth(Date): Date of birthgrade_level(String): Grade levelparent_id(UUID): Parent user referenceenrollment_date(Date): Enrollment datestatus(Enum): ACTIVE, INACTIVE, GRADUATED)emergency_contact(JSON): Emergency contact informationcreated_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Class
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantname(String): Class namegrade_level(String): Grade levelteacher_id(UUID): Teacher user referencemax_students(Integer): Maximum studentsschedule(JSON): Class scheduleacademic_year(String): Academic yearstatus(Enum): ACTIVE, INACTIVE)created_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Logistics Module
Shipment
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenanttracking_number(String): Tracking numberorder_id(String): Order referencesender_id(UUID): Sender referencerecipient_id(UUID): Recipient referenceorigin(JSON): Origin addressdestination(JSON): Destination addressweight(Decimal): Package weightdimensions(JSON): Package dimensionsstatus(Enum): PENDING, IN_TRANSIT, DELIVERED, FAILED)estimated_delivery(DateTime): Estimated deliveryactual_delivery(DateTime): Actual deliverycarrier(String): Shipping carriercreated_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Vehicle
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantplate_number(String): Vehicle plate numbertype(String): Vehicle typecapacity(Decimal): Vehicle capacitydriver_id(UUID): Driver user referencestatus(Enum): ACTIVE, INACTIVE, MAINTENANCE)location(JSON): Current locationlast_maintenance(Date): Last maintenance datenext_maintenance(Date): Next maintenance datecreated_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Beauty Module
Client
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantfirst_name(String): Client first namelast_name(String): Client last namephone(String): Phone numberemail(String): Email addressdate_of_birth(Date): Date of birthaddress(JSON): Client addresspreferences(JSON): Service preferencesnotes(Text): Client notesloyalty_points(Integer): Loyalty pointscreated_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Service
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantname(String): Service namedescription(String): Service descriptionduration(Integer): Duration in minutesprice(Decimal): Service pricecategory(String): Service categorystatus(Enum): ACTIVE, INACTIVE)created_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Audit & Compliance Models
AuditLog
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantuser_id(UUID): Foreign key to Useraction(String): Action performedentity_type(String): Type of entity affectedentity_id(UUID): ID of entity affectedold_values(JSON): Previous valuesnew_values(JSON): New valuesip_address(String): User IP addressuser_agent(String): User agenttimestamp(DateTime): Event timestamp
DataRetention
Fields:
id(UUID): Primary keytenant_id(UUID): Foreign key to Tenantentity_type(String): Type of dataentity_id(UUID): ID of entitydeletion_date(DateTime): Scheduled deletion datestatus(Enum): ACTIVE, DELETED, ARCHIVED)created_at(DateTime): Creation timestampupdated_at(DateTime): Last update timestamp
Relationships Summary
Tenant (1) → Many Users
Tenant (1) → Many Subscriptions
Tenant (1) → Many AuditLogs
Tenant (1) → Many DataRetention
Subscription (1) → Many SubscriptionModules
Subscription (1) → Many PaymentTransactions
Module (1) → Many SubscriptionModules
User (1) → Many AuditLogs
Validation Rules
Tenant Validation
- Name must be unique across all tenants
- Email must be valid format
- Phone number must follow Malaysian format
- Business type must be one of the supported industries
User Validation
- Email must be unique within tenant
- Role must be valid for user's permissions
- Password must meet security requirements
Subscription Validation
- Plan type must match module limits
- Billing cycle must be valid for plan type
- Amount must match plan pricing
Data Isolation
- All queries must include tenant_id filter
- Foreign key relationships must respect tenant boundaries
- Cross-tenant data access must be explicitly prevented
Compliance Requirements
PDPA 2010 Compliance
- All personal data must be encrypted at rest
- Data access must be logged and auditable
- Data retention policies must be enforced
- User consent must be obtained and recorded
Healthcare Data Protection
- Patient data must have additional access controls
- Medical records must have audit trails
- Emergency access must be logged and reviewed
- Data backup procedures must be HIPAA-compliant
Financial Data Protection
- Payment information must be tokenized
- Financial transactions must have audit trails
- Access to financial data must be restricted
- Compliance with Bank Negara Malaysia requirements