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              = "widget16614938322000001"
	Assets                = "widget16614939701650001"
	ProblemDescription    = "widget16487195633330001"
	ImprovementSuggestion = "widget16614941455820001"
	EmergencyLevel        = "widget16487195406530001"
	ResponsiblePerson     = "widget16614941687660001"
	Collaborators         = "widget16614942163000001"
	RectificationTime     = "widget16614942960990001"
)

// safe type
const (
	AppSafe      = "$i18n-l7a2g2r6-klab9dmr3kp-4"
	DataSafe     = "l7a2jgxo-2jkfo0zshca-1"
	TerminalSafe = "l7a2jgxo-uc0arvj6q2k-3"
	CloudSafe    = "l7a2jgxo-x8q66urvgah-5"
	ContentSafe  = "l7a2jgxo-znw0q0xdwak-7"
	HostSafe     = "lbowqi7a-y72wsnjh59l-1"
	OfficeSafe   = "l7a2jgxo-jqbkukuvsva-9"
	OtherSafe    = "l7a2jgxo-w420i13xm4-11"
)

// assets

const (
	Account     = "l7a2m0af-x4u2i1gmq-0"
	Permission  = "l7a2lbta-ae4482m7on-1"
	Application = "l7a2lbta-cd8pmuoswpk-3"
	Domain      = "lb0msap1-v4k71b1lffg-1"
	Email       = "l9zacui1-0zzwnosj2puf-1"
	DataBase    = "l7a2lbta-at1yiuyq91h-5"
	CloudServer = "l7a2lbta-fummiojdsym-7"
	Logging     = "l7a2lbta-rffobfbqkq-9"
	Hardware    = "l7a2lbta-08wh0siprxof-11"
	Port        = "lb0msap1-j5vnxm291kb-3"
	Document    = "lf26bjpi-ip9bs3wv7y-1"
	OtherAssets = "l7a2lbta-bxh87q5cbaq-13"
)

// emergency level

const (
	Normal   = "l1et1ne6-wlhbvc5yoj-0"
	Urgent   = "l1et11i4-qql1hs1hjtj-5"
	Pressing = "l1et11i4-6pxlpr21rlq-7"
)
