changed arhitecture

This commit is contained in:
2026-07-15 18:08:19 +05:00
parent 7e3a5cebcc
commit 585ba63bc2
95 changed files with 4985 additions and 1360 deletions

View File

@@ -19,16 +19,6 @@ definitions:
status:
type: boolean
type: object
auth.CreateBranchUserDTO:
properties:
branchId:
type: integer
userId:
type: integer
required:
- branchId
- userId
type: object
auth.LoginDTO:
properties:
email:
@@ -46,6 +36,21 @@ definitions:
required:
- refreshToken
type: object
auth.UpdateProfileDTO:
properties:
avatar:
type: string
firstName:
type: string
lastName:
type: string
name:
type: string
phone:
type: string
required:
- name
type: object
branches.CreateBranchDTO:
properties:
active:
@@ -71,9 +76,7 @@ definitions:
name:
$ref: '#/definitions/branches.LocalizedText'
phoneNumbers:
items:
type: string
type: array
type: string
provinceId:
type: integer
region:
@@ -119,9 +122,7 @@ definitions:
name:
$ref: '#/definitions/branches.LocalizedText'
phoneNumbers:
items:
type: string
type: array
type: string
provinceId:
type: integer
region:
@@ -289,6 +290,112 @@ definitions:
- passportTwo
- region
type: object
cardpinorders.CreateCardPinOrderDTO:
properties:
bornAt:
type: string
branchId:
type: integer
cardNumber:
type: string
cardTypeId:
type: integer
customerName:
type: string
customerPatronicName:
type: string
customerSurname:
type: string
notes:
type: string
passportFour:
type: string
passportId:
type: string
passportOne:
type: string
passportSerie:
type: string
passportThree:
type: string
passportTwo:
type: string
phone:
type: string
region:
type: string
status:
type: string
uniqueId:
type: string
userId:
type: integer
required:
- branchId
- cardTypeId
- customerName
- customerSurname
- passportFour
- passportId
- passportOne
- passportSerie
- passportThree
- passportTwo
- region
type: object
cardpinorders.UpdateCardPinOrderDTO:
properties:
bornAt:
type: string
branchId:
type: integer
cardNumber:
type: string
cardTypeId:
type: integer
customerName:
type: string
customerPatronicName:
type: string
customerSurname:
type: string
notes:
type: string
passportFour:
type: string
passportId:
type: string
passportOne:
type: string
passportSerie:
type: string
passportThree:
type: string
passportTwo:
type: string
phone:
type: string
region:
type: string
status:
type: string
uniqueId:
type: string
userId:
type: integer
required:
- branchId
- cardTypeId
- customerName
- customerSurname
- passportFour
- passportId
- passportOne
- passportSerie
- passportThree
- passportTwo
- region
type: object
cards.CreateCardDTO:
properties:
month:
@@ -911,6 +1018,16 @@ definitions:
- guardName
- name
type: object
permissionuser.CreatePermissionUserDTO:
properties:
permissionId:
type: integer
userId:
type: integer
required:
- permissionId
- userId
type: object
province.CreateProvinceDTO:
properties:
active:
@@ -1007,6 +1124,16 @@ definitions:
- guardName
- name
type: object
roleusers.CreateRoleUserDTO:
properties:
roleId:
type: integer
userId:
type: integer
required:
- roleId
- userId
type: object
user.CreateUserDTO:
properties:
active:
@@ -1077,6 +1204,16 @@ definitions:
- name
- username
type: object
userbranch.CreateUserBranchDTO:
properties:
branchId:
type: integer
userId:
type: integer
required:
- branchId
- userId
type: object
host: localhost:5050
info:
contact: {}
@@ -1085,6 +1222,34 @@ info:
version: "1.0"
paths:
/branch-users:
get:
description: Returns the authenticated user's branch-user assignments with the
related user and branch
parameters:
- description: Filter by branch name (en, ru, tm)
in: query
name: branch_name
type: string
produces:
- application/json
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'
security:
- BearerAuth: []
summary: List branch users
tags:
- branch-users
post:
consumes:
- application/json
@@ -1095,7 +1260,7 @@ paths:
name: body
required: true
schema:
$ref: '#/definitions/auth.CreateBranchUserDTO'
$ref: '#/definitions/userbranch.CreateUserBranchDTO'
produces:
- application/json
responses:
@@ -1115,7 +1280,7 @@ paths:
- BearerAuth: []
summary: Assign user to branch
tags:
- auth
- branch-users
/branch-users/{id}:
delete:
description: Deletes a branch-user assignment
@@ -1148,7 +1313,7 @@ paths:
- BearerAuth: []
summary: Remove user from branch
tags:
- auth
- branch-users
/branches:
get:
description: Returns paginated branches with optional filters
@@ -1529,6 +1694,196 @@ paths:
summary: Update card order
tags:
- card-orders
/card-pin-orders:
get:
description: Returns paginated card pin orders with optional filters
parameters:
- description: Filter by status
in: query
name: status
type: string
- description: Filter by branch ID
in: query
name: branch_id
type: integer
- description: Filter by user ID
in: query
name: user_id
type: integer
- description: Filter by card type ID
in: query
name: card_type_id
type: integer
- description: Filter by region
in: query
name: region
type: string
- default: 1
description: Page number
in: query
name: page
type: integer
- default: 10
description: Items per page
in: query
name: limit
type: integer
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 card pin orders
tags:
- card-pin-orders
post:
consumes:
- application/json
description: Creates a new card pin order
parameters:
- description: Card pin order payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/cardpinorders.CreateCardPinOrderDTO'
produces:
- application/json
responses:
"201":
description: Created
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: Create card pin order
tags:
- card-pin-orders
/card-pin-orders/{id}:
delete:
description: Deletes a card pin order
parameters:
- description: Card pin order ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/appresult.AppSuccess'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Delete card pin order
tags:
- card-pin-orders
get:
description: Returns a single card pin order
parameters:
- description: Card pin order ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/appresult.AppSuccess'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Get card pin order by ID
tags:
- card-pin-orders
put:
consumes:
- application/json
description: Updates an existing card pin order
parameters:
- description: Card pin order ID
in: path
name: id
required: true
type: integer
- description: Card pin order payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/cardpinorders.UpdateCardPinOrderDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/appresult.AppSuccess'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Update card pin order
tags:
- card-pin-orders
/cards:
get:
description: Returns paginated cards with optional filters
@@ -2972,6 +3327,99 @@ paths:
summary: Update payment card active
tags:
- payment-card
/permission-users:
get:
description: Returns the authenticated user's permission-user assignments with
the related user and permission
parameters:
- description: Filter by permission name
in: query
name: permission_name
type: string
produces:
- application/json
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'
security:
- BearerAuth: []
summary: List permission users
tags:
- permission-users
post:
consumes:
- application/json
description: Creates a permission-user assignment
parameters:
- description: Permission-user payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/permissionuser.CreatePermissionUserDTO'
produces:
- application/json
responses:
"201":
description: Created
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: Assign user to permission
tags:
- permission-users
/permission-users/{id}:
delete:
description: Deletes a permission-user assignment
parameters:
- description: Permission-user ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/appresult.AppSuccess'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Remove user from permission
tags:
- permission-users
/permissions:
get:
description: Returns paginated permissions with optional filters
@@ -3173,9 +3621,67 @@ paths:
summary: Get profile
tags:
- auth
put:
consumes:
- application/json
description: Updates the authenticated user's profile
parameters:
- description: Profile payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/auth.UpdateProfileDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/appresult.AppSuccess'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/appresult.AppError'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Update profile
tags:
- auth
/provinces:
get:
description: Returns all provinces
description: Returns paginated provinces with optional filters
parameters:
- description: Filter by province name (en, ru, tm)
in: query
name: name
type: string
- description: Filter by region (en, ru, tm)
in: query
name: region
type: string
- description: Filter by active status
in: query
name: active
type: boolean
- default: 1
description: Page number
in: query
name: page
type: integer
- default: 10
description: Items per page
in: query
name: limit
type: integer
produces:
- application/json
responses:
@@ -3506,6 +4012,99 @@ paths:
summary: Update reason card
tags:
- reason-card
/role-users:
get:
description: Returns the authenticated user's role-user assignments with the
related user and role
parameters:
- description: Filter by role name
in: query
name: role_name
type: string
produces:
- application/json
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'
security:
- BearerAuth: []
summary: List role users
tags:
- role-users
post:
consumes:
- application/json
description: Creates a role-user assignment
parameters:
- description: Role-user payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/roleusers.CreateRoleUserDTO'
produces:
- application/json
responses:
"201":
description: Created
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: Assign user to role
tags:
- role-users
/role-users/{id}:
delete:
description: Deletes a role-user assignment
parameters:
- description: Role-user ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/appresult.AppSuccess'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Remove user from role
tags:
- role-users
/roles:
get:
description: Returns paginated roles with optional filters
@@ -3884,6 +4483,53 @@ paths:
summary: Update user
tags:
- user
/users/role:
get:
description: Returns paginated users filtered by role
parameters:
- description: user role
in: query
name: role
required: true
type: string
- description: Filter by username
in: query
name: username
type: string
- default: 1
description: Page number
in: query
name: page
type: integer
- default: 10
description: Items per page
in: query
name: limit
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/appresult.AppSuccess'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: List users by role
tags:
- user
securityDefinitions:
BearerAuth:
in: header