25 lines
853 B
Go
25 lines
853 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Announcement represents a global announcement (v0.803 ADM1-04)
|
|
type Announcement struct {
|
|
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"`
|
|
Title string `gorm:"size:200;not null" json:"title"`
|
|
Content string `gorm:"type:text;not null" json:"content"`
|
|
Type string `gorm:"size:20;not null;default:info" json:"type"`
|
|
IsActive bool `gorm:"not null;default:true" json:"is_active"`
|
|
StartsAt time.Time `gorm:"not null" json:"starts_at"`
|
|
EndsAt *time.Time `json:"ends_at,omitempty"`
|
|
CreatedBy *uuid.UUID `gorm:"type:uuid" json:"created_by,omitempty"`
|
|
CreatedAt time.Time `gorm:"not null" json:"created_at"`
|
|
}
|
|
|
|
// TableName returns the table name
|
|
func (Announcement) TableName() string {
|
|
return "announcements"
|
|
}
|