fix: DTO mismatch marketings

This commit is contained in:
Adnan Zahir
2026-04-22 11:41:27 +07:00
parent c8ea370e4b
commit adabd43f38
3 changed files with 24 additions and 2 deletions
@@ -0,0 +1,22 @@
package dto
import (
"testing"
entity "gitlab.com/mbugroup/lti-api.git/internal/entities"
)
func TestToMarketingDeliveryProductDTOIncludesPendingQty(t *testing.T) {
input := entity.MarketingDeliveryProduct{
Id: 1,
MarketingProductId: 42,
UsageQty: 15,
PendingQty: 5,
}
got := ToMarketingDeliveryProductDTO(input)
if got.Qty != 20 {
t.Fatalf("expected qty to include pending quantity, got %.2f", got.Qty)
}
}