PriceCalculator - ob-vss-ss18/ppl-core GitHub Wiki

Der PriceCalculator-Service ist für die Berechnung von Leasing- und Verleihvorgängen zuständig. Er erhält über API eine Liste von Items sowie die Art (Leasing/Verleih) und evtl. vorhandene (Familien-) Rabatte und Vergünstigungen und erstellt damit eine Auflisrung der Kosten und die entgültigen Kosten. Dieses Listung wird als Grundlage für die Rechnung genommen.


type RootQuery {
    calculateTotalPrice(items: [Item]): Float
}

input Item {
  family_discount: Int!
  discout_perc: Float!
  additional_stuff: Float!

  # you need id and itemType (not supportet yet) or
  # price_new, condition and amortisation_factor
  id: Int
  itemType: ItemType

  price_new: Float
  condition: Condition
  amortisation_factor: Float
}

enum ItemType {
  SKI
  STICK
}

enum Condition {
  NEW
  USED
}