Implementing the business transaction function

We learned how to implement a transaction function in the previous section by reviewing SampleTransaction. Following a similar approach, we will implement an insurance claim transaction function. Rename sample.js to logic.js.

Implement the Init function, as follows:

Init() function is used to register insuree person information./**   * Create the insuree  * @param {com.packt.quickstart.claim.Init} initalAppliation - the InitialApplication transaction  * @transaction  */ async function Init(application) { // eslint-disable-line no-unused-vars     const factory = getFactory();     const namespace = 'com.packt.quickstart.claim'; const insuree = factory.newResource(namespace, 'Insuree', application.insureeId); ...

Get Blockchain Development with Hyperledger now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.