package request

type DutyRosterShiftTime struct {
	ShiftStart string `json:"shift_start,omitempty" example:"06:00"`
	ShiftEnd   string `json:"shift_end,omitempty" example:"21:00"`
}

type DutyRosterShiftDate struct {
	DateStart string `json:"date_start,omitempty" example:"2026-03-16"`
	DateEnd   string `json:"date_end,omitempty" example:"2026-03-16"`
}

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

type DutyRosterPilotCrewInput struct {
	ID               string               `json:"id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	ShiftDate        *DutyRosterShiftDate `json:"shift_date,omitempty"`
	FlightInstructor bool                 `json:"flight_instructor,omitempty"`
	LineChecker      bool                 `json:"line_checker,omitempty"`
	Supervisor       bool                 `json:"supervisor,omitempty"`
	Examiner         bool                 `json:"examiner,omitempty"`
	CoPilot          bool                 `json:"co_pilot,omitempty"`
	CrewType         string               `json:"crew_type,omitempty" example:"main" enums:"main,additional"`
}

type DutyRosterOtherPersonInput struct {
	// OtherPersonID — OPTIONAL master person id to reuse (from GET /contact/other).
	// When set, name/mobile_phone/email are snapshotted from the master (may be omitted).
	OtherPersonID string `json:"other_person_id,omitempty" example:"019d6771-5fb5-7337-837f-bc5ed85181a1"`
	Name          string `json:"name,omitempty" example:"Guest Person"`
	MobilePhone   string `json:"mobile_phone,omitempty" example:"+43-1234"`
	Email         string `json:"email,omitempty" example:"guest@example.com"`
}

type DutyRosterDetailsInput struct {
	Pilot       []DutyRosterPilotCrewInput   `json:"pilot"`
	Doctor      []DutyRosterCrewInput        `json:"doctor"`
	Rescuer     []DutyRosterCrewInput        `json:"rescuer"`
	Helper      []DutyRosterCrewInput        `json:"helper"`
	OtherPerson []DutyRosterOtherPersonInput `json:"other_person"`
}

type DutyRosterCreateAttributes struct {
	BaseID    string                 `json:"base_id" validate:"required"`
	DutyDate  string                 `json:"duty_date" validate:"required"`
	ShiftTime DutyRosterShiftTime    `json:"shift_time"`
	Detail    DutyRosterDetailsInput `json:"roster_detail"`
}

type DutyRosterCreateData struct {
	Type       string                     `json:"type" validate:"required,oneof=duty_roster_create duty_roster"`
	Attributes DutyRosterCreateAttributes `json:"attributes" validate:"required"`
}

type DutyRosterCreateRequest struct {
	Data DutyRosterCreateData `json:"data" validate:"required"`
}

type DutyRosterUpdateAttributes struct {
	BaseID    *string                 `json:"base_id,omitempty"`
	DutyDate  *string                 `json:"duty_date,omitempty"`
	ShiftTime *DutyRosterShiftTime    `json:"shift_time,omitempty"`
	Detail    *DutyRosterDetailsInput `json:"roster_detail,omitempty"`
}

type DutyRosterUpdateData struct {
	Type       string                     `json:"type" validate:"required,oneof=duty_roster_update duty_roster"`
	ID         string                     `json:"id"`
	Attributes DutyRosterUpdateAttributes `json:"attributes" validate:"required"`
}

type DutyRosterUpdateRequest struct {
	Data DutyRosterUpdateData `json:"data" validate:"required"`
}

type DutyRosterDeleteCrewAttributes struct {
	Detail DutyRosterDetailsInput `json:"roster_detail"`
}

type DutyRosterDeleteCrewData struct {
	Type       string                         `json:"type" validate:"required,oneof=duty_roster_crew_delete duty_roster_update duty_roster"`
	Attributes DutyRosterDeleteCrewAttributes `json:"attributes" validate:"required"`
}

type DutyRosterDeleteCrewRequest struct {
	Data DutyRosterDeleteCrewData `json:"data" validate:"required"`
}

type DutyRosterDeleteCrewByIDAttributes struct {
	RosterID string `json:"roster_id" validate:"required"`
	CrewID   string `json:"crew_id" validate:"required"`
}

type DutyRosterDeleteCrewByIDData struct {
	Type       string                             `json:"type" validate:"required,oneof=duty_roster_crew_delete duty_roster_update duty_roster"`
	Attributes DutyRosterDeleteCrewByIDAttributes `json:"attributes" validate:"required"`
}

type DutyRosterDeleteCrewByIDRequest struct {
	Data DutyRosterDeleteCrewByIDData `json:"data" validate:"required"`
}

type DutyRosterAnyDeleteData struct {
	ID string `json:"id" validate:"required" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
}

type DutyRosterAnyDeleteRequest struct {
	Data DutyRosterAnyDeleteData `json:"data" validate:"required"`
}

// DutyRosterAnyCreateRequestDoc is documentation-only schema for cleaner Swagger examples.
type DutyRosterAnyCreateRequestDoc struct {
	Data DutyRosterAnyCreateDataDoc `json:"data"`
}

type DutyRosterAnyCreateDataDoc struct {
	Type       string                           `json:"type" example:"duty_roster_create" enums:"duty_roster_create,duty_roster"`
	Attributes DutyRosterAnyCreateAttributesDoc `json:"attributes"`
}

type DutyRosterAnyCreateAttributesDoc struct {
	BaseID    string                       `json:"base_id" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	DutyDate  string                       `json:"duty_date" example:"2026-03-16"`
	ShiftTime DutyRosterShiftTime          `json:"shift_time"`
	Detail    DutyRosterAnyCreateDetailDoc `json:"roster_detail"`
}

type DutyRosterAnyCreateDetailDoc struct {
	Pilot       []DutyRosterPilotAdditionalExampleDoc `json:"pilot"`
	Doctor      []DutyRosterCrewInput                 `json:"doctor"`
	Rescuer     []DutyRosterCrewInput                 `json:"rescuer"`
	Helper      []DutyRosterCrewInput                 `json:"helper"`
	OtherPerson []DutyRosterOtherPersonInput          `json:"other_person"`
}

type DutyRosterPilotAdditionalExampleDoc struct {
	ID               string `json:"id" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	CrewType         string `json:"crew_type" example:"additional" enums:"main,additional"`
	FlightInstructor bool   `json:"flight_instructor" example:"true"`
}
