activity.matching.interfaces

Module Contents

Classes

MatchableOccasion

Describes the interface required by the occasion class used by

MatchableBooking

Describes the interface required by the booking class used by

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.

abstract property id: uuid.UUID[source]

The id of the occasion.

abstract property max_spots: int[source]

The maximum number of available spots.

abstract property exclude_from_overlap_check: bool[source]

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

abstract property anti_affinity_group: str[source]

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 property id: uuid.UUID[source]

The id of the booking.

abstract property occasion_id: uuid.UUID[source]

Returns the id of the occasion this booking belongs to.

abstract property attendee_id: uuid.UUID[source]

Returns the id of the attendee this booking belongs to.

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

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)

abstract property priority: int[source]

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.

abstract property dates: Sequence[OccasionDate][source]

Returns the dates of the booking.

abstract property group_code: str | None[source]

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

abstract __eq__(other: object) bool[source]

The class must be comparable to other classes.

abstract __hash__() int[source]

The class must be hashable.