Rename Account->Card in db package

This commit is contained in:
qowevisa 2024-08-03 08:05:46 +03:00
parent cf09928a39
commit aa69960519
5 changed files with 16 additions and 16 deletions

View File

@ -2,8 +2,8 @@ package db
import "gorm.io/gorm"
// Account can be either card or wallet
type Account struct {
// Card can be either card or wallet
type Card struct {
gorm.Model
Name string
Value uint64

View File

@ -42,7 +42,7 @@ func Connect() *gorm.DB {
log.Panic(err)
}
newUDB := gormDB
gormDB.AutoMigrate(&Account{})
gormDB.AutoMigrate(&Card{})
gormDB.AutoMigrate(&Category{})
gormDB.AutoMigrate(&Item{})
gormDB.AutoMigrate(&ItemPrice{})

View File

@ -8,11 +8,11 @@ import (
type Debt struct {
gorm.Model
AccountID uint
Account *Account
Value uint64
IOwe bool
Date time.Time
DateEnd time.Time
Finished bool
CardID uint
Card *Card
Value uint64
IOwe bool
Date time.Time
DateEnd time.Time
Finished bool
}

View File

@ -8,8 +8,8 @@ import (
type Income struct {
gorm.Model
AccountID uint
Account *Account
Value uint64
Date time.Time
CardID uint
Card *Card
Value uint64
Date time.Time
}

View File

@ -9,8 +9,8 @@ import (
// For grocery payment
type Payment struct {
gorm.Model
AccountID uint
Account *Account
CardID uint
Card *Card
CategoryID uint
Category *Category
Name string