feat: 新增账户服务层,实现账户的增删改查及转账功能,并初始化AI记账、交易服务和预算仓库。

This commit is contained in:
2026-01-29 23:36:57 +08:00
parent d974e81d1d
commit 28ff8b80c2
4 changed files with 90 additions and 21 deletions

View File

@@ -12,12 +12,12 @@ import (
// Service layer errors
var (
ErrAccountNotFound = errors.New("account not found")
ErrAccountInUse = errors.New("account is in use and cannot be deleted")
ErrInsufficientBalance = errors.New("insufficient balance for this operation")
ErrSameAccountTransfer = errors.New("cannot transfer to the same account")
ErrInvalidTransferAmount = errors.New("transfer amount must be positive")
ErrNegativeBalanceNotAllowed = errors.New("negative balance not allowed for non-credit accounts")
ErrAccountNotFound = errors.New("账户不存在")
ErrAccountInUse = errors.New("账户正在使用中,无法删除")
ErrInsufficientBalance = errors.New("余额不足")
ErrSameAccountTransfer = errors.New("不能转账给同一个账户")
ErrInvalidTransferAmount = errors.New("转账金额必须大于0")
ErrNegativeBalanceNotAllowed = errors.New("非信用账户不允许负余额")
)
// AccountInput represents the input data for creating or updating an account