# Quoting/Agreements BC

The Quoting and Agreements Bounded Context provides Participants with quotations for undertaking transfers, and records the participant accept/reject responses.

## Terms

The following terms are used in this BC, also known as a domain.

| Term            | Description                           |
| --------------- | ------------------------------------- |
| **(D)FSP**      | (Digital) Financial Services Provider |
| **Participant** | Financial Services Provider           |

## Functional Overview

![Use Case - Functional Overview](https://960632945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXhOIEoqtInj89WmQ_Q%2Fuploads%2Fgit-blob-72ac92834c1ba5fa885fe5600989d1daa3a8bb3a%2FqtaFunctionalOverview_20210825.png?alt=media)

## Use Cases

### Calculate Quote - Happy Path

#### Description

This process obtains an array of relevant Participant data including status flags, calculates the cost of Transfer including fees, and provides it to the Participant/s. It also able to support the storing of Participants requests & responses (i.e. accept or reject the quote).

#### Flow Diagram

![Use Case - Calculate Quote - Happy Path](https://960632945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXhOIEoqtInj89WmQ_Q%2Fuploads%2Fgit-blob-ce5c78a4df94865b018e14499dc5ccee8121822f%2FqtaCalculateQuoteHappyPath_20210825.png?alt=media)

### Get Quote - Happy Path

#### Description

Process to obtain and deliver existing Quote details to Participant/s on request.

#### Flow Diagram

![Use Case - Example REPLACE ME](https://960632945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXhOIEoqtInj89WmQ_Q%2Fuploads%2Fgit-blob-5c67aa42bc8ea292bb06f41739ab66087032ef52%2FqtaGetQuoteHappyPath.png?alt=media)

### Calculate Quote - Invalid Quote Request

#### Description

Process that enables the system to invalidate quote requests by monitoring and responding to invalid Request Events, FSPs, or duplicate requests.

#### Flow Diagram

![Use Case - Calculate Quote - Invalid Quote Request](https://960632945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXhOIEoqtInj89WmQ_Q%2Fuploads%2Fgit-blob-5cb2262e820fce2112a985cfa0d960644a8d3faa%2FqtaCalculateQuoteInvalidQuoteRequest_20210825.png?alt=media)

### Calculate Quote - Invalid FSPs

#### Description

Process that enables the system to invalidate FSP quote requests where the FSP details mismatch the original Quote for either one or both Participants.

#### Flow Diagram

![Use Case - Calculate Quote - Invalid FSPs](https://960632945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXhOIEoqtInj89WmQ_Q%2Fuploads%2Fgit-blob-80bbd8d7a0154232eab5549648f2950c708710ee%2FqtaCalculateQuoteInvalidFSPs_20210825.png?alt=media)

### Calculate Quote - Invalid Scheme Rules Detected In Request

#### Description

Process to enable the system to invalidate quote requests where Scheme Rules are violated, by one or more Participants, for example where Quote Period Limit reached.

#### Flow Diagram

![Use Case - Calculate Quote - Invalid Scheme Rules detected in Request](https://960632945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXhOIEoqtInj89WmQ_Q%2Fuploads%2Fgit-blob-b98cbc26e2a0fefaf9138aa68cf54f9d4ffb9daa%2FqtaCalculateQuoteInvalidSchemeRulesRequest_20210825.png?alt=media)

### Calculate Quote - Invalid Scheme Rules Detected In Response

#### Desciption

Process to enable the system to invalidate quote reponses where Scheme Rules are violated by one or more Participants, for example, where invalid terms are detected.

#### Flow Diagram

![Use Case - Calculate Quote - Invalid Scheme Rules detected in response](https://960632945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXhOIEoqtInj89WmQ_Q%2Fuploads%2Fgit-blob-a023e3df6a522c0b9661710ffb4eafebc08e3fd0%2FqtaCalculateQuoteInvalidSchemeRulesResponse_20210825.png?alt=media)

## Canonical Quote Model

The canonical model stores the following details of quotations in the Quotes & Agreements BC:

* Quote ID
* Transaction ID
* Participants
  * payerId
  * payeeId
* Payer
  * Participant
    * participantId
    * roleType (e.g. payer)
  * Amount Requested (initial amount)
    * Value (number)
    * Currency (ISO currency code)
  * Amount to send (including fees, etc.)
    * Value (number)
    * Currency (ISO currency code)
* Payee(s) (one or more - should all be added to the "Amount to send")
  * '#'
    * Participant
      * participantId
      * roleType (Identify why this "payee" is receiving this amount, i.e.: fee, recipient, etc.)
      * reason
      * Amount to receive
        * value (number)
        * currency (ISO currency code)
* Extensions

## Concluding comments

* No red flag issues have been observed in the overall BC and Reference Architecture design.
* We need to better understand/clarify the "GET" via "POST" pattern:
  * Should a "GET" event be a simple Restful "GET", or does the system need to support the "GET" from duplicate posts?
  * Are we required to serve "GET" requests that include FSP details at a later date?
