---
# System prepended metadata

title: TIR GROUPE

---

## TIR GROUPE
```mermaid
sequenceDiagram

participant USER
participant WSRG
participant TIR GROUPE(TG)
participant DB

USER ->> WSRG: Redeem
note over WSRG: input:barcode
WSRG ->> DB: Check is 3Party and card is exists
alt Is 3Party
  WSRG ->> TIR GROUPE(TG): TG Redeem 
  TIR GROUPE(TG) -->> WSRG: Is TG Redeem sucess?
  alt sucess
    TIR GROUPE(TG) -->> WSRG: Sucess Message
 
  else fail
    TIR GROUPE(TG) -->> WSRG: err
    WSRG -->> USER: err
  end
   
  alt Card Not Exists
    WSRG ->> DB: Import Card
    WSRG ->> DB: Activation Card
    DB -->> WSRG: Import and activation Card Sucess?
    alt fail
      WSRG ->> TIR GROUPE(TG): void redeem
      WSRG -->> USER: err
    end
  end
    
    
 
end
WSRG ->> DB : Redeem
DB -->> WSRG: Is Redeem sucess?
  alt sucess
    DB -->> WSRG: Sucess Message
    WSRG -->> USER: Sucess Message
  else fail
    DB -->> WSRG: err
    WSRG ->> TIR GROUPE(TG): void redeem
    WSRG -->> USER: err
  end
