Added uploading receipt photo to API

This commit is contained in:
2026-04-11 11:26:58 +03:00
parent 545b05d5a0
commit b66be96033
7 changed files with 455 additions and 4 deletions
+74
View File
@@ -295,6 +295,80 @@ const docTemplate = `{
}
}
},
"/receipts/photo": {
"post": {
"description": "Принимает фото, распознает текст через Google OCR и создает чек с позициями; опционально создает связанную транзакцию",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"Receipts"
],
"summary": "Загрузить чек по фото",
"parameters": [
{
"type": "file",
"description": "Receipt photo",
"name": "photo",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "Family ID for auto-created transaction",
"name": "family_id",
"in": "formData"
},
{
"type": "integer",
"description": "User ID for auto-created transaction",
"name": "created_by",
"in": "formData"
},
{
"type": "string",
"description": "Transaction type, default expense",
"name": "type",
"in": "formData"
},
{
"type": "string",
"description": "Transaction category, default receipt",
"name": "category",
"in": "formData"
},
{
"type": "string",
"description": "Transaction description override",
"name": "description",
"in": "formData"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.AddReceiptResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
}
}
}
},
"/transactions": {
"get": {
"description": "Возвращает список транзакций с фильтрами и пагинацией",