Rules Overview
The rules section displays cashout procedures for each company registered in the system.Accessing Rules
Click the ”📜 Cashout Rules” button in the sidebar:Loading Rules from Database
Fetch Rules
Rules are loaded from the API on page load and when viewing the rules section:API Endpoint:
GET /api/rulesRule Card Display
Each company rule is displayed in a card with:- Company Name: Header (e.g., “Betsson”, “Inkabet”)
- Rule Text: Pre-formatted text with company-specific procedures
- Edit Button: ✏️ Only visible to supervisors
Search Functionality
The search box filters companies in real-time:Editing Rules (Supervisor Only)
Edit Mode Toggle
Edit Mode Toggle
Supervisors can click the ✏️ Editar button to toggle between view and edit mode:
Save Changes
Save Changes
After editing the textarea, click 💾 Guardar to save:API Endpoint:
PUT /api/rules/{id}Adding New Companies (Supervisor Only)
Supervisors see a hidden form to add new companies:Role-Based Access Control
| Feature | Analista | Supervisor |
|---|---|---|
| View Rules | ✅ | ✅ |
| Search Rules | ✅ | ✅ |
| Edit Rules | ❌ | ✅ |
| Add Companies | ❌ | ✅ |
Rule Text Format
Rule text is stored as plain text withwhite-space: pre-wrap for formatting:
API Reference
GET /api/rules
Response:PUT /api/rules/:id
Body:POST /api/rules
Body:Loading States
CSS Classes
.rule-card: Card container with border and padding.rule-text: Textarea for editing (defined in style.css).rules-grid: Grid layout for multiple cards