aboutsummaryrefslogtreecommitdiffstats
path: root/internal/circle/model
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-06-30 21:41:41 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-06-30 21:41:41 -0400
commitc13dd9addbf89f716e4ef5cfdf1d673139ffcb68 (patch)
treebc09646ce1d6d3a402abb4694e19da51b57204f6 /internal/circle/model
downloaddonetick-c13dd9addbf89f716e4ef5cfdf1d673139ffcb68.tar.gz
donetick-c13dd9addbf89f716e4ef5cfdf1d673139ffcb68.tar.bz2
donetick-c13dd9addbf89f716e4ef5cfdf1d673139ffcb68.zip
Move to Donetick Org, first commit
Diffstat (limited to 'internal/circle/model')
-rw-r--r--internal/circle/model/model.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/internal/circle/model/model.go b/internal/circle/model/model.go
new file mode 100644
index 0000000..bf26b34
--- /dev/null
+++ b/internal/circle/model/model.go
@@ -0,0 +1,35 @@
+package circle
+
+import "time"
+
+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
+}
+
+type CircleDetail struct {
+ Circle
+ UserRole string `json:"userRole" gorm:"column:role"`
+}
+
+type UserCircle struct {
+ 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
+}
+
+type UserCircleDetail struct {
+ UserCircle
+ Username string `json:"username" gorm:"column:username"`
+ DisplayName string `json:"displayName" gorm:"column:display_name"`
+ ChatID int `json:"chatID" gorm:"column:chat_id"`
+}