diff --git a/dal/schema/000028_init.up.sql b/dal/schema/000028_init.up.sql index 506906a..ada6806 100644 --- a/dal/schema/000028_init.up.sql +++ b/dal/schema/000028_init.up.sql @@ -134,7 +134,7 @@ CREATE TABLE IF NOT EXISTS YclientsRules ( CREATE TABLE IF NOT EXISTS YclientsFields ( ID BIGSERIAL UNIQUE NOT NULL PRIMARY KEY, - BitrixID VARCHAR(255) NOT NULL, -- Айдишник field в битриксе + YclientsID INT NOT NULL, -- Айдишник field в Yclients SalonID INT NOT NULL, -- ID компании FieldType CustomFieldsTypeYclients NOT NULL, -- тип поля Code text NOT NULL, diff --git a/dal/sqlcgen/models.go b/dal/sqlcgen/models.go index 03370a9..242846e 100644 --- a/dal/sqlcgen/models.go +++ b/dal/sqlcgen/models.go @@ -426,6 +426,19 @@ type Yclientsaccountuser struct { Createdat time.Time `db:"createdat" json:"createdat"` } +type Yclientsfield struct { + ID int64 `db:"id" json:"id"` + Yclientsid int32 `db:"yclientsid" json:"yclientsid"` + Salonid int32 `db:"salonid" json:"salonid"` + Fieldtype interface{} `db:"fieldtype" json:"fieldtype"` + Code string `db:"code" json:"code"` + Title string `db:"title" json:"title"` + Showinui bool `db:"showinui" json:"showinui"` + Usercanedit bool `db:"usercanedit" json:"usercanedit"` + Deleted bool `db:"deleted" json:"deleted"` + Createdat time.Time `db:"createdat" json:"createdat"` +} + type Yclientsrule struct { ID int64 `db:"id" json:"id"` Salonid int32 `db:"salonid" json:"salonid"` diff --git a/model/yclients.go b/model/yclients.go index 91f7ab1..acf4757 100644 --- a/model/yclients.go +++ b/model/yclients.go @@ -149,16 +149,6 @@ type ServiceYclientsRule struct { Cost int `json:"cost"` } -type YclientsCustomFields struct { - MyCustomField int `json:"my_custom_field"` - SomeAnotherField []string `json:"some_another_field"` -} - -type YclientsClientAgreements struct { - IsNewsletterAllowed bool `json:"is_newsletter_allowed"` - IsPersonalDataProcessingAllowed bool `json:"is_personal_data_processing_allowed"` -} - type YclientsCustomFieldsType string const ( @@ -168,3 +158,16 @@ const ( TypeYclientsDate YclientsCustomFieldsType = "date" // Дата (Y-m-d) TypeYclientsDateTime YclientsCustomFieldsType = "datetime" // Дата и время (Y-m-d H:i:s) ) + +type YclientsField struct { + ID int64 `json:"id"` + YclientsID int32 `json:"yclientsID"` + SalonID int32 `json:"salonID"` + FieldType YclientsCustomFieldsType `json:"field_type"` + Code string `json:"code"` + Title string `json:"title"` + ShowINUI bool `json:"show_in_ui"` + UserCanEdit bool `json:"user_can_edit"` + Deleted bool `json:"deleted"` + CreatedAt time.Time `json:"createdAt"` +}