Documentation
¶
Index ¶
- Constants
- Variables
- func CalcCashflowStatsAsync(rail miso.Rail, req ApiCalcCashflowStatsReq, userNo string) error
- func ImportWechatCashflows(inb *miso.Inbound, db *gorm.DB) error
- func ListCashFlows(rail miso.Rail, db *gorm.DB, user common.User, req ListCashFlowReq) (miso.PageRes[ListCashFlowRes], error)
- func ListCashflowStatistics(rail miso.Rail, db *gorm.DB, req ApiListStatisticsReq, user common.User) (miso.PageRes[ApiListStatisticsRes], error)
- func ListCurrencies(rail miso.Rail, db *gorm.DB, user common.User) ([]string, error)
- func LoadCategoryConfs(rail miso.Rail)
- func OnCalcCashflowStatsEvent(rail miso.Rail, evt CalcCashflowStatsEvent) error
- func OnCashflowChanged(rail miso.Rail, changes []CashflowChange, userNo string) error
- func ParseAggRangeTime(aggType string, aggRange string) (util.ETime, error)
- type ApiCalcCashflowStatsReq
- type ApiListStatisticsReq
- type ApiListStatisticsRes
- type ApiPlotStatisticsReq
- type ApiPlotStatisticsRes
- type CalcCashflowStatsEvent
- type CashflowChange
- type CashflowCurrency
- type CashflowSum
- type CategoryConf
- type ListCashFlowReq
- type ListCashFlowRes
- type NewCashflow
- type SaveCashflowParams
- type SavingCashflow
- type TimeRange
Constants ¶
View Source
const ( DirectionIn = "IN" DirectionOut = "OUT" )
View Source
const ( AggTypeYearly = "YEARLY" AggTypeMonthly = "MONTHLY" AggTypeWeekly = "WEEKLY" )
View Source
const ( WechatCategory = "WECHAT" WechatCurrency = "CNY" )
Variables ¶
View Source
var ( RangeFormatMap = map[string]string{ AggTypeYearly: `2006`, AggTypeMonthly: `200601`, AggTypeWeekly: `20060102`, } CalcAggStatPipeline = rabbit.NewEventPipeline[CalcCashflowStatsEvent]("acct:cashflow:calc-agg-stat"). LogPayload(). Listen(2, OnCalcCashflowStatsEvent). MaxRetry(3) )
Functions ¶
func CalcCashflowStatsAsync ¶
func CalcCashflowStatsAsync(rail miso.Rail, req ApiCalcCashflowStatsReq, userNo string) error
func ListCashFlows ¶
func ListCashflowStatistics ¶
func ListCurrencies ¶
func LoadCategoryConfs ¶
func OnCalcCashflowStatsEvent ¶
func OnCalcCashflowStatsEvent(rail miso.Rail, evt CalcCashflowStatsEvent) error
func OnCashflowChanged ¶
func OnCashflowChanged(rail miso.Rail, changes []CashflowChange, userNo string) error
Types ¶
type ApiCalcCashflowStatsReq ¶
type ApiListStatisticsReq ¶
type ApiListStatisticsReq struct {
Paging miso.Paging `desc:"Paging Info"`
AggType string `desc:"Aggregation Type." valid:"member:YEARLY|MONTHLY|WEEKLY"`
AggRange string `desc:"Aggregation Range. The corresponding year (YYYY), month (YYYYMM), sunday of the week (YYYYMMDD)."`
Currency string `desc:"Currency"`
}
type ApiListStatisticsRes ¶
type ApiPlotStatisticsReq ¶
type ApiPlotStatisticsRes ¶
type ApiPlotStatisticsRes struct {
AggRange string `desc:"Aggregation Range. The corresponding year (YYYY), month (YYYYMM), sunday of the week (YYYYMMDD)."`
AggValue string `desc:"Aggregation Value."`
}
func PlotCashflowStatistics ¶
func PlotCashflowStatistics(rail miso.Rail, db *gorm.DB, req ApiPlotStatisticsReq, user common.User) ([]ApiPlotStatisticsRes, error)
type CalcCashflowStatsEvent ¶
type CashflowChange ¶
type CashflowCurrency ¶
type CashflowSum ¶
type CategoryConf ¶
type ListCashFlowReq ¶
type ListCashFlowReq struct {
Paging miso.Paging `desc:"Paging"`
Direction string `desc:"Flow Direction: IN / OUT" valid:"member:IN|OUT|"`
TransTimeStart *util.ETime `desc:"Transaction Time Range Start"`
TransTimeEnd *util.ETime `desc:"Transaction Time Range End"`
TransId string `desc:"Transaction ID"`
Category string `desc:"Category Code"`
MinAmt *money.Amt `desc:"Minimum amount"`
}
type ListCashFlowRes ¶
type ListCashFlowRes struct {
Direction string `desc:"Flow Direction: IN / OUT"`
TransTime util.ETime `desc:"Transaction Time"`
TransId string `desc:"Transaction ID"`
Counterparty string `desc:"Counterparty of the transaction"`
PaymentMethod string `desc:"Payment Method"`
Amount string `desc:"Amount"`
Currency string `desc:"Currency"`
Extra string `desc:"Extra Information"`
Category string `desc:"Category Code"`
CategoryName string `desc:"Category Name"`
Remark string `desc:"Remark"`
CreatedAt util.ETime `desc:"Create Time"`
}
type NewCashflow ¶
type NewCashflow struct {
Direction string
TransTime util.ETime
TransId string
PaymentMethod string
Counterparty string
Amount string
Currency string
Extra string
Remark string
}
func ParseWechatCashflows ¶
func ParseWechatCashflows(rail miso.Rail, path string) ([]NewCashflow, error)
func SaveCashflows ¶
func SaveCashflows(rail miso.Rail, db *gorm.DB, param SaveCashflowParams) ([]NewCashflow, error)
type SaveCashflowParams ¶
type SaveCashflowParams struct {
Cashflows []NewCashflow
Category string
User common.User
}
type SavingCashflow ¶
Click to show internal directories.
Click to hide internal directories.