Align schema, API routes, and auth with updated admin domain model.

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>
This commit is contained in:
2026-07-06 14:09:45 +05:00
parent 0c717101da
commit 82e1aad016
22 changed files with 4248 additions and 418 deletions

View File

@@ -69,7 +69,7 @@ func buildListQuery(filter location.ListFilter) (fromClause, whereClause string,
fromClause = ` FROM location l`
if filter.ProvinceName != "" {
fromClause += ` JOIN province p ON p.id = l.province_id`
fromClause += ` JOIN provinces p ON p.id = l.province_id`
}
var conditions []string
@@ -197,7 +197,7 @@ func (r *repository) Delete(ctx context.Context, id int64) error {
func (r *repository) ensureProvinceExists(ctx context.Context, provinceID int64) error {
var id int64
err := r.client.QueryRow(ctx, `SELECT id FROM province WHERE id = $1`, provinceID).Scan(&id)
err := r.client.QueryRow(ctx, `SELECT id FROM provinces WHERE id = $1`, provinceID).Scan(&id)
if errors.Is(err, pgx.ErrNoRows) {
return fmt.Errorf("province not found")
}