diff --git a/crm/docs/src/spec.json b/crm/docs/src/spec.json index 2f2409747..c8e2ebe2a 100644 --- a/crm/docs/src/spec.json +++ b/crm/docs/src/spec.json @@ -10,8 +10,9 @@ { "name": "Field", "fields": [ - { "name": "Name", "type": "string", "tag": "json:\"name\"" }, - { "name": "Type", "type": "string", "tag": "json:\"type\"" } + { "name": "Name", "type": "string", "db": "field_name" }, + { "name": "Type", "type": "string", "db": "field_type" }, + { "name": "Template", "type": "string", "db": "field_template", "omitempty": true } ] } ], diff --git a/crm/docs/src/spec/field.json b/crm/docs/src/spec/field.json index 632a2e6b5..916caeff6 100644 --- a/crm/docs/src/spec/field.json +++ b/crm/docs/src/spec/field.json @@ -7,13 +7,19 @@ { "fields": [ { + "db": "field_name", "name": "Name", - "tag": "json:\"name\"", "type": "string" }, { + "db": "field_type", "name": "Type", - "tag": "json:\"type\"", + "type": "string" + }, + { + "db": "field_template", + "name": "Template", + "omitempty": true, "type": "string" } ], diff --git a/crm/types/field.go b/crm/types/field.go index 5d1774b62..6d5bc0cb0 100644 --- a/crm/types/field.go +++ b/crm/types/field.go @@ -5,7 +5,8 @@ package types type ( // Fields - CRM input field definitions Field struct { - Name string `json:"name" db:"name"` - Type string `json:"type" db:"type"` + Name string `json:"field_name" db:"field_name"` + Type string `json:"field_type" db:"field_type"` + Template string `json:"field_template,omitempty" db:"field_template"` } ) diff --git a/crm/types/module.go b/crm/types/module.go index f46f04731..91e8d5659 100644 --- a/crm/types/module.go +++ b/crm/types/module.go @@ -9,15 +9,15 @@ import ( type ( // Modules - CRM module definitions Module struct { - ID uint64 `db:"id"` - Name string `db:"name"` - Fields types.JSONText `db:"json"` + ID uint64 `json:"id" db:"id"` + Name string `json:"name" db:"name"` + Fields types.JSONText `json:"json" db:"json"` } // Modules - CRM module definitions Content struct { - ID uint64 `db:"id"` - ModuleID uint64 `db:"module_id"` - Fields types.JSONText `db:"json"` + ID uint64 `json:"id" db:"id"` + ModuleID uint64 `json:"module_id" db:"module_id"` + Fields types.JSONText `json:"json" db:"json"` } )