domain

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(ir IncomeRepository)

Types

type Income

type Income struct {
	Id            int64     `json:"id"`
	Detail        string    `json:"detail"`
	Subject       Subject   `json:"subject_id"`
	Amount        int64     `json:"amount"`
	AccountId     int64     `json:"account_id"`
	TransactionAt time.Time `json:"transaction_at"`
	CreateAt      time.Time `json:"create_at"`
	Operator      Operator  `json:"operator"`
}

type IncomeRepository

type IncomeRepository interface {
	Insert(ctx trx.Context, income *Income) (*Income, error)
	InsertAll(ctx trx.Context, incomes []*Income) ([]*Income, error)
	UpdateById(ctx trx.Context, income *Income, id int64) (bool, error)
	UpdateAccountIdAndDetailByTransactionAt(ctx trx.Context, accountId int64, detail string, transactionAt time.Time) (int64, error)
	DeleteById(ctx trx.Context, id int64) (bool, error)
	DeleteByAccountId(ctx trx.Context, accountId int64) (int64, error)
	FindByAccountIdAndTransactionAtBetween(ctx trx.Context, accountId int64, start, end time.Time) ([]*Income, error)
	FindByAccountIdOrderByAccountIdAndTransactionAtDesc(ctx trx.Context, accountId int64) ([]*Income, error)
	FindById(ctx trx.Context, id int64) (*Income, error)
	CountByAccountId(ctx trx.Context, accountId int64) (int64, error)
	Test(ctx trx.Context) int64
}

type Operator

type Operator struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

type Subject

type Subject struct {
	Id int64
}

Jump to

Keyboard shortcuts

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