package models

import (
	"math/big"

	"github.com/ethereum/go-ethereum/common"
)

type UserInfo struct {
	Id               int64
	Addr             string
	Direct           int64   //我的上级
	DirectNumber     int     //直推总人数
	IndirectRewards  float64 `xorm:"Decimal"`
	Indirect         int64   //上上级
	IndirectNumber   int     //间推总人数
	DirectRewards    float64 `xorm:"Decimal"`
	Superiors        string  //所有上级
	AvailableClaim   float64 `xorm:"Decimal"` //可领取收益
	TotalClaimed     float64 `xorm:"Decimal"` //总共已领取的收益
	AvailableReinput float64 `xorm:"Decimal"` //可用复投
	TotalReinputed   float64 `xorm:"Decimal"` //总复投

	State  int //身份   0 1正式   2  社区
	OpTime string
}

// TeamCultivate float64 `xorm:"Decimal"`
// 	CommunityGift float64 `xorm:"Decimal"`
// 	CommunityNode float64 `xorm:"Decimal"`

type Performance struct {
	Id                      int64
	Addr                    string
	TotalPerformance        float64 `xorm:"Decimal"`
	ClaimedPerformanceLevel int
	PerformanceRewards      float64 `xorm:"Decimal"`

	TotalTeamCultivate    float64 `xorm:"Decimal"`
	ClaimedCultivateLevel int
	TeamCultivateRewards  float64 `xorm:"Decimal"`

	CommunityGift float64 `xorm:"Decimal"`
	CommunityNode float64 `xorm:"Decimal"`
}

type BlockInfo struct {
	Id          int64
	BlockNumber int64
}

type RewardsPool struct {
	Id              int64
	Recommendation  float64 `xorm:"Decimal"`
	TeamPerformance float64 `xorm:"Decimal"`
	TeamCultivate   float64 `xorm:"Decimal"`
	CommunityGift   float64 `xorm:"Decimal"`
	CommunityNode   float64 `xorm:"Decimal"`
	TotalPool       float64 `xorm:"Decimal"`
}

type UserTxs struct {
	Id     int64
	Addr   string
	Hash   string
	OpTime string
}

type AddrBill struct {
	Id         int64
	Addr       string
	Amount     float64 `xorm:"Decimal"`
	BillType   int
	CreateTime string
}

type UserAddr struct {
	Addr         string `xorm:"pk"`
	IdFlag       int
	Pid          int
	RealPid      int
	PidFlag      string
	People       int
	Level        int
	RemovePeople int
	TeamBoss     int
	BadTime      string
	Msg          string
	LockAmount1  float64 `xorm:"Decimal"`
	LockAmount2  float64 `xorm:"Decimal"`
	Profit1      float64 `xorm:"Decimal"`
	Profit2      float64 `xorm:"Decimal"`
	Profit3      float64 `xorm:"Decimal"`
	Profit4      float64 `xorm:"Decimal"`
	Amount       float64 `xorm:"Decimal"`
	Price        float64 `xorm:"Decimal"`
	UseAmount    float64 `xorm:"Decimal"`
	AmountLv     float64 `xorm:"Decimal"`
	Hash         string
	Block        int64
	CreateTime   string
}

type CommonInfo struct {
	Id           int64
	Amount       float64 `xorm:"Decimal"`
	SupplyAmount float64 `xorm:"Decimal"`
	SupplyTime   string
}

type SuccessBill struct {
	Id         int64
	Addr       string
	Amount     float64 `xorm:"Decimal"`
	Status     int
	Block      int64
	Hash       string
	FromAddr   string
	Ty         int
	CreateTime string
}

type WithdrawalBill struct {
	Id          int64
	Addr        string
	Amount      float64 `xorm:"Decimal"`
	Status      int
	CreateBlock int64
	SucBlock    int64
	Hash        string
	CreateTime  string
}

type TeamUserInfo struct {
	Addr       string
	People     int
	NftNum     int
	CreateTime string
}

type Ihot struct {
	User     common.Address
	Referrer common.Address
	Amount   *big.Int
	Price    *big.Int
}

type Withdraw struct {
	User   common.Address
	Amount *big.Int
}
