Documentation ¶
Index ¶
- Variables
- type AccessTokenResponse
- type Address
- type Base
- type City
- type Client
- type Customer
- type Discount
- type DiscountMeasureUnit
- type ListCustomerOptions
- type ListSaleOptions
- type Options
- type Payment
- type PaymentType
- type PersonType
- type RegistrationType
- type RequestParams
- type Sale
- type SaleStatus
- type Seller
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var (
InvalidParamsError = fmt.Errorf("invalid params to create client")
)
View Source
var (
UnmarshalResponseError = errors.New("could not unmarshal response")
)
Functions ¶
This section is empty.
Types ¶
type AccessTokenResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ListCustomers ¶
func (cli *Client) ListCustomers(listOpts ListCustomerOptions) ([]Customer, error)
ListCustomers list customers
type Customer ¶
type Customer struct { ID string `json:"id"` Name string `json:"name"` CompanyName string `json:"company_name"` Email string `json:"email"` BusinessPhone string `json:"business_phone"` MobilePhone string `json:"mobile_phone"` PersonType PersonType `json:"person_type"` Document string `json:"document"` IdentityDocument string `json:"identity_document"` StateRegistrationNumber string `json:"state_registration_number"` StateRegistrationType RegistrationType `json:"state_registration_type"` CityRegistrationNumber string `json:"city_registration_number"` DateOfBirth string `json:"date_of_birth"` Notes string `json:"notes"` CreatedAt time.Time `json:"created_at"` Address Address `json:"address"` }
type Discount ¶
type Discount struct { MeasureUnit DiscountMeasureUnit `json:"measure_unit"` Rate float64 `json:"rate"` }
type DiscountMeasureUnit ¶
type DiscountMeasureUnit string
const ( Percent DiscountMeasureUnit = "PERCENT" Value DiscountMeasureUnit = "VALUE" )
type ListCustomerOptions ¶
type ListCustomerOptions struct { Search string `json:"search,omitempty" structs:"search,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` CompanyName string `json:"company_name,omitempty" structs:"company_name,omitempty"` Document string `json:"document,omitempty" structs:"document,omitempty"` Page int `json:"page,omitempty" structs:"page,omitempty"` Size int `json:"size,omitempty" structs:"size,omitempty"` }
ListCustomerOptions list customer options
func (ListCustomerOptions) AddOptions ¶
func (lco ListCustomerOptions) AddOptions(u string) string
type ListSaleOptions ¶
type ListSaleOptions struct { EmissionStart time.Time `json:"emission_start,omitempty" structs:"emission_start,omitempty"` EmissionEnd time.Time `json:"emission_end,omitempty" structs:"emission_end,omitempty"` Status SaleStatus `json:"status,omitempty" structs:"status,omitempty"` CustomerId string `json:"customer_id,omitempty" structs:"customer_id,omitempty"` Page int `json:"page,omitempty" structs:"page,omitempty"` Size int `json:"size,omitempty" structs:"size,omitempty"` }
ListSaleOptions list sale options
func (ListSaleOptions) AddOptions ¶
func (lso ListSaleOptions) AddOptions(u string) string
type Payment ¶
type Payment struct {
Type PaymentType `json:"type"`
}
type PaymentType ¶
type PaymentType string
const ( Cash PaymentType = "CASH" Times PaymentType = "TIMES" )
type PersonType ¶
type PersonType string
const ( Natural PersonType = "NATURAL" Legal PersonType = "LEGAL" )
type RegistrationType ¶
type RegistrationType string
const ( NoContributor RegistrationType = "NO_CONTRIBUTOR" Contributor RegistrationType = "CONTRIBUTOR" ImmuneContributor RegistrationType = "IMMUNE_CONTRIBUTOR" )
type RequestParams ¶
type RequestParams struct {
// contains filtered or unexported fields
}
type Sale ¶
type Sale struct { ID string `json:"id"` Number int `json:"number"` Emission time.Time `json:"emission"` Status SaleStatus `json:"status"` Scheduled bool `json:"scheduled"` Customer Customer `json:"customer"` // TODO Criar um tipo simplificado de Customer? Discount Discount `json:"discount"` Payment Payment `json:"payment"` Notes string `json:"notes"` ShippingCost float64 `json:"shipping_cost"` Total float64 `json:"total"` Seller Seller `json:"seller"` }
Sale sale
type SaleStatus ¶
type SaleStatus string
SaleStatus represent sales status
const ( Pending SaleStatus = "PENDING" Committed SaleStatus = "COMMITTED" )
Click to show internal directories.
Click to hide internal directories.