71
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 2m31s
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Tag Commit (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 2m31s
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Tag Commit (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
This commit is contained in:
@@ -12,6 +12,17 @@ import (
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
// @Summary Получить баланс агента
|
||||
// @Description Получение текущего баланса агента
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_id path string true "ID агента"
|
||||
// @Success 200 {object} rmodel.BalanceGetResponse "Баланс агента"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/agents/{agent_id}/balance [get]
|
||||
func (h *handler) getBalanceAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getBalanceAgentHandler"
|
||||
|
||||
@@ -42,6 +53,17 @@ func (h *handler) getBalanceAgentHandler(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить список транзакций агента
|
||||
// @Description Получение списка транзакций агента с возможностью фильтрации
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_id path string true "ID агента"
|
||||
// @Success 200 {object} rmodel.TransactionListGetResponse "Список транзакций"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/agents/{agent_id}/transactions [get]
|
||||
func (h *handler) getTransactionListAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getTransactionListAgentHandler"
|
||||
|
||||
@@ -84,6 +106,18 @@ func (h *handler) getTransactionListAgentHandler(w http.ResponseWriter, r *http.
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Создать транзакцию агента
|
||||
// @Description Создание новой транзакции для агента
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_id path string true "ID агента"
|
||||
// @Param request body rmodel.TransactionCreateRequest true "Данные транзакции"
|
||||
// @Success 201 {object} rmodel.TransactionCreateResponse "Транзакция создана"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/agents/{agent_id}/transactions [post]
|
||||
func (h *handler) createTransactionAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "createTransactionAgentHandler"
|
||||
|
||||
@@ -146,6 +180,17 @@ func (h *handler) createTransactionAgentHandler(w http.ResponseWriter, r *http.R
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить список банковских счетов агента
|
||||
// @Description Получение списка банковских счетов агента
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_id path string true "ID агента"
|
||||
// @Success 200 {object} rmodel.BankAccountListGetResponse "Список банковских счетов"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/agents/{agent_id}/bank_accounts [get]
|
||||
func (h *handler) getBankAccountListAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getBankAccountListAgentHandler"
|
||||
|
||||
@@ -178,6 +223,18 @@ func (h *handler) getBankAccountListAgentHandler(w http.ResponseWriter, r *http.
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Создать банковский счет агента
|
||||
// @Description Создание нового банковского счета для агента
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_id path string true "ID агента"
|
||||
// @Param request body rmodel.BankAccountCreateRequest true "Данные банковского счета"
|
||||
// @Success 201 {object} rmodel.BankAccountCreateResponse "Банковский счет создан"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/agents/{agent_id}/bank_accounts [post]
|
||||
func (h *handler) createBankAccountAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "createBankAccountAgentHandler"
|
||||
|
||||
@@ -232,6 +289,19 @@ func (h *handler) createBankAccountAgentHandler(w http.ResponseWriter, r *http.R
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Обновить банковский счет агента
|
||||
// @Description Обновление информации о банковском счете агента
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_id path string true "ID агента"
|
||||
// @Param bank_account_id path string true "ID банковского счета"
|
||||
// @Param request body rmodel.BankAccountUpdateRequest true "Данные для обновления"
|
||||
// @Success 200 {object} map[string]string "Банковский счет обновлен"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/agents/{agent_id}/bank_accounts/{bank_account_id} [put]
|
||||
func (h *handler) updateBankAccountAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "updateBankAccountAgentHandler"
|
||||
|
||||
@@ -285,6 +355,18 @@ func (h *handler) updateBankAccountAgentHandler(w http.ResponseWriter, r *http.R
|
||||
}
|
||||
|
||||
// TODO: test when implemented
|
||||
// @Summary Удалить банковский счет агента
|
||||
// @Description Удаление банковского счета агента
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_id path string true "ID агента"
|
||||
// @Param bank_account_id path string true "ID банковского счета"
|
||||
// @Success 200 {object} map[string]string "Банковский счет удален"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/agents/{agent_id}/bank_accounts/{bank_account_id} [delete]
|
||||
func (h *handler) deleteBankAccountAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "deleteBankAccountAgentHandler"
|
||||
|
||||
@@ -327,6 +409,17 @@ func (h *handler) deleteBankAccountAgentHandler(w http.ResponseWriter, r *http.R
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить баланс дистрибьютора
|
||||
// @Description Получение текущего баланса дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Success 200 {object} rmodel.BalanceGetResponse "Баланс дистрибьютора"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/balance [get]
|
||||
func (h *handler) getBalanceDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getBalanceDistributorHandler"
|
||||
|
||||
@@ -359,6 +452,18 @@ func (h *handler) getBalanceDistributorHandler(w http.ResponseWriter, r *http.Re
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить баланс компании дистрибьютора
|
||||
// @Description Получение баланса конкретной компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Success 200 {object} rmodel.BalanceGetResponse "Баланс компании"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/balance [get]
|
||||
func (h *handler) getCompanyBalanceDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getCompanyBalanceDistributorHandler"
|
||||
|
||||
@@ -391,6 +496,17 @@ func (h *handler) getCompanyBalanceDistributorHandler(w http.ResponseWriter, r *
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить список транзакций дистрибьютора
|
||||
// @Description Получение списка транзакций дистрибьютора с возможностью фильтрации
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Success 200 {object} rmodel.TransactionListGetResponse "Список транзакций"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/transactions [get]
|
||||
func (h *handler) getTransactionListDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getTransactionListDistributorHandler"
|
||||
|
||||
@@ -434,6 +550,18 @@ func (h *handler) getTransactionListDistributorHandler(w http.ResponseWriter, r
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить список транзакций компании дистрибьютора
|
||||
// @Description Получение списка транзакций конкретной компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Success 200 {object} rmodel.TransactionListGetResponse "Список транзакций компании"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/transactions [get]
|
||||
func (h *handler) getCompanyTransactionListDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getCompanyTransactionListDistributorHandler"
|
||||
|
||||
@@ -477,6 +605,18 @@ func (h *handler) getCompanyTransactionListDistributorHandler(w http.ResponseWri
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Создать транзакцию дистрибьютора
|
||||
// @Description Создание новой транзакции для дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param request body rmodel.TransactionCreateRequest true "Данные транзакции"
|
||||
// @Success 201 {object} rmodel.TransactionCreateResponse "Транзакция создана"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/transactions [post]
|
||||
func (h *handler) createTransactionDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "createTransactionDistributorHandler"
|
||||
|
||||
@@ -539,6 +679,17 @@ func (h *handler) createTransactionDistributorHandler(w http.ResponseWriter, r *
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить список банковских счетов дистрибьютора
|
||||
// @Description Получение списка банковских счетов дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Success 200 {object} rmodel.BankAccountListGetResponse "Список банковских счетов"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/bank_accounts [get]
|
||||
func (h *handler) getBankAccountListDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getBankAccountListDistributorHandler"
|
||||
|
||||
@@ -571,6 +722,18 @@ func (h *handler) getBankAccountListDistributorHandler(w http.ResponseWriter, r
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить список банковских счетов компании дистрибьютора
|
||||
// @Description Получение списка банковских счетов конкретной компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Success 200 {object} rmodel.BankAccountListGetResponse "Список банковских счетов компании"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/bank_accounts [get]
|
||||
func (h *handler) getCompanyBankAccountListDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getCompanyBankAccountListDistributorHandler"
|
||||
|
||||
@@ -603,6 +766,19 @@ func (h *handler) getCompanyBankAccountListDistributorHandler(w http.ResponseWri
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Создать банковский счет компании дистрибьютора
|
||||
// @Description Создание нового банковского счета для компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Param request body rmodel.BankAccountCreateRequest true "Данные банковского счета"
|
||||
// @Success 201 {object} rmodel.BankAccountCreateResponse "Банковский счет создан"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/bank_accounts [post]
|
||||
func (h *handler) createBankAccountDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "createBankAccountDistributorHandler"
|
||||
|
||||
@@ -664,6 +840,19 @@ func (h *handler) createBankAccountDistributorHandler(w http.ResponseWriter, r *
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Обновить банковский счет дистрибьютора
|
||||
// @Description Обновление информации о банковском счете дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param bank_account_id path string true "ID банковского счета"
|
||||
// @Param request body rmodel.BankAccountUpdateRequest true "Данные для обновления"
|
||||
// @Success 200 {object} map[string]string "Банковский счет обновлен"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/bank_accounts/{bank_account_id} [put]
|
||||
func (h *handler) updateBankAccountDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "updateBankAccountDistributorHandler"
|
||||
|
||||
@@ -725,6 +914,18 @@ func (h *handler) updateBankAccountDistributorHandler(w http.ResponseWriter, r *
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Удалить банковский счет дистрибьютора
|
||||
// @Description Удаление банковского счета дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param bank_account_id path string true "ID банковского счета"
|
||||
// @Success 200 {object} map[string]string "Банковский счет удален"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/bank_accounts/{bank_account_id} [delete]
|
||||
func (h *handler) deleteBankAccountDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "deleteBankAccountDistributorHandler"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user