ch some
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

This commit is contained in:
2026-09-04 19:33:26 +05:00
parent 28509eb4ca
commit d1a6fcaadc
102 changed files with 2089 additions and 1957 deletions

View File

@@ -56,14 +56,21 @@ Additional Swagger endpoints (categories, settings) are documented but not yet i
├── config.yaml # Runtime configuration
├── docker-compose.yaml # Local development stack
├── db/migrations/ # SQL migrations
├── db/seed.sql # Consolidated, idempotent seed data
├── docs/ # Generated Swagger docs
├── internal/
│ ├── admin/auth/ # Admin auth handlers & repository
│ ├── appresult/ # Response helpers & JWT middleware
│ ├── config/ # Config loader
│ └── handlers/manager/ # Route registration
│ ├── shared/ # Cross-module DTOs, HTTP/SQL/query helpers
│ ├── handlers/manager/ # Route registration (composition root)
│ ├── identity/ # auth, rbac, permission, role, user, userbranch, activitylog
│ ├── cards/ # card orders, balances, PIN orders, rekwizit, etc.
│ ├── lending/ # loan orders, repayments, documents, letters, types
│ ├── org/ # branches, provinces
│ ├── currency/, dashboard/, backup/
└── pkg/
├── client/postgresql/ # PostgreSQL connection pool
├── repository/genericrepo/ # Shared List/GetByID/Delete repository helper
├── logging/ # Structured logging
└── utils/ # JWT & file utilities
```
@@ -165,6 +172,14 @@ make migrate-rollback
Migration files live in `db/migrations/`.
> **Current practice:** the schema currently lives in a single `db/migrations/20260702125108_init.{up,down}.sql` pair, edited in place as the schema evolves rather than appended to. This means an already-migrated database won't pick up later edits to `init` automatically (`golang-migrate` sees it as already applied) — a fresh `make migrate` against an empty database is the reliable path. Switching to append-only migrations going forward is worth deciding on as a team.
Seed data (`db/seed.sql`) loads a consolidated, idempotent set of test accounts/roles/branches:
```bash
make seed
```
## Development
### Run tests