first commit

This commit is contained in:
Matthias Hinrichs
2025-07-05 03:10:41 +02:00
commit 9b7bdcbc53
39 changed files with 5109 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package model
import (
"time"
"gorm.io/gorm"
)
type Portfolio struct {
ID uint `gorm:"primaryKey" json:"id"`
UserID uint `gorm:"not null;index" json:"user_id"` // Referenz auf User
Name string `gorm:"not null;size:255" json:"name"` // Name des Portfolios
BaseCurrency string `gorm:"not null;size:3" json:"base_currency"` // Basiswährung, z.B. "EUR"
Description string `gorm:"type:text" json:"description"` // Beschreibung des Portfolios
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
// Relationships
User User `gorm:"foreignKey:UserID" json:"user,omitempty"`
Activities []Activity `gorm:"foreignKey:PortfolioID" json:"activities,omitempty"`
}