package localdb

import (
	"testing"

	"git.mchus.pro/mchus/quoteforge/internal/models"
)

func TestPricelistItemToLocal_PreservesLotCategory(t *testing.T) {
	item := &models.PricelistItem{
		LotName:     "CPU_A",
		LotCategory: "CPU",
		Price:       10,
	}

	local := PricelistItemToLocal(item, 123)
	if local.LotCategory != "CPU" {
		t.Fatalf("expected LotCategory=CPU, got %q", local.LotCategory)
	}
}

func TestLocalToPricelistItem_PreservesLotCategory(t *testing.T) {
	local := &LocalPricelistItem{
		LotName:     "CPU_A",
		LotCategory: "CPU",
		Price:       10,
	}

	item := LocalToPricelistItem(local, 456)
	if item.LotCategory != "CPU" {
		t.Fatalf("expected LotCategory=CPU, got %q", item.LotCategory)
	}
}

