models

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountTypes = []AccountType{
	{Primary, "primary", "primary"},
	{Secondary, "secondary", "secondary"},
	{Issuer, "issuer", "issuer"},
	{Distributor, "distributor", "distributor"},
	{OtherAccount, "otheraccount", "otheraccount"},
}
View Source
var AssetTypes = []AssetType{
	{KPI, "kpi", "kpi"},
	{Unit, "unit", "unit"},
	{Commercial, "commercial", "commercial"},
	{NFT, "nft", "nft"},
	{OtherAsset, "otherasset", "otherasset"},
}
View Source
var Statuses = []Status{
	{Active, "active", "active"},
	{Inactive, "inactive", "inactive"},
	{Delete, "delete", "delete"},
}
View Source
var TransactionStatuses = []TransactionStatus{
	{Initialized, "initialized", "initialized"},
	{Ongoing, "ongoing", "ongoing"},
	{Done, "done", "done"},
}
View Source
var TransactionTypes = []TransactionType{
	{Payment, "payment", "payment"},
	{SetOptions, "setoptions", "setoptions"},
	{SetTrust, "settrust", "settrust"},
}
View Source
var UserTypes = []UserType{
	{Default, "user", "user"},
	{AssetUser, "assetuser", "assetuser"},
	{Trade, "trade", "trade"},
	{Test, "test", "test"},
	{OtherUser, "otheruser", "otheruser"},
}

Functions

This section is empty.

Types

type Account

type Account struct {
	Status      string `bson:"status,omitempty" json:"status,omitempty"`
	AccountType string `bson:"accounttype,omitempty" json:"accounttype,omitempty"`
	Name        string `validate:"required" bson:"name,omitempty" json:"name,omitempty"`
	Public      string `valid:"required,min=56,max=56" bson:"public" json:"public,omitempty"`
	Secret      string `valid:"required,min=56,max=56" bson:"secret" json:"secret,omitempty"`
}

Account model

type AccountType

type AccountType struct {
	AccountTypeId `json:"id"`
	Name          string `json:"name"`
	Value         string `json:"value"`
}

func (*AccountType) GetAccountType

func (e *AccountType) GetAccountType() string

type AccountTypeId

type AccountTypeId int
const (
	Primary AccountTypeId = iota
	Secondary
	Issuer
	Distributor
	OtherAccount
)

func (AccountTypeId) GetAccountType

func (c AccountTypeId) GetAccountType() string

type Artifact added in v0.0.7

type Artifact struct {
	ID       primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Item_Id  primitive.ObjectID `bson:"item_id,omitempty" json:"item_id,omitempty"`
	Created  time.Time          `bson:"created,omitempty" json:"created,omitempty"`
	Modified time.Time          `bson:"modified,omitempty" json:"modified,omitempty"`
	Status   string             `bson:"status,omitempty" json:"status,omitempty"`
	Version  int                `bson:"version,omitempty" json:"version,omitempty"`
	Name     string             `validate:"required" bson:"name,omitempty" json:"name,omitempty"`
	Url      string             `bson:"url,omitempty" json:"url,omitempty"`
	Code     string             `bson:"code,omitempty" json:"code,omitempty"`
}

Artifact model

type Asset

type Asset struct {
	ID                 primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	Created            time.Time          `bson:"created,omitempty" json:"created,omitempty"`
	Modified           time.Time          `bson:"modified,omitempty" json:"modified,omitempty"`
	Status             string             `bson:"status,omitempty" json:"status,omitempty"`
	AssetType          string             `bson:"assettype,omitempty" json:"assettype,omitempty"`
	IssuerAccount      *Account           `bson:"issueraccount,omitempty" json:"issueraccount,omitempty"`
	DistributorAccount *Account           `bson:"distributoraccount,omitempty" json:"distributoraccount,omitempty"`
	Name               string             `validate:"required" bson:"name,omitempty" json:"name,omitempty"`
	Abbr               string             `valid:"required,min=3,max=12" bson:"abbr,omitempty" json:"abbr,omitempty"`
	Public             string             `valid:"required,min=56,max=56" bson:"public,omitempty" json:"public,omitempty"`
	Note               string             `bson:"note,omitempty" json:"note,omitempty"`
}

Asset model

type AssetType

type AssetType struct {
	AssetTypeId `json:"assettypeid"`
	Name        string `json:"name"`
	Value       string `json:"value"`
}

func (*AssetType) GetAssetType

func (e *AssetType) GetAssetType() string

type AssetTypeId

type AssetTypeId int
const (
	KPI AssetTypeId = iota
	Unit
	Commercial
	NFT
	OtherAsset
)

func (AssetTypeId) GetAssetType

func (c AssetTypeId) GetAssetType() string

type Count added in v0.0.8

type Count struct {
	CurrentPage int `json:"currentpage"`
	PageSize    int `json:"pagesize"`
	Total       int `json:"total"`
}

type Item

type Item struct {
	ID           primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Created      time.Time          `bson:"created,omitempty" json:"created,omitempty"`
	Modified     time.Time          `bson:"modified,omitempty" json:"modified,omitempty"`
	Status       string             `bson:"status,omitempty" json:"status,omitempty"`
	SerialNumber string             `bson:"serialnumber,omitempty" json:"serialnumber,omitempty"`
	PhysicalType string             `bson:"physicaltype,omitempty" json:"physicaltype,omitempty"`
	TagType      string             `bson:"tagtype,omitempty" json:"tagtype,omitempty"`
	Network      string             `bson:"network,omitempty" json:"network,omitempty"`
	Name         string             `validate:"required" bson:"name,omitempty" json:"name"`
	Location     string             `bson:"location,omitempty" json:"location,omitempty"`
	Note         string             `bson:"note,omitempty" json:"note,omitempty"`
}

Item model

type OfferObject added in v0.0.5

type OfferObject struct {
	StatusObject
	Seller  Account `json:"seller"`
	Selling Asset   `json:"selling"`
	Buying  Asset   `json:"buying"`
	Amount  string  `json:"amount"`
	Price   string  `json:"price"`
}

OfferObject - used to handle json input

type PaymentObject

type PaymentObject struct {
	StatusObject
	FromAccount Account `json:"fromaccount"`
	ToAccount   Account `json:"toaccount"`
	Asset       Asset   `json:"asset"`
	Amount      string  `json:"amount"`
}

PaymentObject - used to handle json input

type ReturnObject added in v0.0.8

type ReturnObject struct {
	Records []any `json:"Records"`
	Count   Count `json:"Count"`
}

type SetOptionsObject

type SetOptionsObject struct {
	StatusObject
	MainAccount   Account          `json:"mainaccount"`
	SignerAccount Account          `json:"signeraccount,omitempty"`
	Thresholds    *ThresholdObject `json:"thresholds,omitempty"`
	Weight        int              `json:"weight,omitempty"`
}

SetOptionsObject - used to handle json input

type SetTrustObject

type SetTrustObject struct {
	StatusObject
	Account Account `json:"account"`
	Asset   Asset   `json:"asset"`
	Limit   string  `json:"limit,omitempty"`
}

SetTrustObject - used to handle json input

type SignObject

type SignObject struct {
	StatusObject
	Transaction   Transaction `json:"transaction,omitempty"`
	SignerAccount Account     `json:"signeraccount,omitempty"`
}

SignObject - used to handle json input

type Status

type Status struct {
	StatusId `json:"statusid"`
	Name     string `json:"name"`
	Value    string `json:"value"`
}

func (*Status) GetStatus

func (e *Status) GetStatus() string

type StatusId

type StatusId int
const (
	Active StatusId = iota
	Inactive
	Delete
)

func (StatusId) GetStatus

func (c StatusId) GetStatus() string

type StatusObject

type StatusObject struct {
	Description string `json:"description,omitempty"`
	Success     bool   `json:"success,omitempty"`
	Error       string `json:"error,omitempty"`
}

type Task added in v0.0.7

type Task struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Asset_Id  primitive.ObjectID `bson:"asset_id,omitempty" json:"asset_id,omitempty"`
	User_Id   primitive.ObjectID `bson:"user_id,omitempty" json:"user_id,omitempty"`
	Created   time.Time          `bson:"created,omitempty" json:"created,omitempty"`
	Modified  time.Time          `bson:"modified,omitempty" json:"modified,omitempty"`
	Deadline  time.Time          `bson:"deadline,omitempty" json:"deadline,omitempty"`
	Status    string             `bson:"status,omitempty" json:"status,omitempty"`
	Artifacts *[]Artifact        `bson:"artifacts,omitempty" json:"artifacts,omitempty"`
	Payment   string             `bson:"payment,omitempty" json:"payment,omitempty"`
	Name      string             `validate:"required" bson:"name,omitempty" json:"name,omitempty"`
	Amount    int                `bson:"amount,omitempty" json:"amount,omitempty"`
	Note      string             `bson:"note,omitempty" json:"note,omitempty"`
}

Task model

type TemplateTask added in v0.0.7

type TemplateTask struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Asset_Id  primitive.ObjectID `bson:"asset_id,omitempty" json:"asset_id,omitempty"`
	Owner_Id  primitive.ObjectID `bson:"owner_id,omitempty" json:"owner_id,omitempty"`
	Created   time.Time          `bson:"created,omitempty" json:"created,omitempty"`
	Modified  time.Time          `bson:"modified,omitempty" json:"modified,omitempty"`
	Deadline  int                `bson:"deadline,omitempty" json:"deadline,omitempty"`
	Status    string             `bson:"status,omitempty" json:"status,omitempty"`
	Version   string             `bson:"version,omitempty" json:"version,omitempty"`
	Artifacts *[]Artifact        `bson:"artifacts,omitempty" json:"artifacts,omitempty"`
	Name      string             `validate:"required" bson:"name,omitempty" json:"name,omitempty"`
	Amount    int                `bson:"amount,omitempty" json:"amount,omitempty"`
	Note      string             `bson:"note,omitempty" json:"note,omitempty"`
}

TemplateTask model

type TemplateWorkflow added in v0.0.7

type TemplateWorkflow struct {
	ID            primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Owner_Id      primitive.ObjectID `bson:"owner_id,omitempty" json:"owner_id,omitempty"`
	Created       time.Time          `bson:"created,omitempty" json:"created,omitempty"`
	Modified      time.Time          `bson:"modified,omitempty" json:"modified,omitempty"`
	Status        string             `bson:"status,omitempty" json:"status,omitempty"`
	Version       string             `bson:"version,omitempty" json:"version,omitempty"`
	TemplateTasks *[]TemplateTask    `bson:"templatetasks,omitempty" json:"templatetasks,omitempty"`
	Name          string             `validate:"required" bson:"name,omitempty" json:"name,omitempty"`
	Note          string             `bson:"note,omitempty" json:"note,omitempty"`
}

TemplateWorkflow model

type ThresholdObject

type ThresholdObject struct {
	LowThreshold    int `json:"lowthreshold"`
	MediumThreshold int `json:"mediumthreshold"`
	HighThreshold   int `json:"highthreshold"`
}

type TransObject

type TransObject struct {
	TransactionId     primitive.ObjectID `json:"transactionid"`
	Created           time.Time          `json:"created"`
	Modified          time.Time          `json:"modified"`
	Status            string             `json:"status"`
	SourceAccount     Account            `json:"sourceaccount"`
	MaxTime           string             `json:"maxtime"`
	Envelope          string             `json:"envelope"`
	TransactionWeight int                `json:"transactionweight"`
	CurrentWeight     int                `json:"currentweight"`
}

TransObject - used to handle json input

type Transaction

type Transaction struct {
	ID                primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Created           time.Time          `bson:"created,omitempty" json:"created"`
	Modified          time.Time          `bson:"modified,omitempty" json:"modified"`
	Status            string             `bson:"status,omitempty" json:"status"`
	TransactionStatus string             `bson:"transactiontype,omitempty" json:"transactionstatus"`
	TransactionType   string             `bson:"transactiontype,omitempty" json:"transactiontype"`
	SourceAccount     Account            `bson:"sourceaccount,omitempty" json:"sourceaccount"`
	SignerAccounts    []Account          `bson:"signeraccounts,omitempty" json:"signeraccounts,omitempty"`
	Maxtime           string             `bson:"maxtime,omitempty" json:"maxtime"`
	Envelope          string             `bson:"envelope,omitempty" json:"envelope"`
	TransactionWeight int                `bson:"transactionweight,omitempty" json:"transactionweight"`
	CurrentWeight     int                `bson:"currentweight,omitempty" json:"currentweight"`
}

Transaction model

type TransactionStatus added in v0.0.3

type TransactionStatus struct {
	TransactionStatusId `json:"transactionstatusid"`
	Name                string `json:"name"`
	Value               string `json:"value"`
}

func (*TransactionStatus) GetTransactionStatus added in v0.0.3

func (e *TransactionStatus) GetTransactionStatus() string

type TransactionStatusId added in v0.0.3

type TransactionStatusId int
const (
	Initialized TransactionStatusId = iota
	Ongoing
	Done
)

func (TransactionStatusId) GetTransactionStatus added in v0.0.3

func (c TransactionStatusId) GetTransactionStatus() string

type TransactionType

type TransactionType struct {
	TransactionTypeId `json:"transactiontypeid"`
	Name              string `json:"name"`
	Value             string `json:"value"`
}

func (*TransactionType) GetTransactionType added in v0.0.3

func (e *TransactionType) GetTransactionType() string

type TransactionTypeId

type TransactionTypeId int
const (
	Payment TransactionTypeId = iota
	SetOptions
	SetTrust
)

func (TransactionTypeId) GetTransactionType

func (c TransactionTypeId) GetTransactionType() string

type User

type User struct {
	ID       primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Created  time.Time          `bson:"created,omitempty" json:"created"`
	Modified time.Time          `bson:"modified,omitempty" json:"modified"`
	Status   string             `bson:"status,omitempty" json:"status"`
	UserType string             `bson:"usertype,omitempty" json:"usertype"`
	Accounts []Account          `bson:"accounts,omitempty" json:"accounts,omitempty"`
	Name     string             `validate:"required" bson:"name,omitempty" json:"name"`
	Email    string             `validate:"required,email" bson:"email,omitempty" json:"email"`
	Note     string             `bson:"note,omitempty" json:"note"`
}

User model

type UserType

type UserType struct {
	UserTypeId `json:"usertypeid"`
	Name       string `json:"name"`
	Value      string `json:"value"`
}

func (*UserType) GetUserType

func (e *UserType) GetUserType() string

type UserTypeId

type UserTypeId int
const (
	Default UserTypeId = iota
	AssetUser
	Trade
	Test
	OtherUser
)

func (UserTypeId) GetUserType

func (c UserTypeId) GetUserType() string

type Workflow

type Workflow struct {
	ID                  primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Owner_Id            primitive.ObjectID `bson:"owner_id,omitempty" json:"owner_id,omitempty"`
	User_Id             primitive.ObjectID `bson:"user_id,omitempty" json:"user_id,omitempty"`
	TemplateWorkflow_Id primitive.ObjectID `bson:"templateworkflow_id,omitempty" json:"templateworkflow_id,omitempty"`
	Created             time.Time          `bson:"created,omitempty" json:"created,omitempty"`
	Modified            time.Time          `bson:"modified,omitempty" json:"modified,omitempty"`
	Status              string             `bson:"status,omitempty" json:"status,omitempty"`
	Tasks               *[]Task            `bson:"tasks,omitempty" json:"tasks,omitempty"`
	Name                string             `validate:"required" bson:"name,omitempty" json:"name,omitempty"`
	Note                string             `bson:"note,omitempty" json:"note,omitempty"`
}

Workflow model

Jump to

Keyboard shortcuts

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