December 2018
Intermediate to advanced
222 pages
6h 6m
English
In this step, the insuree reports the lost item to the broker with all the claim information. This function also records the current system process time at the processAt field. currentts.Format(2006-01-02 15:04:05) is a Go custom format; it will convert the current time into YYYY-MM-dd hh:mm:ss format, as shown in the following example:
func (c *ClaimContract) ReportLost(stub shim.ChaincodeStubInterface, args []string) pb.Response { claimId := args[0] desc := args[1] insureeId := args[2] brokerId := args[3] currentts := time.Now() processAt := currentts.Format("2006-01-02 15:04:05") //initialized claim claimData := Claim{ Id: claimId, Desc: desc, Status: "ReportLost", InsureeId: insureeId, BrokerId: brokerId, InsurerId: "", Comment: ...Read now
Unlock full access