add payment text
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

This commit is contained in:
2026-09-30 16:26:38 +05:00
parent 7e403dab13
commit ebedeba009
19 changed files with 1387 additions and 23 deletions

View File

@@ -5118,6 +5118,203 @@ const docTemplate = `{
}
}
},
"/payment-texts": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns the admin-editable, localized texts (warnings, hints) shown to clients on visa/master/sber payout screens. Clients only get active ones, with empty languages filled with a default text.",
"produces": [
"application/json"
],
"tags": [
"payment-texts"
],
"summary": "List payment texts",
"parameters": [
{
"type": "string",
"description": "Filter by code, name or text",
"name": "search",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/paymenttexts.ListPaymentTextDTO"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
}
}
}
},
"/payment-texts/{code}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns one payment text by its fixed code (e.g. payment_warning_text, sber_payment_warning). For clients, empty languages are filled with a default text, a deleted known code returns its default, and inactive texts are 404.",
"produces": [
"application/json"
],
"tags": [
"payment-texts"
],
"summary": "Get a payment text by code",
"parameters": [
{
"type": "string",
"description": "Text code",
"name": "code",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/paymenttexts.PaymentTextDTO"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Updates the name, localized text and active flag of an existing payment text. The code itself cannot be changed.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"payment-texts"
],
"summary": "Update a payment text",
"parameters": [
{
"type": "string",
"description": "Text code",
"name": "code",
"in": "path",
"required": true
},
{
"description": "Payment text payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/paymenttexts.UpdatePaymentTextDTO"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/paymenttexts.PaymentTextDTO"
}
},
"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"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Super admin only. Deletes a payment text by code; clients then get the built-in default text for known codes.",
"produces": [
"application/json"
],
"tags": [
"payment-texts"
],
"summary": "Delete a payment text",
"parameters": [
{
"type": "string",
"description": "Text code",
"name": "code",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/appresult.AppSuccess"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
}
}
}
},
"/permissions": {
"get": {
"security": [
@@ -9357,6 +9554,67 @@ const docTemplate = `{
}
}
},
"paymenttexts.ListPaymentTextDTO": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/paymenttexts.PaymentTextDTO"
}
}
}
},
"paymenttexts.PaymentTextDTO": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"id": {
"type": "integer"
},
"isActive": {
"type": "boolean"
},
"name": {
"type": "string"
},
"text": {
"$ref": "#/definitions/shared.LocalizedText"
},
"updatedAt": {
"type": "string"
},
"updatedById": {
"type": "integer"
},
"updatedByName": {
"type": "string"
}
}
},
"paymenttexts.UpdatePaymentTextDTO": {
"type": "object",
"required": [
"isActive",
"name"
],
"properties": {
"isActive": {
"type": "boolean"
},
"name": {
"type": "string"
},
"text": {
"$ref": "#/definitions/shared.LocalizedText"
}
}
},
"perm.Code": {
"type": "string",
"enum": [

View File

@@ -5112,6 +5112,203 @@
}
}
},
"/payment-texts": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns the admin-editable, localized texts (warnings, hints) shown to clients on visa/master/sber payout screens. Clients only get active ones, with empty languages filled with a default text.",
"produces": [
"application/json"
],
"tags": [
"payment-texts"
],
"summary": "List payment texts",
"parameters": [
{
"type": "string",
"description": "Filter by code, name or text",
"name": "search",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/paymenttexts.ListPaymentTextDTO"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
}
}
}
},
"/payment-texts/{code}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns one payment text by its fixed code (e.g. payment_warning_text, sber_payment_warning). For clients, empty languages are filled with a default text, a deleted known code returns its default, and inactive texts are 404.",
"produces": [
"application/json"
],
"tags": [
"payment-texts"
],
"summary": "Get a payment text by code",
"parameters": [
{
"type": "string",
"description": "Text code",
"name": "code",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/paymenttexts.PaymentTextDTO"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Updates the name, localized text and active flag of an existing payment text. The code itself cannot be changed.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"payment-texts"
],
"summary": "Update a payment text",
"parameters": [
{
"type": "string",
"description": "Text code",
"name": "code",
"in": "path",
"required": true
},
{
"description": "Payment text payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/paymenttexts.UpdatePaymentTextDTO"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/paymenttexts.PaymentTextDTO"
}
},
"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"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Super admin only. Deletes a payment text by code; clients then get the built-in default text for known codes.",
"produces": [
"application/json"
],
"tags": [
"payment-texts"
],
"summary": "Delete a payment text",
"parameters": [
{
"type": "string",
"description": "Text code",
"name": "code",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/appresult.AppSuccess"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
}
}
}
},
"/permissions": {
"get": {
"security": [
@@ -9351,6 +9548,67 @@
}
}
},
"paymenttexts.ListPaymentTextDTO": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/paymenttexts.PaymentTextDTO"
}
}
}
},
"paymenttexts.PaymentTextDTO": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"id": {
"type": "integer"
},
"isActive": {
"type": "boolean"
},
"name": {
"type": "string"
},
"text": {
"$ref": "#/definitions/shared.LocalizedText"
},
"updatedAt": {
"type": "string"
},
"updatedById": {
"type": "integer"
},
"updatedByName": {
"type": "string"
}
}
},
"paymenttexts.UpdatePaymentTextDTO": {
"type": "object",
"required": [
"isActive",
"name"
],
"properties": {
"isActive": {
"type": "boolean"
},
"name": {
"type": "string"
},
"text": {
"$ref": "#/definitions/shared.LocalizedText"
}
}
},
"perm.Code": {
"type": "string",
"enum": [

View File

@@ -1402,6 +1402,46 @@ definitions:
- sberBankFeeTmt
- tvebFeeUsd
type: object
paymenttexts.ListPaymentTextDTO:
properties:
count:
type: integer
items:
items:
$ref: '#/definitions/paymenttexts.PaymentTextDTO'
type: array
type: object
paymenttexts.PaymentTextDTO:
properties:
code:
type: string
id:
type: integer
isActive:
type: boolean
name:
type: string
text:
$ref: '#/definitions/shared.LocalizedText'
updatedAt:
type: string
updatedById:
type: integer
updatedByName:
type: string
type: object
paymenttexts.UpdatePaymentTextDTO:
properties:
isActive:
type: boolean
name:
type: string
text:
$ref: '#/definitions/shared.LocalizedText'
required:
- isActive
- name
type: object
perm.Code:
enum:
- dashboard
@@ -5149,6 +5189,137 @@ paths:
summary: Update payment settings
tags:
- payment-settings
/payment-texts:
get:
description: Returns the admin-editable, localized texts (warnings, hints) shown
to clients on visa/master/sber payout screens. Clients only get active ones,
with empty languages filled with a default text.
parameters:
- description: Filter by code, name or text
in: query
name: search
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/paymenttexts.ListPaymentTextDTO'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: List payment texts
tags:
- payment-texts
/payment-texts/{code}:
delete:
description: Super admin only. Deletes a payment text by code; clients then
get the built-in default text for known codes.
parameters:
- description: Text code
in: path
name: code
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/appresult.AppSuccess'
"403":
description: Forbidden
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 a payment text
tags:
- payment-texts
get:
description: Returns one payment text by its fixed code (e.g. payment_warning_text,
sber_payment_warning). For clients, empty languages are filled with a default
text, a deleted known code returns its default, and inactive texts are 404.
parameters:
- description: Text code
in: path
name: code
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/paymenttexts.PaymentTextDTO'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Get a payment text by code
tags:
- payment-texts
put:
consumes:
- application/json
description: Updates the name, localized text and active flag of an existing
payment text. The code itself cannot be changed.
parameters:
- description: Text code
in: path
name: code
required: true
type: string
- description: Payment text payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/paymenttexts.UpdatePaymentTextDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/paymenttexts.PaymentTextDTO'
"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 a payment text
tags:
- payment-texts
/permissions:
get:
description: 'Returns the permission catalog: one code per module, in display

View File

@@ -29,6 +29,7 @@ var swaggerTagOrder = []struct {
{Name: "file-upload", Description: "File upload"},
{Name: "backups", Description: "Database SQL backups"},
{Name: "currencies", Description: "Currency exchange rates"},
{Name: "payment-texts", Description: "Payment warning texts (Visa/Master, Sber)"},
{Name: "dashboard", Description: "Admin dashboard overview"},
}