Add province-scoped branches for loan paid letters and harden loans.user_id.
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>
This commit is contained in:
@@ -43,13 +43,13 @@ func (r *repository) List(ctx context.Context, filter province.ListFilter) (prov
|
||||
}
|
||||
|
||||
func (r *repository) ListRegions(ctx context.Context, activeOnly bool) (province.ListRegionsDTO, error) {
|
||||
query := `SELECT DISTINCT region FROM provinces`
|
||||
inner := `SELECT DISTINCT region::jsonb AS region FROM provinces`
|
||||
var args []interface{}
|
||||
if activeOnly {
|
||||
query += ` WHERE active = $1`
|
||||
inner += ` WHERE active = $1`
|
||||
args = append(args, true)
|
||||
}
|
||||
query += ` ORDER BY region->>'tm', region->>'en', region->>'ru'`
|
||||
query := `SELECT region FROM (` + inner + `) AS distinct_regions ORDER BY region->>'tm', region->>'en', region->>'ru'`
|
||||
|
||||
rows, err := r.client.Query(ctx, query, args...)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user