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>
Reject zero loanType/branchId/dates before insert, and assert mobile-style payloads bind through gin required tags.
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>
Loan orders, paid-off letters, and repayments now include user, branch, type, and document names alongside foreign-key IDs.
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>
The baked-in host and basePath pointed "Try it out" at the app's own listen
address, so requests from the browser never reached the server. doc.json is
now built from the incoming request, using X-Forwarded-Prefix to restore the
path prefix nginx strips before proxying.
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>
config.yaml carried real secrets (jwt_key, DB password) despite already
being listed in .gitignore. Untrack it, add config.example.yaml with
placeholder values, and point the README setup steps at the example file.
Rename loan_required_documents to loan_order_required_docs, simplify document fields to name/value, and map loan_types columns to name, maturity, notes, and active.
Co-authored-by: Cursor <cursoragent@cursor.com>
Revert example database settings in Docker and docs, fix Makefile migrate target, and gitignore local bank_db dumps and schema files.
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace bank_db/bank_admin with example_db/example_user in config.yaml, docker-compose, Makefile, and README so pushed templates do not expose real credentials.
Co-authored-by: Cursor <cursoragent@cursor.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>