corrad-bp/.cursor/rules/database-models.mdc
Md Afiq Iskandar 7fca97912f Add Documentation for Backend Services, Components, Database Models, Development Guidelines, Form Handling, Project Overview, Project Structure, Routing, and State Management
- Created comprehensive documentation files for backend services, detailing API endpoints, database access, authentication, and middleware.
- Added documentation for Rose UI components and custom FormKit components, including descriptions and usage.
- Documented database models defined in Prisma, outlining core and supporting models with their fields and relationships.
- Established development guidelines for component and form development, state management, API development, and styling.
- Included details on FormKit integration for form handling, plugins, and the form builder feature.
- Provided an overview of the project structure, key configuration files, and routing system with main routes and middleware usage.
- Enhanced state management documentation with key stores and usage guidelines for Pinia.
2025-04-23 08:19:14 +08:00

31 lines
1.1 KiB
Plaintext

---
description:
globs:
alwaysApply: false
---
# Database Models
The project uses Prisma ORM with the following key models defined in [schema.prisma](mdc:prisma/schema.prisma):
## Core Models
- **User**: User management with authentication
- Fields: userID, userUsername, userPassword, userFullName, userEmail, userPhone, userStatus
- Relationships: audit (one-to-many), userrole (one-to-many)
- **Role**: Role-based access control
- Fields: roleID, roleName, roleDescription, roleStatus
- Relationships: userrole (one-to-many)
- **UserRole**: Join table connecting users and roles
- Fields: userRoleID, userRoleUserID, userRoleRoleID, userRoleCreatedDate
- Relationships: user (many-to-one), role (many-to-one)
## Supporting Models
- **Audit**: System for tracking user actions
- Fields: auditID, auditIP, auditURL, auditURLMethod, auditURLPayload, auditAction, auditDetails, auditUserID, auditUsername
- Relationships: user (many-to-one)
- **Lookup**: Reference data for dropdown options
- Fields: lookupID, lookupOrder, lookupTitle, lookupRefCode, lookupValue, lookupType, lookupStatus