customers

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCustomerRewardPointsResponse added in v1.14.0

type AddCustomerRewardPointsResponse struct {
	Status                         sharedCommon.Status             `json:"status"`
	AddCustomerRewardPointsResults []AddCustomerRewardPointsResult `json:"records"`
}

type AddCustomerRewardPointsResponseBulk added in v1.14.0

type AddCustomerRewardPointsResponseBulk struct {
	Status    sharedCommon.Status                       `json:"status"`
	BulkItems []AddCustomerRewardPointsResponseBulkItem `json:"requests"`
}

type AddCustomerRewardPointsResponseBulkItem added in v1.14.0

type AddCustomerRewardPointsResponseBulkItem struct {
	Status                         sharedCommon.StatusBulk         `json:"status"`
	AddCustomerRewardPointsResults []AddCustomerRewardPointsResult `json:"records"`
}

type AddCustomerRewardPointsResult added in v1.14.0

type AddCustomerRewardPointsResult struct {
	TransactionID   int64 `json:"transactionID"`
	CustomerID      int64 `json:"customerID"`
	Points          int64 `json:"points"`
	CreatedUnixTime int64 `json:"createdUnixTime"`
	ExpiryUnixTime  int64 `json:"expiryUnixTime"`
}

type Attribute

type Attribute struct {
	Name  string `json:"attributeNam"`
	Type  string `json:"attributeType"`
	Value string `json:"attributeValue"`
}

Attribute field

type Client

type Client struct {
	*common.Client
}

func NewClient

func NewClient(client *common.Client) *Client

func (*Client) AddCustomerRewardPoints added in v1.14.0

func (cli *Client) AddCustomerRewardPoints(ctx context.Context, filters map[string]string) (AddCustomerRewardPointsResult, error)

func (*Client) AddCustomerRewardPointsBulk added in v1.14.0

func (cli *Client) AddCustomerRewardPointsBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (AddCustomerRewardPointsResponseBulk, error)

func (*Client) DeleteCustomer added in v1.15.0

func (cli *Client) DeleteCustomer(ctx context.Context, filters map[string]string) error

func (*Client) DeleteCustomerBulk added in v1.15.0

func (cli *Client) DeleteCustomerBulk(ctx context.Context, customerMap []map[string]interface{}, attrs map[string]string) (DeleteCustomersResponseBulk, error)

func (*Client) DeleteSupplier added in v1.9.1

func (cli *Client) DeleteSupplier(ctx context.Context, filters map[string]string) error

DeleteSupplier https://learn-api.erply.com/requests/deletesupplier/

func (*Client) DeleteSupplierBulk added in v1.9.1

func (cli *Client) DeleteSupplierBulk(ctx context.Context, supplierMap []map[string]interface{}, attrs map[string]string) (DeleteSuppliersResponseBulk, error)

func (*Client) GetCompanyTypes added in v1.17.0

func (cli *Client) GetCompanyTypes(ctx context.Context, filters map[string]string) ([]CompanyType, error)

func (*Client) GetCustomers

func (cli *Client) GetCustomers(ctx context.Context, filters map[string]string) ([]Customer, error)

GetCustomers will list customers according to specified filters.

func (*Client) GetCustomersBulk added in v1.7.5

func (cli *Client) GetCustomersBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (GetCustomersResponseBulk, error)

GetCustomersBulk will list customers according to specified filters sending a bulk request to fetch more customers than the default limit

func (*Client) GetSuppliers

func (cli *Client) GetSuppliers(ctx context.Context, filters map[string]string) ([]Supplier, error)

GetSuppliers will list suppliers according to specified filters.

func (*Client) GetSuppliersBulk added in v1.3.1

func (cli *Client) GetSuppliersBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (GetSuppliersResponseBulk, error)

GetSuppliersBulk will list suppliers according to specified filters sending a bulk request to fetch more suppliers than the default limit

func (*Client) SaveCompanyType added in v1.18.0

func (cli *Client) SaveCompanyType(ctx context.Context, filters map[string]string) (*SaveCompanyTypeResponse, error)

func (*Client) SaveCustomer

func (cli *Client) SaveCustomer(ctx context.Context, filters map[string]string) (*CustomerImportReport, error)

func (*Client) SaveCustomerBulk added in v1.15.0

func (cli *Client) SaveCustomerBulk(ctx context.Context, customerMap []map[string]interface{}, attrs map[string]string) (SaveCustomerResponseBulk, error)

func (*Client) SaveSupplier

func (cli *Client) SaveSupplier(ctx context.Context, filters map[string]string) (*CustomerImportReport, error)

func (*Client) SaveSupplierBulk added in v1.4.0

func (cli *Client) SaveSupplierBulk(ctx context.Context, supplierMap []map[string]interface{}, attrs map[string]string) (SaveSuppliersResponseBulk, error)

func (*Client) SaveSupplierGroup added in v1.18.0

func (cli *Client) SaveSupplierGroup(ctx context.Context, filters map[string]string) (*SaveSupplierGroupResponse, error)

func (*Client) ValidateCustomerUsername

func (cli *Client) ValidateCustomerUsername(ctx context.Context, username string) (bool, error)

func (*Client) VerifyCustomerUser

func (cli *Client) VerifyCustomerUser(ctx context.Context, username, password string) (*WebshopClient, error)

username and password are required fields here

type CompanyType added in v1.17.0

type CompanyType struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	Order        int    `json:"order"`
	Added        int    `json:"added"`
	LastModified int    `json:"lastModified"`
}

type ContactPerson

type ContactPerson struct {
	ContactPersonID   int    `json:"contactPersonID"`
	FullName          string `json:"fullName"`
	GroupName         string `json:"groupName"`
	CountryID         string `json:"countryID"`
	Phone             string `json:"phone"`
	Email             string `json:"email"`
	Fax               string `json:"fax"`
	Code              string `json:"code"`
	BankName          string `json:"bankName"`
	BankAccountNumber string `json:"bankAccountNumber"`
	BankIBAN          string `json:"bankIBAN"`
	BankSWIFT         string `json:"bankSWIFT"`
	Notes             string `json:"notes"`
}

type ContactPersons

type ContactPersons []ContactPerson

type Customer

type Customer struct {
	ID                      int                         `json:"id"`
	PayerID                 int                         `json:"payerID,omitempty"`
	CustomerID              int                         `json:"customerID"`
	TypeID                  string                      `json:"type_id"`
	FullName                string                      `json:"fullName"`
	CompanyName             string                      `json:"companyName"`
	FirstName               string                      `json:"firstName"`
	LastName                string                      `json:"lastName"`
	GroupID                 int                         `json:"groupID"`
	EDI                     string                      `json:"EDI"`
	GLN                     string                      `json:"GLN"`
	IsPOSDefaultCustomer    int                         `json:"isPOSDefaultCustomer"`
	CountryID               string                      `json:"countryID"`
	Phone                   string                      `json:"phone"`
	EInvoiceEmail           string                      `json:"eInvoiceEmail"`
	Email                   string                      `json:"email"`
	Fax                     string                      `json:"fax"`
	Code                    string                      `json:"code"`
	ReferenceNumber         string                      `json:"referenceNumber"`
	VatNumber               string                      `json:"vatNumber"`
	BankName                string                      `json:"bankName"`
	BankAccountNumber       string                      `json:"bankAccountNumber"`
	BankIBAN                string                      `json:"bankIBAN"`
	BankSWIFT               string                      `json:"bankSWIFT"`
	PaymentDays             int                         `json:"paymentDays"`
	Notes                   string                      `json:"notes"`
	LastModified            int                         `json:"lastModified"`
	CustomerType            string                      `json:"customerType"`
	Address                 string                      `json:"address"`
	CustomerAddresses       sharedCommon.Addresses      `json:"addresses"`
	Street                  string                      `json:"street"`
	Address2                string                      `json:"address2"`
	City                    string                      `json:"city"`
	PostalCode              string                      `json:"postalCode"`
	Country                 string                      `json:"country"`
	State                   string                      `json:"state"`
	ContactPersons          ContactPersons              `json:"contactPersons"`
	Attributes              []sharedCommon.ObjAttribute `json:"attributes"`
	Credit                  int                         `json:"credit"`
	CompanyTypeID           int                         `json:"companyTypeID"`
	PersonTitleID           int                         `json:"personTitleID"`
	EmailEnabled            int                         `json:"emailEnabled"`
	MailEnabled             int                         `json:"mailEnabled"`
	EInvoiceEnabled         int                         `json:"eInvoiceEnabled"`
	FlagStatus              int                         `json:"flagStatus"`
	OperatorIdentifier      string                      `json:"operatorIdentifier"`
	Gender                  string                      `json:"gender"`
	GroupName               string                      `json:"groupName"`
	Mobile                  string                      `json:"mobile"`
	Birthday                string                      `json:"birthday"`
	IntegrationCode         string                      `json:"integrationCode"`
	ColorStatus             string                      `json:"colorStatus"`
	FactoringContractNumber string                      `json:"factoringContractNumber"`
	Image                   string                      `json:"image"`
	TwitterID               string                      `json:"twitterID"`
	FacebookName            string                      `json:"facebookName"`
	CreditCardLastNumbers   string                      `json:"creditCardLastNumbers"`
	EuCustomerType          string                      `json:"euCustomerType"`
	CustomerCardNumber      string                      `json:"customerCardNumber"`
	LastModifierUsername    string                      `json:"lastModifierUsername"`
	DefaultAssociationName  string                      `json:"defaultAssociationName"`
	DefaultProfessionalName string                      `json:"defaultProfessionalName"`
	TaxExempt               int                         `json:"taxExempt"`
	PaysViaFactoring        int                         `json:"paysViaFactoring"`
	SalesBlocked            int                         `json:"salesBlocked"`
	RewardPointsDisabled    int                         `json:"rewardPointsDisabled"`
	CustomerBalanceDisabled int                         `json:"customerBalanceDisabled"`
	PosCouponsDisabled      int                         `json:"posCouponsDisabled"`
	EmailOptOut             int                         `json:"emailOptOut"`
	ShipGoodsWithWaybills   int                         `json:"shipGoodsWithWaybills"`
	DefaultAssociationID    int                         `json:"defaultAssociationID"`
	DefaultProfessionalID   int                         `json:"defaultProfessionalID"`

	// Web-shop related fields
	Username  string `json:"webshopUsername"`
	LastLogin string `json:"webshopLastLogin"`
}

type CustomerImportReport

type CustomerImportReport struct {
	ClientID   int `json:"clientID"`
	CustomerID int `json:"customerID"`
}

type CustomerImportReports

type CustomerImportReports []CustomerImportReport

type CustomerListingDataProvider added in v1.7.5

type CustomerListingDataProvider struct {
	// contains filtered or unexported fields
}

func NewCustomerListingDataProvider added in v1.7.5

func NewCustomerListingDataProvider(erplyClient Manager) *CustomerListingDataProvider

func (*CustomerListingDataProvider) Count added in v1.7.5

func (l *CustomerListingDataProvider) Count(ctx context.Context, filters map[string]interface{}) (int, error)

func (*CustomerListingDataProvider) Read added in v1.7.5

func (l *CustomerListingDataProvider) Read(ctx context.Context, bulkFilters []map[string]interface{}, callback func(item interface{})) error

type CustomerRequest

type CustomerRequest struct {
	CustomerID        int
	CompanyName       string
	Address           string
	PostalCode        string
	AddressTypeID     int
	City              string
	State             string
	Country           string
	FirstName         string
	LastName          string
	FullName          string
	RegistryCode      string
	VatNumber         string
	Email             string
	Phone             string
	BankName          string
	BankAccountNumber string

	// Web-shop related fields
	Username string
	Password string
}

type Customers

type Customers []Customer

type DeleteCustomerResponse added in v1.15.0

type DeleteCustomerResponse struct {
	Status sharedCommon.Status `json:"status"`
}

type DeleteCustomerResponseBulkItem added in v1.15.0

type DeleteCustomerResponseBulkItem struct {
	Status sharedCommon.StatusBulk `json:"status"`
}

type DeleteCustomersResponseBulk added in v1.15.0

type DeleteCustomersResponseBulk struct {
	Status    sharedCommon.Status              `json:"status"`
	BulkItems []DeleteCustomerResponseBulkItem `json:"requests"`
}

type DeleteSupplierResponse added in v1.9.1

type DeleteSupplierResponse struct {
	Status sharedCommon.Status `json:"status"`
}

type DeleteSuppliersResponseBulk added in v1.9.1

type DeleteSuppliersResponseBulk struct {
	Status    sharedCommon.Status               `json:"status"`
	BulkItems []DeleteSuppliersResponseBulkItem `json:"requests"`
}

type DeleteSuppliersResponseBulkItem added in v1.9.1

type DeleteSuppliersResponseBulkItem struct {
	Status sharedCommon.StatusBulk `json:"status"`
}

type GetCompanyTypesResponse added in v1.17.0

type GetCompanyTypesResponse struct {
	Status       sharedCommon.Status `json:"status"`
	CompanyTypes []CompanyType       `json:"records"`
}

func (GetCompanyTypesResponse) GetStatus added in v1.18.0

type GetCustomersResponse

type GetCustomersResponse struct {
	Status    sharedCommon.Status `json:"status"`
	Customers Customers           `json:"records"`
}

type GetCustomersResponseBulk added in v1.7.5

type GetCustomersResponseBulk struct {
	Status    sharedCommon.Status            `json:"status"`
	BulkItems []GetCustomersResponseBulkItem `json:"requests"`
}

type GetCustomersResponseBulkItem added in v1.7.5

type GetCustomersResponseBulkItem struct {
	Status    sharedCommon.StatusBulk `json:"status"`
	Customers Customers               `json:"records"`
}

type GetSuppliersResponse added in v1.3.1

type GetSuppliersResponse struct {
	Status    sharedCommon.Status `json:"status"`
	Suppliers []Supplier          `json:"records"`
}

GetSuppliersResponse

type GetSuppliersResponseBulk added in v1.3.1

type GetSuppliersResponseBulk struct {
	Status    sharedCommon.Status            `json:"status"`
	BulkItems []GetSuppliersResponseBulkItem `json:"requests"`
}

type GetSuppliersResponseBulkItem added in v1.3.1

type GetSuppliersResponseBulkItem struct {
	Status    sharedCommon.StatusBulk `json:"status"`
	Suppliers []Supplier              `json:"records"`
}

type Manager

type Manager interface {
	SaveCustomer(ctx context.Context, filters map[string]string) (*CustomerImportReport, error)
	SaveCustomerBulk(ctx context.Context, customerMap []map[string]interface{}, attrs map[string]string) (SaveCustomerResponseBulk, error)
	GetCustomers(ctx context.Context, filters map[string]string) ([]Customer, error)
	GetCustomersBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (GetCustomersResponseBulk, error)
	DeleteCustomer(ctx context.Context, filters map[string]string) error
	DeleteCustomerBulk(ctx context.Context, customerMap []map[string]interface{}, attrs map[string]string) (DeleteCustomersResponseBulk, error)
	VerifyCustomerUser(ctx context.Context, username, password string) (*WebshopClient, error)
	ValidateCustomerUsername(ctx context.Context, username string) (bool, error)
	GetSuppliers(ctx context.Context, filters map[string]string) ([]Supplier, error)
	GetSuppliersBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (GetSuppliersResponseBulk, error)
	SaveSupplier(ctx context.Context, filters map[string]string) (*CustomerImportReport, error)
	SaveSupplierBulk(ctx context.Context, suppliers []map[string]interface{}, attrs map[string]string) (SaveSuppliersResponseBulk, error)
	DeleteSupplier(ctx context.Context, filters map[string]string) error
	DeleteSupplierBulk(ctx context.Context, supplierMap []map[string]interface{}, attrs map[string]string) (DeleteSuppliersResponseBulk, error)
	AddCustomerRewardPoints(ctx context.Context, filters map[string]string) (AddCustomerRewardPointsResult, error)
	AddCustomerRewardPointsBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (AddCustomerRewardPointsResponseBulk, error)
	GetCompanyTypes(ctx context.Context, filters map[string]string) ([]CompanyType, error)
	SaveCompanyType(ctx context.Context, filters map[string]string) (*SaveCompanyTypeResponse, error)
	SaveSupplierGroup(ctx context.Context, filters map[string]string) (*SaveSupplierGroupResponse, error)
}

type PostCustomerResponse

type PostCustomerResponse struct {
	Status                sharedCommon.Status   `json:"status"`
	CustomerImportReports CustomerImportReports `json:"records"`
}

type SaveCompanyTypeRecord added in v1.18.0

type SaveCompanyTypeRecord struct {
	CompanyTypeID int `json:"companyTypeID"`
}

type SaveCompanyTypeResponse added in v1.18.0

type SaveCompanyTypeResponse struct {
	Status  sharedCommon.Status     `json:"status"`
	Records []SaveCompanyTypeRecord `json:"records"`
}

type SaveCustomerResp added in v1.15.0

type SaveCustomerResp struct {
	CustomerID    int  `json:"customerID"`
	AlreadyExists bool `json:"alreadyExists"`
}

type SaveCustomerResponseBulk added in v1.15.0

type SaveCustomerResponseBulk struct {
	Status    sharedCommon.Status            `json:"status"`
	BulkItems []SaveCustomerResponseBulkItem `json:"requests"`
}

type SaveCustomerResponseBulkItem added in v1.15.0

type SaveCustomerResponseBulkItem struct {
	Status  sharedCommon.StatusBulk `json:"status"`
	Records []SaveCustomerResp      `json:"records"`
}

type SaveSupplierGroupRecord added in v1.18.0

type SaveSupplierGroupRecord struct {
	SupplierGroupID int `json:"supplierGroupID"`
}

type SaveSupplierGroupResponse added in v1.18.0

type SaveSupplierGroupResponse struct {
	Status  sharedCommon.Status       `json:"status"`
	Records []SaveSupplierGroupRecord `json:"records"`
}

type SaveSupplierResp added in v1.4.0

type SaveSupplierResp struct {
	SupplierID    int  `json:"supplierID"`
	AlreadyExists bool `json:"alreadyExists"`
}

SaveSupplierResp

type SaveSuppliersResponseBulk added in v1.4.0

type SaveSuppliersResponseBulk struct {
	Status    sharedCommon.Status             `json:"status"`
	BulkItems []SaveSuppliersResponseBulkItem `json:"requests"`
}

type SaveSuppliersResponseBulkItem added in v1.4.0

type SaveSuppliersResponseBulkItem struct {
	Status  sharedCommon.StatusBulk `json:"status"`
	Records []SaveSupplierResp      `json:"records"`
}

type Supplier

type Supplier struct {
	SupplierId      uint                        `json:"supplierID"`
	SupplierType    string                      `json:"supplierType"`
	FullName        string                      `json:"fullName"`
	CompanyName     string                      `json:"companyName"`
	FirstName       string                      `json:"firstName"`
	LstName         string                      `json:"lastName"`
	GroupId         uint                        `json:"groupID"`
	GroupName       string                      `json:"groupName"`
	Phone           string                      `json:"phone"`
	Mobile          string                      `json:"mobile"`
	Email           string                      `json:"email"`
	Fax             string                      `json:"fax"`
	Code            string                      `json:"code"`
	IntegrationCode string                      `json:"integrationCode"`
	VatrateID       uint                        `json:"vatrateID"`
	CurrencyCode    string                      `json:"currencyCode"`
	DeliveryTermsID uint                        `json:"deliveryTermsID"`
	CountryId       uint                        `json:"countryID"`
	CountryName     string                      `json:"countryName"`
	CountryCode     string                      `json:"countryCode"`
	Address         string                      `json:"address"`
	Gln             string                      `json:"GLN"`
	Attributes      []sharedCommon.ObjAttribute `json:"attributes"`

	// Detail fields
	VatNumber           string `json:"vatNumber"`
	Skype               string `json:"skype"`
	Website             string `json:"website"`
	BankName            string `json:"bankName"`
	BankAccountNumber   string `json:"bankAccountNumber"`
	BankIBAN            string `json:"bankIBAN"`
	BankSWIFT           string `json:"bankSWIFT"`
	Birthday            string `json:"birthday"`
	CompanyID           uint   `json:"companyID"`
	ParentCompanyName   string `json:"parentCompanyName"`
	SupplierManagerID   uint   `json:"supplierManagerID"`
	SupplierManagerName string `json:"supplierManagerName"`
	PaymentDays         uint   `json:"paymentDays"`
	Notes               string `json:"notes"`
	LastModified        string `json:"lastModified"`
	Added               uint64 `json:"added"`
}

type SupplierListingDataProvider added in v1.6.2

type SupplierListingDataProvider struct {
	// contains filtered or unexported fields
}

func NewSupplierListingDataProvider added in v1.15.0

func NewSupplierListingDataProvider(erplyClient Manager) *SupplierListingDataProvider

func (*SupplierListingDataProvider) Count added in v1.6.2

func (l *SupplierListingDataProvider) Count(ctx context.Context, filters map[string]interface{}) (int, error)

func (*SupplierListingDataProvider) Read added in v1.6.2

func (l *SupplierListingDataProvider) Read(ctx context.Context, bulkFilters []map[string]interface{}, callback func(item interface{})) error

type WebshopClient

type WebshopClient struct {
	ClientID        string `json:"clientID"`
	ClientUsername  string `json:"clientUsername"`
	ClientName      string `json:"clientName"`
	ClientFirstName string `json:"clientFirstName"`
	ClientLastName  string `json:"clientLastName"`
	ClientGroupID   string `json:"clientGroupID"`
	ClientGroupName string `json:"clientGroupName"`
	CompanyID       string `json:"companyID"`
	CompanyName     string `json:"companyName"`
}

Jump to

Keyboard shortcuts

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