Files
apskel-pos-backend/internal/processor
efrilmandClaude Opus 5.5 5baed18b22 feat(loyalty): earning calculator
Adds CalculateEarning (docs/prd-point-coin.md F1, Q1, Q10, PC-202), a pure
function returning, per currency, the amount an order earns and the
settings that produced it, plus the basis:

  basis  = subtotal − discount − paid with EnakPoint   (never negative)
  amount = 0 below min_order_amount, else
           floor(basis / earn_per_amount) × earn_value, capped by max_per_order

Tax and anything added on top of the subtotal are not part of the basis,
and the part paid with EnakPoint earns nothing. Money is handled in whole
cents: in float64 some baskets divide to 4956.999… and a naive floor would
lose a point, which a test reproduces. Metadata() gives the snapshot the
EARN row will freeze.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 10:31:09 +07:00
..
Fix
2025-09-12 15:41:08 +07:00
2026-08-11 22:41:10 +07:00
2026-08-05 19:28:38 +07:00
2026-08-13 14:38:28 +07:00
2026-08-13 14:38:28 +07:00
2025-09-12 16:37:16 +07:00
2025-09-18 12:01:20 +07:00
2026-08-13 14:38:28 +07:00
2026-08-13 14:38:28 +07:00
2026-06-03 14:56:27 +07:00
2025-09-18 13:39:37 +07:00
2025-09-17 19:30:17 +07:00
2025-08-14 01:35:19 +07:00
2026-05-10 10:57:38 +07:00
2025-09-18 01:32:01 +07:00
2026-04-20 12:31:33 +07:00
2025-08-03 23:55:51 +07:00
2026-08-13 14:38:28 +07:00
2025-09-17 23:55:11 +07:00
2026-05-10 14:52:02 +07:00
2026-08-13 14:38:28 +07:00
2025-09-17 19:30:17 +07:00
2025-08-10 20:58:32 +07:00
2025-09-12 15:37:19 +07:00
2026-05-10 10:42:09 +07:00