package response

import shareddto "wucher/internal/transport/http/dto/shared"

type FleetStatusAttributes struct {
	Helicopter           *shareddto.FleetStatusHelicopter          `json:"helicopter,omitempty"`
	Status               string                                    `json:"status" example:"active" enums:"active,serviced"`
	ServicedAt           string                                    `json:"serviced_at,omitempty" example:"2026-05-29T07:43:06Z"`
	MaintenanceSchedules []shareddto.MaintenanceScheduleAttributes `json:"maintenance_schedules"`
	Files                []FleetStatusFile                         `json:"files"`
	Summary              shareddto.FleetStatusSummary              `json:"summary"`
	MCF                  *shareddto.FleetStatusMCF                 `json:"mcf,omitempty"`
	Complaints           []shareddto.FleetStatusComplaint          `json:"complaints,omitempty"`
	EASARelease          *shareddto.FleetStatusEASARelease         `json:"easa_release,omitempty"`
	CreatedAt            string                                    `json:"created_at,omitempty" example:"2026-05-29T07:43:06Z"`
	CreatedBy            string                                    `json:"created_by,omitempty" example:"John Doe"`
	UpdatedAt            string                                    `json:"updated_at,omitempty" example:"2026-05-29T07:43:06Z"`
	UpdatedBy            string                                    `json:"updated_by,omitempty" example:"John Doe"`
}

type FleetStatusFile struct {
	ID                   string `json:"id,omitempty" example:"019d6773-ccca-71dd-b9c7-8e6f531deb90"`
	FileAttachmentID     string `json:"file_attachment_id" example:"019d7000-aaaa-7bbb-8ccc-111111111111"`
	Category             string `json:"category" example:"wb"`
	IsMandatory          bool   `json:"is_mandatory" example:"true"`
	Name                 string `json:"name,omitempty" example:"weight_balance.pdf"`
	DownloadURL          string `json:"download_url,omitempty" example:"https://storage.example.com/fleet/wb.pdf?X-Amz-Signature=abc123"`
	ThumbnailDownloadURL string `json:"thumbnail_download_url,omitempty" example:"https://storage.example.com/fleet/wb.thumb.jpg?X-Amz-Signature=abc123"`
	SizeBytes            *int64 `json:"size_bytes,omitempty" example:"1024000"`
}

type FleetStatusResource struct {
	Type       string                `json:"type" example:"fleet_status"`
	ID         string                `json:"id" example:"019d6773-ccca-71dd-b9c7-8e6f531deb90"`
	Attributes FleetStatusAttributes `json:"attributes"`
}

type FleetStatusResponse struct {
	Data FleetStatusResource `json:"data"`
}

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

type FleetStatusDataTableResponse struct {
	Data []FleetStatusResource `json:"data"`
	Meta struct {
		Draw            int   `json:"draw" example:"1"`
		RecordsTotal    int64 `json:"records_total" example:"100"`
		RecordsFiltered int64 `json:"records_filtered" example:"20"`
	} `json:"meta"`
}

// FleetStatusDeleteResponse is the ack returned when a fleet status is deleted.
type FleetStatusDeleteResponse struct {
	Data struct {
		Type       string `json:"type" example:"fleet_status_delete"`
		Attributes struct {
			Deleted bool `json:"deleted" example:"true"`
		} `json:"attributes"`
	} `json:"data"`
}

// FleetStatusMarkServicedResponse is the ack returned when a fleet status is marked serviced.
type FleetStatusMarkServicedResponse struct {
	Data struct {
		Type       string `json:"type" example:"fleet_status_mark_serviced"`
		Attributes struct {
			Serviced bool `json:"serviced" example:"true"`
		} `json:"attributes"`
	} `json:"data"`
}

type FleetStatusServiceLogAttributes struct {
	FleetStatusID     string                           `json:"fleet_status_id" example:"019d6773-ccca-71dd-b9c7-8e6f531deb90"`
	HelicopterID      string                           `json:"helicopter_id" example:"019d6771-5fb5-7337-837f-bc5ed85181a1"`
	Helicopter        *shareddto.FleetStatusHelicopter `json:"helicopter,omitempty"`
	FleetStatusStatus string                           `json:"fleet_status_status,omitempty" example:"serviced"`
	InspectionType    string                           `json:"inspection_type" example:"A/F"`
	Type              string                           `json:"type" example:"100H"`
	Due               string                           `json:"due" example:"1200 FH"`
	Ext               string                           `json:"ext" example:"1300 FH"`
	ServicedAt        string                           `json:"serviced_at" example:"2026-05-29T07:43:06Z"`
	CreatedAt         string                           `json:"created_at" example:"2026-05-29T07:43:06Z"`
	CreatedBy         string                           `json:"created_by" example:"John Doe"`
}

type FleetStatusServiceLogResource struct {
	Type       string                          `json:"type" example:"fleet_status_service_log"`
	ID         string                          `json:"id" example:"019d6773-ccca-71dd-b9c7-8e6f531deb90"`
	Attributes FleetStatusServiceLogAttributes `json:"attributes"`
}

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