diff --git a/dal/schema/000013_init.down.sql b/dal/schema/000013_init.down.sql new file mode 100644 index 0000000..6e8b352 --- /dev/null +++ b/dal/schema/000013_init.down.sql @@ -0,0 +1,2 @@ +ALTER TABLE rules +DROP COLUMN IF EXISTS TagsToAdd; \ No newline at end of file diff --git a/dal/schema/000013_init.up.sql b/dal/schema/000013_init.up.sql new file mode 100644 index 0000000..c748bd9 --- /dev/null +++ b/dal/schema/000013_init.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE rules +ADD COLUMN TagsToAdd JSONB DEFAULT '{}'; \ No newline at end of file diff --git a/model/amo.go b/model/amo.go index 34c4bb2..75e74ec 100644 --- a/model/amo.go +++ b/model/amo.go @@ -144,12 +144,21 @@ type Rule struct { //Utms []int32 `json:"UTMs"` /* - правила заполнения полей сущностей в амо*/ Fieldsrule Fieldsrule `json:"FieldsRule"` + // теги добавляемые к сделке + TagsToAdd TagsToAdd `json:"TagsToAdd"` /* - флаг мягкого удаления*/ Deleted bool `json:"Deleted"` /* - таймштамп создания воронки в нашей системе*/ Createdat int64 `json:"CreatedAt"` } +type TagsToAdd struct { + Lead []int64 `json:"Lead"` + Contact []int64 `json:"Contact"` + Company []int64 `json:"Company"` + Customer []int64 `json:"Customer"` +} + type Fieldsrule struct { Lead []FieldRule `json:"Lead"` Contact ContactRules `json:"Contact"` diff --git a/sqlc.yaml b/sqlc.yaml index 665bef1..9658197 100644 --- a/sqlc.yaml +++ b/sqlc.yaml @@ -28,6 +28,8 @@ packages: - "./dal/schema/000011_init.down.sql" - "./dal/schema/000012_init.up.sql" - "./dal/schema/000012_init.down.sql" + - "./dal/schema/000013_init.up.sql" + - "./dal/schema/000013_init.down.sql" engine: "postgresql" emit_json_tags: true emit_db_tags: true