@startuml

namespace core{
	abstract class DataBaseItem{
		-int64 id_
		-bool linked_to_database_
		-DataBaseItemPtr old_value_
		--
		-signal<void, DataBaseItem> signal_changed_
		--
		+DataBaseItem(int64 id)
		#DataBaseItem(DataBaseItem dbi)
		..
		{abstract} #bool changed()
		{abstract} +DataBaseItemPtr clone()
		+ bool sameDatabaseId(DataBaseItem dbi)
		..
		-int64 id()
		-setId(int64 id)
		#DataBaseItemPtr getOld()
		#void setOld()
		+bool linkedToDatabase()
		+signal<void, DataBaseItem> signalChanged()
	}

	class FullTank{
		#Date begin_date_
		#Date end_date_
		#double distance_
		#double volume_
		#double price_per_liter_
		--
		+FullTank(int64 id)
		+FullTank(…)
		#FullTank(FullTank ft)
		..
		#bool changed()
		+DataBaseItemPtr clone()
		+double totalPrice()
		+double consumption()
		+double pricePer100Km()
		+int duration()
		+double ConsumptionPerMonth()
		+double monthPrice()
		+Date meanDate()
		..
		+All getter and setter

	}
	DataBaseItem <|-- FullTank

	abstract class Need{
		#Date begin_date_
		#Date end_date_
		#int begin_km_
		#int end_km_
		#int delay_km_
		#int delay_year_
		#double price_
		--
		+Need(int64 id)
		+Need(…)
		#Need(Need n)
		..
		+bool need()
		{abstract}+string needName()
		+int dayBefore()
		+int kmBefore(int km)
		+double pricePerYear()
		+double pricePer100Km()
		+int age()
		+int km(int km)
		+bool currentlyUsed()
		..
		+All getter and setter
	}
	DataBaseItem <|-- Need

	abstract class PhysicalNeed{
		#string brand_
		#string model_
		--
		+PhysicalNeed(int64 id)
		+PhysicalNeed(…)
		#PhysicalNeed(PhysicalNeed n)
		..
		+All getter and setter
	}
	Need <|-- PhysicalNeed

	enum Wiper::Position{
		BOTTOM
		FRONT
	}

	class Wiper{
		#Wiper::Position position
		--
		+Wiper(int64 id)
		+Wiper(…)
		#Wiper(Wiper w)
		..
		#bool changed()
		+DataBaseItemPtr clone()
		+string needName
		..
		+All getter and setter
	}
	PhysicalNeed <|-- Wiper
	Wiper --> Wiper::Position

	enum Tyre::Position{
		BOTTOM_RIGHT
		BOTTOM_LEFT
		FRONT_RIGHT
		FRONT_LEFT
	}

	class Tyre{
		#Tyre::Position position
		--
		+Tyre(int64 id)
		+Tyre(…)
		#Tyre(Tyre t)
		..
		#bool changed()
		+DataBaseItemPtr clone()
		+string needName
		..
		+All getter and setter
	}
	PhysicalNeed <|-- Tyre
	Tyre --> Tyre::Position

	abstract class PlacedNeed{
		#string place
		--
		+PlacedNeed(int64 id)
		+PlacedNeed(…)
		#PlacedNeed(PlacedNeed n)
		..
		+All getter and setter
	}
	Need <|-- PlacedNeed

	class Service{
		--
		+Service(int64 id)
		+Service(…)
		#Service(Service s)
		..
		#bool changed()
		+DataBaseItemPtr clone()
		+string needName
	}
	PlacedNeed <|-- Service

	class Inspection{
		--
		+Inspection(int64 id)
		+Inspection(…)
		#Inspection(Inspection i)
		..
		#bool changed()
		+DataBaseItemPtr clone()
		+string needName
	}
	PlacedNeed <|-- Inspection

	class Insurance{
		string name_
		--
		+Insurance(int64 id)
		+Insurance(…)
		#Insurance(Insurance i)
		..
		#bool changed()
		+DataBaseItemPtr clone()
		+string needName
		..
		+All getter and setter
	}
	PlacedNeed <|-- Insurance

	enum Fuel{
		DIESEL
		GAS
		ELECTRICITY
		GPL
	}

	class Car{
		#string name_
		#string brand_
		#string model_
		#string plate_
		#string owner_
		#Date date_of_ownership_
		#double price_
		#Fuel fuel_
		#int distance_
		#list<FullTank> fulltanks_
		#Need* needs_[]
		--
		-signal<void, FullTank> signal_fulltank_added_
		-signal<void, Car, FullTank> signal_fulltank_removed_
		--
		+Car(…)
		#Car(Car car)
		..
		#bool changed()
		+DataBaseItemPtr clone()
		+double totalPrice()
		+double fullTankPricePerMonth()
		+double pricePerMonth()
		+double pricePerYear()
		+double consumption()
		+double fullTankPricePer100Km()
		+double pricePer100Km()
		+double fullTanksDistance()
		+double fullTanksVolume()
		+double fullTanksDuration()
		+double fullTanksPricePerLiter()
		+double fullTanksConsumptionPerMonth()
		..
		+All getter and setter
	}
	DataBaseItem <|-- Car
	Car --> Fuel
}

@enduml
