package com.bytesw.bytebot.bean;

import com.bytesw.bytebot.model.Flight;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Getter
@Setter
public class FlightBean {
    @Expose
    private Long id;

    @Expose
    private String airline;

    @Expose
    private String airplane;

    @Expose
    private Long originAirportId;

    @Expose
    private String originAirportName;

    @Expose
    private Long destinationAirportId;

    @Expose
    private String destinationAirportName;

    @Expose
    private String departureDate;

    @Expose
    private String arrivalDate;

    @Expose
    private String departureTime;

    @Expose
    private String arrivalTime;

    public static FlightBean miniClone(Flight flight) {
        FlightBean bean = new FlightBean();

        bean.setId(flight.getId());
        bean.setAirplane(flight.getAirplane());
        bean.setAirline(flight.getAirline());
        bean.setArrivalDate(flight.getArrivalDate());
        bean.setDepartureDate(flight.getDepartureDate());
        bean.setArrivalTime(flight.getArrivalTime());
        bean.setDepartureTime(flight.getDepartureTime());
        bean.setOriginAirportName(flight.getOrigin().getAirportName());
        bean.setDestinationAirportName(flight.getDestination().getAirportName());

        return bean;
    }
}
