Added uploading receipt photo to API
This commit is contained in:
@@ -284,6 +284,80 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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": "Возвращает список транзакций с фильтрами и пагинацией",
|
||||
|
||||
Reference in New Issue
Block a user