Put the user's role and branch on GET /profile, upsert role_user and branch_user on POST, and drop their list endpoints.
Also accept flexible card-order form values, move mock seed under db/mock, and regenerate Swagger. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns a paginated audit trail of user actions (create/update/delete)",
|
||||
"description": "Returns a paginated audit trail of user actions (create/update/delete). Each log includes the actor's username and role from role_user.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -133,56 +133,13 @@
|
||||
}
|
||||
},
|
||||
"/branch-users": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns the authenticated user's branch-user assignments with the related user and branch",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"branch-users"
|
||||
],
|
||||
"summary": "List branch users",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Filter by branch name (en, ru, tm)",
|
||||
"name": "branch_name",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Creates a branch-user assignment",
|
||||
"description": "Creates a branch-user assignment, or updates the user's existing branch if one is already assigned",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -4106,7 +4063,7 @@
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns the authenticated user's profile",
|
||||
"description": "Returns the authenticated user's profile with role and branches",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -4846,56 +4803,13 @@
|
||||
}
|
||||
},
|
||||
"/role-users": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns the authenticated user's role-user assignments with the related user and role",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"role-users"
|
||||
],
|
||||
"summary": "List role users",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Filter by role name",
|
||||
"name": "role_name",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Creates a role-user assignment",
|
||||
"description": "Creates a role-user assignment, or updates the user's existing role if one is already assigned",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -5849,59 +5763,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/visa-master-payment-orders/branches": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns branches for the selected province for visa/master payment order forms",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"visa-master-payment-orders"
|
||||
],
|
||||
"summary": "List branches by province",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Province ID",
|
||||
"name": "province_id",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Only active branches",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/visa-master-payment-orders/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -6362,7 +6223,6 @@
|
||||
"customerName",
|
||||
"customerSurname",
|
||||
"passportFour",
|
||||
"passportGivenAt",
|
||||
"passportGivenBy",
|
||||
"passportId",
|
||||
"passportOne",
|
||||
@@ -6373,7 +6233,8 @@
|
||||
],
|
||||
"properties": {
|
||||
"bornAt": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
},
|
||||
"bornPlace": {
|
||||
"type": "string"
|
||||
@@ -6418,7 +6279,8 @@
|
||||
"type": "string"
|
||||
},
|
||||
"passportGivenAt": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
},
|
||||
"passportGivenBy": {
|
||||
"type": "string"
|
||||
@@ -6472,7 +6334,6 @@
|
||||
"customerName",
|
||||
"customerSurname",
|
||||
"passportFour",
|
||||
"passportGivenAt",
|
||||
"passportGivenBy",
|
||||
"passportId",
|
||||
"passportOne",
|
||||
@@ -6483,7 +6344,8 @@
|
||||
],
|
||||
"properties": {
|
||||
"bornAt": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
},
|
||||
"bornPlace": {
|
||||
"type": "string"
|
||||
@@ -6528,7 +6390,8 @@
|
||||
"type": "string"
|
||||
},
|
||||
"passportGivenAt": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
},
|
||||
"passportGivenBy": {
|
||||
"type": "string"
|
||||
|
||||
Reference in New Issue
Block a user