sequenceDiagram
    participant Admin
	participant CBS
    participant SC as SEPA CONNECTOR
    participant DIS
    participant BANK

 
  Note right of DIS: Transfer sent from Bank.
  BANK->>DIS: Sends CLAIM_FOR_VALUE_DATE_CORRECTION
  activate DIS
    
	alt 1. Received CLAIM_FOR_VALUE_DATE_CORRECTION has an syntax error according to DIS
		DIS->>BANK: Sends SYNRES	
		DIS->>Admin: Notification: SYNRES sent
	else 2 Received CLAIM_FOR_VALUE_DATE_CORRECTION has an signature error according to DIS
		DIS->>BANK: Sends AUTHRES
		DIS->>Admin: Notification: AUTHRES sent
	else 3 Received CLAIM_FOR_VALUE_DATE_CORRECTION has an other errors according to DIS
		DIS->>BANK: Sends RESULT
		DIS->>Admin: Notification: RESULT sent
		Note right of DIS: To be confirmed: <br> can we send RESULT?
	else 4 Received CLAIM_FOR_VALUE_DATE_CORRECTION has no errors according to DIS
		DIS->>BANK: Sends CONTRL
		Note right of DIS: Create document	
        DIS->>SC: Sends CLAIM_FOR_VALUE_DATE_CORRECTION			
		deactivate DIS
		activate SC 
        SC->>CBS: Sends CLAIM_FOR_VALUE_DATE_CORRECTION
		activate CBS
		SC-->>CBS: (ClaimForValueDateCorrection)
		deactivate SC
		Note right of CBS: Save CLAIM_FOR_VALUE_DATE_CORRECTION
		Note right of CBS: Claim: WAITING
		deactivate CBS
        

        alt 4.1 Received CLAIM_FOR_VALUE_DATE_CORRECTION is rejected
		   Note over SC,DIS: Negative response
		  activate CBS
          Note right of CBS: Create INQUIRY_RESPONSE <br> with RJVA or CVAA
          Note right of CBS: Claim: WAITING
          Note right of CBS: Inquiry_reponse: CREATED
		  deactivate CBS
		  
			alt 4.1.1. MQ unavailable
				activate CBS
				CBS->>CBS: Inquiry_reponse deferred		
				Note right of CBS:Inquiry_reponse: DEFERRED			
				CBS->>CBS: Tries to resend INQUIRY_RESPONSE
				deactivate CBS
	
			else 4.1.2 MQ available
				activate CBS
				CBS->>SC: Sends INQUIRY_RESPONSE
				activate SC
				CBS-->>SC: (InquiryResponse with RJVA or CVAA)
				Note right of CBS: Claim: RESPONDED
				Note right of CBS: Inquiry_reponse: SENT
				deactivate CBS
				SC->>DIS: Sends INQUIRY_RESPONSE 
				deactivate SC
				activate DIS
            
				alt 4.1.2.1 INQUIRY_RESPONSE - Received DIS error
					DIS->>SC: Sends DIS INQUIRY_RESPONSE recjection
					activate SC
					SC->>CBS: Sends DIS INQUIRY_RESPONSE recjection
					activate CBS
					SC-->>CBS: (StandAloneNotification(REJECTED, DIS))
					deactivate SC
					Note right of CBS: Claim: FAILED
					Note right of CBS: Inquiry_reponse: REJECTING
					deactivate CBS
					
					alt 4.1.2.1.1 Admin rejects INQUIRY_RESPONSE
						activate Admin
						Admin->>CBS: Rejects inquiry_response
						deactivate Admin
						activate CBS
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: REJECTED
						deactivate CBS
					else 4.1.2.1.2 Admin resends INQUIRY_RESPONSE
						activate Admin
						Admin->>CBS: Resends inquiry_response
						deactivate Admin
						activate CBS
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: RETRIED
						deactivate CBS
					else 4.1.2.1.3 CBS rejects INQUIRY_RESPONSE
						activate CBS
						CBS->>CBS: Rejects inquiry_response
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: REJECTED
						deactivate CBS
					else 4.1.2.1.4 CBS resends INQUIRY_RESPONSE
						activate CBS
						CBS->>CBS: Resends inquiry_response
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: RETRIED
						deactivate CBS	
					end

				else 4.1.2.2 DIS acknowledgement
					Note right of DIS: Creates and <br> signs message
					DIS->>SC: Sends DIS acknowledgement
					activate SC
					SC->>CBS: Sends DIS acknowledgement
					activate CBS
					SC-->>CBS: (StandAloneNotification(Acknowledged, DIS))
					deactivate SC
					Note right of CBS: Claim: RESPONDED
					Note right of CBS: Inquiry_reponse: PENDING
					deactivate CBS
					DIS->>BANK: Sends INQUIRY_RESPONSE
					deactivate DIS
	
					alt 4.1.2.2.1 No inquiry_response received
						BANK->>DIS: Exception
						DIS->>Admin: Notification: INQUIRY_RESPONSE recjected

						alt 4.1.2.2.1.1 Admin rejects INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Rejects inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: REJECTED
							deactivate CBS
						else 4.1.2.2.1.2 Admin resends INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Resends inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: RETRIED
							deactivate CBS
						end

					else 4.1.2.2.2 Received syntax error    
						BANK->>DIS: Sends SYNRES
						DIS->>Admin: Notification:  INQUIRY_RESPONSE recjected
						
						alt 4.1.2.2.2.1 Admin rejects INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Rejects inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: REJECTED
							deactivate CBS
						else 4.1.2.2.2.2 Admin resends INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Resends inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: RETRIED
							deactivate CBS
						end
						
					else 4.1.2.2.3 Received signature error    
						BANK->>DIS: Sends AUTHRES
						DIS->>Admin: Notification: INQUIRY_RESPONSE recjected
						
						alt 4.1.2.2.3.1 Admin rejects INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Rejects inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: REJECTED
							deactivate CBS
						else 4.1.2.2.3.2 Admin resends INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Resends inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: RETRIED
							deactivate CBS
						end

					else 4.1.2.2.4 Received acknowledgement
						BANK->>DIS: Sends CONTRL
						activate DIS
						
				alt 4.1.2.4.1 INQUIRY_RESPONSE - Received pacs.002 with RJCT       
					BANK->>DIS: Sends INQUIRY_RESPONSE rejection
					

							alt 4.1.2.4.1.1 Received pacs.002 has an syntax error according to DIS
								DIS->>BANK: Sends SYNRES
								DIS->>Admin: Notification: SYNRES sent
							else 4.1.2.4.1.2 Received pacs.002 has an signature error according to DIS
								DIS->>BANK: Sends AUTHRES
								DIS->>Admin: Notification: AUTHRES sent
							else 4.1.2.4.1.3 Received pacs.002 has an other errors according to DIS
								DIS->>BANK: Sends RESULT
								DIS->>Admin: Notification: RESULT sent
								Note right of DIS: To be confirmed: <br> can we send RESULT?
							else 4.1.2.4.1.4 Received pacs.002 has no errors according to DIS
								DIS->>BANK: Sends CONTRL
								Note right of DIS: Create document
								DIS->>SC: Sends INQUIRY_RESPONSE rejection
								deactivate DIS
								activate SC
								SC->>CBS: Sends INQUIRY_RESPONSE rejection
								activate CBS
								SC-->>CBS: (StandAloneNotification(REJECTED, BANK))
								deactivate SC
								Note right of CBS: Claim: FAILED
								Note right of CBS: Inquiry_reponse: REJECTING
								deactivate CBS
								
								alt 4.1.2.4.1.4.1 Admin rejects INQUIRY_RESPONSE
									activate Admin
									Admin->>CBS: Rejects inquiry_response
									deactivate Admin
									activate CBS
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: REJECTED
									deactivate CBS
								else 4.1.2.4.1.4.2 Admin resends INQUIRY_RESPONSE
									activate Admin
									Admin->>CBS: Resends inquiry_response
									deactivate Admin
									activate CBS
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: RETRIED
									deactivate CBS
								else 4.1.2.4.1.4.3 CBS rejects INQUIRY_RESPONSE
									activate CBS
									CBS->>CBS: Rejects inquiry_response
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: REJECTED
									deactivate CBS
								else 4.1.2.4.1.4.4 CBS resends INQUIRY_RESPONSE
									activate CBS
									CBS->>CBS: Resends inquiry_response
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: RETRIED
									deactivate CBS	
									end
							end
				
				else 4.1.2.4.2 INQUIRY_RESPONSE - Received pacs.002 with ACCP    
					BANK->>DIS: Sends INQUIRY_RESPONSE acceptance
					activate DIS
				
							alt 4.1.2.4.2.1  Received pacs.002 has an syntax error according to DIS
								DIS->>BANK: Sends SYNRES
								DIS->>Admin: Notification: SYNRES sent
							else 4.1.2.4.2.2 Received pacs.002 has an signature error according to DIS
								DIS->>BANK: Sends AUTHRES
								DIS->>Admin: Notification: AUTHRES sent
							else 4.1.2.4.2.3 Received pacs.002 has an other errors according to DIS
								DIS->>BANK: Sends RESULT
								DIS->>Admin: Notification: RESULT sent
								Note right of DIS: To be confirmed: <br> can we send RESULT?
							else 4.1.2.4.2.4 Received pacs.002 has no errors according to DIS
								DIS->>BANK: Sends CONTRL
								Note right of DIS: Create document		
								DIS->>SC: Sends INQUIRY_RESPONSE acceptance
								deactivate DIS
								activate SC
								SC->>CBS: Sends INQUIRY_RESPONSE acceptance
								activate CBS
								SC-->>CBS: (StandAloneNotification(COMPLETED, BANK))
								deactivate SC
								Note right of CBS: Claim: COMPLETED
								Note right of CBS: Inquiry_reponse: COMPLETED
								deactivate CBS
					end
                  end
             end
			 end
                 end   
    else 4.2 Received CLAIM_FOR_VALUE_DATE_CORRECTION is accepted
	    Note over SC,DIS: Positive response with request for interest compensation
        activate CBS
        Note right of CBS: Create INQUIRY_RESPONSE with ACVA
		Note right of CBS: Fee can be calculated
        Note right of CBS: Claim: WAITING
        Note right of CBS: Inquiry_reponse: CREATED
		deactivate CBS
		
		alt 4.2.1. MQ unavailable
			activate CBS
			CBS->>CBS: INQUIRY_RESPONSE deferred		
			Note right of CBS:inquiry_response: DEFERRED			
			CBS->>CBS: Tries to resend INQUIRY_RESPONSE
			deactivate CBS
	
		else 4.2.2 MQ available
			activate CBS
			CBS->>SC: Sends INQUIRY_RESPONSE
			activate SC
			CBS-->>SC: (InquiryResponse with ACVA)
rect rgba(255, 0, 0)				
			Note right of CBS: Claim: ACCEPTED
end			
			Note right of CBS: inquiry_response: SENT
			deactivate CBS
			deactivate SC
			activate DIS
            
				alt 4.2.2.1 INQUIRY_RESPONSE - Received DIS error
					DIS->>SC: Sends DIS INQUIRY_RESPONSE recjection
					activate SC
					SC->>CBS: Sends DIS INQUIRY_RESPONSE recjection
					activate CBS
					SC-->>CBS: (StandAloneNotification(REJECTED, DIS))
					deactivate SC
					Note right of CBS: Claim: FAILED
					Note right of CBS: Inquiry_reponse: REJECTING
					deactivate CBS
					
					alt 4.2.2.1.1 Admin rejects INQUIRY_RESPONSE
						activate Admin
						Admin->>CBS: Rejects inquiry_response
						deactivate Admin
						activate CBS
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: REJECTED
						deactivate CBS
					else 4.2.2.1.2 Admin resends INQUIRY_RESPONSE
						activate Admin
						Admin->>CBS: Resends inquiry_response
						deactivate Admin
						activate CBS
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: RETRIED
						deactivate CBS
					else 4.2.2.1.3 CBS rejects INQUIRY_RESPONSE
						activate CBS
						CBS->>CBS: Rejects inquiry_response
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: REJECTED
						deactivate CBS
					else 4.2.2.1.4 CBS resends INQUIRY_RESPONSE
						activate CBS
						CBS->>CBS: Resends inquiry_response
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: RETRIED
						deactivate CBS	
					end

				else 4.2.2.2 DIS acknowledgement
					Note right of DIS: Creates and <br> signs message
					DIS->>SC: Sends DIS acknowledgement
					activate SC
					SC->>CBS: Sends DIS acknowledgement
					activate CBS
					SC-->>CBS: (StandAloneNotification(Acknowledged, DIS))
					deactivate SC
					
rect rgba(255, 0, 0)								
				    Note right of CBS: Claim:  ACCEPTED
	end						
					Note right of CBS: Inquiry_reponse: PENDING
					deactivate CBS
					DIS->>BANK: Sends INQUIRY_RESPONSE
					deactivate DIS
	
					alt 4.2.2.2.1 No inquiry_response received
						BANK->>DIS: Exception
						DIS->>Admin: Notification: INQUIRY_RESPONSE recjected

						alt 4.2.2.2.1.1 Admin rejects INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Rejects inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: REJECTED
							deactivate CBS
						else 4.2.2.2.1.2 Admin resends INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Resends inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: RETRIED
							deactivate CBS
						end

					else 4.2.2.2.2 Received syntax error    
						BANK->>DIS: Sends SYNRES
						DIS->>Admin: Notification:  INQUIRY_RESPONSE recjected
						
						alt 4.2.2.2.2.1 Admin rejects INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Rejects inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: REJECTED
							deactivate CBS
						else 4.2.2.2.2.2 Admin resends INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Resends inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: RETRIED
							deactivate CBS
						end
						
					else 4.2.2.2.3 Received signature error    
						BANK->>DIS: Sends AUTHRES
						DIS->>Admin: Notification: INQUIRY_RESPONSE recjected
						
						alt 4.2.2.2.3.1 Admin rejects INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Rejects inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: REJECTED
							deactivate CBS
						else 4.2.2.2.3.2 Admin resends INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Resends inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: RETRIED
							deactivate CBS
						end

					else 4.2.2.2.4 Received acknowledgement
						BANK->>DIS: Sends CONTRL
						activate DIS
						
				alt 4.2.2.4.1 INQUIRY_RESPONSE - Received pacs.002 with RJCT       
					BANK->>DIS: Sends INQUIRY_RESPONSE rejection
					

							alt 4.2.2.4.1.1 Received pacs.002 has an syntax error according to DIS
								DIS->>BANK: Sends SYNRES
								DIS->>Admin: Notification: SYNRES sent
							else 4.2.2.4.1.2 Received pacs.002 has an signature error according to DIS
								DIS->>BANK: Sends AUTHRES
								DIS->>Admin: Notification: AUTHRES sent
							else 4.2.2.4.1.3 Received pacs.002 has an other errors according to DIS
								DIS->>BANK: Sends RESULT
								DIS->>Admin: Notification: RESULT sent
								Note right of DIS: To be confirmed: <br> can we send RESULT?
							else 4.2.2.4.1.4 Received pacs.002 has no errors according to DIS
								DIS->>BANK: Sends CONTRL
								Note right of DIS: Create document
								DIS->>SC: Sends INQUIRY_RESPONSE rejection
								deactivate DIS
								activate SC
								SC->>CBS: Sends INQUIRY_RESPONSE rejection
								activate CBS
								SC-->>CBS: (StandAloneNotification(REJECTED, BANK))
								deactivate SC
								Note right of CBS: Claim: FAILED
								Note right of CBS: Inquiry_reponse: REJECTING
								deactivate CBS
								
								alt 4.2.2.4.1.4.1 Admin rejects INQUIRY_RESPONSE
									activate Admin
									Admin->>CBS: Rejects inquiry_response
									deactivate Admin
									activate CBS
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: REJECTED
									deactivate CBS
								else 4.2.2.4.1.4.2 Admin resends INQUIRY_RESPONSE
									activate Admin
									Admin->>CBS: Resends inquiry_response
									deactivate Admin
									activate CBS
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: RETRIED
									deactivate CBS
								else 4.2.2.4.1.4.3 CBS rejects INQUIRY_RESPONSE
									activate CBS
									CBS->>CBS: Rejects inquiry_response
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: REJECTED
									deactivate CBS
								else 4.2.2.4.1.4.4 CBS resends INQUIRY_RESPONSE
									activate CBS
									CBS->>CBS: Resends inquiry_response
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: RETRIED
									deactivate CBS	
									end
							end
				
				else 4.2.2.4.2 INQUIRY_RESPONSE - Received pacs.002 with ACCP    
					BANK->>DIS: Sends INQUIRY_RESPONSE acceptance
					activate DIS
				
							alt 4.2.2.4.2.1  Received pacs.002 has an syntax error according to DIS
								DIS->>BANK: Sends SYNRES
								DIS->>Admin: Notification: SYNRES sent
							else 4.2.2.4.2.2 Received pacs.002 has an signature error according to DIS
								DIS->>BANK: Sends AUTHRES
								DIS->>Admin: Notification: AUTHRES sent
							else 4.2.2.4.2.3 Received pacs.002 has an other errors according to DIS
								DIS->>BANK: Sends RESULT
								DIS->>Admin: Notification: RESULT sent
								Note right of DIS: To be confirmed: <br> can we send RESULT?
							else 4.2.2.4.2.4 Received pacs.002 has no errors according to DIS
								DIS->>BANK: Sends CONTRL
								Note right of DIS: Create document		
								DIS->>SC: Sends INQUIRY_RESPONSE acceptance
								deactivate DIS
								activate SC
								SC->>CBS: Sends INQUIRY_RESPONSE acceptance
								activate CBS
								SC-->>CBS: (StandAloneNotification(COMPLETED, BANK))
								deactivate SC						
rect rgba(255, 0, 0)								
				    Note right of CBS: Claim:  ACCEPTED
	end	

								Note right of CBS: Inquiry_reponse: COMPLETED
								deactivate CBS
								
								Note over SC,DIS: Confirmed Positive Response
								activate CBS
								Note right of CBS: Create INQUIRY_RESPONSE with MODI
								Note right of CBS: Claim: ACCEPTED
								Note right of CBS: Inquiry_reponse: CREATED
								deactivate CBS
		
								alt 4.2.2.4.2.4.1. MQ unavailable
									activate CBS
									CBS->>CBS: INQUIRY_RESPONSE deferred		
									Note right of CBS:inquiry_response: DEFERRED			
									CBS->>CBS: Tries to resend INQUIRY_RESPONSE
									deactivate CBS
	
							else 4.2.2.4.2.4.2 MQ available
									activate CBS
									CBS->>SC: Sends INQUIRY_RESPONSE
									activate SC
									CBS-->>SC: (InquiryResponse with MODI)
rect rgba(255, 0, 0)				
									Note right of CBS: Claim: RESPONDED
end			
									Note right of CBS: inquiry_response: SENT
									deactivate CBS
									deactivate SC
									activate DIS
            
									alt 4.2.2.4.2.4.2.1 INQUIRY_RESPONSE - Received DIS error
										DIS->>SC: Sends DIS INQUIRY_RESPONSE recjection
										activate SC
										SC->>CBS: Sends DIS INQUIRY_RESPONSE recjection
										activate CBS
										SC-->>CBS: (StandAloneNotification(REJECTED, DIS))
										deactivate SC
										Note right of CBS: Claim: FAILED
										Note right of CBS: Inquiry_reponse: REJECTING
										deactivate CBS
					
										alt 4.2.2.4.2.4.2.1.1 Admin rejects INQUIRY_RESPONSE
											activate Admin
											Admin->>CBS: Rejects inquiry_response
											deactivate Admin
											activate CBS
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: REJECTED
											deactivate CBS
										else 4.2.2.4.2.4.2.1.2 Admin resends INQUIRY_RESPONSE
											activate Admin
											Admin->>CBS: Resends inquiry_response
											deactivate Admin
											activate CBS
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: RETRIED
											deactivate CBS
										else 4.2.2.4.2.4.2.1.3 CBS rejects INQUIRY_RESPONSE
											activate CBS
											CBS->>CBS: Rejects inquiry_response
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: REJECTED
											deactivate CBS
										else 4.2.2.4.2.4.2.1.4 CBS resends INQUIRY_RESPONSE
											activate CBS
											CBS->>CBS: Resends inquiry_response
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: RETRIED
											deactivate CBS	
										end
	
								else 4.2.2.4.2.4.2.2 DIS acknowledgement
									Note right of DIS: Creates and <br> signs message
									DIS->>SC: Sends DIS acknowledgement
									activate SC
									SC->>CBS: Sends DIS acknowledgement
									activate CBS
									SC-->>CBS: (StandAloneNotification(Acknowledged, DIS))
									deactivate SC
					
rect rgba(255, 0, 0)								
									Note right of CBS: Claim:  RESPONDED
	end						
									Note right of CBS: Inquiry_reponse: PENDING
									deactivate CBS
									DIS->>BANK: Sends INQUIRY_RESPONSE
									deactivate DIS
	
									alt 4.2.2.4.2.4.2.2.1 No inquiry_response received
										BANK->>DIS: Exception
										DIS->>Admin: Notification: INQUIRY_RESPONSE recjected

										alt 4.2.2.4.2.4.2.2.1.1 Admin rejects INQUIRY_RESPONSE
											activate Admin
											Admin->>CBS: Rejects inquiry_response
											deactivate Admin
											activate CBS
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: REJECTED
											deactivate CBS
										else 4.2.2.2.1.2 Admin resends INQUIRY_RESPONSE
											activate Admin
											Admin->>CBS: Resends inquiry_response
											deactivate Admin
											activate CBS
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: RETRIED
											deactivate CBS
										end

								else 4.2.2.4.2.4.2.2.2 Received syntax error    
									BANK->>DIS: Sends SYNRES
									DIS->>Admin: Notification:  INQUIRY_RESPONSE recjected
						
									alt 4.2.2.4.2.4.2.2.2.1 Admin rejects INQUIRY_RESPONSE
										activate Admin
										Admin->>CBS: Rejects inquiry_response
										deactivate Admin
										activate CBS
										Note right of CBS: Claim: FAILED
										Note right of CBS: Inquiry_reponse: REJECTED
										deactivate CBS
									else 4.2.2.4.2.4.2.2.2.2 Admin resends INQUIRY_RESPONSE
										activate Admin
										Admin->>CBS: Resends inquiry_response
										deactivate Admin
										activate CBS
										Note right of CBS: Claim: FAILED
										Note right of CBS: Inquiry_reponse: RETRIED
										deactivate CBS
									end
						
								else 4.2.2.4.2.4.2.2.3 Received signature error    
									BANK->>DIS: Sends AUTHRES
									DIS->>Admin: Notification: INQUIRY_RESPONSE recjected
						
									alt 4.2.2.4.2.4.2.2.3.1 Admin rejects INQUIRY_RESPONSE
										activate Admin
										Admin->>CBS: Rejects inquiry_response
										deactivate Admin
										activate CBS
										Note right of CBS: Claim: FAILED
										Note right of CBS: Inquiry_reponse: REJECTED
										deactivate CBS
									else 4.2.2.4.2.4.2.2.3.2 Admin resends INQUIRY_RESPONSE
										activate Admin
										Admin->>CBS: Resends inquiry_response
										deactivate Admin
										activate CBS
										Note right of CBS: Claim: FAILED
										Note right of CBS: Inquiry_reponse: RETRIED
										deactivate CBS
									end

							else 4.2.2.4.2.4.2.2.4 Received acknowledgement
								BANK->>DIS: Sends CONTRL
								activate DIS
						
								alt 4.2.2.4.2.4.2.2.4.1 INQUIRY_RESPONSE - Received pacs.002 with RJCT       
									BANK->>DIS: Sends INQUIRY_RESPONSE rejection
					

									alt 4.2.2.4.2.4.2.2.4.1.1 Received pacs.002 has an syntax error according to DIS
										DIS->>BANK: Sends SYNRES
										DIS->>Admin: Notification: SYNRES sent
									else 4.2.2.4.2.4.2.2.4.1.2 Received pacs.002 has an signature error according to DIS
										DIS->>BANK: Sends AUTHRES
										DIS->>Admin: Notification: AUTHRES sent
									else 4.2.2.4.2.4.2.2.4.1.3 Received pacs.002 has an other errors according to DIS
										DIS->>BANK: Sends RESULT
										DIS->>Admin: Notification: RESULT sent
										Note right of DIS: To be confirmed: <br> can we send RESULT?
									else 4.2.2.4.2.4.2.2.4.1.3.4 Received pacs.002 has no errors according to DIS
										DIS->>BANK: Sends CONTRL
										Note right of DIS: Create document
										DIS->>SC: Sends INQUIRY_RESPONSE rejection
										deactivate DIS
										activate SC
										SC->>CBS: Sends INQUIRY_RESPONSE rejection
										activate CBS
										SC-->>CBS: (StandAloneNotification(REJECTED, BANK))
										deactivate SC
										Note right of CBS: Claim: FAILED
										Note right of CBS: Inquiry_reponse: REJECTING
										deactivate CBS
								
										alt 4.2.2.4.2.4.2.2.4.1.3.4.1 Admin rejects INQUIRY_RESPONSE
											activate Admin
											Admin->>CBS: Rejects inquiry_response
											deactivate Admin
											activate CBS
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: REJECTED
											deactivate CBS
										else 4.2.2.4.2.4.2.2.4.1.3.4.2 Admin resends INQUIRY_RESPONSE
											activate Admin
											Admin->>CBS: Resends inquiry_response
											deactivate Admin
											activate CBS
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: RETRIED
											deactivate CBS
										else 4.2.2.4.2.4.2.2.4.1.3.4.3 CBS rejects INQUIRY_RESPONSE
											activate CBS
											CBS->>CBS: Rejects inquiry_response
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: REJECTED
											deactivate CBS
										else 4.2.2.4.2.4.2.2.4.1.3.4.4 CBS resends INQUIRY_RESPONSE
											activate CBS
											CBS->>CBS: Resends inquiry_response
											Note right of CBS: Claim: FAILED
											Note right of CBS: Inquiry_reponse: RETRIED
											deactivate CBS	
										end
								end
				
								else 4.2.2.4.2.4.2.2.4.2 INQUIRY_RESPONSE - Received pacs.002 with ACCP    
									BANK->>DIS: Sends INQUIRY_RESPONSE acceptance
									activate DIS
				
									alt 4.2.2.4.2.4.2.2.4.2.1  Received pacs.002 has an syntax error according to DIS
										DIS->>BANK: Sends SYNRES
										DIS->>Admin: Notification: SYNRES sent
									else 4.2.2.4.2.4.2.2.4.2.2 Received pacs.002 has an signature error according to DIS
										DIS->>BANK: Sends AUTHRES
										DIS->>Admin: Notification: AUTHRES sent
									else 4.2.2.4.2.4.2.2.4.2.3 Received pacs.002 has an other errors according to DIS
										DIS->>BANK: Sends RESULT
										DIS->>Admin: Notification: RESULT sent
										Note right of DIS: To be confirmed: <br> can we send RESULT?
									else 4.2.2.4.2.4.2.2.4.2.4 Received pacs.002 has no errors according to DIS
										DIS->>BANK: Sends CONTRL
										Note right of DIS: Create document		
										DIS->>SC: Sends INQUIRY_RESPONSE acceptance
										deactivate DIS
										activate SC
										SC->>CBS: Sends INQUIRY_RESPONSE acceptance
										activate CBS
										SC-->>CBS: (StandAloneNotification(COMPLETED, BANK))
										deactivate SC						
rect rgba(255, 0, 0)								
				    Note right of CBS: Claim:  COMPLETED
	end	
								Note right of CBS: Inquiry_reponse: COMPLETED
								deactivate CBS
								
								end
								end
								end
								end
								end
							
							
							
	else 4.3 Received CLAIM_FOR_VALUE_DATE_CORRECTION is confirmed
		  Note over SC,DIS: Confirmed Positive Response
		  activate CBS
          Note right of CBS: Create INQUIRY_RESPONSE <br> with MODI
          Note right of CBS: Claim: WAITING
          Note right of CBS: Inquiry_reponse: CREATED
		  deactivate CBS
		  
		 alt 4.3.1. MQ unavailable
				activate CBS
				CBS->>CBS: Inquiry_reponse deferred		
				Note right of CBS:Inquiry_reponse: DEFERRED			
				CBS->>CBS: Tries to resend INQUIRY_RESPONSE
				deactivate CBS
	
			else 4.3.2 MQ available
				activate CBS
				CBS->>SC: Sends INQUIRY_RESPONSE
				activate SC
				CBS-->>SC: (InquiryResponse with MODI)
				Note right of CBS: Claim: RESPONDED
				Note right of CBS: Inquiry_reponse: SENT
				deactivate CBS
				SC->>DIS: Sends INQUIRY_RESPONSE 
				deactivate SC
				activate DIS
            
				alt 4.3.2.1 INQUIRY_RESPONSE - Received DIS error
					DIS->>SC: Sends DIS INQUIRY_RESPONSE recjection
					activate SC
					SC->>CBS: Sends DIS INQUIRY_RESPONSE recjection
					activate CBS
					SC-->>CBS: (StandAloneNotification(REJECTED, DIS))
					deactivate SC
					Note right of CBS: Claim: FAILED
					Note right of CBS: Inquiry_reponse: REJECTING
					deactivate CBS
					
					alt 4.3.2.1.1 Admin rejects INQUIRY_RESPONSE
						activate Admin
						Admin->>CBS: Rejects inquiry_response
						deactivate Admin
						activate CBS
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: REJECTED
						deactivate CBS
					else 4.3.2.1.2 Admin resends INQUIRY_RESPONSE
						activate Admin
						Admin->>CBS: Resends inquiry_response
						deactivate Admin
						activate CBS
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: RETRIED
						deactivate CBS
					else 4.3.2.1.3 CBS rejects INQUIRY_RESPONSE
						activate CBS
						CBS->>CBS: Rejects inquiry_response
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: REJECTED
						deactivate CBS
					else 4.3.2.1.4 CBS resends INQUIRY_RESPONSE
						activate CBS
						CBS->>CBS: Resends inquiry_response
						Note right of CBS: Claim: FAILED
						Note right of CBS: Inquiry_reponse: RETRIED
						deactivate CBS	
					end

				else 4.3.2.2 DIS acknowledgement
					Note right of DIS: Creates and <br> signs message
					DIS->>SC: Sends DIS acknowledgement
					activate SC
					SC->>CBS: Sends DIS acknowledgement
					activate CBS
					SC-->>CBS: (StandAloneNotification(Acknowledged, DIS))
					deactivate SC
					Note right of CBS: Claim: RESPONDED
					Note right of CBS: Inquiry_reponse: PENDING
					deactivate CBS
					DIS->>BANK: Sends INQUIRY_RESPONSE
					deactivate DIS
	
					alt 4.3.2.2.1 No inquiry_response received
						BANK->>DIS: Exception
						DIS->>Admin: Notification: INQUIRY_RESPONSE recjected

						alt 4.3.2.2.1.1 Admin rejects INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Rejects inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: REJECTED
							deactivate CBS
						else 4.3.2.2.1.2 Admin resends INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Resends inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: RETRIED
							deactivate CBS
						end

					else 4.3.2.2.2 Received syntax error    
						BANK->>DIS: Sends SYNRES
						DIS->>Admin: Notification:  INQUIRY_RESPONSE recjected
						
						alt 4.3.2.2.2.1 Admin rejects INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Rejects inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: REJECTED
							deactivate CBS
						else 4.3.2.2.2.2 Admin resends INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Resends inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: RETRIED
							deactivate CBS
						end
						
					else 4.3.2.2.3 Received signature error    
						BANK->>DIS: Sends AUTHRES
						DIS->>Admin: Notification: INQUIRY_RESPONSE recjected
						
						alt 4.3.2.2.3.1 Admin rejects INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Rejects inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: REJECTED
							deactivate CBS
						else 4.3.2.2.3.2 Admin resends INQUIRY_RESPONSE
							activate Admin
							Admin->>CBS: Resends inquiry_response
							deactivate Admin
							activate CBS
							Note right of CBS: Claim: FAILED
							Note right of CBS: Inquiry_reponse: RETRIED
							deactivate CBS
						end

					else 4.3.2.2.4 Received acknowledgement
						BANK->>DIS: Sends CONTRL
						activate DIS
						
				alt 4.3.2.4.1 INQUIRY_RESPONSE - Received pacs.002 with RJCT       
					BANK->>DIS: Sends INQUIRY_RESPONSE rejection
					

							alt 4.3.2.4.1.1 Received pacs.002 has an syntax error according to DIS
								DIS->>BANK: Sends SYNRES
								DIS->>Admin: Notification: SYNRES sent
							else 4.3.2.4.1.2 Received pacs.002 has an signature error according to DIS
								DIS->>BANK: Sends AUTHRES
								DIS->>Admin: Notification: AUTHRES sent
							else 4.3.2.4.1.3 Received pacs.002 has an other errors according to DIS
								DIS->>BANK: Sends RESULT
								DIS->>Admin: Notification: RESULT sent
								Note right of DIS: To be confirmed: <br> can we send RESULT?
							else 4.3.2.4.1.4 Received pacs.002 has no errors according to DIS
								DIS->>BANK: Sends CONTRL
								Note right of DIS: Create document
								DIS->>SC: Sends INQUIRY_RESPONSE rejection
								deactivate DIS
								activate SC
								SC->>CBS: Sends INQUIRY_RESPONSE rejection
								activate CBS
								SC-->>CBS: (StandAloneNotification(REJECTED, BANK))
								deactivate SC
								Note right of CBS: Claim: FAILED
								Note right of CBS: Inquiry_reponse: REJECTING
								deactivate CBS
								
								alt 4.3.2.4.1.4.1 Admin rejects INQUIRY_RESPONSE
									activate Admin
									Admin->>CBS: Rejects inquiry_response
									deactivate Admin
									activate CBS
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: REJECTED
									deactivate CBS
								else 4.3.2.4.1.4.2 Admin resends INQUIRY_RESPONSE
									activate Admin
									Admin->>CBS: Resends inquiry_response
									deactivate Admin
									activate CBS
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: RETRIED
									deactivate CBS
								else 4.3.2.4.1.4.3 CBS rejects INQUIRY_RESPONSE
									activate CBS
									CBS->>CBS: Rejects inquiry_response
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: REJECTED
									deactivate CBS
								else 4.3.2.4.1.4.4 CBS resends INQUIRY_RESPONSE
									activate CBS
									CBS->>CBS: Resends inquiry_response
									Note right of CBS: Claim: FAILED
									Note right of CBS: Inquiry_reponse: RETRIED
									deactivate CBS	
									end
							end
				
				else 4.3.2.4.2 INQUIRY_RESPONSE - Received pacs.002 with ACCP    
					BANK->>DIS: Sends INQUIRY_RESPONSE acceptance
					activate DIS
				
							alt 4.3.2.4.2.1  Received pacs.002 has an syntax error according to DIS
								DIS->>BANK: Sends SYNRES
								DIS->>Admin: Notification: SYNRES sent
							else 4.3.2.4.2.2 Received pacs.002 has an signature error according to DIS
								DIS->>BANK: Sends AUTHRES
								DIS->>Admin: Notification: AUTHRES sent
							else 4.3.2.4.2.3 Received pacs.002 has an other errors according to DIS
								DIS->>BANK: Sends RESULT
								DIS->>Admin: Notification: RESULT sent
								Note right of DIS: To be confirmed: <br> can we send RESULT?
							else 4.3.2.4.2.4 Received pacs.002 has no errors according to DIS
								DIS->>BANK: Sends CONTRL
								Note right of DIS: Create document		
								DIS->>SC: Sends INQUIRY_RESPONSE acceptance
								deactivate DIS
								activate SC
								SC->>CBS: Sends INQUIRY_RESPONSE acceptance
								activate CBS
								SC-->>CBS: (StandAloneNotification(COMPLETED, BANK))
								deactivate SC
								Note right of CBS: Claim: COMPLETED
								Note right of CBS: Inquiry_reponse: COMPLETED
								deactivate CBS
					end
                  end
             end
			 end
                 end   
							
							
							
							
							
							
							
							
							
							
							
								
							end
                 end
             end
			 end
                 end   
end
    else 4.4 No response is sent to BANK
        activate BANK
		BANK->>DIS: Sends Status update request
        Note right of SC: See Status Update from Bank diagram
		deactivate BANK

end