开发者

Car service database design (domain model)?

开发者 https://www.devze.com 2023-04-12 11:19 出处:网络
First of all I know that there is no Car, Model, Manufacture... tables that I probably should make, but that is not a problem right now.

First of all I know that there is no Car, Model, Manufacture... tables that I probably should make, but that is not a problem right now.

I must say that I have already made database and relational model looks like this (I simplified it, to concentrate on important), but I need to draw a conceptual (domain) model of this:

Client (clientID, name, surname, telephone)

Address (clientID, number, street, cityZipCode)

City (city开发者_Go百科ZipCode, cityName)

Visit (clientID, visitDate, totalPrice)

Service (serviceID, serviceName)

Criteria (criteriaName, size, measureUnit)

ServicePriceCriteria (serviceID, criteriaName, size, price)

VisitItem (clientID, visitDate, serviceID, criteriaName, size, quantity)

My the biggest problem was how to provide that ONE service can have different prices for different criteria.

i. e. Oil Changes for the truck costs 15€. For suv same service costs 8€.... Other example is when price depends on the size of the wheel. For 14 inches wheel some service costs 10€ and the same service for 17 inches wheel costs 15€.

So for the first example I have: Service(123, 'Oil Changes'), Criteria('typeOfVehicle', 'Truck', null), ServicePriceCriteria(123, 'typeOfVehicle', 'Truck', 15)

Service(123, 'Oil Changes'), Criteria('typeOfVehicle', 'SUV', null), ServicePriceCriteria(123, 'typeOfVehicle', 'SUV', 8)

For the second example it looks like this: Service(124, 'Some Service'), Criteria('Size of wheel', '14', inches), ServicePriceCriteria(124, 'Size of wheel', '14', 10)

Service(124, 'Some Service'), Criteria('Size of wheel', '17', inches), ServicePriceCriteria(124, 'Size of wheel', '17', 15)

I hope so you realized what was my idea. I wanna to ask you is this my solution acceptable at all? And is this correct domain model of this database:

Car service database design (domain model)?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号