corrad-bp/.cursor/rules/database-models.mdc
Md Afiq Iskandar 93dbb7d5ee Update globs in database models and development guidelines documentation
- Modified the globs in `database-models.mdc` to include server-side JavaScript files.
- Updated the globs in `development-guidelines.mdc` to encompass server-side JavaScript files alongside Vue components, enhancing the scope of the documentation.
2025-04-23 09:28:19 +08:00

31 lines
1.1 KiB
Plaintext

---
description:
globs: server/**/*.js
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