Web users may only CRUD their own records, operators stay in assigned branches, and admin/manager/superadmin keep full access.
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace permission_user with permission_role, enforce RBAC on admin routes, and limit operators to their assigned branches.
Co-authored-by: Cursor <cursoragent@cursor.com>
Fold follow-up migrations into init, expose GET /users/clients and /users/staff, and refresh seed data.
Co-authored-by: Cursor <cursoragent@cursor.com>
Expose GET /loan-paid-off-letters/branches?province_id= for form pickers, require loans.user_id, and proxy the Vite frontend under /online/.
Co-authored-by: Cursor <cursoragent@cursor.com>
Expose distinct regions and etraps-by-region under provinces and branches, and seed real etraps per welayat.
Co-authored-by: Cursor <cursoragent@cursor.com>
Introduces a branch_user join table linking branches to users, plus
create/delete API endpoints under the auth module for managing branch
assignments. The create response includes the branch's localized name
via a join. Regenerated swagger docs to include the new endpoints.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rename users table fields and loan documents table, expand branch billing credentials, switch to /api/admin prefix, refactor auth endpoints, replace PATCH with PUT for status updates, remove file upload APIs, and regenerate Swagger with ordered tags.
Co-authored-by: Cursor <cursoragent@cursor.com>