Class Order

java.lang.Object
com.prog3.ipt.Model.CitizenClasses.Order

public class Order extends Object
Order is a class that represents a purchase commit by a citizen due to buy tickets and season tickets offered for sale by the system
  • Field Details

    • transactionCode

      private String transactionCode
    • purchaseDate

      private LocalDate purchaseDate
    • purchasePrice

      private double purchasePrice
    • citizenID

      private String citizenID
    • paymentMethodStrategy

      private PaymentMethodStrategy paymentMethodStrategy
    • purchaseList

      private ArrayList<TravelDocument> purchaseList
    • purchaseObservableList

      private javafx.collections.ObservableList<TravelDocumentFX> purchaseObservableList
  • Constructor Details

    • Order

      public Order(String transactionCode, LocalDate purchaseDate, double purchasePrice, String citizenID, PaymentMethodStrategy paymentMethodStrategy, ArrayList<TravelDocument> purchaseList, javafx.collections.ObservableList<TravelDocumentFX> purchaseObservableList)
      Order constructor
      Parameters:
      transactionCode - The unique identifier of the transaction commit by a citizen
      purchaseDate - Date on which the transaction took place
      purchasePrice - Total cost of the transaction
      citizenID - Citizen who commit transaction
      paymentMethodStrategy - Method used to pay for the transaction
      purchaseList - List of purchases made by the transaction
      purchaseObservableList - FX Object which represents list of purchases made by the transaction
  • Method Details

    • setTransactionCode

      void setTransactionCode(String transactionCode)
    • setPurchaseDate

      void setPurchaseDate(LocalDate purchaseDate)
    • setPurchasePrice

      void setPurchasePrice(double purchasePrice)
    • setCitizenID

      void setCitizenID(String citizenID)
    • setPaymentMethodStrategy

      void setPaymentMethodStrategy(PaymentMethodStrategy paymentMethodStrategy)
    • setPurchaseList

      void setPurchaseList(ArrayList<TravelDocument> purchaseList)
    • setPurchaseObservableList

      void setPurchaseObservableList(javafx.collections.ObservableList<TravelDocumentFX> purchaseObservableList)
    • getTransactionCode

      public String getTransactionCode()
    • getPurchaseDate

      public LocalDate getPurchaseDate()
    • getPurchasePrice

      public double getPurchasePrice()
    • getCitizenID

      public String getCitizenID()
    • getPaymentMethodStrategy

      public PaymentMethodStrategy getPaymentMethodStrategy()
    • getPurchaseList

      public ArrayList<TravelDocument> getPurchaseList()
    • getPurchaseObservableList

      public javafx.collections.ObservableList<TravelDocumentFX> getPurchaseObservableList()
    • addTravelDocument

      public void addTravelDocument(TravelDocument travelDocumentObject)
      Adds a reference to a TravelDocument object into an ArrayList object, then gets the equivalent FX TravelDocument object of TravelDocument object and adds reference to it into an ObservableList. In the end adds the cost of the TravelDocument object in question to the total amount of the transaction.
      Parameters:
      travelDocumentObject - Travel document bought by transaction
    • removeTravelDocument

      public void removeTravelDocument(TravelDocument travelDocumentObject)
      Removes a reference to a TravelDocument object into an ArrayList object, then gets the equivalent FX TravelDocument object of TravelDocument object and removes reference to it into an ObservableList. In the end removes the cost of the TravelDocument object in question to the total amount of the transaction.
      Parameters:
      travelDocumentObject - Travel document to remove from transaction
    • addTravelDocumentFX

      public void addTravelDocumentFX(TravelDocumentFX travelDocumentFXObject)
      Gets the equivalent TravelDocument object of FX TravelDocument object and adds reference to it into an ArrayList. Adds a reference to a FX TravelDocument object into an ObservableList object. In the end adds the cost of the FX TravelDocument object in question to the total amount of the transaction.
      Parameters:
      travelDocumentFXObject - FX object of Travel document bought by transaction
    • removeTravelDocumentFX

      public void removeTravelDocumentFX(TravelDocumentFX travelDocumentFXObject)
      Gets the equivalent TravelDocument object of FX TravelDocument object and removes reference to it into an ArrayList. Removes a reference to a FX TravelDocument object into an ObservableList object. In the end removes the cost of the FX TravelDocument object in question to the total amount of the transaction.
      Parameters:
      travelDocumentFXObject - FX object of Travel document to remove from transaction
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object