cash_pool.go 988 字节
package domain

import "time"

// 现金池
type CashPool struct {
	CashPoolId int64 `json:"cashPoolId"`  // 现金池id
	Cash float64 `json:"cash"`  // 投入现金池的现金
	CompanyId int64 `json:"companyId"`	// 公司id
	ExchangedCash float64 `json:"exchangedCash"`  // 已兑换的现金
	UnExchangeCash float64 `json:"unExchangeCash"`  // 未兑换的现金
	ExchangedSuMoney float64 `json:"exchangedSuMoney"` 	// 已兑换的素币
	UnExchangeSuMoney float64 `json:"unExchangeSuMoney"`  // 未兑换的素币
	//Operator *EmployeeInfo `json:"operator"`  // 操作人
	Rate float64 `json:"rate"` 	// 平均兑换汇率
	CreateTime time.Time `json:"createTime"`  // 现金投入现金池时间
}

type CashPoolRepository interface {
	Save(cashPool *CashPool) (*CashPool, error)
	Find(queryOptions map[string]interface{}) (int64, []*CashPool, error)
}

func (cashPool *CashPool) Identity() interface{} {
	if cashPool.CashPoolId == 0 {
		return nil
	}
	return cashPool.CashPoolId
}