package shared

import "time"

type ReserveAcAttributes struct {
	Status     string                      `json:"status" example:"pending"`
	AircraftID string                      `json:"helicopter_id" example:"019d6771-5fb5-7337-837f-bc5ed85181a1"`
	Aircraft   *ReserveAcAircraftSummary   `json:"helicopter,omitempty"`
	LastDaily  *ReserveAcLastDailyInfo     `json:"last_daily_inspection,omitempty"`
	FlightID   string                      `json:"flight_id,omitempty" example:"019d6773-ccca-71dd-b9c7-8e6f531deb90"`
	Inspection *ReserveAcInspectionSummary `json:"inspection,omitempty"`
	CreatedAt  string                      `json:"created_at,omitempty" example:"2026-04-14T08:00:00Z"`
	CreatedBy  string                      `json:"created_by,omitempty" example:"019d61db-53c6-7280-87ec-e65f205c6d3b"`
	UpdatedAt  string                      `json:"updated_at,omitempty" example:"2026-04-14T08:00:00Z"`
	UpdatedBy  string                      `json:"updated_by,omitempty" example:"019d61db-53c6-7280-87ec-e65f205c6d3b"`
	DeletedAt  string                      `json:"deleted_at,omitempty" example:"2026-04-14T08:00:00Z"`
	DeletedBy  string                      `json:"deleted_by,omitempty" example:"019d61db-53c6-7280-87ec-e65f205c6d3b"`
}

type ReserveAcLastDailyInfo struct {
	Name      string `json:"name" example:"Ganahl Stefan"`
	ShortName string `json:"short_name" example:"GAN"`
	Date      string `json:"date" example:"17.04.2026"`
	UTCTime   string `json:"utc_time" example:"10:57"`
}

type ReserveAcAircraftSummary struct {
	ID          string `json:"id" example:"019d6771-5fb5-7337-837f-bc5ed85181a1"`
	Designation string `json:"designation" example:"AIRBUS H145"`
	Identifier  string `json:"identifier" example:"D-HYAR"`
	Type        string `json:"type" example:"H145"`
	AOG         bool   `json:"aog" example:"false"`
	IsActive    bool   `json:"is_active" example:"true"`
}

type ReserveAcInspectionSummary struct {
	ID              string                             `json:"id" example:"019d6772-471c-7b70-b42a-d94020ef61e4"`
	InspectionDate  string                             `json:"inspection_date,omitempty" example:"2026-04-15"`
	Before          ReserveAcBeforeSectionDTO          `json:"before"`
	Prepare         ReserveAcPrepareSectionDTO         `json:"prepare"`
	FleetStatusFile ReserveAcFleetStatusFileSectionDTO `json:"fleet_status_file"`
}

type ReserveAcBeforeSectionDTO struct {
	Total         int                              `json:"total" example:"3"`
	Completed     int                              `json:"completed" example:"1"`
	DoneFiles     []ReserveAcFileChecklistItemDTO  `json:"done_file_checklist,omitempty"`
	Fields        *ReserveAcBeforeInspectionFields `json:"fields,omitempty"`
	FileChecklist []ReserveAcFileChecklistItemDTO  `json:"file_checklist"`
}

type ReserveAcPrepareSectionDTO struct {
	Total         int                             `json:"total" example:"3"`
	Completed     int                             `json:"completed" example:"1"`
	DoneFiles     []ReserveAcFileChecklistItemDTO `json:"done_file_checklist,omitempty"`
	PrepareFields *ReserveAcPrepareFields         `json:"prepare_fields,omitempty"`
	FileChecklist []ReserveAcFileChecklistItemDTO `json:"file_checklist"`
}

type ReserveAcFleetStatusFileSectionDTO struct {
	Total         int                             `json:"total" example:"2"`
	Completed     int                             `json:"completed" example:"1"`
	DoneFiles     []ReserveAcFileChecklistItemDTO `json:"done_file_checklist,omitempty"`
	FileChecklist []ReserveAcFileChecklistItemDTO `json:"file_checklist"`
}

type ReserveAcFileChecklistItemDTO struct {
	HelicopterFileID string `json:"helicopter_file_id" example:"019d7000-aaaa-7bbb-8ccc-111111111111"`
	FileAttachmentID string `json:"file_attachment_id,omitempty" example:"019d7000-aaaa-7bbb-8ccc-222222222222"`
	FileName         string `json:"file_name,omitempty" example:"Before Flight Checklist.pdf"`
	DownloadURL      string `json:"download_url,omitempty" example:"https://s3.localhost.localstack.cloud:4566/wucher-file-dev/files/2026/04/05/policy.pdf?X-Amz-Signature=..."`
	IsDone           bool   `json:"is_done" example:"false"`
	IsMandatory      bool   `json:"is_mandatory" example:"true"`
}

type ReserveAcBeforeInspectionFields struct {
	OilEngineNR1Checked       *bool    `json:"oil_engine_nr1_checked,omitempty"`
	OilEngineNR2Checked       *bool    `json:"oil_engine_nr2_checked,omitempty"`
	HydraulicLHChecked        *bool    `json:"hydraulic_lh_checked,omitempty"`
	HydraulicRHChecked        *bool    `json:"hydraulic_rh_checked,omitempty"`
	OilTransmissionMGBChecked *bool    `json:"oil_transmission_mgb_checked,omitempty"`
	OilTransmissionIGBChecked *bool    `json:"oil_transmission_igb_checked,omitempty"`
	OilTransmissionTGBChecked *bool    `json:"oil_transmission_tgb_checked,omitempty"`
	FuelAmount                *float64 `json:"fuel_amount,omitempty"`
	FuelUnit                  string   `json:"fuel_unit,omitempty"`
	FuelAddedAmount           *float64 `json:"fuel_added_amount,omitempty"`
	Note                      *string  `json:"note,omitempty"`
}

type ReserveAcPrepareFields struct {
	NotamBriefing         *bool `json:"notam_briefing,omitempty"`
	WeatherBriefing       *bool `json:"weather_briefing,omitempty"`
	OperationalFlightPlan *bool `json:"operational_flight_plan,omitempty"`
}

type LastDailyInspection struct {
	ID        []byte
	Name      string
	ShortName string
	At        time.Time
}

type LastDailyInspectionSummary struct {
	InspectionID string
	Status       string

	InspectorID        string
	InspectorName      string
	InspectorLicenseNo string

	BaseID           string
	BaseName         string
	BaseAbbreviation string
	BaseType         string

	InspectedAt time.Time

	InspectionFilesChecklistCompleted int
	InspectionFilesChecklistTotal     int
}
