Organizations
Organization model in ClueQuest Go SDK
Schema
Field | Type | Description | Extra Info |
---|---|---|---|
ID | uuid.UUID | Unique identifier for the organization. | Primary Key |
Name | string | Name of the organization. | unique , not null |
DisplayName | string | Display name of the organization. | not null |
CreatedBy | uuid.UUID | Identifier of the user who created the organization. | Relation to User model |
CreatedAt | time.Time | Timestamp of when the organization was created. | Set automatically to current time at creation |
UpdatedAt | time.Time | Timestamp of the last update to the organization. | Set automatically to current time at update |
DeletedAt | gorm.DeletedAt | Timestamp of when the organization was deleted (if applicable). | It is needed for soft deletion. |
Model
type Organization struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:uuid_generate_v4()" json:"id"`
Name string `gorm:"unique;not null" json:"name"`
DisplayName string `gorm:"not null" json:"display_name"`
CreatedBy uuid.UUID `gorm:"type:uuid;" json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Creator User `gorm:"foreignKey:CreatedBy" json:"creator,omitempty"`
}
Relationships
Creator
: Many-to-one relationship with the User model. An organization is created by a single user.