mobivoc icon indicating copy to clipboard operation
mobivoc copied to clipboard

Add offers to civic structures

Open Jeremy-Gaillard opened this issue 5 years ago • 3 comments

The goodrelations cookbook has examples of complex pricings that require both Offers and PriceSpecifications to be modelled (quantity discounts most notably). These are the kind of pricing that I am currently trying to model for a parking facility.

In mobivoc, the Civic structure class only has Price specification in its range, which prevents the implementation of these complex pricings. Therefore, I suggest adding offers to the Civic structure class to fix this issue.

Jeremy-Gaillard avatar Mar 13 '19 14:03 Jeremy-Gaillard

Gone through it but does it also include a pricing model like for shared mobility where you pay a certain starting fee depending on certain conditions (day/night) and then an additional cost per time/distance or a combination of it with a possible cap above a certain amount?

pomgod avatar Mar 14 '19 14:03 pomgod

Some of the pricings I had to model are pretty close to what you are describing.

Here are a few examples of different offers described in JSON to express pricings of different parking facilities.

  • This one shows how you can mix different measures in the same offer
[{
// Monthly subscription to the parking facility
	"s:priceSpecification": [{
		"s:name": "Monthly subscription",
		"s:billingIncrement": 1,
		"s:unitCode": "MON",
		"s:referenceQuantity": {
			"s:value": 1
		},
		"mv:validForVehicle": "mv:Car",
		"s:price": 105.1
	},
// You can exit the parking 15 times without paying
	{
		"s:name": "15 free exits",
		"s:billingIncrement": 1,
		"s:unitText": "Exit",
		"s:referenceQuantity": {
			"s:value": 1
		},
		"mv:validForVehicle": "mv:Car",
		"s:price": 0,
		"s:eligibleQuantity": {
			"s:maxValue": 15
		}
	},
// Every additional exit is 6€ 
	{
		"s:name": "Additional exits",
		"s:billingIncrement": 1,
		"s:unitText": "Exit",
		"s:referenceQuantity": {
			"s:value": 1
		},
		"mv:validForVehicle": "mv:Car",
		"s:price": 6,
		"s:eligibleQuantity": {
			"s:minValue": 16
		}
	}]
}]
  • This one shows how you can have a price cap during a period of the day
[
// Parking with a 15 minutes interval pricing and a night-time cap of 5.85€
	{
		"s:priceSpecification": [{
			"s:name": "15 minutes",
			"s:billingIncrement": 15,
			"s:unitCode": "MIN",
			"s:referenceQuantity": {
				"s:value": 15
			},
			"mv:validForVehicle": "mv:Car",
			"s:price": 0.65
		}, {
			"s:name": "Night cap",
			"s:billingIncrement": 13,
			"s:unitCode": "HUR",
			"s:referenceQuantity": {
				"s:value": 13
			},
			"mv:validForVehicle": null,
			"s:price": 5.85,
			"s:validFrom": "20:00:00",
			"s:validThrough": "08:59:59"
		}]
	},
// Monthly subscription
	{
		"s:priceSpecification": [{
			"s:name": "Monthly illimited subscription",
			"s:billingIncrement": 1,
			"s:unitCode": "MON",
			"s:referenceQuantity": {
				"s:value": 1
			},
			"mv:validForVehicle": "mv:Car",
			"s:price": 177.3
		}]
	}
]
  • This one shows how you can have separate offers to indicate they are mutually exclusive
[
// Decreasing price over time: first 4 hours are billed 0.65€/15 minutes, the following ones 0.30€/15 minutes
	{
		"s:priceSpecification": [{
			"s:name": "15 minutes from 0 to 4h",
			"s:billingIncrement": 15,
			"s:unitCode": "MIN",
			"s:referenceQuantity": {
				"s:value": 15
			},
			"mv:validForVehicle": "mv:Car",
			"s:price": 0.65,
			"s:eligibleQuantity": {
				"s:maxValue": 4,
				"s:unitCode": "HUR"
			}
		}, {
			"s:name": "15 minutes over 4h",
			"s:billingIncrement": 15,
			"s:unitCode": "MIN",
			"s:referenceQuantity": {
				"s:value": 15
			},
			"mv:validForVehicle": "mv:Car",
			"s:price": 0.3,
			"s:eligibleQuantity": {
				"s:minValue": 4,
				"s:maxValue": 24,
				"s:unitCode": "HUR"
			}
		}]
	},
// day-long fees that can not be combined with the quarter-hour pricings
// described above (for example, you can not pay 1 day + 3 hours, you have to pay 2 days)
	{
		"s:priceSpecification": [{
			"s:name": "Day fee",
			"s:billingIncrement": 1,
			"s:unitCode": "DAY",
			"s:referenceQuantity": {
				"s:value": 1
			},
			"mv:validForVehicle": "mv:Car",
			"s:price": 20.95
		}]
	}
]

I think your example could be expressed using only PriceSpecifications. It seems to me the advantage of using Offers is mainly to be able to seperate different pricings that should not interact with one another (like in my third example).

Jeremy-Gaillard avatar Mar 18 '19 14:03 Jeremy-Gaillard

Thanks a lot for the idea & examples!

This project lives mostly from contributions based on research project requirements. Sometimes, contributions are also coming via students who focus on a certain topic.

if the need arises, I will have a look at this and see if I can include. But for now, the issue will stay open as an idea to be implemented in the future.

np00 avatar Jun 18 '19 14:06 np00