package org import ( "errors" "time" ) // Typed errors var ( ErrOrgNotFound = errors.New("organization not found") ErrOrgNameTaken = errors.New("organization name is taken") ) type Org struct { ID int64 `xorm:"pk autoincr 'id'"` Version int Name string Address1 string Address2 string City string ZipCode string State string Country string Created time.Time Updated time.Time } type OrgUser struct { ID int64 `xorm:"pk autoincr 'id'"` OrgID int64 `xorm:"org_id"` UserID int64 `xorm:"user_id"` Role RoleType Created time.Time Updated time.Time } // swagger:enum RoleType type RoleType string const ( ROLE_VIEWER RoleType = "Viewer" ROLE_EDITOR RoleType = "Editor" ROLE_ADMIN RoleType = "Admin" ) type CreateOrgCommand struct { Name string `json:"name" binding:"Required"` // initial admin user for account UserID int64 `json:"-"` } type GetOrgIDForNewUserCommand struct { Email string Login string OrgID int64 OrgName string SkipOrgSetup bool }