add new type for add tags to rule

This commit is contained in:
Pavel 2024-06-08 15:59:56 +03:00
parent da2584a374
commit 1a7fcd8df0
4 changed files with 15 additions and 0 deletions

@ -0,0 +1,2 @@
ALTER TABLE rules
DROP COLUMN IF EXISTS TagsToAdd;

@ -0,0 +1,2 @@
ALTER TABLE rules
ADD COLUMN TagsToAdd JSONB DEFAULT '{}';

@ -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"`

@ -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