payment-history: payment detail with GBÜS response, sorting, newest-first logs
- GET /payment-history/payments/{id}: single payment attempt with the raw
gateway_response (last HALKBANK JSON) for the "storage" icon modal
- GET /payment-history: sort (id/created_at/status/amount) and order
(asc/desc, default desc) query params
- GET /payment-history/{id}: order logs now newest first
- index on visa_master_order_payments (gateway_status, id DESC)
- regenerate swagger docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
711
docs/docs.go
711
docs/docs.go
@@ -2630,6 +2630,331 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/backlog": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Open (unhandled) orders per order type aged under 1 day / 1-3 days / over 3 days, the oldest open order, and the average processing time of orders finished in range; plus exact visa/master payout timing from the payment log. Order types are limited to the modules the caller can open.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: backlog",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/branches": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Per-branch leaderboard (orders per type, open/approved/rejected, approval rate, average processing hours) and order counts per region, for orders created in range.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: branches",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/customers": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Loan applicants in range by age group, education, marriage status and number of guarantors, each with its approval rate. Needs the loans permission.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: customers",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/finance": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Successful visa/master payouts (amount, bank/GBÜS/TVEB fees), gateway status breakdown and success rate, monthly payout totals, and the total loan amount requested. Payouts need the cards permission, the loan total the loans permission.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: finance",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/products": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Loan orders by source (web/mobile) and loan type, card orders by card type, and paid vs unpaid card orders, for orders created in range.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: products",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/system": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Registration funnel (all-scope callers with the users permission), operator activity and error rate per module (activity-logs permission), order peak hours heatmap in Ashgabat time, and card balance check stats (cards permission). Widgets the caller cannot see are null or empty.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: system",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Number of operators to return",
|
||||
"name": "operator_limit",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/overview": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -2682,6 +3007,49 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/server-stats": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns host CPU, RAM and disk usage plus the API process's own memory and uptime. CPU usage is sampled over ~250ms; host fields are null when the OS cannot report them.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard"
|
||||
],
|
||||
"summary": "Server statistics",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/sysstats.Stats"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/file": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -4943,6 +5311,30 @@ const docTemplate = `{
|
||||
"name": "search",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"id",
|
||||
"created_at",
|
||||
"status",
|
||||
"amount"
|
||||
],
|
||||
"type": "string",
|
||||
"default": "id",
|
||||
"description": "Sort column",
|
||||
"name": "sort",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"asc",
|
||||
"desc"
|
||||
],
|
||||
"type": "string",
|
||||
"default": "desc",
|
||||
"description": "Sort direction",
|
||||
"name": "order",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 1,
|
||||
@@ -4980,6 +5372,64 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/payment-history/payments/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns one visa/master/sber payout attempt by its payment ID, with the raw GBÜS response - the detail view behind a payment-history list row",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"payment-history"
|
||||
],
|
||||
"summary": "Get a single payment attempt",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Payment ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/paymenthistory.PaymentHistoryDetailDTO"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/payment-history/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -9414,12 +9864,24 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"paymenthistory.PaymentHistoryItemDTO": {
|
||||
"paymenthistory.PaymentHistoryDetailDTO": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"amountMinor": {
|
||||
"description": "AmountMinor is the amount registered with GBÜS, in tetri.",
|
||||
"type": "integer"
|
||||
},
|
||||
"amountTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"amountUsd": {
|
||||
"description": "AmountUsd is amount_tmt converted back at the attempt's own\nexchange_rate_usd - the USD figure the payout was quoted in.",
|
||||
"type": "number"
|
||||
},
|
||||
"apiClient": {
|
||||
"description": "ApiClient is the branch's GBÜS merchant username for this order type\n(visa/master or sber) and Description the text sent with register.do -\nboth as visamasterpay's Pay picks them.",
|
||||
"type": "string"
|
||||
},
|
||||
"bankFeeTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
@@ -9429,6 +9891,10 @@ const docTemplate = `{
|
||||
"branchName": {
|
||||
"$ref": "#/definitions/shared.LocalizedText"
|
||||
},
|
||||
"cardholderName": {
|
||||
"description": "CardholderName/MaskedPan come from GBÜS's getOrderStatusExtended\ncardAuthInfo, so they're only known once an attempt has been\nfinalized by the callback/status check (unset while pending, and for\nattempts that never reached the card form).",
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -9438,6 +9904,124 @@ const docTemplate = `{
|
||||
"createdByName": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"exchangeRateRub": {
|
||||
"type": "number"
|
||||
},
|
||||
"exchangeRateUsd": {
|
||||
"type": "number"
|
||||
},
|
||||
"formUrl": {
|
||||
"description": "FormUrl/SuccessUrl are only set while the attempt is still pending\n(awaiting the customer to finish paying on GBÜS's hosted page) - once\nan attempt is finalized (success/failed), gateway_response no longer\nholds a formUrl, so there's nothing left to resume.",
|
||||
"type": "string"
|
||||
},
|
||||
"gatewayReference": {
|
||||
"type": "string"
|
||||
},
|
||||
"gatewayResponse": {
|
||||
"type": "object"
|
||||
},
|
||||
"gatewayStatus": {
|
||||
"type": "string"
|
||||
},
|
||||
"gbusFeeTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"maskedPan": {
|
||||
"type": "string"
|
||||
},
|
||||
"orderId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"orderNumber": {
|
||||
"type": "string"
|
||||
},
|
||||
"orderUniqueId": {
|
||||
"type": "string"
|
||||
},
|
||||
"paid": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"passportName": {
|
||||
"type": "string"
|
||||
},
|
||||
"passportSurname": {
|
||||
"type": "string"
|
||||
},
|
||||
"paymentPeriod": {
|
||||
"type": "string"
|
||||
},
|
||||
"successUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalAmountTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"tvebFeeTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"tvebFeeUsd": {
|
||||
"type": "number"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"paymenthistory.PaymentHistoryItemDTO": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"amountMinor": {
|
||||
"description": "AmountMinor is the amount registered with GBÜS, in tetri.",
|
||||
"type": "integer"
|
||||
},
|
||||
"amountTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"amountUsd": {
|
||||
"description": "AmountUsd is amount_tmt converted back at the attempt's own\nexchange_rate_usd - the USD figure the payout was quoted in.",
|
||||
"type": "number"
|
||||
},
|
||||
"apiClient": {
|
||||
"description": "ApiClient is the branch's GBÜS merchant username for this order type\n(visa/master or sber) and Description the text sent with register.do -\nboth as visamasterpay's Pay picks them.",
|
||||
"type": "string"
|
||||
},
|
||||
"bankFeeTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"branchId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"branchName": {
|
||||
"$ref": "#/definitions/shared.LocalizedText"
|
||||
},
|
||||
"cardholderName": {
|
||||
"description": "CardholderName/MaskedPan come from GBÜS's getOrderStatusExtended\ncardAuthInfo, so they're only known once an attempt has been\nfinalized by the callback/status check (unset while pending, and for\nattempts that never reached the card form).",
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdById": {
|
||||
"type": "integer"
|
||||
},
|
||||
"createdByName": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"exchangeRateRub": {
|
||||
"type": "number"
|
||||
},
|
||||
@@ -9460,6 +10044,9 @@ const docTemplate = `{
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"maskedPan": {
|
||||
"type": "string"
|
||||
},
|
||||
"orderId": {
|
||||
"type": "integer"
|
||||
},
|
||||
@@ -9840,6 +10427,128 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.CPU": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cores": {
|
||||
"type": "integer"
|
||||
},
|
||||
"loadAvg": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"usagePercent": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.Disk": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"freeBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"path": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"usagePercent": {
|
||||
"type": "number"
|
||||
},
|
||||
"usedBytes": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.Memory": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"availableBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"limitBytes": {
|
||||
"description": "LimitBytes is the container (cgroup) memory limit, nil when unlimited.",
|
||||
"type": "integer"
|
||||
},
|
||||
"swapTotalBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"swapUsedBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"totalBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"usagePercent": {
|
||||
"type": "number"
|
||||
},
|
||||
"usedBytes": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.Process": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"goroutines": {
|
||||
"type": "integer"
|
||||
},
|
||||
"heapAllocBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"numGc": {
|
||||
"type": "integer"
|
||||
},
|
||||
"sysBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"uptimeSeconds": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.Stats": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"arch": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"cpu": {
|
||||
"$ref": "#/definitions/sysstats.CPU"
|
||||
},
|
||||
"disks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/sysstats.Disk"
|
||||
}
|
||||
},
|
||||
"goVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"hostUptimeSeconds": {
|
||||
"type": "integer"
|
||||
},
|
||||
"hostname": {
|
||||
"type": "string"
|
||||
},
|
||||
"memory": {
|
||||
"$ref": "#/definitions/sysstats.Memory"
|
||||
},
|
||||
"os": {
|
||||
"type": "string"
|
||||
},
|
||||
"process": {
|
||||
"$ref": "#/definitions/sysstats.Process"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user.CreateUserDTO": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
@@ -2624,6 +2624,331 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/backlog": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Open (unhandled) orders per order type aged under 1 day / 1-3 days / over 3 days, the oldest open order, and the average processing time of orders finished in range; plus exact visa/master payout timing from the payment log. Order types are limited to the modules the caller can open.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: backlog",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/branches": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Per-branch leaderboard (orders per type, open/approved/rejected, approval rate, average processing hours) and order counts per region, for orders created in range.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: branches",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/customers": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Loan applicants in range by age group, education, marriage status and number of guarantors, each with its approval rate. Needs the loans permission.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: customers",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/finance": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Successful visa/master payouts (amount, bank/GBÜS/TVEB fees), gateway status breakdown and success rate, monthly payout totals, and the total loan amount requested. Payouts need the cards permission, the loan total the loans permission.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: finance",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/products": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Loan orders by source (web/mobile) and loan type, card orders by card type, and paid vs unpaid card orders, for orders created in range.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: products",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/analytics/system": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Registration funnel (all-scope callers with the users permission), operator activity and error rate per module (activity-logs permission), order peak hours heatmap in Ashgabat time, and card balance check stats (cards permission). Widgets the caller cannot see are null or empty.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard-analytics"
|
||||
],
|
||||
"summary": "Dashboard analytics: system",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"default": "Jan 1 of current year",
|
||||
"description": "Start date YYYY-MM-DD (inclusive)",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"default": "today",
|
||||
"description": "End date YYYY-MM-DD (inclusive)",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Number of operators to return",
|
||||
"name": "operator_limit",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/overview": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -2676,6 +3001,49 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/dashboard/server-stats": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns host CPU, RAM and disk usage plus the API process's own memory and uptime. CPU usage is sampled over ~250ms; host fields are null when the OS cannot report them.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"dashboard"
|
||||
],
|
||||
"summary": "Server statistics",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/appresult.AppSuccess"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/sysstats.Stats"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/file": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -4937,6 +5305,30 @@
|
||||
"name": "search",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"id",
|
||||
"created_at",
|
||||
"status",
|
||||
"amount"
|
||||
],
|
||||
"type": "string",
|
||||
"default": "id",
|
||||
"description": "Sort column",
|
||||
"name": "sort",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"asc",
|
||||
"desc"
|
||||
],
|
||||
"type": "string",
|
||||
"default": "desc",
|
||||
"description": "Sort direction",
|
||||
"name": "order",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 1,
|
||||
@@ -4974,6 +5366,64 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/payment-history/payments/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns one visa/master/sber payout attempt by its payment ID, with the raw GBÜS response - the detail view behind a payment-history list row",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"payment-history"
|
||||
],
|
||||
"summary": "Get a single payment attempt",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Payment ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/paymenthistory.PaymentHistoryDetailDTO"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/appresult.AppError"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/payment-history/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -9408,12 +9858,24 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"paymenthistory.PaymentHistoryItemDTO": {
|
||||
"paymenthistory.PaymentHistoryDetailDTO": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"amountMinor": {
|
||||
"description": "AmountMinor is the amount registered with GBÜS, in tetri.",
|
||||
"type": "integer"
|
||||
},
|
||||
"amountTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"amountUsd": {
|
||||
"description": "AmountUsd is amount_tmt converted back at the attempt's own\nexchange_rate_usd - the USD figure the payout was quoted in.",
|
||||
"type": "number"
|
||||
},
|
||||
"apiClient": {
|
||||
"description": "ApiClient is the branch's GBÜS merchant username for this order type\n(visa/master or sber) and Description the text sent with register.do -\nboth as visamasterpay's Pay picks them.",
|
||||
"type": "string"
|
||||
},
|
||||
"bankFeeTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
@@ -9423,6 +9885,10 @@
|
||||
"branchName": {
|
||||
"$ref": "#/definitions/shared.LocalizedText"
|
||||
},
|
||||
"cardholderName": {
|
||||
"description": "CardholderName/MaskedPan come from GBÜS's getOrderStatusExtended\ncardAuthInfo, so they're only known once an attempt has been\nfinalized by the callback/status check (unset while pending, and for\nattempts that never reached the card form).",
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -9432,6 +9898,124 @@
|
||||
"createdByName": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"exchangeRateRub": {
|
||||
"type": "number"
|
||||
},
|
||||
"exchangeRateUsd": {
|
||||
"type": "number"
|
||||
},
|
||||
"formUrl": {
|
||||
"description": "FormUrl/SuccessUrl are only set while the attempt is still pending\n(awaiting the customer to finish paying on GBÜS's hosted page) - once\nan attempt is finalized (success/failed), gateway_response no longer\nholds a formUrl, so there's nothing left to resume.",
|
||||
"type": "string"
|
||||
},
|
||||
"gatewayReference": {
|
||||
"type": "string"
|
||||
},
|
||||
"gatewayResponse": {
|
||||
"type": "object"
|
||||
},
|
||||
"gatewayStatus": {
|
||||
"type": "string"
|
||||
},
|
||||
"gbusFeeTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"maskedPan": {
|
||||
"type": "string"
|
||||
},
|
||||
"orderId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"orderNumber": {
|
||||
"type": "string"
|
||||
},
|
||||
"orderUniqueId": {
|
||||
"type": "string"
|
||||
},
|
||||
"paid": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"passportName": {
|
||||
"type": "string"
|
||||
},
|
||||
"passportSurname": {
|
||||
"type": "string"
|
||||
},
|
||||
"paymentPeriod": {
|
||||
"type": "string"
|
||||
},
|
||||
"successUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalAmountTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"tvebFeeTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"tvebFeeUsd": {
|
||||
"type": "number"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"paymenthistory.PaymentHistoryItemDTO": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"amountMinor": {
|
||||
"description": "AmountMinor is the amount registered with GBÜS, in tetri.",
|
||||
"type": "integer"
|
||||
},
|
||||
"amountTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"amountUsd": {
|
||||
"description": "AmountUsd is amount_tmt converted back at the attempt's own\nexchange_rate_usd - the USD figure the payout was quoted in.",
|
||||
"type": "number"
|
||||
},
|
||||
"apiClient": {
|
||||
"description": "ApiClient is the branch's GBÜS merchant username for this order type\n(visa/master or sber) and Description the text sent with register.do -\nboth as visamasterpay's Pay picks them.",
|
||||
"type": "string"
|
||||
},
|
||||
"bankFeeTmt": {
|
||||
"type": "number"
|
||||
},
|
||||
"branchId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"branchName": {
|
||||
"$ref": "#/definitions/shared.LocalizedText"
|
||||
},
|
||||
"cardholderName": {
|
||||
"description": "CardholderName/MaskedPan come from GBÜS's getOrderStatusExtended\ncardAuthInfo, so they're only known once an attempt has been\nfinalized by the callback/status check (unset while pending, and for\nattempts that never reached the card form).",
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdById": {
|
||||
"type": "integer"
|
||||
},
|
||||
"createdByName": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"exchangeRateRub": {
|
||||
"type": "number"
|
||||
},
|
||||
@@ -9454,6 +10038,9 @@
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"maskedPan": {
|
||||
"type": "string"
|
||||
},
|
||||
"orderId": {
|
||||
"type": "integer"
|
||||
},
|
||||
@@ -9834,6 +10421,128 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.CPU": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cores": {
|
||||
"type": "integer"
|
||||
},
|
||||
"loadAvg": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"usagePercent": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.Disk": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"freeBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"path": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"usagePercent": {
|
||||
"type": "number"
|
||||
},
|
||||
"usedBytes": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.Memory": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"availableBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"limitBytes": {
|
||||
"description": "LimitBytes is the container (cgroup) memory limit, nil when unlimited.",
|
||||
"type": "integer"
|
||||
},
|
||||
"swapTotalBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"swapUsedBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"totalBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"usagePercent": {
|
||||
"type": "number"
|
||||
},
|
||||
"usedBytes": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.Process": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"goroutines": {
|
||||
"type": "integer"
|
||||
},
|
||||
"heapAllocBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"numGc": {
|
||||
"type": "integer"
|
||||
},
|
||||
"sysBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"uptimeSeconds": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sysstats.Stats": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"arch": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"cpu": {
|
||||
"$ref": "#/definitions/sysstats.CPU"
|
||||
},
|
||||
"disks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/sysstats.Disk"
|
||||
}
|
||||
},
|
||||
"goVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"hostUptimeSeconds": {
|
||||
"type": "integer"
|
||||
},
|
||||
"hostname": {
|
||||
"type": "string"
|
||||
},
|
||||
"memory": {
|
||||
"$ref": "#/definitions/sysstats.Memory"
|
||||
},
|
||||
"os": {
|
||||
"type": "string"
|
||||
},
|
||||
"process": {
|
||||
"$ref": "#/definitions/sysstats.Process"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user.CreateUserDTO": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
@@ -1304,22 +1304,136 @@ definitions:
|
||||
$ref: '#/definitions/paymenthistory.PaymentHistoryItemDTO'
|
||||
type: array
|
||||
type: object
|
||||
paymenthistory.PaymentHistoryItemDTO:
|
||||
paymenthistory.PaymentHistoryDetailDTO:
|
||||
properties:
|
||||
amountMinor:
|
||||
description: AmountMinor is the amount registered with GBÜS, in tetri.
|
||||
type: integer
|
||||
amountTmt:
|
||||
type: number
|
||||
amountUsd:
|
||||
description: |-
|
||||
AmountUsd is amount_tmt converted back at the attempt's own
|
||||
exchange_rate_usd - the USD figure the payout was quoted in.
|
||||
type: number
|
||||
apiClient:
|
||||
description: |-
|
||||
ApiClient is the branch's GBÜS merchant username for this order type
|
||||
(visa/master or sber) and Description the text sent with register.do -
|
||||
both as visamasterpay's Pay picks them.
|
||||
type: string
|
||||
bankFeeTmt:
|
||||
type: number
|
||||
branchId:
|
||||
type: integer
|
||||
branchName:
|
||||
$ref: '#/definitions/shared.LocalizedText'
|
||||
cardholderName:
|
||||
description: |-
|
||||
CardholderName/MaskedPan come from GBÜS's getOrderStatusExtended
|
||||
cardAuthInfo, so they're only known once an attempt has been
|
||||
finalized by the callback/status check (unset while pending, and for
|
||||
attempts that never reached the card form).
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
createdById:
|
||||
type: integer
|
||||
createdByName:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
exchangeRateRub:
|
||||
type: number
|
||||
exchangeRateUsd:
|
||||
type: number
|
||||
formUrl:
|
||||
description: |-
|
||||
FormUrl/SuccessUrl are only set while the attempt is still pending
|
||||
(awaiting the customer to finish paying on GBÜS's hosted page) - once
|
||||
an attempt is finalized (success/failed), gateway_response no longer
|
||||
holds a formUrl, so there's nothing left to resume.
|
||||
type: string
|
||||
gatewayReference:
|
||||
type: string
|
||||
gatewayResponse:
|
||||
type: object
|
||||
gatewayStatus:
|
||||
type: string
|
||||
gbusFeeTmt:
|
||||
type: number
|
||||
id:
|
||||
type: integer
|
||||
maskedPan:
|
||||
type: string
|
||||
orderId:
|
||||
type: integer
|
||||
orderNumber:
|
||||
type: string
|
||||
orderUniqueId:
|
||||
type: string
|
||||
paid:
|
||||
type: boolean
|
||||
passportName:
|
||||
type: string
|
||||
passportSurname:
|
||||
type: string
|
||||
paymentPeriod:
|
||||
type: string
|
||||
successUrl:
|
||||
type: string
|
||||
totalAmountTmt:
|
||||
type: number
|
||||
tvebFeeTmt:
|
||||
type: number
|
||||
tvebFeeUsd:
|
||||
type: number
|
||||
type:
|
||||
type: string
|
||||
updatedAt:
|
||||
type: string
|
||||
userId:
|
||||
type: integer
|
||||
type: object
|
||||
paymenthistory.PaymentHistoryItemDTO:
|
||||
properties:
|
||||
amountMinor:
|
||||
description: AmountMinor is the amount registered with GBÜS, in tetri.
|
||||
type: integer
|
||||
amountTmt:
|
||||
type: number
|
||||
amountUsd:
|
||||
description: |-
|
||||
AmountUsd is amount_tmt converted back at the attempt's own
|
||||
exchange_rate_usd - the USD figure the payout was quoted in.
|
||||
type: number
|
||||
apiClient:
|
||||
description: |-
|
||||
ApiClient is the branch's GBÜS merchant username for this order type
|
||||
(visa/master or sber) and Description the text sent with register.do -
|
||||
both as visamasterpay's Pay picks them.
|
||||
type: string
|
||||
bankFeeTmt:
|
||||
type: number
|
||||
branchId:
|
||||
type: integer
|
||||
branchName:
|
||||
$ref: '#/definitions/shared.LocalizedText'
|
||||
cardholderName:
|
||||
description: |-
|
||||
CardholderName/MaskedPan come from GBÜS's getOrderStatusExtended
|
||||
cardAuthInfo, so they're only known once an attempt has been
|
||||
finalized by the callback/status check (unset while pending, and for
|
||||
attempts that never reached the card form).
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
createdById:
|
||||
type: integer
|
||||
createdByName:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
exchangeRateRub:
|
||||
type: number
|
||||
exchangeRateUsd:
|
||||
@@ -1339,6 +1453,8 @@ definitions:
|
||||
type: number
|
||||
id:
|
||||
type: integer
|
||||
maskedPan:
|
||||
type: string
|
||||
orderId:
|
||||
type: integer
|
||||
orderNumber:
|
||||
@@ -1600,6 +1716,86 @@ definitions:
|
||||
tm:
|
||||
type: string
|
||||
type: object
|
||||
sysstats.CPU:
|
||||
properties:
|
||||
cores:
|
||||
type: integer
|
||||
loadAvg:
|
||||
items:
|
||||
type: number
|
||||
type: array
|
||||
usagePercent:
|
||||
type: number
|
||||
type: object
|
||||
sysstats.Disk:
|
||||
properties:
|
||||
freeBytes:
|
||||
type: integer
|
||||
path:
|
||||
type: string
|
||||
totalBytes:
|
||||
type: integer
|
||||
usagePercent:
|
||||
type: number
|
||||
usedBytes:
|
||||
type: integer
|
||||
type: object
|
||||
sysstats.Memory:
|
||||
properties:
|
||||
availableBytes:
|
||||
type: integer
|
||||
limitBytes:
|
||||
description: LimitBytes is the container (cgroup) memory limit, nil when unlimited.
|
||||
type: integer
|
||||
swapTotalBytes:
|
||||
type: integer
|
||||
swapUsedBytes:
|
||||
type: integer
|
||||
totalBytes:
|
||||
type: integer
|
||||
usagePercent:
|
||||
type: number
|
||||
usedBytes:
|
||||
type: integer
|
||||
type: object
|
||||
sysstats.Process:
|
||||
properties:
|
||||
goroutines:
|
||||
type: integer
|
||||
heapAllocBytes:
|
||||
type: integer
|
||||
numGc:
|
||||
type: integer
|
||||
sysBytes:
|
||||
type: integer
|
||||
uptimeSeconds:
|
||||
type: integer
|
||||
type: object
|
||||
sysstats.Stats:
|
||||
properties:
|
||||
arch:
|
||||
type: string
|
||||
collectedAt:
|
||||
type: string
|
||||
cpu:
|
||||
$ref: '#/definitions/sysstats.CPU'
|
||||
disks:
|
||||
items:
|
||||
$ref: '#/definitions/sysstats.Disk'
|
||||
type: array
|
||||
goVersion:
|
||||
type: string
|
||||
hostUptimeSeconds:
|
||||
type: integer
|
||||
hostname:
|
||||
type: string
|
||||
memory:
|
||||
$ref: '#/definitions/sysstats.Memory'
|
||||
os:
|
||||
type: string
|
||||
process:
|
||||
$ref: '#/definitions/sysstats.Process'
|
||||
type: object
|
||||
user.CreateUserDTO:
|
||||
properties:
|
||||
active:
|
||||
@@ -3588,6 +3784,228 @@ paths:
|
||||
summary: Update currency rate
|
||||
tags:
|
||||
- currencies
|
||||
/dashboard/analytics/backlog:
|
||||
get:
|
||||
description: Open (unhandled) orders per order type aged under 1 day / 1-3 days
|
||||
/ over 3 days, the oldest open order, and the average processing time of orders
|
||||
finished in range; plus exact visa/master payout timing from the payment log.
|
||||
Order types are limited to the modules the caller can open.
|
||||
parameters:
|
||||
- default: Jan 1 of current year
|
||||
description: Start date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: from
|
||||
type: string
|
||||
- default: today
|
||||
description: End date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: to
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 'Dashboard analytics: backlog'
|
||||
tags:
|
||||
- dashboard-analytics
|
||||
/dashboard/analytics/branches:
|
||||
get:
|
||||
description: Per-branch leaderboard (orders per type, open/approved/rejected,
|
||||
approval rate, average processing hours) and order counts per region, for
|
||||
orders created in range.
|
||||
parameters:
|
||||
- default: Jan 1 of current year
|
||||
description: Start date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: from
|
||||
type: string
|
||||
- default: today
|
||||
description: End date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: to
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 'Dashboard analytics: branches'
|
||||
tags:
|
||||
- dashboard-analytics
|
||||
/dashboard/analytics/customers:
|
||||
get:
|
||||
description: Loan applicants in range by age group, education, marriage status
|
||||
and number of guarantors, each with its approval rate. Needs the loans permission.
|
||||
parameters:
|
||||
- default: Jan 1 of current year
|
||||
description: Start date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: from
|
||||
type: string
|
||||
- default: today
|
||||
description: End date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: to
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 'Dashboard analytics: customers'
|
||||
tags:
|
||||
- dashboard-analytics
|
||||
/dashboard/analytics/finance:
|
||||
get:
|
||||
description: Successful visa/master payouts (amount, bank/GBÜS/TVEB fees), gateway
|
||||
status breakdown and success rate, monthly payout totals, and the total loan
|
||||
amount requested. Payouts need the cards permission, the loan total the loans
|
||||
permission.
|
||||
parameters:
|
||||
- default: Jan 1 of current year
|
||||
description: Start date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: from
|
||||
type: string
|
||||
- default: today
|
||||
description: End date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: to
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 'Dashboard analytics: finance'
|
||||
tags:
|
||||
- dashboard-analytics
|
||||
/dashboard/analytics/products:
|
||||
get:
|
||||
description: Loan orders by source (web/mobile) and loan type, card orders by
|
||||
card type, and paid vs unpaid card orders, for orders created in range.
|
||||
parameters:
|
||||
- default: Jan 1 of current year
|
||||
description: Start date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: from
|
||||
type: string
|
||||
- default: today
|
||||
description: End date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: to
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 'Dashboard analytics: products'
|
||||
tags:
|
||||
- dashboard-analytics
|
||||
/dashboard/analytics/system:
|
||||
get:
|
||||
description: Registration funnel (all-scope callers with the users permission),
|
||||
operator activity and error rate per module (activity-logs permission), order
|
||||
peak hours heatmap in Ashgabat time, and card balance check stats (cards permission).
|
||||
Widgets the caller cannot see are null or empty.
|
||||
parameters:
|
||||
- default: Jan 1 of current year
|
||||
description: Start date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: from
|
||||
type: string
|
||||
- default: today
|
||||
description: End date YYYY-MM-DD (inclusive)
|
||||
in: query
|
||||
name: to
|
||||
type: string
|
||||
- default: 10
|
||||
description: Number of operators to return
|
||||
in: query
|
||||
name: operator_limit
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppSuccess'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 'Dashboard analytics: system'
|
||||
tags:
|
||||
- dashboard-analytics
|
||||
/dashboard/overview:
|
||||
get:
|
||||
description: Returns the KPI cards, loan/card trend, loan status breakdown,
|
||||
@@ -3622,6 +4040,32 @@ paths:
|
||||
summary: Dashboard overview
|
||||
tags:
|
||||
- dashboard
|
||||
/dashboard/server-stats:
|
||||
get:
|
||||
description: Returns host CPU, RAM and disk usage plus the API process's own
|
||||
memory and uptime. CPU usage is sampled over ~250ms; host fields are null
|
||||
when the OS cannot report them.
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/appresult.AppSuccess'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/sysstats.Stats'
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Server statistics
|
||||
tags:
|
||||
- dashboard
|
||||
/file:
|
||||
post:
|
||||
consumes:
|
||||
@@ -5069,6 +5513,24 @@ paths:
|
||||
in: query
|
||||
name: search
|
||||
type: string
|
||||
- default: id
|
||||
description: Sort column
|
||||
enum:
|
||||
- id
|
||||
- created_at
|
||||
- status
|
||||
- amount
|
||||
in: query
|
||||
name: sort
|
||||
type: string
|
||||
- default: desc
|
||||
description: Sort direction
|
||||
enum:
|
||||
- asc
|
||||
- desc
|
||||
in: query
|
||||
name: order
|
||||
type: string
|
||||
- default: 1
|
||||
description: Page number
|
||||
in: query
|
||||
@@ -5138,6 +5600,45 @@ paths:
|
||||
summary: Get payment logs for an order
|
||||
tags:
|
||||
- payment-history
|
||||
/payment-history/payments/{id}:
|
||||
get:
|
||||
description: Returns one visa/master/sber payout attempt by its payment ID,
|
||||
with the raw GBÜS response - the detail view behind a payment-history list
|
||||
row
|
||||
parameters:
|
||||
- description: Payment ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/paymenthistory.PaymentHistoryDetailDTO'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/appresult.AppError'
|
||||
"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: Get a single payment attempt
|
||||
tags:
|
||||
- payment-history
|
||||
/payment-settings:
|
||||
get:
|
||||
description: Returns the admin-configurable bank and GBÜS commission fees used
|
||||
|
||||
Reference in New Issue
Block a user