import com.uca.flights.*;
import com.uca.bookings.*;

import java.text.SimpleDateFormat;
import java.time.Duration;

public class Start {

    public static void main(String[] args){
        /*Airport a1 = new Airport(new City(new CityId("c1"),"t1"), "ae1","n1");
        Airport a2 = new Airport(new City(new CityId("c2"),"t2"), "ae2","n2");
        Step s1 = new Step(a1,Duration.ZERO);
        Step s2 = new Step(a2,Duration.ofDays(1));
        Step s3 = new Step(a1,Duration.ofDays(2));
        Jump j2 = new Jump(s2,s3);
        Jump j1 = new Jump(s1,s2,j2);

        TripBuilder tb1 = new TripBuilder(s3);
        tb1.append(s1);
        tb1.toTrip();*/
        /*Vol volFinal = new Vol();

        SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy hh:mm");
        String dd = "21/10/2020 13:00";
        String da = "23/10/2020 02:15";

        try {
            volFinal.setDateDepart(format.parse(dd));
            volFinal.setDateArrivee(format.parse(da));
        } catch (Exception e){
            throw new RuntimeException("Unable to format to date");
        }

        System.out.println(volFinal.getDateArrivee());
        System.out.println(volFinal.obtenirDuree().toString().substring(2));






        //Bidirectional
        Vol vol = new Vol();
        vol.setNumero("abc1");

        Vol vol2 = new Vol();
        vol2.setNumero("abc2");

        Compagnie compagnie = new Compagnie();
        compagnie.setName("Air France");
        compagnie.addVol(vol);
        compagnie.addVol(vol2);

        for(Vol v : compagnie.getVols()){
            System.out.println(v.getNumero());
        }

        System.out.println(vol.getCompagnie().getName());
        System.out.println(vol2.getCompagnie().getName());

        vol2.setCompagnie(null);
        System.out.println(vol2.getCompagnie());

        for(Vol v : compagnie.getVols()){
            System.out.println(v.getNumero());
        }*/
    }
}
