package v1

type Event struct {
	Schema    string    `json:"schema"`
	Header    Header    `json:"header"`
	EventData EventData `json:"event"`
}

type Header struct {
	EventID    string `json:"event_id"`
	EventType  string `json:"event_type"`
	CreateTime string `json:"create_time"`
	Token      string `json:"token"`
	AppID      string `json:"app_id"`
	TenantKey  string `json:"tenant_key"`
}

type EventData struct {
	Sender  Sender  `json:"sender"`
	Message Message `json:"message"`
}

type Sender struct {
	SenderID   UserID `json:"sender_id"`
	SenderType string `json:"sender_type"`
	TenantKey  string `json:"tenant_key"`
}

type UserID struct {
	UnionID string `json:"union_id"`
	UserID  string `json:"user_id"`
	OpenID  string `json:"open_id"`
}

type Message struct {
	MessageID   string `json:"message_id"`
	RootID      string `json:"root_id"`
	ParentID    string `json:"parent_id"`
	CreateTime  string `json:"create_time"`
	ChatID      string `json:"chat_id"`
	ChatType    string `json:"chat_type"`
	MessageType string `json:"message_type"`
	Content     string `json:"content"`
}

type LarkReplyMsgResData struct {
	MessageID      string `json:"message_id"`
	RootID         string `json:"root_id"`
	ParentID       string `json:"parent_id"`
	MessageType    string `json:"message_type"`
	CreateTime     string `json:"create_time"`
	ChatID         string `json:"chat_id"`
	UpperMessageID string `json:"upper_message_id"`
	Body           struct {
		Content string `json:"content"`
	} `json:"body"`
	Mentions []struct {
		Key       string `json:"key"`
		ID        string `json:"id"`
		IdType    string `json:"id_type"`
		Name      string `json:"name"`
		TenantKey string `json:"tenant_key"`
	} `json:"mentions"`
	Sender struct {
		ID         string `json:"id"`
		IdType     string `json:"id_type"`
		SenderType string `json:"sender_type"`
		TenantKey  string `json:"tenant_key"`
	} `json:"sender"`
}

type ContractItems struct {
	Items []ContractItem `json:"items"`
}

type ContractItem struct {
	ContractID       int64          `json:"contract_id"`
	CounterPartyList []CounterParty `json:"counter_party_list"`
}

type CounterParty struct {
	CounterPartyName string          `json:"counter_party_name"`
	CounterPartyId   string          `json:"counter_party_id"`
	RegisterAddress  RegisterAddress `json:"register_address"`
}

type RegisterAddress struct {
	Country string `json:"country"`
}
type Body struct {
	PageSize         int                  `json:"page_size"`
	PageToken        string               `json:"page_token"`
	CombineCondition CombineConditionType `json:"combine_condition"`
}

type CombineConditionType struct {
	SubmittedTimeStart string `json:"submited_time_start "`
	SubmittedTimeEnd   string `json:"submited_time_end"`
}

type ContractReqBody struct {
	PageSize         int              `json:"page_size"`
	PageToken        string           `json:"page_token"`
	CombineCondition CombineCondition `json:"combine_condition"`
}

type CombineCondition struct {
	SubmittedTimeStart string `json:"submited_time_start"`
	SubmittedTimeEnd   string `json:"submited_time_end"`
}

// bitable

type ComProblemFields struct {
	SearchedName    string   `json:"SearchedName,omitempty"`
	PrimaryName     string   `json:"PrimaryName,omitempty"`
	CountryISOCode  string   `json:"CountryISOCode,omitempty"`
	EntityType      string   `json:"EntityType,omitempty"`
	RiskIcons       []string `json:"RiskIcons,omitempty"`
	Title           string   `json:"Title,omitempty"`
	MatchedName     string   `json:"MatchedName,omitempty"`
	MatchedNameType string   `json:"MatchedNameType,omitempty"`
	MatchScore      string   `json:"MatchScore,omitempty"`
}
type SanctionsFields struct {
	SearchedName           string `json:"SearchedName,omitempty"`
	PrimaryName            string `json:"PrimaryName,omitempty"`
	OrganizationNames      string `json:"OrganizationNames,omitempty"`
	WatchListContentStatus string `json:"WatchListContentStatus,omitempty"`
	WatchListContentNotes  string `json:"WatchListContentNotes,omitempty"`
	DataProviders          string `json:"DataProviders,omitempty"`
}
type SancRefFields struct {
	SearchedName string `json:"SearchedName,omitempty"`
	PrimaryName  string `json:"PrimaryName,omitempty"`
	Reference    string `json:"Reference,omitempty"`
	ProviderName string `json:"ProviderName,omitempty"`
	ProviderCode string `json:"ProviderCode,omitempty"`
	Description  string `json:"Description,omitempty"`
	Status       string `json:"Status,omitempty"`
	StartDate    string `json:"StartDate,omitempty"`
	EndDate      string `json:"EndDate,omitempty"`
}

type ComBasicFields struct {
	SearchedName string `json:"SearchedName,omitempty"`
	PrimaryName  string `json:"PrimaryName,omitempty"`
	Region       string `json:"Region,omitempty"`
	Status       string `json:"Status,omitempty"`
	Address      string `json:"Address,omitempty"`
	RegNumber    string `json:"RegNumber,omitempty"`
}

type SearchedCompany struct {
	SearchedName     string   `json:"SearchedName,omitempty"`
	Country          string   `json:"Country,omitempty"`
	From             string   `json:"From,omitempty"`
	SearchResult     string   `json:"SearchResult,omitempty"`
	RiskIcons        []string `json:"RiskIcons,omitempty"`
	SanctionQuantity string   `json:"SanctionQuantity,omitempty"`
	BannedCountry    string   `json:"BannedCountry,omitempty"`
}

type BitableItem struct {
	Fields   interface{} `json:"fields"`
	ID       string      `json:"id,omitempty" `
	RecordID string      `json:"record_id"`
}

const (
	SafeType              = "widget17090260081280001"
	Assets                = "widget17090262147630001"
	ProblemDescription    = "widget17090263297460001"
	ImprovementSuggestion = "widget17090263562610001"
	EmergencyLevel        = "widget17090264132800001"
	ResponsiblePerson     = "widget17090264557090001"
	Collaborators         = "widget17090264920160001"
	RectificationTime     = "widget17090265236940001"
)

// safe type
const (
	AppSafe      = "lt45yji8-k4ah4qrhhtk-0"
	DataSafe     = "lt45yji8-frxsroqrc4-0"
	TerminalSafe = "lt45yji8-ly4vddb6py-0"
	CloudSafe    = "lt45yrq1-fr8pmiyx4-1"
	ContentSafe  = "lt45yrq1-3lstagvgx5n-3"
	HostSafe     = "lt45yrq1-fw8rcfmidp-5"
	OfficeSafe   = "lt45yrq1-mlvx5cfnu3c-7"
	OtherSafe    = "lt45yrq1-i7rlxd4rkb-9"
)

// assets

const (
	Account     = "lt462yy5-7737de7mt-0"
	Permission  = "lt462yy5-kx5n0ryrvli-0"
	Application = "lt462yy6-4nknxcm00pj-0"
	Domain      = "lt462yy6-l8bewrru21n-0"
	Email       = "lt462yy6-sab6huttxoq-0"
	DataBase    = "lt462yy6-9s8vc6vbktj-0"
	CloudServer = "lt462yy6-qir7m7zg91m-0"
	Logging     = "lt462yy6-30zroefonvw-0"
	Hardware    = "lt45yrq1-b841kqxgz1c-11"
	Port        = "lt45yrq1-bbpuvud2a9l-13"
	Document    = "lt45yrq1-wiet6qaunkb-15"
	OtherAssets = "lt45yrq1-bw736mb6ve4-17"
)

// emergency level

const (
	Normal   = "lt46784g-bup45ln3ios-0"
	Urgent   = "lt46784g-4p5zi3homo5-0"
	Pressing = "lt46784g-q5c3yzuv7wf-0"
)
