init
This commit is contained in:
27
internal/models/ledger.go
Normal file
27
internal/models/ledger.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package models
|
||||
|
||||
// Ledger represents an independent accounting book for separating different accounting scenarios
|
||||
// Feature: accounting-feature-upgrade
|
||||
// Validates: Requirements 3.1
|
||||
type Ledger struct {
|
||||
BaseModel
|
||||
UserID uint `gorm:"not null;index" json:"user_id"`
|
||||
Name string `gorm:"size:100;not null" json:"name"`
|
||||
Theme string `gorm:"size:50" json:"theme"` // pink, beige, brown
|
||||
CoverImage string `gorm:"size:255" json:"cover_image"`
|
||||
IsDefault bool `gorm:"default:false" json:"is_default"`
|
||||
SortOrder int `gorm:"default:0" json:"sort_order"`
|
||||
|
||||
// Relationships
|
||||
Transactions []Transaction `gorm:"foreignKey:LedgerID" json:"-"`
|
||||
}
|
||||
|
||||
// TableName specifies the table name for Ledger
|
||||
func (Ledger) TableName() string {
|
||||
return "ledgers"
|
||||
}
|
||||
|
||||
// MaxLedgersPerUser is the maximum number of ledgers a user can create
|
||||
// Feature: accounting-feature-upgrade
|
||||
// Validates: Requirements 3.12
|
||||
const MaxLedgersPerUser = 10
|
||||
Reference in New Issue
Block a user