activity.matching.interfaces

Classes

MatchableOccasion

Describes the interface required by the occasion class used by

MatchableBooking

Describes the interface required by the booking class used by

Module Contents

class activity.matching.interfaces.MatchableOccasion[source]

Describes the interface required by the occasion class used by the algorithm.

This allows us to untie our implementation from the database.

property id: uuid.UUID[source]
Abstractmethod:

The id of the occasion.

property max_spots: int[source]
Abstractmethod:

The maximum number of available spots.

property exclude_from_overlap_check: bool[source]
Abstractmethod:

True if bookings of this occasion are ignored during overlap checks.

property anti_affinity_group: str[source]
Abstractmethod:

Forces the occasion to not be accept an attendee that has an occasion of the same anti-affinity-group.

Note that the anti-affinity-group is ignored if the occasion is excluded from overlap checks.

See exclude_from_overlap_check().

class activity.matching.interfaces.MatchableBooking[source]

Describes the interface required by the booking class used by the algorithm.

This allows us to untie our implementation from the database.

abstract __eq__(other: object) bool[source]

The class must be comparable to other classes.

abstract __hash__() int[source]

The class must be hashable.

property id: uuid.UUID[source]
Abstractmethod:

The id of the booking.

property occasion_id: uuid.UUID[source]
Abstractmethod:

Returns the id of the occasion this booking belongs to.

property attendee_id: uuid.UUID[source]
Abstractmethod:

Returns the id of the attendee this booking belongs to.

property state: onegov.activity.models.booking.BookingState[source]
Abstractmethod:

Returns the state of the booking, one of:

  • “open” (for unassigned bookings)

  • “accepted” (for already accepted bookings)

  • “blocked” (for bookings blocked by another accepted booking)

property priority: int[source]
Abstractmethod:

Returns the priority of the booking. The higher the priority the further up the wishlist.

Bookings further up the wishlist are first passed to the occasions. All things being equal (i.e. the scores of the other bookings), this leads to a higher chance of placement.

property dates: Sequence[OccasionDate][source]
Abstractmethod:

Returns the dates of the booking.

property group_code: str | None[source]
Abstractmethod:

A code holding groups together. Grouped bookings are preferred over other bookings (so that groups may stay together).