package request

type EASAReleaseCreateAttributes struct {
	HelicopterID string `json:"helicopter_id" validate:"required,uuid" example:"019d6771-5fb5-7337-837f-bc5ed85181a1"`
	// ComplaintID — OPTIONAL complaint (UUIDv7) this release closes. Set it to scope the
	// release to a specific defect; leave empty for a standalone (aircraft-clear) release.
	ComplaintID string `json:"complaint_id,omitempty" validate:"omitempty,uuid" example:"019d6774-1111-7fba-9ef4-3795c0da8a13"`
	// FlightID — OPTIONAL flight context. Used for the standalone (no-complaint) sign-off gate.
	FlightID                   string  `json:"flight_id,omitempty" validate:"omitempty,uuid" example:"019d6774-98e8-7fba-9ef4-3795c0da8a13"`
	EASADate                   *string `json:"easa_date,omitempty" example:"2026-06-16"`
	EASAACHours                *string `json:"easa_ac_hours,omitempty" example:"1245.3"`
	EASALocation               *string `json:"easa_location,omitempty" example:"LOWI"`
	EASAWONo                   *string `json:"easa_wo_no,omitempty" example:"WO-2026-001"`
	EASAMaintManualRevAirframe *string `json:"easa_maint_manual_rev_airframe,omitempty" example:"Rev 12"`
	EASAMaintManualRevEngine   *string `json:"easa_maint_manual_rev_engine,omitempty" example:"Rev 8"`
	// EASASignerID — OPTIONAL contact id (UUIDv7) of the signer/technician. Required only to sign.
	EASASignerID *string `json:"easa_signer_id,omitempty" example:"019d61db-53c6-7280-87ec-e65f205c6d3b"`
	EASAPermitNo *string `json:"easa_permit_no,omitempty" example:"145.A.50"`
	// Sign, when true, signs the release immediately at creation. Requires all
	// required fields to be present; otherwise the request is rejected.
	Sign bool `json:"sign,omitempty" example:"false"`
}

type EASAReleaseCreateData struct {
	Type       string                      `json:"type" validate:"required,oneof=easa_release_create easa_release" example:"easa_release_create"`
	Attributes EASAReleaseCreateAttributes `json:"attributes" validate:"required"`
}

type EASAReleaseCreateRequest struct {
	Data EASAReleaseCreateData `json:"data" validate:"required"`
}

type EASAReleaseUpdateAttributes struct {
	EASADate                   *string `json:"easa_date,omitempty" example:"2026-06-16"`
	EASAACHours                *string `json:"easa_ac_hours,omitempty" example:"1245.3"`
	EASALocation               *string `json:"easa_location,omitempty" example:"LOWI"`
	EASAWONo                   *string `json:"easa_wo_no,omitempty" example:"WO-2026-001"`
	EASAMaintManualRevAirframe *string `json:"easa_maint_manual_rev_airframe,omitempty" example:"Rev 12"`
	EASAMaintManualRevEngine   *string `json:"easa_maint_manual_rev_engine,omitempty" example:"Rev 8"`
	// EASASignerID — OPTIONAL contact id (UUIDv7) of the signer/technician. Required only to sign.
	EASASignerID *string `json:"easa_signer_id,omitempty" example:"019d61db-53c6-7280-87ec-e65f205c6d3b"`
	EASAPermitNo *string `json:"easa_permit_no,omitempty" example:"145.A.50"`
}

type EASAReleaseUpdateData struct {
	Type       string                      `json:"type" validate:"required,oneof=easa_release_update easa_release" example:"easa_release_update"`
	ID         string                      `json:"id" validate:"required" example:"019d6771-5fb5-7337-837f-bc5ed85181a1"`
	Attributes EASAReleaseUpdateAttributes `json:"attributes" validate:"required"`
}

type EASAReleaseUpdateRequest struct {
	Data EASAReleaseUpdateData `json:"data" validate:"required"`
}
