Manual CTT Unlink
This page explains focused manual unlink flow for removing CTT-to-NTT relationship.
API Endpoints
POST /ticket/ctt/unlinkPOST /ticket/ctt/unlink/bulk
Purpose
Manual unlink removes existing CTT pairing from NTT when operator decides current relationship is wrong or no longer valid.
Business meaning
Manual unlink also is not DB-only action.
It includes:
- current-pair validation
- local unlink
- TaaS or TMF synchronization
- rollback on external failure
- optional follow-up activity handling
- count refresh and audit logging
Flow summary
| Step | Business meaning |
|---|---|
| receive unlink request | operator-driven unlink starts |
loop each cttId if batch-style payload used | many items can be processed |
| verify current CTT-to-NTT pair | unlink only applies to real existing relation |
clear local nttId and nttTicketNo | local relationship is removed |
| send unlink to TaaS or TMF | downstream sync happens |
| external sync failed? | original link is restored |
| set unlink-block cache or follow-up protections | conflicting immediate actions are reduced |
| trigger follow-up job or note path | downstream repair behavior can run |
refresh NTT cttCount | aggregate count stays correct |
| write CTT and NTT audit logs | unlink trace is preserved |
| return unlink result | caller gets outcome |
Implementation note
Current repo confirms:
- controller exposes
POST /ticket/ctt/unlink - service delegates to
unlinkCttNttWithAudit(...) - unlink-then-link flow also reuses same unlink helper
Code refs:
mvp3-ticket-service/src/modules/ctt/ctt.controller.ts:330mvp3-ticket-service/src/modules/ctt/ctt.service.ts:2695mvp3-ticket-service/src/modules/ctt/ctt.service.ts:2790