The deal reached shortly after midnight on Sunday, is a four-year collective agreement that prevents a major shutdown of Canada's largest airline.