Documentation
¶
Index ¶
- Constants
- type BodyMock
- type BusinessArea
- type Client
- func (cli *Client) GetBusinessAreas(ctx context.Context, filters map[string]string) ([]BusinessArea, error)
- func (cli *Client) GetCountries(ctx context.Context, filters map[string]string) ([]Country, error)
- func (cli *Client) GetCurrencies(ctx context.Context, filters map[string]string) ([]Currency, error)
- func (cli *Client) GetEmployees(ctx context.Context, filters map[string]string) ([]Employee, error)
- func (cli *Client) GetUserRights(ctx context.Context, filters map[string]string) ([]UserRights, error)
- func (cli *Client) LogProcessingOfCustomerData(ctx context.Context, filters map[string]string) error
- type ClientMock
- type Country
- type Currency
- type Employee
- type EmployeeProduct
- type EmployeeWarehouse
- type GetBusinessAreasResponse
- type GetCountriesResponse
- type GetCurrenciesResponse
- type GetEmployeesResponse
- type GetUserRightsResponse
- type InstallationRequest
- type InstallationResponse
- type Manager
- type ObjAttribute
- type PartnerClient
- type UserRights
Constants ¶
const ( GetCountriesMethod = "getCountries" GetEmployeesMethod = "getEmployees" GetBusinessAreasMethod = "getBusinessAreas" GetCurrenciesMethod = "getCurrencies" GetUserRightsMethod = "getUserRights" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyMock ¶ added in v0.3.0
BodyMock implements resp.Body
func NewFromStr ¶ added in v0.3.0
NewFromStr creates BodyMock from a string
func NewFromStruct ¶ added in v0.3.0
func NewFromStruct(input interface{}) *BodyMock
NewFromStruct creates BodyMock from a struct converted to json or string
type BusinessArea ¶ added in v0.1.0
type Client ¶ added in v0.4.0
type Client struct {
//Address requests
AddressProvider addresses.Manager
//Token requests
AuthProvider auth.Provider
//Company and Conf parameter requests
CompanyManager company.Manager
//Customers and suppliers requests
CustomerManager customers.Manager
//POS related requests
PosManager pos.Manager
//Products related requests
ProductManager products.Manager
//SalesDocuments, Payments, Projects, ShoppingCart, VatRates
SalesManager sales.Manager
//Warehouse requests
WarehouseManager warehouse.Manager
//Service Discovery
ServiceDiscoverer servicediscovery.ServiceDiscoverer
// contains filtered or unexported fields
}
func NewClient ¶
NewClient Takes three params: sessionKey string obtained from credentials or jwt clientCode erply customer identification number and a custom http Client if needs to be overwritten. if nil will use default http client provided by the SDK
func (*Client) GetBusinessAreas ¶ added in v0.4.0
func (cli *Client) GetBusinessAreas(ctx context.Context, filters map[string]string) ([]BusinessArea, error)
GetBusinessAreas will list business areas according to specified filters.
func (*Client) GetCountries ¶ added in v0.4.0
GetCountries will list countries according to specified filters.
func (*Client) GetCurrencies ¶ added in v0.4.0
func (cli *Client) GetCurrencies(ctx context.Context, filters map[string]string) ([]Currency, error)
GetCurrencies will list currencies according to specified filters.
func (*Client) GetEmployees ¶ added in v0.4.0
GetEmployees will list employees according to specified filters.
func (*Client) GetUserRights ¶ added in v0.4.0
func (cli *Client) GetUserRights(ctx context.Context, filters map[string]string) ([]UserRights, error)
GetUserName from GetUserRights erply API request
type ClientMock ¶ added in v0.3.0
type ClientMock struct {
ErrToGive error
ResponseToGive *http.Response
Requests []*http.Request
Lock sync.Mutex
}
ClientMock mocks HttpClient interface
type Employee ¶ added in v0.1.0
type Employee struct {
EmployeeID string `json:"employeeID"`
FullName string `json:"fullName"`
EmployeeName string `json:"employeeName"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Phone string `json:"phone"`
Mobile string `json:"mobile"`
Email string `json:"email"`
Fax string `json:"fax"`
Code string `json:"code"`
Gender string `json:"gender"`
UserID string `json:"userID"`
Username string `json:"username"`
UserGroupID string `json:"userGroupID"`
Warehouses []EmployeeWarehouse `json:"warehouses"`
PointsOfSale string `json:"pointsOfSale"`
ProductIDs []EmployeeProduct `json:"productIDs"`
Attributes []ObjAttribute `json:"attributes"`
LastModified uint64 `json:"lastModified"`
LastModifiedByUserName string `json:"lastModifiedByUserName"`
// detail fileds
Skype string `json:"skype"`
Birthday string `json:"birthday"`
JobTitleID uint `json:"jobTitleID"`
JobTitleName string `json:"jobTitleName"`
Notes string `json:"notes"`
Added uint64 `json:"added"`
}
type EmployeeProduct ¶ added in v0.1.0
type EmployeeWarehouse ¶ added in v0.1.0
type EmployeeWarehouse struct {
Id uint `json:"id"`
}
type GetBusinessAreasResponse ¶ added in v0.1.0
type GetBusinessAreasResponse struct {
Status common.Status `json:"status"`
BusinessAreas []BusinessArea `json:"records"`
}
type GetCountriesResponse ¶ added in v0.1.0
type GetCurrenciesResponse ¶ added in v0.1.0
type GetEmployeesResponse ¶ added in v0.1.0
type GetUserRightsResponse ¶
type GetUserRightsResponse struct {
Status common.Status `json:"status"`
Records []UserRights `json:"records"`
}
type InstallationRequest ¶ added in v0.1.0
type InstallationResponse ¶ added in v0.1.0
type InstallationResponse struct {
ClientCode int `json:"clientCode"`
UserName string `json:"username"`
Password string `json:"password"`
}
func CreateInstallation ¶ added in v0.1.0
func CreateInstallation(baseUrl, partnerKey string, in *InstallationRequest, httpCli *http.Client) (*InstallationResponse, error)
type Manager ¶ added in v0.4.0
type Manager interface {
GetCountries(ctx context.Context, filters map[string]string) ([]Country, error)
GetUserRights(ctx context.Context, filters map[string]string) ([]UserRights, error)
GetEmployees(ctx context.Context, filters map[string]string) ([]Employee, error)
GetBusinessAreas(ctx context.Context, filters map[string]string) ([]BusinessArea, error)
GetCurrencies(ctx context.Context, filters map[string]string) ([]Currency, error)
LogProcessingOfCustomerData(ctx context.Context, filters map[string]string) error
}
this interface sums up the general requests here
type ObjAttribute ¶ added in v0.1.0
type PartnerClient ¶ added in v0.4.0
type PartnerClient struct {
Client *Client
PartnerTokenProvider auth.PartnerTokenProvider
}
func NewPartnerClient ¶ added in v0.4.0
func NewPartnerClient(sessionKey, clientCode, partnerKey string, customCli *http.Client) (*PartnerClient, error)
type UserRights ¶
type UserRights struct {
UserName string `json:"userName"`
}