first commit
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
Reference in New Issue
Block a user