package model

import (
	"kami/internal/consts"
	"kami/internal/model/entity"
	"kami/utility/integration/restriction"

	"github.com/gogf/gf/v2/frame/g"
)

// RestrictionDeviceInput 当前的IP地址
type RestrictionDeviceInput struct {
	IPs         []string `json:"ips"`
	RemoteIP    string   `json:"remoteIP"`
	DeviceID    string   `json:"deviceID"`
	DeviceModel string   `json:"deviceModel"`
	UserAgent   string   `json:"userAgent"`
}

type RestrictionIPRecordOutput struct {
	g.Meta `orm:"table:restrict_ip_record"`
	entity.V1RestrictIpRecord
	RawData restriction.Response `json:"rawData"    orm:"raw_data"`
}

type RestrictWithIPRecordOutput struct {
	g.Meta `orm:"table:restrict_ip_order_access"`
	entity.V1RestrictIpOrderAccess
	IpRecord RestrictionIPRecordOutput `json:"ipRecord" orm:"with:id=restrict_ip_id"`
}

type AddRestrictionRecordInput struct {
	Ip       string                           `json:"ip"`
	Status   consts.RestrictStatus            `json:"status"`
	DeviceId string                           `json:"deviceId"`
	Strategy MerchantDeployInfoStrategyOutput `json:"strategy"`
	CardPass string                           `json:"cardPass"`
	OrderNo  string                           `json:"orderNo"`
}
