app

package
v0.6.3-kompitech1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func (*Claim) Contract

func (c *Claim) Contract(stub shim.ChaincodeStubInterface) (*Contract, error)

type ClaimStatus

type ClaimStatus int8

The claim status indicates how the claim should be treated

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

func (*Contract) Claims

func (c *Contract) Claims(stub shim.ChaincodeStubInterface) ([]Claim, error)

func (*Contract) User

func (c *Contract) User(stub shim.ChaincodeStubInterface) (*User, error)

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 Item

type Item struct {
	ID          int32   `json:"id"`
	Brand       string  `json:"brand"`
	Model       string  `json:"model"`
	Price       float32 `json:"price"`
	Description string  `json:"description"`
	SerialNo    string  `json:"serial_no"`
}

Entity not persisted on its own

type RepairOrder

type RepairOrder struct {
	ClaimUUID    string `json:"claim_uuid"`
	ContractUUID string `json:"contract_uuid"`
	Item         Item   `json:"item"`
	Ready        bool   `json:"ready"`
}

Key consists of prefix + UUID fo the repair order

type SmartContract

type SmartContract struct {
}

func (*SmartContract) Init

Init callback representing the invocation of a chaincode

func (*SmartContract) Invoke

Invoke Function accept blockchain code invocations.

type User

type User struct {
	Username      string   `json:"username"`
	Password      string   `json:"password"`
	FirstName     string   `json:"first_name"`
	LastName      string   `json:"last_name"`
	ContractIndex []string `json:"contracts"`
}

Key consists of prefix + username

func (*User) Contacts

func (u *User) Contacts(stub shim.ChaincodeStubInterface) []Contract

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL