Documentation ¶
Index ¶
- func CreatePurchasePath() string
- func ShowPurchasePath(transactionID string) string
- type Client
- func (c *Client) CreatePurchase(ctx context.Context, path string, payload *PurchasePayload) (*http.Response, error)
- func (c *Client) DecodePurchase(resp *http.Response) (*Purchase, error)
- func (c *Client) DownloadJs(ctx context.Context, filename, dest string) (int64, error)
- func (c *Client) DownloadSwaggerJSON(ctx context.Context, dest string) (int64, error)
- func (c *Client) DownloadUI(ctx context.Context, dest string) (int64, error)
- func (c *Client) NewCreatePurchaseRequest(ctx context.Context, path string, payload *PurchasePayload) (*http.Request, error)
- func (c *Client) NewShowPurchaseRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) ShowPurchase(ctx context.Context, path string) (*http.Response, error)
- type Purchase
- type PurchasePayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePurchasePath ¶
func CreatePurchasePath() string
CreatePurchasePath computes a request path to the create action of Purchase.
func ShowPurchasePath ¶
ShowPurchasePath computes a request path to the show action of Purchase.
Types ¶
type Client ¶
type Client struct { *goaclient.Client Encoder *goa.HTTPEncoder Decoder *goa.HTTPDecoder }
Client is the pos service client.
func (*Client) CreatePurchase ¶
func (c *Client) CreatePurchase(ctx context.Context, path string, payload *PurchasePayload) (*http.Response, error)
creates a purchase
func (*Client) DecodePurchase ¶
DecodePurchase decodes the Purchase instance encoded in resp body.
func (*Client) DownloadJs ¶
DownloadJs downloads /files with the given filename and writes it to the file dest. It returns the number of bytes downloaded in case of success.
func (*Client) DownloadSwaggerJSON ¶
DownloadSwaggerJSON downloads swagger.json and writes it to the file dest. It returns the number of bytes downloaded in case of success.
func (*Client) DownloadUI ¶
DownloadUI downloads index.html and writes it to the file dest. It returns the number of bytes downloaded in case of success.
func (*Client) NewCreatePurchaseRequest ¶
func (c *Client) NewCreatePurchaseRequest(ctx context.Context, path string, payload *PurchasePayload) (*http.Request, error)
NewCreatePurchaseRequest create the request corresponding to the create action endpoint of the Purchase resource.
func (*Client) NewShowPurchaseRequest ¶
NewShowPurchaseRequest create the request corresponding to the show action endpoint of the Purchase resource.
type Purchase ¶
type Purchase struct { // API href of Purchase Href string `json:"href"` // Operation reference code Locator string `bson:"locator,omitempty" json:"locator"` // Total amount paid PurchaseValue float64 `bson:"purchase_value,omitempty" json:"purchase_value"` // Purchase status Status string `bson:"status,omitempty" json:"status"` // Unique transaction identifier TransactionID string `bson:"_id,omitempty" json:"transaction_id"` }
Purchase media type (default view)
Identifier: application/json; view=default
type PurchasePayload ¶
type PurchasePayload struct { ID *bson.ObjectId `bson:"_id,omitempty"` // Operation reference code Locator string `bson:"locator,omitempty" json:"locator"` // Total amount paid PurchaseValue float64 `bson:"purchase_value,omitempty" json:"purchase_value"` Status *string `bson:"status,omitempty" json:"status"` }
Detailed information regarding a POS purchase operation
func (*PurchasePayload) Validate ¶
func (ut *PurchasePayload) Validate() (err error)
Validate validates the PurchasePayload type instance.