Commerce & financial systems

Order recovery / profit analysis

Kybro Topup · Operations & analytics

A commerce backend with automated wallet top-ups, durable order recovery, profit reports, and explainable recommendations based on sales.

System flow

  1. Order & payment
  2. Supplier submission
  3. Reconciliation
  4. Settlement & reports

The problem

An order can time out even after a supplier accepts it. A useful store backend has to keep the financial outcome, supplier status, and customer notification consistent, then turn that history into meaningful operating reports.

The build

I built the order and payment services, supplier integrations, catalog workflows, administrative reporting, and analytics. Kybro uses a Telegram storefront, while the difficult work lives in backend services and PostgreSQL records.

Engineering notes

Recovering an uncertain submission

Provider submission and final settlement are recorded as separate events. The recovery workflow reconciles pending work rather than treating every transport timeout as proof that an order failed.

Recommendations that show their reasoning

Reports combine settled sales, cost, margin, failures, and time-of-day demand. Recommendations carry a formula, threshold, and measured value, so advice about weak margins or busy periods can be checked instead of presented as a profit guarantee.

Pricing follows a hierarchy

Profit rules resolve from the product’s category through parent categories, then provider or global defaults. Decimal calculations and order snapshots preserve the values used at purchase time.

Notifications survive a restart

Business events enter a durable outbox. Worker leases, retries, delivery receipts, and permanent-failure handling keep sending separate from the order transaction, while acknowledging external delivery cannot be perfectly atomic with a database update.

What it includes

  • Automatic ShamCash and Syriatel Cash wallet top-ups.
  • Order timelines, stored snapshots, reconciliation, and durable notification delivery.
  • Revenue, costs, gross and net profit, referral payouts, demand patterns, and product margins.
Back to the project index