Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SDK *fabsdk.FabricSDK // sdk handler ChannelName = "assetschannel" // channel ChainCodeName = "insurance" // chaincode name Org = "org1" // org name User = "Admin" // user ConfigPath = "blockchain/config.yaml" // config EndPoint = "peer1.org1.example.com" // client endpoint )
settings
Functions ¶
func ChannelExecute ¶
ChannelExecute invoke chaincode and update
func ChannelQuery ¶
ChannelQuery invoke chaincode and query
Types ¶
type Claim ¶
type Claim struct { ContractUUID string `json:"contract_uuid"` Date time.Time `json:"date"` Description string `json:"description"` IsTheft bool `json:"is_theft"` Status ClaimStatus `json:"status"` Reimbursable float32 `json:"reimbursable"` Repaired bool `json:"repaired"` FileReference string `json:"file_reference"` }
Key consists of prefix + UUID of the contract + UUID of the claim
type ClaimStatus ¶
type ClaimStatus int8
const ( // The claims status is unknown ClaimStatusUnknown ClaimStatus = iota // The claim is new ClaimStatusNew // The claim has been rejected (either by the insurer, or by authorities ClaimStatusRejected // The item is up for repairs, or has been repaired ClaimStatusRepair // The customer should be reimbursed, or has already been ClaimStatusReimbursement // The theft of the item has been confirmed by authorities ClaimStatusTheftConfirmed )
func (ClaimStatus) MarshalJSON ¶
func (s ClaimStatus) MarshalJSON() ([]byte, error)
func (*ClaimStatus) UnmarshalJSON ¶
func (s *ClaimStatus) UnmarshalJSON(b []byte) error
type Contract ¶
type Contract struct { Username string `json:"username"` Item Item `json:"item"` StartDate time.Time `json:"start_date"` EndDate time.Time `json:"end_date"` Void bool `json:"void"` ContractTypeUUID string `json:"contract_type_uuid"` ClaimIndex []string `json:"claim_index,omitempty"` }
Key consists of prefix + username + UUID of the contract
type ContractType ¶
type ContractType struct { ShopType string `json:"shop_type"` FormulaPerDay string `json:"formula_per_day"` MaxSumInsured float32 `json:"max_sum_insured"` TheftInsured bool `json:"theft_insured"` Description string `json:"description"` Conditions string `json:"conditions"` Active bool `json:"active"` MinDurationDays int32 `json:"min_duration_days"` MaxDurationDays int32 `json:"max_duration_days"` }
Key consists of prefix + UUID of the contract type
type ContractTypeWithUUID ¶
type ContractTypeWithUUID struct { UUID string `json:"uuid"` *ContractType }
type ContractWithUUID ¶
Click to show internal directories.
Click to hide internal directories.