Initial LC model

As presented earlier in the LC concepts and design section, we have four actors in our LC use case, namely, a buyer, a seller, an issuing bank, and a confirming bank. Let's define these participants in our CTO model as follows:

namespace org.example.lc
enum ParticipantType {
o BUYER
o SELLER
o ISSUING_BANK
o CONFIRMING_BANK
}

// PARTICIPANTS
//BANK
participant Bank identified by bankID {
o String bankID
o String name
o ParticipantType type
}
//USER
participant User identified by userId {
o String userId
o String name
o String lastName optional
o String companyName

  o ParticipantType type
--> Bank bank
}

We first define four types of participants—a buyer, seller, issuing bank, and confirming bank—in an enumeration, which is declared using the keyword enum ParticipantType. Then, we define a bank participant with the attribute ParticipantType to differentiate between the issuing and confirming banks.

A participant User, is defined with the property userId as the identity field, the associated company name, and the bank he will deal with. For example, the buyer will deal with the issuing bank and the seller will deal with the confirming bank.

Now, let’s define the letter of credit asset:

// ENUMS
enum LCStatus {
o CONTRACT
o REQUEST_LC
o ISSUE_LC
o ADVICE_LC
o DELIVER_PRODUCT
o PRESENT_DOCUMENT
o DELIVERY_DOCUMENT
o BUYER_DEBIT_PAYMENT
o BANKS_PAYMENT_TRANSFER
o SELL_RECEIVED_PAYMENT
o CLOSED
}
// ASSETS
asset LetterOfCredit identified by letterId {
o String letterId
--> User buyer
--> User seller
--> Bank issuingBank
--> Bank confirmingBank
o Rule[] rules
o ProductDetails productDetails
o String [] evidence
o LCStatus status
o String closeReason optional
}
concept ProductDetails {
o String productType
o Integer quantity
o Double pricePerUnit
}
concept Rule {
o String ruleId
o String ruleText
}

As we saw in the LC concepts and design section, the entire LC process has 10 steps. Therefore, we have defined the possible status in the LCStatus enumeration. We have also added a final CLOSED status to signal the end of the LC process.

We define the ProductDetails concept, which contains information on the kind of product and total price that the buyer is paying to the seller. In Composer's modeling language, concepts are abstract classes contained by an asset, participant, or transaction.

We model the LC as an asset with an ID, letterId, which can be used by all participants in the network to trace this LC. The LC is related (relationship) to the four participants, and defines certain rules (Rule[] rules) that only permitted, authorized parties can perform. The evidence array provides proof of certain steps needed to display the required documents. The variable LCStatus will keep track of the current blockchain LC status (as defined in the LCStatus enum).

We have defined the assets and participants, so now it is time to define the requisite transactions following the LC process steps.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset