order

package
v0.0.0-...-3acebc4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccessor

func NewAccessor(request *tools.APIRequest) *orderMongoAccessor

New creates a new instance of the orderMongoAccessor

Types

type Order

type Order struct {
	utils.AbstractObject
	OrderBy              string                `json:"order_by" bson:"order_by" validate:"required"`
	WorkflowID           string                `json:"workflow_id" bson:"workflow_id" validate:"required"`
	WorkflowExecutionIDs []string              `json:"workflow_execution_ids" bson:"workflow_execution_ids" validate:"required"`
	Status               enum.CompletionStatus `json:"status" bson:"status" default:"0"`
	SubOrders            map[string]*PeerOrder `json:"sub_orders" bson:"sub_orders"`
	Total                float64               `json:"total" bson:"total" validate:"required"`
}

func (*Order) CanDelete

func (r *Order) CanDelete() bool

func (*Order) CanUpdate

func (r *Order) CanUpdate(set utils.DBObject) (bool, utils.DBObject)

func (*Order) DraftOrder

func (o *Order) DraftOrder(scheduler *workflow_execution.WorkflowSchedule, request *tools.APIRequest) error

func (*Order) GetAccessor

func (d *Order) GetAccessor(request *tools.APIRequest) utils.Accessor

func (*Order) Pay

func (o *Order) Pay(scheduler *workflow_execution.WorkflowSchedule, request *tools.APIRequest) error

func (*Order) Quantity

func (o *Order) Quantity() int

func (*Order) SetName

func (d *Order) SetName()

func (*Order) StoreDraftDefault

func (r *Order) StoreDraftDefault()

type PeerItemOrder

type PeerItemOrder struct {
	Quantity int                                `json:"quantity,omitempty" bson:"quantity,omitempty"`
	Purchase purchase_resource.PurchaseResource `json:"purchase,omitempty" bson:"purchase,omitempty"`
	Item     pricing.PricedItemITF              `json:"item,omitempty" bson:"item,omitempty"`
}

func (*PeerItemOrder) GetPrice

func (d *PeerItemOrder) GetPrice(request *tools.APIRequest) (float64, error)

type PeerOrder

type PeerOrder struct {
	utils.AbstractObject
	Error          string                `json:"error,omitempty" bson:"error,omitempty"`
	PeerID         string                `json:"peer_id,omitempty" bson:"peer_id,omitempty"`
	Status         enum.CompletionStatus `json:"status" bson:"status" default:"0"`
	BillingAddress string                `json:"billing_address,omitempty" bson:"billing_address,omitempty"`
	Items          []*PeerItemOrder      `json:"items,omitempty" bson:"items,omitempty"`
	Total          float64               `json:"total,omitempty" bson:"total,omitempty"`
}

func (*PeerOrder) AddItem

func (d *PeerOrder) AddItem(item pricing.PricedItemITF, quantity int)

func (*PeerOrder) Pay

func (d *PeerOrder) Pay(request *tools.APIRequest, response chan *PeerOrder, wg *sync.WaitGroup)

func (*PeerOrder) SetName

func (d *PeerOrder) SetName()

func (*PeerOrder) SumUpBill

func (d *PeerOrder) SumUpBill(request *tools.APIRequest) error

Jump to

Keyboard shortcuts

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