Versions in this module Expand all Collapse all v1 v1.0.1 Nov 17, 2024 v1.0.0 Oct 29, 2024 Changes in this version + type Category struct + AccountId uint + CreatedAt time.Time + DeletedAt gorm.DeletedAt + FatherId uint + ID uint + Icon string + IncomeExpense constant.IncomeExpense + Name string + OrderUpdatedAt time.Time + Previous uint + UpdatedAt time.Time + func (c *Category) CheckName(_ *gorm.DB) error + func (c *Category) GetAccount() (result accountModel.Account, err error) + func (c *Category) GetFather() (father Father, err error) + func (c *Category) SelectById(id uint) error + type CategoryDao struct + func NewDao(db ...*gorm.DB) *CategoryDao + func (cd *CategoryDao) CreateMapping(parent, child Category) (Mapping, error) + func (cd *CategoryDao) Exist(account accountModel.Account) (bool, error) + func (cd *CategoryDao) GetAll(account accountModel.Account, incomeExpense *constant.IncomeExpense) ([]Category, error) + func (cd *CategoryDao) GetFatherList(account accountModel.Account, incomeExpense *constant.IncomeExpense) ([]Father, error) + func (cd *CategoryDao) GetListByAccount(account accountModel.Account, ie *constant.IncomeExpense) (list []Category, err error) + func (cd *CategoryDao) GetListByFather(father Father) ([]Category, error) + func (cd *CategoryDao) GetMappingByAccountMappingOrderByParentCategory(parentAccountId, childAccountId uint) ([]Mapping, error) + func (cd *CategoryDao) GetUnmappedList(mainAccount, mappingAccount accountModel.Account, ie *constant.IncomeExpense) (list []Category, err error) + func (cd *CategoryDao) Order(list []Category) + func (cd *CategoryDao) OrderFather(list []Father) + func (cd *CategoryDao) SelectById(id uint) (category Category, err error) + func (cd *CategoryDao) SelectByName(accountId uint, name string) (category Category, err error) + func (cd *CategoryDao) SelectFatherById(id uint) (father Father, err error) + func (cd *CategoryDao) SelectFatherFirstChild(fatherId uint) (Father, error) + func (cd *CategoryDao) SelectFirstChild(categoryId uint) (Category, error) + func (cd *CategoryDao) SelectMapping(parentAccountId, childCategoryId uint) (Mapping, error) + func (cd *CategoryDao) SelectMappingByCAccountIdAndPCategoryId(childAccountId, parentCategoryId uint) (Mapping, error) + func (cd *CategoryDao) Update(categoryId uint, data CategoryUpdateData) error + func (cd *CategoryDao) UpdateChildPrevious(categoryId, newPrevious uint) error + func (cd *CategoryDao) UpdateFatherChildPrevious(categoryId, newPrevious uint) error + type CategoryUpdateData struct + Icon *string + Name *string + type Condition struct + type Father struct + AccountId uint + CreatedAt time.Time + ID uint + IncomeExpense constant.IncomeExpense + Name string + OrderUpdatedAt time.Time + Previous uint + func (f *Father) SelectById(id uint) error + func (f *Father) TableName() string + type Mapping struct + ChildAccountId uint + ChildCategoryId uint + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + ParentAccountId uint + ParentCategoryId uint + UpdatedAt time.Time + func (p *Mapping) TableName() string