70 lines
2.6 KiB
Go
70 lines
2.6 KiB
Go
package viewmodel
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type OrganizationType struct {
|
|
ID int64 `json:"-"`
|
|
Name string `json:"name"`
|
|
Key string `json:"key"`
|
|
Description string `json:"desc,omitempty"`
|
|
Created time.Time `json:"-"`
|
|
Updated time.Time `json:"-"`
|
|
}
|
|
|
|
type Organization struct {
|
|
ID int64 `json:"-"`
|
|
UUID string `json:"id"`
|
|
Type OrganizationType `json:"type"`
|
|
Name string `json:"name"`
|
|
Description string `json:"desc,omitempty"`
|
|
ReferenceID int64 `json:"-"`
|
|
ParentID int64 `json:"-"`
|
|
Main bool `json:"main"`
|
|
Created time.Time `json:"created"`
|
|
Updated time.Time `json:"updated"`
|
|
Active bool `json:"active"`
|
|
Blocked bool `json:"blocked"`
|
|
Suspended bool `json:"suspended"`
|
|
Author User `json:"author"`
|
|
LastEditor User `json:"last_editor"`
|
|
Contacts []OrganizationContact `json:"contacts"`
|
|
Addresses []OrganizationAddress `json:"addresses"`
|
|
ChildOrgs []Organization `json:"childs,omitempty"`
|
|
Parent *Organization `json:"parent,omitempty"`
|
|
Reference interface{} `json:"reference,omitempty"`
|
|
}
|
|
|
|
type OrganizationContact struct {
|
|
ID int64 `json:"-"`
|
|
UUID string `json:"id"`
|
|
Organization *Organization `json:"organization,omitempty"`
|
|
Type ContactType `json:"type"`
|
|
Contact string `json:"contact"`
|
|
Name string `json:"name"`
|
|
Description string `json:"desc"`
|
|
Created time.Time `json:"created"`
|
|
CreatedUser User `json:"author"`
|
|
Updated time.Time `json:"updated"`
|
|
UpdatedUser User `json:"last_editor"`
|
|
Active bool `json:"active"`
|
|
}
|
|
|
|
type OrganizationAddress struct {
|
|
ID int64 `json:"-"`
|
|
UUID string `json:"id"`
|
|
Organization *Organization `json:"organization,omitempty"`
|
|
InternalID string `json:"internal_id"`
|
|
Name string `json:"name"`
|
|
Address string `json:"address"`
|
|
Description string `json:"desc"`
|
|
Latitude float64 `json:"lat"`
|
|
Longitude float64 `json:"long"`
|
|
Created time.Time `json:"created"`
|
|
CreatedUser User `json:"author"`
|
|
Updated time.Time `json:"updated"`
|
|
UpdatedUser User `json:"last_editor"`
|
|
Active bool `json:"active"`
|
|
}
|