customers

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) GetCustomers

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

GetCustomers will list customers according to specified filters.

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) SaveCustomer

func (cli *Client) SaveCustomer(ctx context.Context, filters map[string]string) (*CustomerImportReport, 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) 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 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"`
	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"`

	// 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 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 GetCustomersResponse

type GetCustomersResponse struct {
	Status    sharedCommon.Status `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)
	GetCustomers(ctx context.Context, filters map[string]string) ([]Customer, 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)
}

type PostCustomerResponse

type PostCustomerResponse struct {
	Status                sharedCommon.Status   `json:"status"`
	CustomerImportReports CustomerImportReports `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 NewListingDataProvider added in v1.6.2

func NewListingDataProvider(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