Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add offers to civic structures #53

Open
Jeremy-Gaillard opened this issue Mar 13, 2019 · 3 comments
Open

Add offers to civic structures #53

Jeremy-Gaillard opened this issue Mar 13, 2019 · 3 comments
Labels

Comments

@Jeremy-Gaillard
Copy link

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.

@pomgod
Copy link

pomgod commented Mar 14, 2019

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?

@Jeremy-Gaillard
Copy link
Author

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).

@np00
Copy link
Collaborator

np00 commented Jun 18, 2019

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 np00 added the idea label Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants