Documentation
¶
Index ¶
- Variables
- func GetAllModels() []any
- type Activity
- type ActivityType
- type Answer
- type Camp
- type Event
- type EventType
- type Image
- type Message
- type Option
- type Payment
- type Question
- type QuestionGroup
- type QuestionType
- type RollCall
- type RollCallReaction
- type Room
- type RoomGroup
- type RoomStatus
- type RoomStatusLog
- type User
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Activity ¶ added in v1.1.0
type Activity struct {
gorm.Model
Type ActivityType `gorm:"size:50;not null;"`
CampID uint `gorm:"not null"`
Camp *Camp `gorm:"foreignKey:CampID;references:ID;constraint:OnDelete:CASCADE"`
UserID *string `gorm:"size:32"` // payment_* のみ使用
User *User `gorm:"foreignKey:UserID;references:ID"`
ReferenceID uint `gorm:"not null"` // RoomID / PaymentID / RollCallID / QuestionGroupID
Amount *int // payment_* のみ使用
}
type ActivityType ¶ added in v1.1.0
type ActivityType string
const ( ActivityTypeRoomCreated ActivityType = "room_created" ActivityTypePaymentCreated ActivityType = "payment_created" ActivityTypePaymentAmountChanged ActivityType = "payment_amount_changed" ActivityTypePaymentPaidChanged ActivityType = "payment_paid_changed" ActivityTypeRollCallCreated ActivityType = "roll_call_created" ActivityTypeQuestionCreated ActivityType = "question_created" )
type Answer ¶
type Answer struct {
gorm.Model
QuestionID uint `gorm:"uniqueIndex:idx_question_id_user_id"`
UserID string `gorm:"uniqueIndex:idx_question_id_user_id"`
Type QuestionType `gorm:"type:enum('free_text', 'free_number', 'single', 'multiple')"`
FreeTextContent *string
FreeNumberContent *float64
SelectedOptions []Option `gorm:"many2many:answer_options;ForeignKey:id;References:id"`
}
type Camp ¶
type Camp struct {
gorm.Model
DisplayID string
Name string
Guidebook string
IsDraft bool
IsPaymentOpen bool
IsRegistrationOpen bool
DateStart time.Time
DateEnd time.Time
Participants []User `gorm:"many2many:camp_participants;"`
Payments []Payment
Events []Event
QuestionGroups []QuestionGroup
RollCalls []RollCall
RoomGroups []RoomGroup
Images []Image
}
type QuestionGroup ¶
type QuestionType ¶
type QuestionType string
const ( FreeTextQuestion QuestionType = "free_text" FreeNumberQuestion QuestionType = "free_number" SingleChoiceQuestion QuestionType = "single" MultipleChoiceQuestion QuestionType = "multiple" )
type RollCallReaction ¶
type RoomStatus ¶ added in v1.1.0
type RoomStatusLog ¶ added in v1.1.0
type RoomStatusLog struct {
gorm.Model
RoomID uint `gorm:"not null"`
Room *Room `gorm:"foreignKey:RoomID;references:ID;constraint:OnDelete:CASCADE"`
Type *string `gorm:"size:8"`
Topic string `gorm:"not null;size:64"`
OperatorID string `gorm:"not null;size:32"`
Operator *User `gorm:"foreignKey:OperatorID;references:ID;constraint:OnDelete:RESTRICT"`
}
type User ¶
type User struct {
ID string `gorm:"primaryKey;size:32"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
IsStaff bool `gorm:"index"`
Answers []Answer
Payments []Payment
OrganizedEvents []Event `gorm:"foreignKey:OrganizerID"`
TargetMessages []Message `gorm:"foreignKey:TargetUserID"`
}
Click to show internal directories.
Click to hide internal directories.