entity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Announcement

type Announcement struct {
	Title             string       `json:"title,omitempty"`
	AvailableQuantity int          `json:"available_quantity,omitempty"`
	Price             float64      `json:"price,omitempty"`
	CurrencyID        string       `json:"currency_id,omitempty"`
	BuyingMode        string       `json:"buying_mode,omitempty"`
	CategoryID        string       `json:"category_id,omitempty"`
	Condition         string       `json:"condition,omitempty"`
	ListingTypeID     ListingType  `json:"listing_type_id,omitempty"`
	Channels          []string     `json:"channels,omitempty"`
	Attributes        []attributes `json:"attributes,omitempty"`
	Pictures          []pictures   `json:"pictures,omitempty"`
	SaleTerms         []saleTerms  `json:"sale_terms,omitempty"`
}

func NewAnnouncement

func NewAnnouncement(rootAnn *common.MeliAnnouncement) (*Announcement, error)

func (*Announcement) ChangeTitle

func (a *Announcement) ChangeTitle(title string)

func (*Announcement) GenerateClassic

func (a *Announcement) GenerateClassic()

type ID

type ID = uuid.UUID

ID entity ID

func NewID

func NewID() ID

NewID create a new entity ID

func StringToID

func StringToID(s string) (ID, error)

StringToID convert a string to an entity ID

type ListingType

type ListingType string

type Order

type Order struct {
	ID            ID
	StoreID       ID
	MarketplaceID string
	DateCreated   time.Time
	Items         []OrderItem
	Status        OrderStatus
}

func NewOrder

func NewOrder(store ID, marketplace_id string, items []OrderItem, status OrderStatus) (*Order, error)

type OrderItem

type OrderItem struct {
	ID       ID
	Title    string
	Quantity int
	Sku      string
}

type OrderStatus

type OrderStatus string
const (
	Premium    OrderStatus = "gold_pro"
	Diamante   OrderStatus = "gold_premium"
	Classic    OrderStatus = "gold_special"
	Ouro       OrderStatus = "gold"
	Prata      OrderStatus = "silver"
	PaiBronzed OrderStatus = "bronze"
	Free       OrderStatus = "free"
)
const (
	Unknown           OrderStatus = ""
	Confirmed         OrderStatus = "confirmed"
	PaymentRequired   OrderStatus = "payment_required"
	PaymentInProcess  OrderStatus = "payment_in_process"
	PartiallyPaid     OrderStatus = "partially_paid"
	PartiallyRefunded OrderStatus = "partially_refunded"
	PendingCancel     OrderStatus = "pending_cancel"
	Cancelled         OrderStatus = "cancelled"
	Invalid           OrderStatus = "invalid"
)

func (OrderStatus) String

func (s OrderStatus) String() string

type Store

type Store struct {
	ID    ID
	Email string
	Name  string
}

func NewStore

func NewStore(email, name string) (*Store, error)

Jump to

Keyboard shortcuts

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