Contracts for buyer
This commit is contained in:
@@ -21,10 +21,44 @@ type Contract struct {
|
||||
Status string
|
||||
BlockchainID string
|
||||
ContractInfos []ContractInfo
|
||||
BuyerName string `gorm:"-"`
|
||||
NumberOfDevices int `gorm:"-"`
|
||||
}
|
||||
|
||||
const ContractStatusActive = "active"
|
||||
const ContractStatusPending = "pending"
|
||||
const ContractStatusDraft = "draft"
|
||||
const ContractStatusSigned = "signed"
|
||||
const ContractStatusReadyForActivation = "ready_for_activation"
|
||||
const ContractStatusExecuted = "executed"
|
||||
const ContractStatusRevoked = "revoked"
|
||||
|
||||
|
||||
type Status struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
func GetContractStatuses() []Status {
|
||||
return []Status{
|
||||
{Key: "Active", Value: "active"},
|
||||
{Key: "Pending signature", Value: "pending"},
|
||||
{Key: "Draft", Value: "draft"},
|
||||
{Key: "Signed", Value: "signed"},
|
||||
{Key: "Ready for Activation", Value: "ready_for_activation"},
|
||||
{Key: "Executed", Value: "executed"},
|
||||
{Key: "Revoked", Value: "revoked"},
|
||||
}
|
||||
}
|
||||
|
||||
type ListContractResponse struct {
|
||||
Status KeyValue `json:"Status"`
|
||||
Buyer CompanyShortResponse `json:"Buyer"`
|
||||
ContractID int
|
||||
NumberOfDevices int
|
||||
DateCreated time.Time
|
||||
|
||||
}
|
||||
|
||||
func (Contract) Update() (bool, error) {
|
||||
return false, nil
|
||||
|
||||
Reference in New Issue
Block a user