bill

package
v0.0.0-...-b52a236 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateBillDTO

type CreateBillDTO struct {
	Amount    float64
	Category  string
	Name      *string    // optional
	CreatedAt *time.Time // if not provided, then use current time as default
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(billRepo bill.Repository, userRepo user.Repository) *Service

func (*Service) CancelBillAndUpdateUserBalance

func (receiver *Service) CancelBillAndUpdateUserBalance(billID uint) error

CancelBillAndUpdateUserBalance 取消订单并更新用户余额

func (*Service) CreateNewBill

func (receiver *Service) CreateNewBill(userID uint, amount float64, category string, opts ...bill.CreateBillOptions) (*models.Bill, error)

func (*Service) CreateNewBills

func (receiver *Service) CreateNewBills(userID uint, billDTOs []CreateBillDTO) error

func (*Service) GetUserBillsByCreateTime

func (receiver *Service) GetUserBillsByCreateTime(userID uint, opts ...bill.GetUserBillsByCreateTimeOptions) ([]*models.Bill, error)

GetUserBillsByCreateTime 获取用户在指定时间范围内的账单列表,若 opts 为空,则返回账单(opts 只取列表第一个作为查询参数)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL