Added analytics by transactions
This commit is contained in:
@@ -504,6 +504,69 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/transactions/analytics": {
|
||||
"get": {
|
||||
"description": "Возвращает расходы, доходы и total за период. При фильтре по type второй тип возвращается как 0.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Transactions"
|
||||
],
|
||||
"summary": "Получить аналитику по транзакциям",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Family ID",
|
||||
"name": "family_id",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Transaction type: income or expense",
|
||||
"name": "type",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "RFC3339 start datetime",
|
||||
"name": "date_from",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "RFC3339 end datetime",
|
||||
"name": "date_to",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.TransactionAnalyticsResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/transactions/{id}": {
|
||||
"get": {
|
||||
"description": "Возвращает транзакцию по ее внутреннему ID",
|
||||
@@ -1140,6 +1203,20 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.TransactionAnalyticsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"expenses": {
|
||||
"type": "number"
|
||||
},
|
||||
"incomes": {
|
||||
"type": "number"
|
||||
},
|
||||
"total": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.TransactionListResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user