packages feed

casa-reoc-0.1.0.0: examples/src/ReOC/Example/Saltbush.hs

{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wall #-}

{- | A crop and pasture survey business in South Australia's Mid North. Its
CEO is a general manager who is not a director and does not fly; its chief
remote pilot, who obtained their RePL through private pilot licence theory,
is also its maintenance controller. It operates a multirotor, a fixed-wing
and a powered-lift RPA, engages seasonal remote pilots, and conducts only
solo operations. It discloses a suspended driver licence, and a director
makes the declaration.

The application starts as 'mkUnfilledReOC', and each field is set with its
optic; 'fillReOC' then checks it. The company, its people, numbers and
addresses are made up.
-}
module ReOC.Example.Saltbush (
  saltbushInput,
  saltbush,
) where

import Control.Lens ((&), (.~), (?~))
import Data.List.NonEmpty (NonEmpty)
import qualified Data.Time.Calendar.Month as Month
import ReOC.Example.Aircraft (agEagleEBeeX, aircraft, djiMavic3Multispectral, equipment, operatedType, wingtraOneGenII)
import ReOC.Example.Policies (examplePolicies)
import ReOC.Example.Risk
import ReOC.Fill (fillReOC)
import ReOC.Model

-- | The application of Saltbush Ag Surveys Pty Ltd, as it is filled in.
saltbushInput :: UnfilledReOC
saltbushInput =
  mkUnfilledReOC
    -- the company, with its operational headquarters on a farm
    & operator . company . companyName ?~ "Saltbush Ag Surveys"
    & operator . company . abn ?~ "40 941 019 012"
    & operator . company . arn ?~ "9990401"
    & operator . company . registeredOffice . streetAddress .~ ["9 Quandong Street"]
    & operator . company . registeredOffice . suburb ?~ "Clare"
    & operator . company . registeredOffice . stateOrTerritory ?~ SouthAustralia
    & operator . company . registeredOffice . postcode ?~ "5453"
    & operator . company . operationalHeadquarters
      ?~ OperationalHeadquartersAddress
        ( mkUnfilledAddress
            & streetAddress .~ ["Shed 2, 1410 Saltbush Road"]
            & suburb ?~ "Andrews"
            & stateOrTerritory ?~ SouthAustralia
            & postcode ?~ "5454"
        )
    & operator . company . phoneNumber ?~ "08 7010 3365"
    & operator . company . emailAddress ?~ "office@saltbushag.example"
    -- the CEO, a general manager who is not a director
    & operator . keyPersonnel . chiefExecutive . nominee . person . fullName ?~ "Graham Pickering"
    & operator . keyPersonnel . chiefExecutive . nominee . person . arn ?~ "9990402"
    & operator . keyPersonnel . chiefExecutive . nominee . person . phoneNumber ?~ "0491 573 770"
    & operator . keyPersonnel . chiefExecutive . nominee . person . emailAddress ?~ "graham@saltbushag.example"
    & operator . keyPersonnel . chiefExecutive . nominee . otherQualifications .~ ["a Bachelor of Agricultural Science"]
    & operator . keyPersonnel . chiefExecutive . nominee . aviationExperience
      ?~ "no remote pilot experience; ten years of engaging aerial agricultural operators as a farm manager"
    & operator . keyPersonnel . chiefExecutive . directorStatus ?~ NotADirector
    & operator . keyPersonnel . chiefExecutive . managementExperience
      ?~ "General manager of Saltbush Ag Surveys Pty Ltd, appointed by its directors with authority over its finances and staff. Twenty years managing broadacre farms of up to 6,000 ha, including staff, contractors, chemical and work health and safety obligations."
    -- the chief remote pilot, also the maintenance controller
    & operator . keyPersonnel . chiefPilot . crpNominee
      ?~ CRPNominated
        ( mkUnfilledNominee
            & person . fullName ?~ "Jess Varga"
            & person . arn ?~ "9990403"
            & person . phoneNumber ?~ "0491 573 087"
            & person . emailAddress ?~ "jess@saltbushag.example"
            & otherQualifications .~ ["a private pilot licence (aeroplane)", "a Certificate III in Agriculture"]
            & aviationExperience ?~ "about 450 hours of RPA survey operations and 210 hours as pilot in command of light aeroplanes"
        )
    & operator . keyPersonnel . chiefPilot . rePLOrigin ?~ PPLTheory
    & operator . keyPersonnel . chiefPilot . rpaHistory
      ?~ "Holds RePL, multirotor and aeroplane up to 7 kg, and powered-lift up to 25 kg, obtained through PPL theory. About 450 hours on DJI Mavic 3 Multispectral, Phantom 4 Multispectral, AgEagle eBee X and WingtraOne, in crop and pasture surveys in SA."
    & operator . keyPersonnel . chiefPilot . otherReOCRoles ?~ NoOtherReOCRoles
    & operator . keyPersonnel . chiefPilot . radio ?~ FlightCrewLicence
    & operator . keyPersonnel . mcNominee ?~ MCIsCRP
    -- a multirotor, a fixed-wing and a powered-lift RPA
    & operator . fleet
      .~ [ operatedType
            djiMavic3Multispectral
            [ aircraft "1581F6MPD24A0090" [equipment "DJI RC Pro Enterprise remote controller" "5ZDCL1N0C40220"]
            , aircraft "1581F6MPD24A0133" [equipment "DJI RC Pro Enterprise remote controller" "5ZDCL1N0C40247"]
            ]
         , operatedType
            agEagleEBeeX
            [aircraft "EBX-2-0877" [equipment "Aeria X camera" "AX-11592", equipment "eBee ground modem" "GM2-28810"]]
         , operatedType
            wingtraOneGenII
            [ aircraft
                "WT2-004518"
                [equipment "Sony RX1R II camera" "3910447", equipment "WingtraPilot tablet and telemetry radio" "WTR-22071"]
            ]
         ]
    -- a disclosed history, and a declaration by a director
    & applicationForm . primaryContact ?~ ApplicantIsPrimaryContact
    & applicationForm . personnelHistory . actionTaken ?~ NoHistory
    & applicationForm . personnelHistory . transportLicenceRefused
      ?~ HistoryDisclosed
        (Just "Graham Pickering (CEO): driver licence suspended for 3 months in 2021 for demerit points; reinstated in 2021, no further offences.")
    & applicationForm . personnelHistory . criminalConviction ?~ NoHistory
    & applicationForm . personnelHistory . suspensionPending ?~ NoHistory
    & applicationForm . regulatoryHistory ?~ NoRegulatoryAction
    & applicationForm . proceduresLibrary ?~ False
    & applicationForm . declaration
      ?~ DeclaredByOther
        ( mkUnfilledDeclarant
            & fullName ?~ "Kate Pickering"
            & role ?~ "Director"
        )
    -- the operations manual
    & operationsManual . firstIssue . version . majorVersion ?~ 1
    & operationsManual . firstIssue . version . minorVersion ?~ 0
    & operationsManual . firstIssue . issueDate ?~ m
    & operationsManual . firstIssue . effective ?~ "On issue of the ReOC"
    & operationsManual . firstIssue . parts ?~ "All"
    & operationsManual . firstIssue . details ?~ "Initial issue for the ReOC application."
    & operationsManual . services
      .~ [ "multispectral crop health surveys"
         , "pasture biomass mapping"
         , "elevation surveys for drainage and contour banks"
         , "inspection of stock water, fences and storm damage"
         ]
    & operationsManual . policies .~ examplePolicies
    & operationsManual . policies . dutyHours ?~ 11
    & operationsManual . policies . inspectionMonths ?~ 6
    & operationsManual . policies . inspectionHours ?~ 50
    & operationsManual . policies . batteryReserve ?~ 25
    & operationsManual . policies . independentReviewYears ?~ 3
    & operationsManual . riskRegister
      .~ [peopleRisk m]
        <> airspaceRisks m
        <> [ commandLinkRisk m
           , batteryRisk m
           , weatherRisk m
           , riskEntry
              m
              "Agricultural aircraft spraying or spreading nearby"
              "Mid-air collision with an agricultural aircraft working below 500 ft"
              "VLOS lookout; give way to crewed aircraft (2.4.2)"
              (Remote, Catastrophic)
              "Landholder asked about planned aerial application before each job; neighbouring operators contacted in spraying season; CTAF monitored; RPA landed when an aircraft is heard"
              (ExtremelyImprobable, Catastrophic)
              ChiefRemotePilot
           , riskEntry
              m
              "Long mapping missions in automated flight"
              "RPA leaves VLOS or the operating area"
              "Mission planned within VLOS; boundary checked in planning (App C)"
              (Remote, Moderate)
              "Large paddocks split into missions that stay within VLOS of a control point; RP moves with the RPA where needed"
              (Improbable, Moderate)
              ChiefRemotePilot
           , riskEntry
              m
              "Livestock, farm machinery and farm workers"
              "Stock startled into fences; RPA strikes a worker or machinery"
              "30 m from people; onsite validation (2.3, 2.4.6)"
              (Remote, Minor)
              "Landholder told of flight times; paddocks with stock surveyed at height; take-off away from machinery"
              (Improbable, Minor)
              ChiefRemotePilot
           , riskEntry
              m
              "Working alone in remote areas"
              "Delayed help after injury, vehicle breakdown or fire"
              "Fitness for duty requirements (1.7)"
              (Remote, Hazardous)
              "Daily check-in with the office; satellite messenger carried; fire extinguisher in the vehicle; no flights on total fire ban days"
              (Improbable, Moderate)
              ChiefExecutiveOfficer
           , fitnessRisk ChiefExecutiveOfficer m
           , recencyRisk m
           , firmwareRisk m
           ]
    & operationsManual . crew ?~ SoloOperationsOnly
    & operationsManual . pilots ?~ OtherRemotePilots
 where
  m = Month.YearMonth 2026 6

-- | The application of Saltbush Ag Surveys Pty Ltd: valid, or every reason it is not.
saltbush :: Either (NonEmpty ReOCError) ReOC
saltbush =
  fillReOC saltbushInput