package dto

// JSON:API HEMS Operation DTOs

type HEMSOperationOperationalDataRef struct {
	ID string `json:"id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
}

type HEMSOperationCategoryRef struct {
	ID   string `json:"id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	Name string `json:"name,omitempty" example:"Firefighting"`
	Type string `json:"type,omitempty" example:"first"`
}

type HEMSOperationMissionRef struct {
	ID       string `json:"id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	FlightID string `json:"flight_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	Type     string `json:"type,omitempty" example:"HEMS"`
}

type HEMSOperationAttributes struct {
	Date                    string                           `json:"date" example:"2026-03-12T03:04:05Z"`
	OperationalDataID       string                           `json:"operational_data_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	MissionID               string                           `json:"mission_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	HEMSOperationCategoryID string                           `json:"hems_operation_category_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	OperationalData         *HEMSOperationOperationalDataRef `json:"operational_data,omitempty"`
	Mission                 *HEMSOperationMissionRef         `json:"mission,omitempty"`
	HEMSOperationCategory   *HEMSOperationCategoryRef        `json:"hems_operation_category,omitempty"`
	CreatedAt               string                           `json:"created_at,omitempty" example:"2026-03-12T03:04:05Z"`
	CreatedBy               string                           `json:"created_by,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	UpdatedAt               string                           `json:"updated_at,omitempty" example:"2026-03-12T03:04:05Z"`
	UpdatedBy               string                           `json:"updated_by,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	DeletedAt               string                           `json:"deleted_at,omitempty" example:"2026-03-12T03:04:05Z"`
	DeletedBy               string                           `json:"deleted_by,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
}

type HEMSOperationResource struct {
	Type       string                  `json:"type" example:"hems_operation"`
	ID         string                  `json:"id" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	Attributes HEMSOperationAttributes `json:"attributes"`
}

type HEMSOperationResponse struct {
	Data HEMSOperationResource `json:"data"`
}

type HEMSOperationListResponse struct {
	Data []HEMSOperationResource `json:"data"`
	Meta struct {
		PageNumber int   `json:"page_number" example:"1"`
		PageSize   int   `json:"page_size" example:"20"`
		Total      int64 `json:"total" example:"120"`
	} `json:"meta"`
}

type HEMSOperationDataTableResponse struct {
	Data []HEMSOperationResource `json:"data"`
	Meta struct {
		Draw            int   `json:"draw" example:"1"`
		RecordsTotal    int64 `json:"records_total" example:"120"`
		RecordsFiltered int64 `json:"records_filtered" example:"12"`
	} `json:"meta"`
}

type HEMSOperationCreateAttributes struct {
	Date                    string  `json:"date" validate:"required" example:"2026-03-12T03:04:05Z"`
	OperationalDataID       *string `json:"operational_data_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	MissionID               *string `json:"mission_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	HEMSOperationCategoryID *string `json:"hems_operation_category_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
}

type HEMSOperationCreateData struct {
	Type       string                        `json:"type" validate:"required,oneof=hems_operation_create hems_operation" example:"hems_operation_create"`
	Attributes HEMSOperationCreateAttributes `json:"attributes" validate:"required"`
}

type HEMSOperationCreateRequest struct {
	Data HEMSOperationCreateData `json:"data" validate:"required"`
}

type HEMSOperationUpdateAttributes struct {
	Date                    *string `json:"date,omitempty" example:"2026-03-12T03:04:05Z"`
	OperationalDataID       *string `json:"operational_data_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	MissionID               *string `json:"mission_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	HEMSOperationCategoryID *string `json:"hems_operation_category_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
}

type HEMSOperationUpdateData struct {
	Type       string                        `json:"type" validate:"required,oneof=hems_operation_update hems_operation" example:"hems_operation_update"`
	Attributes HEMSOperationUpdateAttributes `json:"attributes" validate:"required"`
}

type HEMSOperationUpdateRequest struct {
	Data HEMSOperationUpdateData `json:"data" validate:"required"`
}
