2024-06-30 21:41:41 -04:00
|
|
|
package circle
|
|
|
|
|
2024-12-14 02:15:51 -05:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
nModel "donetick.com/core/internal/notifier/model"
|
|
|
|
)
|
2024-06-30 21:41:41 -04:00
|
|
|
|
|
|
|
type Circle struct {
|
|
|
|
ID int `json:"id" gorm:"primary_key"` // Unique identifier
|
|
|
|
Name string `json:"name" gorm:"column:name"` // Full name
|
|
|
|
CreatedBy int `json:"created_by" gorm:"column:created_by"` // Created by
|
|
|
|
CreatedAt time.Time `json:"created_at" gorm:"column:created_at"` // Created at
|
|
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` // Updated at
|
|
|
|
InviteCode string `json:"invite_code" gorm:"column:invite_code"` // Invite code
|
|
|
|
Disabled bool `json:"disabled" gorm:"column:disabled"` // Disabled
|
2025-02-09 20:15:28 -05:00
|
|
|
WebhookURL *string `json:"-" gorm:"column:webhook_url"` // Webhook URL
|
2024-06-30 21:41:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type CircleDetail struct {
|
|
|
|
Circle
|
|
|
|
UserRole string `json:"userRole" gorm:"column:role"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserCircle struct {
|
2024-12-31 02:19:02 -05:00
|
|
|
ID int `json:"id" gorm:"primary_key"` // Unique identifier
|
|
|
|
UserID int `json:"userId" gorm:"column:user_id"` // User ID
|
|
|
|
CircleID int `json:"circleId" gorm:"column:circle_id"` // Circle ID
|
|
|
|
Role string `json:"role" gorm:"column:role"` // Role
|
|
|
|
IsActive bool `json:"isActive" gorm:"column:is_active;default:false"`
|
|
|
|
CreatedAt time.Time `json:"createdAt" gorm:"column:created_at"` // Created at
|
|
|
|
UpdatedAt time.Time `json:"updatedAt" gorm:"column:updated_at"` // Updated at
|
|
|
|
Points int `json:"points" gorm:"column:points;default:0;not null"` // Points
|
|
|
|
PointsRedeemed int `json:"pointsRedeemed" gorm:"column:points_redeemed;default:0;not null"` // Points Redeemed
|
2024-06-30 21:41:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type UserCircleDetail struct {
|
|
|
|
UserCircle
|
2025-02-09 20:15:28 -05:00
|
|
|
Username string `json:"-" gorm:"column:username"`
|
|
|
|
DisplayName string `json:"displayName" gorm:"column:display_name"`
|
|
|
|
NotificationType nModel.NotificationPlatform `json:"-" gorm:"column:notification_type"`
|
|
|
|
TargetID string `json:"-" gorm:"column:target_id"` // Target ID
|
2024-06-30 21:41:41 -04:00
|
|
|
}
|