Add region and etrap APIs for branch create form.
Expose distinct regions and etraps-by-region under provinces and branches, and seed real etraps per welayat. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1579,6 +1579,70 @@ paths:
|
||||
summary: Update branch
|
||||
tags:
|
||||
- branches
|
||||
/branches/etraps:
|
||||
get:
|
||||
description: Returns provinces (etraps) for the selected region; pick id as
|
||||
provinceId
|
||||
parameters:
|
||||
- description: Region name (en, ru or tm)
|
||||
in: query
|
||||
name: region
|
||||
required: true
|
||||
type: string
|
||||
- default: true
|
||||
description: Only active etraps
|
||||
in: query
|
||||
name: active
|
||||
type: boolean
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: List etraps by region for branch create
|
||||
tags:
|
||||
- branches
|
||||
/branches/regions:
|
||||
get:
|
||||
description: Returns distinct regions from provinces (use before selecting etrap/provinceId)
|
||||
parameters:
|
||||
- default: true
|
||||
description: Only active provinces
|
||||
in: query
|
||||
name: active
|
||||
type: boolean
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: List regions for branch create
|
||||
tags:
|
||||
- branches
|
||||
/card-orders:
|
||||
get:
|
||||
description: Returns paginated card orders with optional filters
|
||||
@@ -3917,6 +3981,69 @@ paths:
|
||||
summary: Update province
|
||||
tags:
|
||||
- province
|
||||
/provinces/etraps:
|
||||
get:
|
||||
description: Returns provinces (etraps) belonging to the selected region
|
||||
parameters:
|
||||
- description: Region name (en, ru or tm)
|
||||
in: query
|
||||
name: region
|
||||
required: true
|
||||
type: string
|
||||
- default: true
|
||||
description: Only active etraps
|
||||
in: query
|
||||
name: active
|
||||
type: boolean
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: List etraps by region
|
||||
tags:
|
||||
- province
|
||||
/provinces/regions:
|
||||
get:
|
||||
description: Returns unique regions from the provinces table (for region dropdown)
|
||||
parameters:
|
||||
- default: true
|
||||
description: Only active provinces
|
||||
in: query
|
||||
name: active
|
||||
type: boolean
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: List distinct regions
|
||||
tags:
|
||||
- province
|
||||
/reasons-cards:
|
||||
get:
|
||||
description: Returns paginated reason cards with optional filters
|
||||
|
||||
Reference in New Issue
Block a user