# Product Price Response Required (Fix N/A price in cashier search)

## Masalah yang Terjadi

Di FE (cashier search suggestion), harga tampil `N/A` walaupun master data sudah diimport dari Excel.

## Akar Masalah (BE)

Endpoint:

- `GET /api/v1/products`

saat ini **tidak mengembalikan field harga** (`base_price` / `normal_price` / `promo_price`) di response item.

Akibatnya FE tidak punya nilai untuk ditampilkan pada kolom harga suggestion.

## Bukti Teknis

Di `internal/modules/products/handler.go`:

- Query list sudah select:
  - `id`, `item_code`, `barcode`, `name`, `brand`, `category`, `size`, `collection`
- Tidak select:
  - `base_price`
  - `normal_price`
  - `promo_price`

Padahal hasil import sudah menyimpan `SELL PRICE` ke `bazzar_pos.products.base_price`.

## Yang Harus Diupdate di BE

## 1) Update response endpoint `GET /api/v1/products`

Tambahkan minimal:

- `base_price`

Disarankan juga:

- `normal_price`
- `promo_price`

Contoh response item yang dibutuhkan FE:

```json
{
  "id": 1513,
  "item_code": "SDRWC050003",
  "barcode": "92031405000301",
  "name": "SAPPHIRE TROPICAL",
  "brand": "RYCROFT",
  "category": "",
  "size": "39",
  "collection": "2025 Q4",
  "base_price": 649000,
  "normal_price": 649000,
  "promo_price": 50000
}
```

## 2) (Opsional tapi disarankan) Join harga aktif dari tabel `product_prices`

Jika bisnis memakai harga dinamis:

- Ambil harga aktif berdasarkan `effective_from/effective_to`
- fallback ke `products.base_price` jika tidak ada row aktif

## 3) Pastikan detail endpoint juga kirim harga

- `GET /api/v1/products/:id`
- `PUT /api/v1/products/:id` response

Supaya modal edit/detail FE bisa konsisten.

## Catatan Import Excel

Mapping import saat ini:

- `SELL PRICE` -> `products.base_price` ✅
- `HARGA PROMO` belum diproses ke `product_prices` / `promo_price` ❗

Jika ingin promo langsung terbaca, tambahkan parsing kolom `HARGA PROMO` saat import.

## Checklist Uji Setelah Perbaikan

1. Import excel sukses.
2. `GET /api/v1/products?search=...` return `base_price` (dan/atau `promo_price`).
3. FE cashier suggestion menampilkan harga (bukan `N/A`).

