package forms

import (
	"time"
)

type Workflow struct {
	WorkFlowName      string     `json:"worker_flow_name"`
	WorkFlowID        string     `json:"worker_flow_id"`
	Subject           string     `json:"subject"`
	NotificationGroup string     `json:"notification_group"`
	TriggerID         string     `json:"trigger_id"`
	CreatorID         string     `json:"creator_id"`
	InAppContent      string     `json:"in_app_content"`
	Variables         []Variable `json:"variables"`
	CreatedAt         time.Time  `json:"created_at"`
	UpdatedAt         time.Time  `json:"updated_at"`
}

type WorkFlows struct {
	Workflows []Workflow `json:"work_flows"`
	PageQuery PageQuery  `json:"page_query"`
	Count     int        `json:"count"`
}

type Variable struct {
	Name     string `json:"name"`
	Value    string `json:"value"`
	Type     string `json:"type"`
	Required bool   `json:"required"`
	Id       string `json:"id"`
}
type Trigger struct {
	TenantID      uint              `json:"tenant_id"`
	TriggerID     string            `json:"trigger_id"`
	Payload       map[string]string `json:"payload"`
	TargetIDList  []string          `json:"target_id_list"`
	Roles         []string          `json:"roles"`
	ScopeType     string            `json:"scope_type"`
	WorkFlowID    string            `json:"worker_flow_id"`
	IsTest        bool              `json:"is_test"`
	IsSendNow     bool              `json:"is_send_now"`
	ScheduleTime  time.Time         `json:"schedule_time"`
	Operator      string            `json:"operator"`
	TransactionId string            `json:"transaction_id"`
}

type Notification struct {
	NotificationID    string    `json:"notification_id"`
	MarkAsID          string    `json:"mark_as_id"`
	WorkFlowName      string    `json:"worker_flow_name"`
	NotificationGroup string    `json:"notification_group"`
	InAppContent      string    `json:"in_app_content"`
	Subject           string    `json:"subject"`
	IsRead            bool      `json:"is_read"`
	Status            string    `json:"status"`
	SubscriberID      string    `json:"subscriber_id"`
	TransactionID     string    `json:"transaction_id"`
	SendAt            time.Time `json:"send_at"`
	SendBy            string    `json:"send_by"`
}
type Notifications struct {
	Data      []Notification `json:"data"`
	PageQuery PageQuery      `json:"page_query"`
	Count     int            `json:"count"`
	HasMore   bool           `json:"has_more"`
}
type OpsNotification struct {
	Roles        string       `json:"roles"`
	Notification Notification `json:"notification"`
}
type OpsNotifications struct {
	Data      []OpsNotification `json:"data"`
	PageQuery PageQuery         `json:"page_query"`
	Count     int               `json:"count"`
	HasMore   bool              `json:"has_more"`
}

type NotificationsSummary struct {
	Date     string   `json:"date"`
	Count    int      `json:"count"`
	Channels []string `json:"channels"`
}

type NotificationQuery struct {
	Page             int    `form:"page" json:"page"`
	WorkFlowNameLike string `form:"work_flow_name_like" json:"work_flow_name_like"`
	OrgID            uint   `form:"org_id" json:"org_id"`
	UserID           uint   `form:"user_id" json:"user_id"`
	TransactionID    string `form:"transaction_id" json:"transaction_id"`
}

type NotificationRequest struct {
	TenantID       uint   `json:"tenant_id"`
	UserID         uint   `json:"user_id"`
	NotificationID string `json:"notification_id"`
	QueryType      string `json:"query_type"`
	Page           int    `json:"page"`
	PageSize       int    `json:"page_size"`
}
type NotificationMarkRequest struct {
	TenantID       uint   `json:"tenant_id"`
	UserID         uint   `json:"user_id"`
	Type           string `json:"type"`
	NotificationID string `json:"notification_id"`
}
