Skip to main content

Manual CTT Unlink

This page explains focused manual unlink flow for removing CTT-to-NTT relationship.

API Endpoints

  • POST /ticket/ctt/unlink
  • POST /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

StepBusiness meaning
receive unlink requestoperator-driven unlink starts
loop each cttId if batch-style payload usedmany items can be processed
verify current CTT-to-NTT pairunlink only applies to real existing relation
clear local nttId and nttTicketNolocal relationship is removed
send unlink to TaaS or TMFdownstream sync happens
external sync failed?original link is restored
set unlink-block cache or follow-up protectionsconflicting immediate actions are reduced
trigger follow-up job or note pathdownstream repair behavior can run
refresh NTT cttCountaggregate count stays correct
write CTT and NTT audit logsunlink trace is preserved
return unlink resultcaller 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:330
  • mvp3-ticket-service/src/modules/ctt/ctt.service.ts:2695
  • mvp3-ticket-service/src/modules/ctt/ctt.service.ts:2790