From c3b6f94fed946096257c6e7a7bb8e3a6cee8d5b8 Mon Sep 17 00:00:00 2001 From: Mikhail Kiselev Date: Sun, 8 Feb 2026 05:31:11 +0300 Subject: [PATCH] fix: add tsType tags for time.Time fields --- internal/models/models.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/models/models.go b/internal/models/models.go index 2dcf5c3..ffbfe20 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -11,8 +11,8 @@ type Participant struct { TimeLimit int `json:"timeLimit" gorm:"default:120"` // seconds Order int `json:"order" gorm:"default:0"` Active bool `json:"active" gorm:"default:true"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` + CreatedAt time.Time `json:"createdAt" tsType:"string"` + UpdatedAt time.Time `json:"updatedAt" tsType:"string"` } type Meeting struct { @@ -20,15 +20,15 @@ type Meeting struct { Name string `json:"name" gorm:"not null;default:Daily Standup"` TimeLimit int `json:"timeLimit" gorm:"default:3600"` // total meeting limit in seconds (1 hour) Sessions []MeetingSession `json:"sessions,omitempty" gorm:"foreignKey:MeetingID"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` + CreatedAt time.Time `json:"createdAt" tsType:"string"` + UpdatedAt time.Time `json:"updatedAt" tsType:"string"` } type MeetingSession struct { ID uint `json:"id" gorm:"primaryKey"` MeetingID uint `json:"meetingId" gorm:"not null"` - StartedAt time.Time `json:"startedAt"` - EndedAt *time.Time `json:"endedAt,omitempty"` + StartedAt time.Time `json:"startedAt" tsType:"string"` + EndedAt *time.Time `json:"endedAt,omitempty" tsType:"string"` TotalDuration int `json:"totalDuration"` // seconds Completed bool `json:"completed" gorm:"default:false"` ParticipantLogs []ParticipantLog `json:"participantLogs,omitempty" gorm:"foreignKey:SessionID"` @@ -40,8 +40,8 @@ type ParticipantLog struct { SessionID uint `json:"sessionId" gorm:"not null"` ParticipantID uint `json:"participantId" gorm:"not null"` Participant Participant `json:"participant,omitempty" gorm:"foreignKey:ParticipantID"` - StartedAt time.Time `json:"startedAt"` - EndedAt *time.Time `json:"endedAt,omitempty"` + StartedAt time.Time `json:"startedAt" tsType:"string"` + EndedAt *time.Time `json:"endedAt,omitempty" tsType:"string"` Duration int `json:"duration"` // seconds Skipped bool `json:"skipped" gorm:"default:false"` Overtime bool `json:"overtime" gorm:"default:false"`