Bulk Link CTT
This page explains focused bulk-link flow for linking many CTT items to NTT targets.
API Endpoints
POST /ticket/ctt/link/bulk
Purpose
Bulk link lets operator process many relationship actions in one request while still preserving per-item validation.
Business meaning
Bulk link is wrapper around manual link logic.
It does not bypass single-item rules. Each item still depends on:
- CTT existence
- NTT existence
- duplicate-link rejection
- external sync success
Flow summary
| Step | Business meaning |
|---|---|
| receive list of link pairs | batch begins |
| initialize success and failed counters | aggregate result starts |
| loop each pair | process item by item |
| build per-item remark | reporting context is prepared |
| run full manual link helper | single-item link logic is reused |
| item success? | increment success or collect error |
| continue remaining items | one failure does not stop whole batch immediately |
| all items failed? | batch throws aggregated bad request |
| at least one success? | return mixed success result |
Implementation note
Current repo confirms:
- controller exposes
POST /ticket/ctt/link/bulk - service loops through entries and reuses
linkCttNttWithAudit(...) - response tracks
success,failed, anderrors
Code refs:
mvp3-ticket-service/src/modules/ctt/ctt.controller.ts:294mvp3-ticket-service/src/modules/ctt/ctt.service.ts:2211