2021-10-27 15:49:06 +03:00
|
|
|
package retailcrm
|
2018-02-27 11:37:15 +03:00
|
|
|
|
2020-08-05 17:34:38 +03:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"net/http"
|
|
|
|
"reflect"
|
2020-08-05 19:29:25 +03:00
|
|
|
"strings"
|
2020-08-05 17:34:38 +03:00
|
|
|
)
|
2018-02-27 11:37:15 +03:00
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// ByID is "id" constant to use as `by` property in methods.
|
2019-10-16 16:32:31 +03:00
|
|
|
const ByID = "id"
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// ByExternalId is "externalId" constant to use as `by` property in methods.
|
2019-10-16 16:32:31 +03:00
|
|
|
const ByExternalID = "externalId"
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Client type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Client struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
URL string
|
2018-02-27 11:37:15 +03:00
|
|
|
Key string
|
2018-09-28 01:37:56 +03:00
|
|
|
Debug bool
|
2018-02-27 11:37:15 +03:00
|
|
|
httpClient *http.Client
|
2021-10-27 15:49:06 +03:00
|
|
|
logger BasicLogger
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Pagination type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Pagination struct {
|
|
|
|
Limit int `json:"limit,omitempty"`
|
|
|
|
TotalCount int `json:"totalCount,omitempty"`
|
|
|
|
CurrentPage int `json:"currentPage,omitempty"`
|
|
|
|
TotalPageCount int `json:"totalPageCount,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Address type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Address struct {
|
2020-08-04 13:09:42 +03:00
|
|
|
Index string `json:"index,omitempty"`
|
|
|
|
CountryIso string `json:"countryIso,omitempty"`
|
|
|
|
Region string `json:"region,omitempty"`
|
|
|
|
RegionID int `json:"regionId,omitempty"`
|
|
|
|
City string `json:"city,omitempty"`
|
|
|
|
CityID int `json:"cityId,omitempty"`
|
|
|
|
CityType string `json:"cityType,omitempty"`
|
|
|
|
Street string `json:"street,omitempty"`
|
|
|
|
StreetID int `json:"streetId,omitempty"`
|
|
|
|
StreetType string `json:"streetType,omitempty"`
|
|
|
|
Building string `json:"building,omitempty"`
|
|
|
|
Flat string `json:"flat,omitempty"`
|
|
|
|
Floor int `json:"floor,omitempty"`
|
|
|
|
Block int `json:"block,omitempty"`
|
|
|
|
House string `json:"house,omitempty"`
|
2021-09-06 16:37:43 +03:00
|
|
|
Housing string `json:"housing,omitempty"`
|
2020-08-04 13:09:42 +03:00
|
|
|
Metro string `json:"metro,omitempty"`
|
|
|
|
Notes string `json:"notes,omitempty"`
|
|
|
|
Text string `json:"text,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// GeoHierarchyRow type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type GeoHierarchyRow struct {
|
|
|
|
Country string `json:"country,omitempty"`
|
|
|
|
Region string `json:"region,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
RegionID int `json:"regionId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
City string `json:"city,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
CityID int `json:"cityId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Source type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Source struct {
|
|
|
|
Source string `json:"source,omitempty"`
|
|
|
|
Medium string `json:"medium,omitempty"`
|
|
|
|
Campaign string `json:"campaign,omitempty"`
|
|
|
|
Keyword string `json:"keyword,omitempty"`
|
|
|
|
Content string `json:"content,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Contragent type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Contragent struct {
|
|
|
|
ContragentType string `json:"contragentType,omitempty"`
|
|
|
|
LegalName string `json:"legalName,omitempty"`
|
|
|
|
LegalAddress string `json:"legalAddress,omitempty"`
|
|
|
|
INN string `json:"INN,omitempty"`
|
|
|
|
OKPO string `json:"OKPO,omitempty"`
|
|
|
|
KPP string `json:"KPP,omitempty"`
|
|
|
|
OGRN string `json:"OGRN,omitempty"`
|
|
|
|
OGRNIP string `json:"OGRNIP,omitempty"`
|
|
|
|
CertificateNumber string `json:"certificateNumber,omitempty"`
|
|
|
|
CertificateDate string `json:"certificateDate,omitempty"`
|
|
|
|
BIK string `json:"BIK,omitempty"`
|
|
|
|
Bank string `json:"bank,omitempty"`
|
|
|
|
BankAddress string `json:"bankAddress,omitempty"`
|
|
|
|
CorrAccount string `json:"corrAccount,omitempty"`
|
|
|
|
BankAccount string `json:"bankAccount,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// APIKey type.
|
2018-03-19 23:18:36 +03:00
|
|
|
type APIKey struct {
|
2018-02-27 11:37:15 +03:00
|
|
|
Current bool `json:"current,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Property type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Property struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Value string `json:"value,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
Sites []string `json:"Sites,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// IdentifiersPair type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type IdentifiersPair struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// DeliveryTime type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type DeliveryTime struct {
|
|
|
|
From string `json:"from,omitempty"`
|
|
|
|
To string `json:"to,omitempty"`
|
|
|
|
Custom string `json:"custom,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Customer related types
|
|
|
|
*/
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Customer type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Customer struct {
|
2021-10-27 17:18:50 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
FirstName string `json:"firstName,omitempty"`
|
|
|
|
LastName string `json:"lastName,omitempty"`
|
|
|
|
Patronymic string `json:"patronymic,omitempty"`
|
|
|
|
Sex string `json:"sex,omitempty"`
|
|
|
|
Email string `json:"email,omitempty"`
|
|
|
|
Phones []Phone `json:"phones,omitempty"`
|
|
|
|
Address *Address `json:"address,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Birthday string `json:"birthday,omitempty"`
|
|
|
|
ManagerID int `json:"managerId,omitempty"`
|
|
|
|
Vip bool `json:"vip,omitempty"`
|
|
|
|
Bad bool `json:"bad,omitempty"`
|
|
|
|
Site string `json:"site,omitempty"`
|
|
|
|
Source *Source `json:"source,omitempty"`
|
|
|
|
Contragent *Contragent `json:"contragent,omitempty"`
|
|
|
|
PersonalDiscount float32 `json:"personalDiscount,omitempty"`
|
|
|
|
CumulativeDiscount float32 `json:"cumulativeDiscount,omitempty"`
|
|
|
|
DiscountCardNumber string `json:"discountCardNumber,omitempty"`
|
|
|
|
EmailMarketingUnsubscribedAt string `json:"emailMarketingUnsubscribedAt,omitempty"`
|
|
|
|
AvgMarginSumm float32 `json:"avgMarginSumm,omitempty"`
|
|
|
|
MarginSumm float32 `json:"marginSumm,omitempty"`
|
|
|
|
TotalSumm float32 `json:"totalSumm,omitempty"`
|
|
|
|
AverageSumm float32 `json:"averageSumm,omitempty"`
|
|
|
|
OrdersCount int `json:"ordersCount,omitempty"`
|
|
|
|
CostSumm float32 `json:"costSumm,omitempty"`
|
|
|
|
MaturationTime int `json:"maturationTime,omitempty"`
|
|
|
|
FirstClientID string `json:"firstClientId,omitempty"`
|
|
|
|
LastClientID string `json:"lastClientId,omitempty"`
|
|
|
|
BrowserID string `json:"browserId,omitempty"`
|
|
|
|
MgCustomerID string `json:"mgCustomerId,omitempty"`
|
|
|
|
PhotoURL string `json:"photoUrl,omitempty"`
|
|
|
|
CustomFields StringMap `json:"customFields,omitempty"`
|
|
|
|
Tags []Tag `json:"tags,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// CorporateCustomer type.
|
2019-10-16 16:32:31 +03:00
|
|
|
type CorporateCustomer struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
Nickname string `json:"nickName,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Vip bool `json:"vip,omitempty"`
|
|
|
|
Bad bool `json:"bad,omitempty"`
|
2021-10-27 17:18:50 +03:00
|
|
|
CustomFields StringMap `json:"customFields,omitempty"`
|
2019-10-16 16:32:31 +03:00
|
|
|
PersonalDiscount float32 `json:"personalDiscount,omitempty"`
|
|
|
|
DiscountCardNumber string `json:"discountCardNumber,omitempty"`
|
|
|
|
ManagerID int `json:"managerId,omitempty"`
|
|
|
|
Source *Source `json:"source,omitempty"`
|
|
|
|
CustomerContacts []CorporateCustomerContact `json:"customerContacts,omitempty"`
|
|
|
|
Companies []Company `json:"companies,omitempty"`
|
|
|
|
Addresses []CorporateCustomerAddress `json:"addresses,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type CorporateCustomerContact struct {
|
|
|
|
IsMain bool `json:"isMain,omitempty"`
|
|
|
|
Customer CorporateCustomerContactCustomer `json:"customer,omitempty"`
|
|
|
|
Companies []IdentifiersPair `json:"companies,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// CorporateCustomerAddress type. Address didn't inherited in order to simplify declaration.
|
|
|
|
type CorporateCustomerAddress struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
Index string `json:"index,omitempty"`
|
|
|
|
CountryISO string `json:"countryIso,omitempty"`
|
|
|
|
Region string `json:"region,omitempty"`
|
|
|
|
RegionID int `json:"regionId,omitempty"`
|
|
|
|
City string `json:"city,omitempty"`
|
|
|
|
CityID int `json:"cityId,omitempty"`
|
|
|
|
CityType string `json:"cityType,omitempty"`
|
|
|
|
Street string `json:"street,omitempty"`
|
|
|
|
StreetID int `json:"streetId,omitempty"`
|
|
|
|
StreetType string `json:"streetType,omitempty"`
|
|
|
|
Building string `json:"building,omitempty"`
|
|
|
|
Flat string `json:"flat,omitempty"`
|
|
|
|
IntercomCode string `json:"intercomCode,omitempty"`
|
|
|
|
Floor int `json:"floor,omitempty"`
|
|
|
|
Block int `json:"block,omitempty"`
|
|
|
|
House string `json:"house,omitempty"`
|
|
|
|
Housing string `json:"housing,omitempty"`
|
|
|
|
Metro string `json:"metro,omitempty"`
|
|
|
|
Notes string `json:"notes,omitempty"`
|
|
|
|
Text string `json:"text,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type CorporateCustomerContactCustomer struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
BrowserID string `json:"browserId,omitempty"`
|
|
|
|
Site string `json:"site,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Company struct {
|
2021-10-27 15:49:06 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
IsMain bool `json:"isMain,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Brand string `json:"brand,omitempty"`
|
|
|
|
Site string `json:"site,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Contragent *Contragent `json:"contragent,omitempty"`
|
|
|
|
Address *IdentifiersPair `json:"address,omitempty"`
|
2021-10-27 17:18:50 +03:00
|
|
|
CustomFields StringMap `json:"customFields,omitempty"`
|
2019-10-16 16:32:31 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// CorporateCustomerNote type.
|
2019-10-16 16:32:31 +03:00
|
|
|
type CorporateCustomerNote struct {
|
|
|
|
ManagerID int `json:"managerId,omitempty"`
|
|
|
|
Text string `json:"text,omitempty"`
|
|
|
|
Customer *IdentifiersPair `json:"customer,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Phone type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Phone struct {
|
|
|
|
Number string `json:"number,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// CustomerHistoryRecord type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type CustomerHistoryRecord struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Created bool `json:"created,omitempty"`
|
|
|
|
Deleted bool `json:"deleted,omitempty"`
|
|
|
|
Source string `json:"source,omitempty"`
|
|
|
|
Field string `json:"field,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
User *User `json:"user,omitempty"`
|
|
|
|
APIKey *APIKey `json:"apiKey,omitempty"`
|
|
|
|
Customer *Customer `json:"customer,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// CorporateCustomerHistoryRecord type.
|
2019-10-16 16:32:31 +03:00
|
|
|
type CorporateCustomerHistoryRecord struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Created bool `json:"created,omitempty"`
|
|
|
|
Deleted bool `json:"deleted,omitempty"`
|
|
|
|
Source string `json:"source,omitempty"`
|
|
|
|
Field string `json:"field,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
User *User `json:"user,omitempty"`
|
|
|
|
APIKey *APIKey `json:"apiKey,omitempty"`
|
|
|
|
CorporateCustomer *CorporateCustomer `json:"corporateCustomer,omitempty"`
|
2019-10-16 16:32:31 +03:00
|
|
|
}
|
|
|
|
|
2018-02-27 11:37:15 +03:00
|
|
|
/**
|
|
|
|
Order related types
|
|
|
|
*/
|
|
|
|
|
2021-10-27 15:49:06 +03:00
|
|
|
type OrderPayments map[string]OrderPayment
|
2021-10-27 17:18:50 +03:00
|
|
|
type StringMap map[string]string
|
2021-11-08 13:25:56 +03:00
|
|
|
type Properties map[string]Property
|
2021-10-27 15:49:06 +03:00
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Order type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Order struct {
|
2021-10-27 15:49:06 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
Number string `json:"number,omitempty"`
|
|
|
|
FirstName string `json:"firstName,omitempty"`
|
|
|
|
LastName string `json:"lastName,omitempty"`
|
|
|
|
Patronymic string `json:"patronymic,omitempty"`
|
|
|
|
Email string `json:"email,omitempty"`
|
|
|
|
Phone string `json:"phone,omitempty"`
|
|
|
|
AdditionalPhone string `json:"additionalPhone,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
StatusUpdatedAt string `json:"statusUpdatedAt,omitempty"`
|
|
|
|
ManagerID int `json:"managerId,omitempty"`
|
|
|
|
Mark int `json:"mark,omitempty"`
|
|
|
|
Call bool `json:"call,omitempty"`
|
|
|
|
Expired bool `json:"expired,omitempty"`
|
|
|
|
FromAPI bool `json:"fromApi,omitempty"`
|
|
|
|
MarkDatetime string `json:"markDatetime,omitempty"`
|
|
|
|
CustomerComment string `json:"customerComment,omitempty"`
|
|
|
|
ManagerComment string `json:"managerComment,omitempty"`
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
StatusComment string `json:"statusComment,omitempty"`
|
|
|
|
FullPaidAt string `json:"fullPaidAt,omitempty"`
|
|
|
|
Site string `json:"site,omitempty"`
|
|
|
|
OrderType string `json:"orderType,omitempty"`
|
|
|
|
OrderMethod string `json:"orderMethod,omitempty"`
|
|
|
|
CountryIso string `json:"countryIso,omitempty"`
|
|
|
|
Summ float32 `json:"summ,omitempty"`
|
|
|
|
TotalSumm float32 `json:"totalSumm,omitempty"`
|
|
|
|
PrepaySum float32 `json:"prepaySum,omitempty"`
|
|
|
|
PurchaseSumm float32 `json:"purchaseSumm,omitempty"`
|
|
|
|
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
|
|
|
|
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
|
|
|
|
Weight float32 `json:"weight,omitempty"`
|
|
|
|
Length int `json:"length,omitempty"`
|
|
|
|
Width int `json:"width,omitempty"`
|
|
|
|
Height int `json:"height,omitempty"`
|
|
|
|
ShipmentStore string `json:"shipmentStore,omitempty"`
|
|
|
|
ShipmentDate string `json:"shipmentDate,omitempty"`
|
|
|
|
ClientID string `json:"clientId,omitempty"`
|
|
|
|
Shipped bool `json:"shipped,omitempty"`
|
|
|
|
UploadedToExternalStoreSystem bool `json:"uploadedToExternalStoreSystem,omitempty"`
|
|
|
|
Source *Source `json:"source,omitempty"`
|
|
|
|
Contragent *Contragent `json:"contragent,omitempty"`
|
|
|
|
Customer *Customer `json:"customer,omitempty"`
|
|
|
|
Delivery *OrderDelivery `json:"delivery,omitempty"`
|
|
|
|
Marketplace *OrderMarketplace `json:"marketplace,omitempty"`
|
|
|
|
Items []OrderItem `json:"items,omitempty"`
|
2021-10-27 17:18:50 +03:00
|
|
|
CustomFields StringMap `json:"customFields,omitempty"`
|
2021-10-27 15:49:06 +03:00
|
|
|
Payments OrderPayments `json:"payments,omitempty"`
|
2022-12-07 17:40:52 +03:00
|
|
|
ApplyRound *bool `json:"applyRound,omitempty"`
|
2022-12-08 13:32:54 +03:00
|
|
|
PrivilegeType string `json:"privilegeType,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrdersStatus type.
|
2020-06-29 16:26:10 +03:00
|
|
|
type OrdersStatus struct {
|
|
|
|
ID int `json:"id"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Group string `json:"group"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderDelivery type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OrderDelivery struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
IntegrationCode string `json:"integrationCode,omitempty"`
|
|
|
|
Cost float32 `json:"cost,omitempty"`
|
|
|
|
NetCost float32 `json:"netCost,omitempty"`
|
|
|
|
VatRate string `json:"vatRate,omitempty"`
|
|
|
|
Date string `json:"date,omitempty"`
|
|
|
|
Time *OrderDeliveryTime `json:"time,omitempty"`
|
|
|
|
Address *Address `json:"address,omitempty"`
|
|
|
|
Service *OrderDeliveryService `json:"service,omitempty"`
|
|
|
|
Data *OrderDeliveryData `json:"data,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderDeliveryTime type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OrderDeliveryTime struct {
|
|
|
|
From string `json:"from,omitempty"`
|
|
|
|
To string `json:"to,omitempty"`
|
|
|
|
Custom string `json:"custom,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderDeliveryService type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OrderDeliveryService struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderDeliveryDataBasic type.
|
2020-08-05 17:34:38 +03:00
|
|
|
type OrderDeliveryDataBasic struct {
|
2018-02-27 11:37:15 +03:00
|
|
|
TrackNumber string `json:"trackNumber,omitempty"`
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
PickuppointAddress string `json:"pickuppointAddress,omitempty"`
|
|
|
|
PayerType string `json:"payerType,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderDeliveryData type.
|
2020-08-05 17:34:38 +03:00
|
|
|
type OrderDeliveryData struct {
|
|
|
|
OrderDeliveryDataBasic
|
|
|
|
AdditionalFields map[string]interface{}
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// UnmarshalJSON method.
|
2020-08-05 17:34:38 +03:00
|
|
|
func (v *OrderDeliveryData) UnmarshalJSON(b []byte) error {
|
|
|
|
var additionalData map[string]interface{}
|
2021-10-27 15:49:06 +03:00
|
|
|
err := json.Unmarshal(b, &additionalData)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
err = json.Unmarshal(b, &v.OrderDeliveryDataBasic)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2020-08-05 17:34:38 +03:00
|
|
|
object := reflect.TypeOf(v.OrderDeliveryDataBasic)
|
|
|
|
|
|
|
|
for i := 0; i < object.NumField(); i++ {
|
|
|
|
field := object.Field(i)
|
|
|
|
|
|
|
|
if i, ok := field.Tag.Lookup("json"); ok {
|
2020-08-05 19:29:25 +03:00
|
|
|
name := strings.Split(i, ",")[0]
|
|
|
|
delete(additionalData, strings.TrimSpace(name))
|
2020-08-05 17:34:38 +03:00
|
|
|
} else {
|
|
|
|
delete(additionalData, field.Name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
v.AdditionalFields = additionalData
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// MarshalJSON method.
|
2020-08-05 17:34:38 +03:00
|
|
|
func (v OrderDeliveryData) MarshalJSON() ([]byte, error) {
|
|
|
|
result := map[string]interface{}{}
|
|
|
|
data, _ := json.Marshal(v.OrderDeliveryDataBasic)
|
2021-10-27 15:49:06 +03:00
|
|
|
err := json.Unmarshal(data, &result)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2020-08-05 17:34:38 +03:00
|
|
|
|
|
|
|
for key, value := range v.AdditionalFields {
|
|
|
|
result[key] = value
|
|
|
|
}
|
|
|
|
|
|
|
|
return json.Marshal(result)
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderMarketplace type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OrderMarketplace struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
OrderID string `json:"orderId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderPayment type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OrderPayment struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
PaidAt string `json:"paidAt,omitempty"`
|
|
|
|
Amount float32 `json:"amount,omitempty"`
|
|
|
|
Comment string `json:"comment,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderItem type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OrderItem struct {
|
2021-11-08 13:25:56 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
InitialPrice float32 `json:"initialPrice,omitempty"`
|
|
|
|
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
|
|
|
DiscountTotal float32 `json:"discountTotal,omitempty"`
|
|
|
|
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
|
|
|
|
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
|
|
|
|
ProductName string `json:"productName,omitempty"`
|
|
|
|
VatRate string `json:"vatRate,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Quantity float32 `json:"quantity,omitempty"`
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
Comment string `json:"comment,omitempty"`
|
|
|
|
IsCanceled bool `json:"isCanceled,omitempty"`
|
|
|
|
Offer Offer `json:"offer,omitempty"`
|
|
|
|
Properties Properties `json:"properties,omitempty"`
|
|
|
|
PriceType *PriceType `json:"priceType,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrdersHistoryRecord type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OrdersHistoryRecord struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Created bool `json:"created,omitempty"`
|
|
|
|
Deleted bool `json:"deleted,omitempty"`
|
|
|
|
Source string `json:"source,omitempty"`
|
|
|
|
Field string `json:"field,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
User *User `json:"user,omitempty"`
|
|
|
|
APIKey *APIKey `json:"apiKey,omitempty"`
|
|
|
|
Order *Order `json:"order,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Pack type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Pack struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
|
|
|
Quantity float32 `json:"quantity,omitempty"`
|
|
|
|
Store string `json:"store,omitempty"`
|
|
|
|
ShipmentDate string `json:"shipmentDate,omitempty"`
|
|
|
|
InvoiceNumber string `json:"invoiceNumber,omitempty"`
|
|
|
|
DeliveryNoteNumber string `json:"deliveryNoteNumber,omitempty"`
|
|
|
|
Item *PackItem `json:"item,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
ItemID int `json:"itemId,omitempty"`
|
2019-02-20 10:07:02 +03:00
|
|
|
Unit *Unit `json:"unit,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// PackItem type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type PackItem struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Order *Order `json:"order,omitempty"`
|
|
|
|
Offer *Offer `json:"offer,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// PacksHistoryRecord type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type PacksHistoryRecord struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Created bool `json:"created,omitempty"`
|
|
|
|
Deleted bool `json:"deleted,omitempty"`
|
|
|
|
Source string `json:"source,omitempty"`
|
|
|
|
Field string `json:"field,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
User *User `json:"user,omitempty"`
|
|
|
|
Pack *Pack `json:"pack,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Offer type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Offer struct {
|
2021-10-27 17:18:50 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
XMLID string `json:"xmlId,omitempty"`
|
|
|
|
Article string `json:"article,omitempty"`
|
|
|
|
VatRate string `json:"vatRate,omitempty"`
|
|
|
|
Price float32 `json:"price,omitempty"`
|
|
|
|
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
|
|
|
Quantity float32 `json:"quantity,omitempty"`
|
|
|
|
Height float32 `json:"height,omitempty"`
|
|
|
|
Width float32 `json:"width,omitempty"`
|
|
|
|
Length float32 `json:"length,omitempty"`
|
|
|
|
Weight float32 `json:"weight,omitempty"`
|
|
|
|
Stores []Inventory `json:"stores,omitempty"`
|
|
|
|
Properties StringMap `json:"properties,omitempty"`
|
|
|
|
Prices []OfferPrice `json:"prices,omitempty"`
|
|
|
|
Images []string `json:"images,omitempty"`
|
|
|
|
Unit *Unit `json:"unit,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Inventory type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Inventory struct {
|
|
|
|
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
|
|
|
Quantity float32 `json:"quantity,omitempty"`
|
|
|
|
Store string `json:"store,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// InventoryUpload type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type InventoryUpload struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
XMLID string `json:"xmlId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Stores []InventoryUploadStore `json:"stores,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// InventoryUploadStore type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type InventoryUploadStore struct {
|
|
|
|
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
|
|
|
Available float32 `json:"available,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OfferPrice type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OfferPrice struct {
|
|
|
|
Price float32 `json:"price,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
|
|
|
PriceType string `json:"priceType,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OfferPriceUpload type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OfferPriceUpload struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
XMLID string `json:"xmlId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Site string `json:"site,omitempty"`
|
|
|
|
Prices []PriceUpload `json:"prices,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// PriceUpload type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type PriceUpload struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Price float32 `json:"price,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Unit type.
|
2019-02-20 10:07:02 +03:00
|
|
|
type Unit struct {
|
|
|
|
Code string `json:"code"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Sym string `json:"sym"`
|
|
|
|
Default bool `json:"default,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
}
|
|
|
|
|
2018-02-27 11:37:15 +03:00
|
|
|
/**
|
|
|
|
User related types
|
|
|
|
*/
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// User type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type User struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
FirstName string `json:"firstName,omitempty"`
|
|
|
|
LastName string `json:"lastName,omitempty"`
|
|
|
|
Patronymic string `json:"patronymic,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Online bool `json:"online,omitempty"`
|
|
|
|
IsAdmin bool `json:"isAdmin,omitempty"`
|
|
|
|
IsManager bool `json:"isManager,omitempty"`
|
|
|
|
Email string `json:"email,omitempty"`
|
|
|
|
Phone string `json:"phone,omitempty"`
|
|
|
|
Status string `json:"status,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
Groups []UserGroup `json:"groups,omitempty"`
|
2021-10-27 15:49:06 +03:00
|
|
|
MGUserID uint64 `json:"mgUserId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// UserGroup type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type UserGroup struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
SignatureTemplate string `json:"signatureTemplate,omitempty"`
|
|
|
|
IsManager bool `json:"isManager,omitempty"`
|
|
|
|
IsDeliveryMen bool `json:"isDeliveryMen,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
DeliveryTypes []string `json:"deliveryTypes,omitempty"`
|
|
|
|
BreakdownOrderTypes []string `json:"breakdownOrderTypes,omitempty"`
|
|
|
|
BreakdownSites []string `json:"breakdownSites,omitempty"`
|
|
|
|
BreakdownOrderMethods []string `json:"breakdownOrderMethods,omitempty"`
|
|
|
|
GrantedOrderTypes []string `json:"grantedOrderTypes,omitempty"`
|
|
|
|
GrantedSites []string `json:"grantedSites,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Task related types
|
|
|
|
*/
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Task type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Task struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
PerformerID int `json:"performerId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Text string `json:"text,omitempty"`
|
|
|
|
Commentary string `json:"commentary,omitempty"`
|
|
|
|
Datetime string `json:"datetime,omitempty"`
|
|
|
|
Complete bool `json:"complete,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Creator int `json:"creator,omitempty"`
|
|
|
|
Performer int `json:"performer,omitempty"`
|
|
|
|
Phone string `json:"phone,omitempty"`
|
|
|
|
PhoneSite string `json:"phoneSite,omitempty"`
|
|
|
|
Customer *Customer `json:"customer,omitempty"`
|
|
|
|
Order *Order `json:"order,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Notes related types
|
|
|
|
*/
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Note type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Note struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ManagerID int `json:"managerId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Text string `json:"text,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Customer *Customer `json:"customer,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Payments related types
|
|
|
|
*/
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Payment type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Payment struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
PaidAt string `json:"paidAt,omitempty"`
|
|
|
|
Amount float32 `json:"amount,omitempty"`
|
|
|
|
Comment string `json:"comment,omitempty"`
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
Order *Order `json:"order,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Segment related types
|
|
|
|
*/
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Segment type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Segment struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
CustomersCount int `json:"customersCount,omitempty"`
|
|
|
|
IsDynamic bool `json:"isDynamic,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
}
|
|
|
|
|
2020-07-14 10:22:36 +03:00
|
|
|
/*
|
|
|
|
* Settings related types
|
|
|
|
*/
|
|
|
|
|
|
|
|
// SettingsNode represents an item in settings. All settings nodes contains only string value and update time for now.
|
|
|
|
type SettingsNode struct {
|
2020-08-04 13:09:42 +03:00
|
|
|
Value string `json:"value"`
|
2020-07-14 10:22:36 +03:00
|
|
|
UpdatedAt string `json:"updated_at"`
|
|
|
|
}
|
|
|
|
|
2022-04-29 12:26:38 +03:00
|
|
|
// WorkTime type.
|
|
|
|
type WorkTime struct {
|
|
|
|
DayType string `json:"day_type"`
|
|
|
|
StartTime string `json:"start_time"`
|
|
|
|
EndTime string `json:"end_time"`
|
|
|
|
LunchStartTime string `json:"lunch_start_time"`
|
|
|
|
LunchEndTime string `json:"lunch_end_time"`
|
|
|
|
}
|
|
|
|
|
2022-11-24 13:37:21 +03:00
|
|
|
type SerializedBaseLoyaltyAccount struct {
|
|
|
|
PhoneNumber string `json:"phoneNumber,omitempty"`
|
|
|
|
CardNumber string `json:"cardNumber,omitempty"`
|
|
|
|
CustomFields []string `json:"customFields,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SerializedCreateLoyaltyAccount struct {
|
|
|
|
SerializedBaseLoyaltyAccount
|
|
|
|
Customer SerializedEntityCustomer `json:"customer"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SerializedEditLoyaltyAccount struct {
|
|
|
|
SerializedBaseLoyaltyAccount
|
|
|
|
}
|
|
|
|
|
2020-07-14 10:22:36 +03:00
|
|
|
// Settings type. Contains retailCRM configuration.
|
|
|
|
type Settings struct {
|
|
|
|
DefaultCurrency SettingsNode `json:"default_currency"`
|
2020-08-04 13:09:42 +03:00
|
|
|
SystemLanguage SettingsNode `json:"system_language"`
|
|
|
|
Timezone SettingsNode `json:"timezone"`
|
2022-04-29 12:26:38 +03:00
|
|
|
WorkTimes []WorkTime `json:"work_times"`
|
2020-07-14 10:22:36 +03:00
|
|
|
}
|
|
|
|
|
2018-02-27 11:37:15 +03:00
|
|
|
/**
|
|
|
|
Reference related types
|
|
|
|
*/
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// CostGroup type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type CostGroup struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Color string `json:"color,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// CostItem type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type CostItem struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Group string `json:"group,omitempty"`
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
AppliesToOrders bool `json:"appliesToOrders,omitempty"`
|
|
|
|
AppliesToUsers bool `json:"appliesToUsers,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
|
|
|
Source *Source `json:"source,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Courier type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Courier struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
FirstName string `json:"firstName,omitempty"`
|
|
|
|
LastName string `json:"lastName,omitempty"`
|
|
|
|
Patronymic string `json:"patronymic,omitempty"`
|
|
|
|
Email string `json:"email,omitempty"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Phone *Phone `json:"phone,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// DeliveryService type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type DeliveryService struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// DeliveryType type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type DeliveryType struct {
|
2022-12-08 13:32:54 +03:00
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
DefaultCost float32 `json:"defaultCost,omitempty"`
|
|
|
|
DefaultNetCost float32 `json:"defaultNetCost,omitempty"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
IntegrationCode string `json:"integrationCode,omitempty"`
|
|
|
|
VatRate string `json:"vatRate,omitempty"`
|
|
|
|
DefaultForCrm bool `json:"defaultForCrm,omitempty"`
|
|
|
|
DeliveryServices []string `json:"deliveryServices,omitempty"`
|
2022-12-08 16:24:52 +03:00
|
|
|
PaymentTypes []string `json:"paymentTypes,omitempty"` // Deprecated, use DeliveryPaymentTypes
|
2022-12-08 13:32:54 +03:00
|
|
|
DeliveryPaymentTypes []DeliveryPaymentType `json:"deliveryPaymentTypes,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeliveryPaymentType struct {
|
|
|
|
Code string `json:"code"`
|
|
|
|
Cod bool `json:"cod,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// LegalEntity type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type LegalEntity struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
VatRate string `json:"vatRate,omitempty"`
|
|
|
|
CountryIso string `json:"countryIso,omitempty"`
|
|
|
|
ContragentType string `json:"contragentType,omitempty"`
|
|
|
|
LegalName string `json:"legalName,omitempty"`
|
|
|
|
LegalAddress string `json:"legalAddress,omitempty"`
|
|
|
|
INN string `json:"INN,omitempty"`
|
|
|
|
OKPO string `json:"OKPO,omitempty"`
|
|
|
|
KPP string `json:"KPP,omitempty"`
|
|
|
|
OGRN string `json:"OGRN,omitempty"`
|
|
|
|
OGRNIP string `json:"OGRNIP,omitempty"`
|
|
|
|
CertificateNumber string `json:"certificateNumber,omitempty"`
|
|
|
|
CertificateDate string `json:"certificateDate,omitempty"`
|
|
|
|
BIK string `json:"BIK,omitempty"`
|
|
|
|
Bank string `json:"bank,omitempty"`
|
|
|
|
BankAddress string `json:"bankAddress,omitempty"`
|
|
|
|
CorrAccount string `json:"corrAccount,omitempty"`
|
|
|
|
BankAccount string `json:"bankAccount,omitempty"`
|
|
|
|
}
|
|
|
|
|
2022-11-24 13:37:21 +03:00
|
|
|
type SerializedEntityCustomer struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID int `json:"externalId,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderMethod type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OrderMethod struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
|
|
|
|
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// OrderType type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type OrderType struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
|
|
|
|
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// PaymentStatus type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type PaymentStatus struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
|
|
|
|
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
PaymentComplete bool `json:"paymentComplete,omitempty"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
PaymentTypes []string `json:"paymentTypes,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// PaymentType type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type PaymentType struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
|
|
|
|
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Description string `json:"description,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
DeliveryTypes []string `json:"deliveryTypes,omitempty"`
|
|
|
|
PaymentStatuses []string `json:"PaymentStatuses,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// PriceType type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type PriceType struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Default bool `json:"default,omitempty"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
FilterExpression string `json:"filterExpression,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
Groups []string `json:"groups,omitempty"`
|
|
|
|
Geo []GeoHierarchyRow `json:"geo,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// ProductStatus type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type ProductStatus struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
CancelStatus bool `json:"cancelStatus,omitempty"`
|
|
|
|
OrderStatusByProductStatus string `json:"orderStatusByProductStatus,omitempty"`
|
|
|
|
OrderStatusForProductStatus string `json:"orderStatusForProductStatus,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Status type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Status struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
|
|
|
Group string `json:"group,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// StatusGroup type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type StatusGroup struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
|
|
|
Process bool `json:"process,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
Statuses []string `json:"statuses,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Site type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Site struct {
|
2022-12-08 13:32:54 +03:00
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
URL string `json:"url,omitempty"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
Phones string `json:"phones,omitempty"`
|
|
|
|
Zip string `json:"zip,omitempty"`
|
|
|
|
Address string `json:"address,omitempty"`
|
|
|
|
CountryIso string `json:"countryIso,omitempty"`
|
|
|
|
YmlURL string `json:"ymlUrl,omitempty"`
|
|
|
|
LoadFromYml bool `json:"loadFromYml,omitempty"`
|
|
|
|
CatalogUpdatedAt string `json:"catalogUpdatedAt,omitempty"`
|
|
|
|
CatalogLoadingAt string `json:"catalogLoadingAt,omitempty"`
|
|
|
|
Contragent *LegalEntity `json:"contragent,omitempty"`
|
|
|
|
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
|
|
|
IsDemo bool `json:"isDemo,omitempty"`
|
2022-12-08 16:24:52 +03:00
|
|
|
CatalogID string `json:"catalogId,omitempty"`
|
2022-12-08 13:32:54 +03:00
|
|
|
IsCatalogMainSite bool `json:"isCatalogMainSite,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Store type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Store struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Description string `json:"description,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
XMLID string `json:"xmlId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Email string `json:"email,omitempty"`
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
InventoryType string `json:"inventoryType,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Phone *Phone `json:"phone,omitempty"`
|
|
|
|
Address *Address `json:"address,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// ProductGroup type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type ProductGroup struct {
|
2022-12-08 16:24:52 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ParentID int `json:"parentId,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Site string `json:"site,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
ParentExternalID string `json:"parentExternalId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2022-11-23 18:16:58 +03:00
|
|
|
// BaseProduct type.
|
|
|
|
type BaseProduct struct {
|
2022-11-24 13:37:21 +03:00
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
URL string `json:"url,omitempty"`
|
|
|
|
Article string `json:"article,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
Manufacturer string `json:"manufacturer,omitempty"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
Popular bool `json:"popular,omitempty"`
|
|
|
|
Stock bool `json:"stock,omitempty"`
|
|
|
|
Novelty bool `json:"novelty,omitempty"`
|
|
|
|
Recommended bool `json:"recommended,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Markable bool `json:"markable,omitempty"`
|
2022-11-23 18:16:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Product type.
|
|
|
|
type Product struct {
|
|
|
|
BaseProduct
|
2022-11-24 13:37:21 +03:00
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
MaxPrice float32 `json:"maxPrice,omitempty"`
|
|
|
|
MinPrice float32 `json:"minPrice,omitempty"`
|
|
|
|
ImageURL string `json:"imageUrl,omitempty"`
|
|
|
|
Quantity float32 `json:"quantity,omitempty"`
|
|
|
|
Offers []Offer `json:"offers,omitempty"`
|
|
|
|
Properties StringMap `json:"properties,omitempty"`
|
|
|
|
Groups []ProductGroup `json:"groups,omitempty"`
|
2022-11-23 18:16:58 +03:00
|
|
|
}
|
|
|
|
|
2022-11-24 13:37:21 +03:00
|
|
|
// ProductEditGroupInput type.
|
|
|
|
type ProductEditGroupInput struct {
|
|
|
|
ID int `json:"id"`
|
|
|
|
ExternalID int `json:"externalId,omitempty"`
|
2022-11-23 18:16:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// ProductCreate type.
|
|
|
|
type ProductCreate struct {
|
|
|
|
BaseProduct
|
2022-11-24 13:37:21 +03:00
|
|
|
Groups []ProductEditGroupInput `json:"groups,omitempty"`
|
|
|
|
CatalogID int `json:"catalogId,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ProductEdit type.
|
|
|
|
type ProductEdit struct {
|
|
|
|
BaseProduct
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
CatalogID int `json:"catalogId,omitempty"`
|
|
|
|
Site string `json:"site,omitempty"`
|
|
|
|
Groups []ProductEditGroupInput `json:"groups,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// DeliveryHistoryRecord type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type DeliveryHistoryRecord struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
UpdatedAt string `json:"updatedAt,omitempty"`
|
|
|
|
Comment string `json:"comment,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// DeliveryShipment type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type DeliveryShipment struct {
|
2021-10-27 17:18:50 +03:00
|
|
|
IntegrationCode string `json:"integrationCode,omitempty"`
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
DeliveryType string `json:"deliveryType,omitempty"`
|
|
|
|
Store string `json:"store,omitempty"`
|
|
|
|
ManagerID int `json:"managerId,omitempty"`
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
Date string `json:"date,omitempty"`
|
|
|
|
Time *DeliveryTime `json:"time,omitempty"`
|
|
|
|
LunchTime string `json:"lunchTime,omitempty"`
|
|
|
|
Comment string `json:"comment,omitempty"`
|
|
|
|
Orders []Order `json:"orders,omitempty"`
|
|
|
|
ExtraData StringMap `json:"extraData,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// IntegrationModule type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type IntegrationModule struct {
|
2021-10-27 17:18:50 +03:00
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
IntegrationCode string `json:"integrationCode,omitempty"`
|
2022-12-06 22:27:56 +03:00
|
|
|
Active *bool `json:"active,omitempty"`
|
2021-10-27 17:18:50 +03:00
|
|
|
Freeze bool `json:"freeze,omitempty"`
|
|
|
|
Native bool `json:"native,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Logo string `json:"logo,omitempty"`
|
|
|
|
ClientID string `json:"clientId,omitempty"`
|
|
|
|
BaseURL string `json:"baseUrl,omitempty"`
|
|
|
|
AccountURL string `json:"accountUrl,omitempty"`
|
|
|
|
AvailableCountries []string `json:"availableCountries,omitempty"`
|
|
|
|
Actions StringMap `json:"actions,omitempty"`
|
|
|
|
Integrations *Integrations `json:"integrations,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2022-04-01 17:22:53 +03:00
|
|
|
type ScopesRequired struct {
|
2022-04-13 17:32:26 +03:00
|
|
|
Scopes []string `json:"scopes"`
|
2022-04-01 17:22:53 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Integrations type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Integrations struct {
|
2018-05-10 16:45:56 +03:00
|
|
|
Telephony *Telephony `json:"telephony,omitempty"`
|
|
|
|
Delivery *Delivery `json:"delivery,omitempty"`
|
|
|
|
Store *Warehouse `json:"store,omitempty"`
|
|
|
|
MgTransport *MgTransport `json:"mgTransport,omitempty"`
|
2018-08-30 17:22:44 +03:00
|
|
|
MgBot *MgBot `json:"mgBot,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Delivery type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Delivery struct {
|
|
|
|
Description string `json:"description,omitempty"`
|
2021-10-27 17:18:50 +03:00
|
|
|
Actions StringMap `json:"actions,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
PayerType []string `json:"payerType,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
PlatePrintLimit int `json:"platePrintLimit,omitempty"`
|
|
|
|
RateDeliveryCost bool `json:"rateDeliveryCost,omitempty"`
|
|
|
|
AllowPackages bool `json:"allowPackages,omitempty"`
|
|
|
|
CodAvailable bool `json:"codAvailable,omitempty"`
|
|
|
|
SelfShipmentAvailable bool `json:"selfShipmentAvailable,omitempty"`
|
|
|
|
AllowTrackNumber bool `json:"allowTrackNumber,omitempty"`
|
|
|
|
AvailableCountries []string `json:"availableCountries,omitempty"`
|
|
|
|
RequiredFields []string `json:"requiredFields,omitempty"`
|
|
|
|
StatusList []DeliveryStatus `json:"statusList,omitempty"`
|
|
|
|
PlateList []Plate `json:"plateList,omitempty"`
|
|
|
|
DeliveryDataFieldList []DeliveryDataField `json:"deliveryDataFieldList,omitempty"`
|
|
|
|
ShipmentDataFieldList []DeliveryDataField `json:"shipmentDataFieldList,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// DeliveryStatus type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type DeliveryStatus struct {
|
2022-11-24 13:37:21 +03:00
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
IsEditable bool `json:"isEditable,omitempty"`
|
|
|
|
IsError bool `json:"isError,omitempty"`
|
|
|
|
IsPreprocessing bool `json:"isPreprocessing,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Plate type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Plate struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Label string `json:"label,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// DeliveryDataField type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type DeliveryDataField struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Label string `json:"label,omitempty"`
|
|
|
|
Hint string `json:"hint,omitempty"`
|
|
|
|
Type string `json:"type,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
AutocompleteURL string `json:"autocompleteUrl,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
Multiple bool `json:"multiple,omitempty"`
|
|
|
|
Required bool `json:"required,omitempty"`
|
|
|
|
AffectsCost bool `json:"affectsCost,omitempty"`
|
|
|
|
Editable bool `json:"editable,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Telephony type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Telephony struct {
|
2018-03-19 23:18:36 +03:00
|
|
|
MakeCallURL string `json:"makeCallUrl,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
AllowEdit bool `json:"allowEdit,omitempty"`
|
|
|
|
InputEventSupported bool `json:"inputEventSupported,omitempty"`
|
|
|
|
OutputEventSupported bool `json:"outputEventSupported,omitempty"`
|
|
|
|
HangupEventSupported bool `json:"hangupEventSupported,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
ChangeUserStatusURL string `json:"changeUserStatusUrl,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
AdditionalCodes []AdditionalCode `json:"additionalCodes,omitempty"`
|
|
|
|
ExternalPhones []ExternalPhone `json:"externalPhones,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// AdditionalCode type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type AdditionalCode struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
UserID string `json:"userId,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// ExternalPhone type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type ExternalPhone struct {
|
|
|
|
SiteCode string `json:"siteCode,omitempty"`
|
|
|
|
ExternalPhone string `json:"externalPhone,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Warehouse type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Warehouse struct {
|
2021-04-26 12:09:21 +03:00
|
|
|
Actions []Action `json:"actions,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Action type.
|
2018-02-27 11:37:15 +03:00
|
|
|
type Action struct {
|
|
|
|
Code string `json:"code,omitempty"`
|
2018-03-19 23:18:36 +03:00
|
|
|
URL string `json:"url,omitempty"`
|
2018-02-27 11:37:15 +03:00
|
|
|
CallPoints []string `json:"callPoints,omitempty"`
|
|
|
|
}
|
2018-04-11 13:39:43 +03:00
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// MgTransport type.
|
2018-05-10 16:45:56 +03:00
|
|
|
type MgTransport struct {
|
2021-10-27 15:49:06 +03:00
|
|
|
WebhookURL string `json:"webhookUrl,omitempty"`
|
2018-05-10 16:45:56 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// MgBot type.
|
2018-08-30 17:22:44 +03:00
|
|
|
type MgBot struct{}
|
|
|
|
|
2018-04-11 13:39:43 +03:00
|
|
|
/**
|
|
|
|
Cost related types
|
|
|
|
*/
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// CostRecord type.
|
2018-04-11 13:39:43 +03:00
|
|
|
type CostRecord struct {
|
|
|
|
Source *Source `json:"source,omitempty"`
|
|
|
|
Comment string `json:"comment,omitempty"`
|
|
|
|
DateFrom string `json:"dateFrom,omitempty"`
|
|
|
|
DateTo string `json:"dateTo,omitempty"`
|
|
|
|
Summ float32 `json:"summ,omitempty"`
|
|
|
|
CostItem string `json:"costItem,omitempty"`
|
2021-10-27 15:49:06 +03:00
|
|
|
UserID int `json:"userId,omitempty"`
|
2018-04-11 13:39:43 +03:00
|
|
|
Order *Order `json:"order,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
Sites []string `json:"sites,omitempty"`
|
2018-04-11 13:39:43 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Cost type.
|
2018-04-11 13:39:43 +03:00
|
|
|
type Cost struct {
|
|
|
|
Source *Source `json:"source,omitempty"`
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
DateFrom string `json:"dateFrom,omitempty"`
|
|
|
|
DateTo string `json:"dateTo,omitempty"`
|
|
|
|
Summ float32 `json:"summ,omitempty"`
|
|
|
|
CostItem string `json:"costItem,omitempty"`
|
|
|
|
Comment string `json:"comment,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
CreatedBy string `json:"createdBy,omitempty"`
|
|
|
|
Order *Order `json:"order,omitempty"`
|
2021-10-27 15:49:06 +03:00
|
|
|
UserID int `json:"userId,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
Sites []string `json:"sites,omitempty"`
|
2018-04-11 13:39:43 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// File type.
|
2019-09-04 11:38:21 +03:00
|
|
|
type File struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
Filename string `json:"filename,omitempty"`
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Size int `json:"size,omitempty"`
|
|
|
|
Attachment []Attachment `json:"attachment,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Attachment type.
|
2019-09-04 11:38:21 +03:00
|
|
|
type Attachment struct {
|
|
|
|
Customer *Customer `json:"customer,omitempty"`
|
|
|
|
Order *Order `json:"order,omitempty"`
|
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// CustomFields type.
|
2018-04-11 13:39:43 +03:00
|
|
|
type CustomFields struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Required bool `json:"required,omitempty"`
|
|
|
|
InFilter bool `json:"inFilter,omitempty"`
|
|
|
|
InList bool `json:"inList,omitempty"`
|
|
|
|
InGroupActions bool `json:"inGroupActions,omitempty"`
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
Entity string `json:"entity,omitempty"`
|
|
|
|
Default string `json:"default,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
|
|
|
DisplayArea string `json:"displayArea,omitempty"`
|
|
|
|
ViewMode string `json:"viewMode,omitempty"`
|
|
|
|
Dictionary string `json:"dictionary,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-09-28 13:46:09 +03:00
|
|
|
CustomDictionaries related types
|
2018-04-11 13:39:43 +03:00
|
|
|
*/
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// CustomDictionary type.
|
2018-04-11 13:39:43 +03:00
|
|
|
type CustomDictionary struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
2021-04-26 12:09:21 +03:00
|
|
|
Elements []Element `json:"elements,omitempty"`
|
2018-04-11 13:39:43 +03:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Element type.
|
2018-04-11 13:39:43 +03:00
|
|
|
type Element struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Code string `json:"code,omitempty"`
|
|
|
|
Ordering int `json:"ordering,omitempty"`
|
|
|
|
}
|
2018-06-01 17:57:46 +03:00
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Activity struct.
|
2018-06-01 17:57:46 +03:00
|
|
|
type Activity struct {
|
|
|
|
Active bool `json:"active"`
|
|
|
|
Freeze bool `json:"freeze"`
|
|
|
|
}
|
2020-08-04 13:09:42 +03:00
|
|
|
|
2021-04-26 12:09:21 +03:00
|
|
|
// Tag struct.
|
2020-08-04 13:09:42 +03:00
|
|
|
type Tag struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Color string `json:"color,omitempty"`
|
|
|
|
Attached bool `json:"attached,omitempty"`
|
|
|
|
}
|
2022-08-09 13:45:11 +03:00
|
|
|
|
|
|
|
// BonusOperation struct.
|
|
|
|
type BonusOperation struct {
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
Amount float32 `json:"amount,omitempty"`
|
|
|
|
Order OperationOrder `json:"order"`
|
|
|
|
Bonus OperationBonus `json:"bonus"`
|
|
|
|
Event OperationEvent `json:"event"`
|
|
|
|
LoyaltyAccount OperationLoyaltyAccount `json:"loyaltyAccount"`
|
|
|
|
Loyalty OperationLoyalty `json:"loyalty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// OperationOrder struct.
|
|
|
|
type OperationOrder struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// OperationBonus struct.
|
|
|
|
type OperationBonus struct {
|
|
|
|
ActivationDate string `json:"activationDate,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// OperationEvent struct.
|
|
|
|
type OperationEvent struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// OperationLoyaltyAccount struct.
|
|
|
|
type OperationLoyaltyAccount struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// OperationLoyalty struct.
|
|
|
|
type OperationLoyalty struct {
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
}
|
2022-08-09 15:27:01 +03:00
|
|
|
|
|
|
|
// CursorPagination type.
|
|
|
|
type CursorPagination struct {
|
|
|
|
NextCursor string `json:"nextCursor,omitempty"`
|
|
|
|
}
|
2022-11-24 13:37:21 +03:00
|
|
|
|
|
|
|
// DeliveryTypeInfo type.
|
|
|
|
type DeliveryTypeInfo struct {
|
|
|
|
ID int `json:"id"`
|
|
|
|
Code string `json:"code"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// LoyaltyAccount type.
|
|
|
|
type LoyaltyAccount struct {
|
|
|
|
Active bool `json:"active"`
|
|
|
|
ID int `json:"id"`
|
|
|
|
PhoneNumber string `json:"phoneNumber,omitempty"`
|
|
|
|
CardNumber string `json:"cardNumber,omitempty"`
|
|
|
|
Amount float64 `json:"amount,omitempty"`
|
2022-12-07 17:40:52 +03:00
|
|
|
LoyaltyLevel LoyaltyLevel `json:"level,omitempty"`
|
2022-11-24 13:37:21 +03:00
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
ActivatedAt string `json:"activatedAt,omitempty"`
|
|
|
|
ConfirmedPhoneAt string `json:"confirmedPhoneAt,omitempty"`
|
|
|
|
LastCheckID int `json:"lastCheckId,omitempty"`
|
|
|
|
CustomFields []string `json:"customFields,omitempty"`
|
|
|
|
Loyalty Loyalty `json:"loyalty,omitempty"`
|
|
|
|
Customer Customer `json:"customer,omitempty"`
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
OrderSum float64 `json:"orderSum,omitempty"`
|
|
|
|
NextLevelSum float64 `json:"nextLevelSum,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Loyalty type.
|
|
|
|
type Loyalty struct {
|
2022-12-08 13:32:54 +03:00
|
|
|
ID int `json:"id"`
|
|
|
|
LoyaltyLevels []LoyaltyLevel `json:"levels,omitempty"`
|
|
|
|
Active bool `json:"active,omitempty"`
|
|
|
|
Blocked bool `json:"blocked,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
ConfirmSmsCharge bool `json:"confirmSmsCharge,omitempty"`
|
|
|
|
ConfirmSmsRegistration bool `json:"confirmSmsRegistration,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
|
|
ActivatedAt string `json:"activatedAt,omitempty"`
|
|
|
|
DeactivatedAt string `json:"deactivatedAt,omitempty"`
|
|
|
|
BlockedAt string `json:"blockedAt,omitempty"`
|
2022-11-24 13:37:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// LoyaltyLevel type.
|
|
|
|
type LoyaltyLevel struct {
|
|
|
|
ID int `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
Sum float64 `json:"sum,omitempty"`
|
|
|
|
PrivilegeSize float64 `json:"privilegeSize,omitempty"`
|
|
|
|
PrivilegeSizePromo float64 `json:"privilegeSizePromo,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SmsVerification struct {
|
|
|
|
CreatedAt string `json:"createdAt"`
|
|
|
|
ExpiredAt string `json:"expiredAt"`
|
|
|
|
VerifiedAt string `json:"verifiedAt"`
|
|
|
|
CheckID string `json:"checkId"`
|
|
|
|
ActionType string `json:"actionType"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type LoyaltyBonus struct {
|
2022-12-08 13:32:54 +03:00
|
|
|
Amount float32 `json:"amount"`
|
2022-11-24 13:37:21 +03:00
|
|
|
ActivationDate string `json:"activationDate"`
|
|
|
|
ExpiredDate string `json:"expiredDate,omitempty"`
|
|
|
|
}
|
|
|
|
|
2022-12-07 17:40:52 +03:00
|
|
|
type BonusDetail struct {
|
|
|
|
Date string `json:"date"`
|
2022-12-08 13:32:54 +03:00
|
|
|
Amount float32 `json:"amount"`
|
2022-12-07 17:40:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type SerializedLoyaltyOrder struct {
|
2022-12-08 13:32:54 +03:00
|
|
|
BonusesCreditTotal float32 `json:"bonusesCreditTotal,omitempty"`
|
|
|
|
BonusesChargeTotal float32 `json:"bonusesChargeTotal,omitempty"`
|
2022-12-07 17:40:52 +03:00
|
|
|
PrivilegeType string `json:"privilegeType,omitempty"`
|
|
|
|
TotalSumm float64 `json:"totalSumm,omitempty"`
|
2022-12-08 13:32:54 +03:00
|
|
|
PersonalDiscountPercent float32 `json:"personalDiscountPercent,omitempty"`
|
2022-12-07 17:40:52 +03:00
|
|
|
LoyaltyAccount LoyaltyAccount `json:"loyaltyAccount"`
|
|
|
|
LoyaltyEventDiscount LoyaltyEventDiscount `json:"loyaltyEventDiscount,omitempty"`
|
|
|
|
Customer Customer `json:"customer"`
|
|
|
|
Delivery Delivery `json:"delivery,omitempty"`
|
|
|
|
Site string `json:"site,omitempty"`
|
2022-12-08 13:32:54 +03:00
|
|
|
Items []LoyaltyItems `json:"items,omitempty"`
|
2022-12-07 17:40:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type LoyaltyEventDiscount struct {
|
|
|
|
ID int `json:"id"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type LoyaltyItems struct {
|
2022-12-08 13:32:54 +03:00
|
|
|
BonusesChargeTotal float32 `json:"bonusesChargeTotal,omitempty"`
|
|
|
|
BonusesCreditTotal float32 `json:"bonusesCreditTotal,omitempty"`
|
|
|
|
ID int `json:"id,omitempty"`
|
|
|
|
ExternalIds []CodeValueModel `json:"externalIds,omitempty"`
|
|
|
|
PriceType PriceType `json:"priceType,omitempty"`
|
|
|
|
InitialPrice float32 `json:"initialPrice,omitempty"`
|
|
|
|
Discounts []AbstractDiscount `json:"discounts,omitempty"`
|
|
|
|
Prices []OrderProductPriceItem `json:"prices,omitempty"`
|
|
|
|
VatRate string `json:"vatRate,omitempty"`
|
|
|
|
CreatedAt string `json:"createdAt"`
|
|
|
|
Quantity float32 `json:"quantity"`
|
|
|
|
Offer Offer `json:"offer,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type CodeValueModel struct {
|
|
|
|
Code string `json:"code"`
|
|
|
|
Value string `json:"value,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type AbstractDiscount struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Amount float32 `json:"amount"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type OrderProductPriceItem struct {
|
|
|
|
Price float64 `json:"price"`
|
|
|
|
Quantity float32 `json:"quantity"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type LoyaltyCalculation struct {
|
|
|
|
PrivilegeType string `json:"privilegeType"`
|
|
|
|
Discount float32 `json:"discount"`
|
|
|
|
CreditBonuses float32 `json:"creditBonuses"`
|
|
|
|
LoyaltyEventDiscount LoyaltyEventDiscount `json:"loyaltyEventDiscount,omitempty"`
|
|
|
|
MaxChargeBonuses float32 `json:"maxChargeBonuses,omitempty"`
|
|
|
|
Maximum *bool `json:"maximum,omitempty"`
|
|
|
|
Loyalty SerializedLoyalty `json:"loyalty,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SerializedLoyalty struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
ChargeRate float32 `json:"chargeRate"`
|
2022-12-07 17:40:52 +03:00
|
|
|
}
|
2022-12-09 11:38:21 +03:00
|
|
|
|
|
|
|
type ExternalID struct {
|
|
|
|
ExternalID string `json:"externalId,omitempty"`
|
|
|
|
}
|
2022-12-29 16:17:29 +03:00
|
|
|
|
|
|
|
type UserGroupType string
|
|
|
|
type NotificationType string
|