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:
198
docs/docs.go
198
docs/docs.go
@@ -410,6 +410,105 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/branches/etraps": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns provinces (etraps) for the selected region; pick id as provinceId",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"branches"
|
||||
],
|
||||
"summary": "List etraps by region for branch create",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Region name (en, ru or tm)",
|
||||
"name": "region",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Only active etraps",
|
||||
"name": "active",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/branches/regions": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns distinct regions from provinces (use before selecting etrap/provinceId)",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"branches"
|
||||
],
|
||||
"summary": "List regions for branch create",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Only active provinces",
|
||||
"name": "active",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/branches/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -4064,6 +4163,105 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/provinces/etraps": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns provinces (etraps) belonging to the selected region",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"province"
|
||||
],
|
||||
"summary": "List etraps by region",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Region name (en, ru or tm)",
|
||||
"name": "region",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Only active etraps",
|
||||
"name": "active",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/provinces/regions": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns unique regions from the provinces table (for region dropdown)",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"province"
|
||||
],
|
||||
"summary": "List distinct regions",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Only active provinces",
|
||||
"name": "active",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/provinces/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
|
||||
@@ -404,6 +404,105 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/branches/etraps": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns provinces (etraps) for the selected region; pick id as provinceId",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"branches"
|
||||
],
|
||||
"summary": "List etraps by region for branch create",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Region name (en, ru or tm)",
|
||||
"name": "region",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Only active etraps",
|
||||
"name": "active",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/branches/regions": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns distinct regions from provinces (use before selecting etrap/provinceId)",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"branches"
|
||||
],
|
||||
"summary": "List regions for branch create",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Only active provinces",
|
||||
"name": "active",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/branches/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -4058,6 +4157,105 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/provinces/etraps": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns provinces (etraps) belonging to the selected region",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"province"
|
||||
],
|
||||
"summary": "List etraps by region",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Region name (en, ru or tm)",
|
||||
"name": "region",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Only active etraps",
|
||||
"name": "active",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/provinces/regions": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns unique regions from the provinces table (for region dropdown)",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"province"
|
||||
],
|
||||
"summary": "List distinct regions",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Only active provinces",
|
||||
"name": "active",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/provinces/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
|
||||
@@ -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