reservation.pricing_scheme ========================== .. py:module:: reservation.pricing_scheme Attributes ---------- .. autoapisummary:: reservation.pricing_scheme.AnyRequest reservation.pricing_scheme.PRICING_SCHEMES Classes ------- .. autoapisummary:: reservation.pricing_scheme.ResourcePricingScheme Module Contents --------------- .. py:type:: AnyRequest :canonical: Any .. py:data:: PRICING_SCHEMES :type: dict[str, type[ResourcePricingScheme]] .. py:class:: ResourcePricingScheme Defines a complex pricing scheme, that cannot be expressed using the regular available configuration knobs. These are generally extremely specific to single customers and while they do feature parameters that can be set per resource, the formula itself is static and should not be changed after its inital creation. If the formula needs to change we need to create a new scheme instead, so old reservations can keep relying on the old scheme. .. py:attribute:: __slots__ :value: () .. py:attribute:: name :type: ClassVar[str] .. py:attribute:: label :type: ClassVar[str] .. py:method:: __init_subclass__(name: str | None = None, label: str | None = None, **kwargs: Any) -> None :classmethod: .. py:method:: reservation_unit_price(reservation: onegov.reservation.Reservation, resource: onegov.reservation.Resource, submission_data: dict[str, Any] | None) -> decimal.Decimal | None :classmethod: :abstractmethod: Calculates the unit price for the given reservation. .. py:method:: extend_form[T: onegov.form.Form](form_class: type[T], request: AnyRequest) -> type[T] :classmethod: :abstractmethod: Extends the resource form with any fields specific to this pricing scheme. The fields should always set `depends_on=('pricing_scheme', cls.name)` and the field names schould be prefixed with the name of the pricing scheme, so they never conflict with the fields added by other pricing schemes.