# T752 — import quota sweep counters

> Status: `done`  
> Milestone: `M5` · Phase C  
> Kind: `feat` · Est. change: `~180 lines`

## Goal

手動匯入支援產品上下文，且所有管線可分辨新商機、合併 match、適配不足與截斷。

## Depends on

- T751

## Inputs

- `apps/backend/internal/module/radar/usecase/manual_import.go`
- RadarSweep domain/repositories/mappers
- `../spec.md` §4.2、§4.3、§5.2

## Outputs

| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/backend/internal/module/radar/usecase/manual_import.go` | edit | optional product context 與 shared match pipeline |
| `apps/backend/internal/module/radar/domain/sweep.go` | edit | evaluated／merged／fit rejected counters |
| sweep repositories／mappers | edit | guarded 累加與 public fields |
| quota/counter tests | edit/add | new vs merge vs truncate accounting |

## Behavior

- 新 match 不計成 created opportunity；配額 0 時既有商機仍可補 match，AI 點數另受 gate。
- partial import 每列保留狀態與原因；不得整批空成功。
- Sweep counters 重試不重複累加同一 external/product。

## Out of scope

- 前端 counter mapping（T760）
- 新 usage meter

## Acceptance

- [x] created＋merged＋fit rejected＋truncated 可用 fixture 對帳。

```bash
cd apps/backend && go test ./internal/module/radar/... ./internal/logic/radar/... -count=1
```

Implementation result (2026-08-10): manual import now accepts paired product
context, keeps per-row failure／merged status, and routes new rows through the
same ProductMatch judge. Sweep progress accumulates evaluated, merged, fit
rejected, and truncated counters; existing opportunities can receive a new
product match even when the new-opportunity quota is exhausted.
