As with most modern (micro)services or APIs, it is best to start by designing the specification first and defining what operations are exposed to the outside. The same goes for smart contracts on the blockchain. It's best to start every new contract using a model-first design approach. What I mean by this is to define the data objects (participants, assets (including its attributes), complex types, and enumerations) and the request and response objects for our transactions and events. You can start out on paper, use tools to create entity relationship diagram (ERD) models (for instance, https://draw.io), or design your business model using Hyperledger Composer, a declarative modeling language and development toolset for smart contracts that is deployable on Hyperledger Fabric.
For this chapter, we are going to design the models as a custom ERD diagram, since explaining a toolset such as Hyperledger Composer is a bit on the heavy side, apart from the fact that it...