Commit Graph

102 Commits

Author SHA1 Message Date
11e1fa4972 visamaster: record order actions for the "Ammallar" table
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
Every create, update and delete of a visa/master or sber order is now
recorded in visa_master_order_actions: who did it, finished or failed
(with the exception), and for an update only the columns that changed -
original before, changes after. Marking an order paid when a payment is
finalized is recorded the same way, with no user when the GBÜS callback
did it.

Actions are written in the transaction that changes the order, so one is
on record exactly when its change is; failed ones are written after the
rollback with the values they attempted. The payment finalize records
after its commit instead, so recording never holds up a payment GBÜS has
already taken. Updates that change nothing and creates that fail (no
order to attach to) are not recorded.

GET /visa-master-payment-orders/{id}/actions lists them, newest first;
GET /visa-master-payment-orders/{id}/actions/{actionId} adds original,
changes and exception. Both are staff-only and order-scoped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 22:39:42 +05:00
742e078090 visamasterpay: return gatewayResponse from GET /{id}/status
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
The status check now carries GBÜS's last stored response for the
attempt alongside gatewayStatus - the fresh getOrderStatusExtended.do
answer when it was just checked, the stored one when the attempt was
already finalized, null if GBÜS never answered. The callback is
unchanged: it is public and only reports paid plus a message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 01:25:12 +05:00
570d4c6d20 payment-history: drop /payments/{id}/gateway in favour of /{id}/gateway
Some checks failed
CI/CD / Deploy binary to server (push) Has been cancelled
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
Both routes served the same handler and took an order ID, while
/payments/{id} takes a payment ID - so the /payments/ one read as
per-payment and showed up twice in Swagger. /payment-history/{id}/gateway
is the one to use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 23:30:11 +05:00
d7e5d1f989 swagger: split the Visa/Master tag and document payment-history in Turkmen
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
visa-master-payment-orders mixed order CRUD with the GBÜS payment flow;
they are now visa-master-orders and visa-master-payment. payment-history
summaries, descriptions and params are in Turkmen with one shape
(what it returns, Tertip, Bellik), and its tag description lists the
endpoints in the order they are used.

@securityDefinitions.apikey moves to the end of the general info block:
swag read every line after it as its attributes, so @schemes and all
@tag.* declarations were silently dropped from the spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 23:21:07 +05:00
78e1976e53 visamasterpay: keep a payment pending while GBÜS still reports it in progress
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
A status check that ran before the card was entered (orderStatus 0,
"no payment attempts") finalized the payment as failed, and later
callbacks returned it as already finalized without asking GBÜS again -
so cardholderName/maskedPan stayed null and a real payment was never
recorded. Unpaid in-progress statuses (0, 1, 5) now keep the row
pending with the latest response stored, and rows already failed that
way are re-checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 22:58:49 +05:00
f1337706f0 swagger: document the ?lang= query parameter on every admin endpoint
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
appresult.Localize applies to all /api/admin routes, so each handler's
godoc now declares lang (tm, ru, en, all; default tm) and Swagger UI
offers it as a dropdown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 22:08:32 +05:00
72a5ac52b0 shared: use one LocalizedText type everywhere
Some checks failed
CI/CD / Deploy binary to server (push) Has been cancelled
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
auth, user, userbranch and org/branches each declared their own identical
{en, ru, tm} struct; they now use shared.LocalizedText. No JSON change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 21:48:03 +05:00
c6540a658b api: return localized fields only in the requested ?lang=
appresult.Localize, the first admin middleware, rewrites JSON responses so
every {en, ru, tm} object becomes the plain string for ?lang= (tm, ru, en;
default tm), falling back tm -> ru -> en when that translation is empty.
?lang=all keeps the full objects for edit forms; other values are 400.
Key order and number precision are preserved; non-JSON responses and
/swagger are untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 21:48:02 +05:00
f067872cd7 payment-history: /payments/{id}/gateway takes an order ID and lists its payments
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
The frontend calls /payments/{id}/gateway with an order ID, so that URL
now returns every payment of the order (newest first, each with its
HALKBANK JSON) instead of one payment by payment ID. /{id}/gateway stays
as an alias of the same handler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:18:05 +05:00
6dd6110914 payment-history: bring back GET /payments/{id}/gateway for the frontend
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
The frontend still calls the single-payment gateway view, so it's back
as it was (payment ID -> one PaymentGatewayDTO), alongside the new
order-wide /{id}/gateway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:10:07 +05:00
a3cbb52f4b payment-history: GET /{id}/gateway - all of an order's payments with their HALKBANK JSON
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
The gateway view now takes an order ID and returns every payment of the
order, newest first, each in the same PaymentGatewayDTO shape with its
own last stored GBÜS response. It moves from /payments/{id}/gateway to
/{id}/gateway, next to the other order-scoped routes (/{id}, /{id}/logs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:05:18 +05:00
ef3a1baee2 payment-history: apiClientName, formUrl/successUrl after finalizing, callbackStatus
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
To match the old online payment history page:
- apiClientName: billing_visa_master_username / billing_sber_username
- formUrl falls back to the logged register.do response, so finalized
  attempts keep it; successUrl is the returnUrl logged with register.do
- callbackStatus ("received") and callbackAt from the attempt's first
  callback_received log
- index visa_master_payment_logs (order_id, step) for those lookups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:49:24 +05:00
ae6bf0b7e3 payment-history: GET /payments/{id}/gateway - one payment with its HALKBANK JSON
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
Returns a payment the way the per-order payment table shows it (paid,
cardholder name, masked card, time, payment year/month, USD/TMT amounts,
reference) plus the last stored GBÜS response, for the storage icon.
Card fields and gatewayResponse are null until GBÜS reports them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:10:32 +05:00
c209f338c2 payment-history: /{id} lists the order's payments, logs move to /{id}/logs
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
GET /payment-history/{id} now returns one row per payment of the order
(paid, card, time, period, amounts), newest first - the per-order payment
table the frontend already calls. The step-by-step logs it used to return
are kept at GET /payment-history/{id}/logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:38:02 +05:00
a715cd23ea payment-history: payment detail with GBÜS response, sorting, newest-first logs
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
- 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>
2026-10-24 13:32:36 +05:00
e5f01d0e94 add docker
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
2026-10-23 00:39:04 +05:00
965b00dba5 analytics: customers totals, open counts, normalize education/marriage
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 11:06:18 +05:00
29867561d1 ch panel statistik
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
2026-10-01 18:14:20 +05:00
ebedeba009 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
2026-09-30 16:26:38 +05:00
7e403dab13 rm -file
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
2026-09-30 14:41:31 +05:00
60787c8149 ch something
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
2026-09-30 14:41:13 +05:00
3b33e25703 ch data
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
2026-09-30 14:28:52 +05:00
0de3900ed1 rm file
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
2026-09-30 14:24:18 +05:00
94eb2aa4e9 ch pin-orders
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
2026-09-30 14:23:58 +05:00
27ad42528c ch card-rekwezit
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
2026-09-30 14:20:28 +05:00
15774d2bc4 ch card-orders
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
2026-09-30 14:16:36 +05:00
69d1495b1f remove some daata
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
2026-09-30 14:10:10 +05:00
a44c10d445 added province name
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
2026-09-30 14:00:27 +05:00
68ead82827 ch data
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
2026-09-30 13:55:49 +05:00
4f3631c70d ch branches
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
2026-09-30 13:48:35 +05:00
6f54e9c20b ch role list added name
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
2026-09-30 13:44:10 +05:00
5ab17b1539 ch role list
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
2026-09-30 13:42:14 +05:00
19a1f70588 ch en -tk
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
2026-09-30 13:35:32 +05:00
8b73df4435 ch en-tk
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
2026-09-30 13:29:59 +05:00
0058411cdd add order number
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
2026-09-29 19:29:07 +05:00
e47e8c24d0 added log
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
2026-09-28 16:53:34 +05:00
c01429d2a4 ch mg
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
2026-09-26 21:57:41 +05:00
323e131216 changed role permission
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
2026-09-26 16:34:28 +05:00
f0ecf23879 ch return url
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
2026-09-22 18:31:22 +05:00
d6a1053003 swagger
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
2026-09-22 17:03:23 +05:00
205aaafc63 remove something
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
2026-09-22 13:39:02 +05:00
f2b55f9896 add status api
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
2026-09-22 12:42:31 +05:00
ac94e0dd8a add /order-id
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
2026-09-21 19:52:10 +05:00
235ef5ec9e ch some
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
2026-09-21 19:12:07 +05:00
febd190d6e fixed error
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
2026-09-21 18:31:31 +05:00
99788a853f added payment history
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
2026-09-21 18:12:08 +05:00
23d208769c fixed error
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
2026-09-21 17:51:10 +05:00
f42ad01828 added print
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
2026-09-19 12:26:35 +05:00
87e4b33322 rm -rf amount in db
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
2026-09-19 12:16:24 +05:00
45378559ca todo check day
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
2026-09-19 11:51:23 +05:00