bluedynamics / bda.plone.ticketshop

Sell tickets for events
Other
1 stars 1 forks source link

Why do we duplicate schema extenders here? #7

Closed thet closed 2 years ago

thet commented 8 years ago

E.g. this one: https://github.com/bluedynamics/bda.plone.ticketshop/blob/master/src/bda/plone/ticketshop/at/__init__.py#L279 is the same like that one: https://github.com/bluedynamics/bda.plone.shop/blob/master/src/bda/plone/shop/at.py#L268

It took me quite some time to find out, why the new item_stock_warning_threshold wasn't available on the schema until i found out, that the ticketshop extender overrides the one from the shop. I added the missing field in https://github.com/bluedynamics/bda.plone.ticketshop/commit/3f10985bbb818d2bb226fe041b360e3c472655c9

But I'm wondering, why do we need those extenders, especially if they look like they are the same? Or if we need them, cant we subclass the main ones from bda.plone.shop and get all updates to them for free?

thet commented 8 years ago

/cc @rnixx

rnixx commented 8 years ago

The extenders share the same API, which is required to fit contracts expected by b.p.shop. If you take a closer look there are custom field implementations which take care of shared stock data -> a requirement for selling tickets.

E.g., a theatre has 100 seats, but tickets have different pricing for children, adults and senior citizen, so tickets need to care about overall available seats.

thet commented 2 years ago

tnx for explaining, 6 years after explaining :)