Skip to content

Commit

Permalink
Generate fields for custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
hansmi committed Dec 17, 2023
1 parent 1cdc241 commit eced992
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/client/customfield.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import (
"context"
)

type CustomField struct {
ID int64 `json:"id"`
Name string `json:"name"`
DataType string `json:"data_type"`
}

func (c *Client) customFieldCrudOpts() crudOptions {
return crudOptions{
base: "api/custom_fields/",
Expand Down
10 changes: 10 additions & 0 deletions pkg/client/generate_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ var correspondentModel = model{
},
}

var customFieldModel = model{
name: "customField",
fields: []modelField{
{name: "id", typ: "int64", readOnly: true},
{name: "name", typ: "string"},
{name: "data_type", typ: "string"},
},
}

var storagePathModel = model{
name: "storagePath",
fields: []modelField{
Expand Down Expand Up @@ -157,6 +166,7 @@ func main() {

models := []model{
correspondentModel,
customFieldModel,
documentTypeModel,
storagePathModel,
tagModel,
Expand Down
26 changes: 26 additions & 0 deletions pkg/client/models_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eced992

Please sign in to comment.