Commit Graph

232 Commits

Author SHA1 Message Date
Benjamin Dauvergne ece063b2b3 api: optimize get_all_slots() and around it (#42169)
Workflow in get_all_slots() is simplified :
* first we accumulate, for each desk, the set of time slots when a booking cannot
occur or is already booked,
* then we generate the list of possible time slots and match them to the
exclusion and already booked set.

Intervals is replaced by a simpler data-structure, IntervalSet, it does
not need to be a map, a simple set is enough.

Also :
* moved TimePeriod.get_effective_timeperiods() to the agenda level , it
deduplictes TimePeriod between desks and remove excluded TimePeriod for
virtual agendas.

* added a named-tuple WeekTime to represent a TimePeriod base unit, so
we can use them in IntervalSet easily (as they can be compared) to
compute the effective time periods,

* the fact that base_duration is unique for a given virtual agenda is
now accounted and stated everywhere,

* the fact that generated time slots must have time in the local
timezone for the API to work is now stated everywhere,

* In get_all_slots(), also :
  * integrated the code of get_exceptions_by_desk() into get_all_slots()
  to further reduce the number of SQL queries.
  * used_min/max_datetime is reduced by the exclusion periods, and
    effective time periods are grouped based on the used_min/max_datetime of
    each agenda.
  * pre-filter slots for uniqueness when generating available datetimes
    (but for filling slot we still need exact availability information
    for each desk)
2020-05-19 18:19:34 +02:00
Benjamin Dauvergne 3c5d056fa3 add test on metz data (#42169) 2020-05-19 14:54:55 +02:00
Lauréline Guérin ea908cde22
manager: view to duplicate a desk (#42626) 2020-05-18 10:21:59 +02:00
Lauréline Guérin d41b9ab20b
api: list bookings of user_external_id for an event (#40719) 2020-05-15 11:32:49 +02:00
Lauréline Guérin 1584b52ed3
agendas: add user_external_id field on Booking (#40719) 2020-05-15 11:15:41 +02:00
Lauréline Guérin 8e775f2bd3
api: fix fillslots api when meeting type id is not found (#42534) 2020-05-15 09:44:24 +02:00
Lauréline Guérin 19af0088ff
agendas: fix import when unknown field found (#42523) 2020-05-07 11:25:44 +02:00
Lauréline Guérin cc6da3d0a8
manager: fix exception form when start_datetime is invalid (#42397) 2020-05-05 14:59:24 +02:00
Lauréline Guérin 4d5d9a7c3c
agendas: fix import when missing exceptions or timeperiods (#42196) 2020-05-04 09:09:46 +02:00
Frédéric Péters 746e027573 api: include agenda details to fillslot response (#42360) 2020-05-03 18:58:15 +02:00
Frédéric Péters 9d0b76c82a api: reduce number of sql queries in datetimes API (#42142) 2020-05-01 09:29:17 +02:00
Benjamin Dauvergne 124ff4b0aa tests: use a temporary MEDIA_ROOT (#42325) 2020-04-30 12:56:17 +02:00
Emmanuel Cazenave 2748439c23 api: add more infos on places for an event agenda (#40412) 2020-03-31 14:47:12 +02:00
Emmanuel Cazenave 7c707f6674 virtual agendas: handle import/export (#40057) 2020-03-20 13:03:34 +01:00
Emmanuel Cazenave ec474b46d2 api: restrict slots with exluded timeperiods (#40058) 2020-03-20 13:03:34 +01:00
Emmanuel Cazenave aec5b30fd9 manager: add excluded timeperiods management (#40058) 2020-03-20 13:03:34 +01:00
Emmanuel Cazenave 55f6d0e47d virtual agendas: use real agendas booking delays (#40121)
If booking delays are defined on the virtual agenda, they will take
precedence.
2020-03-20 13:03:34 +01:00
Emmanuel Cazenave 2111a1872b manager: allow empty booking delays on virtual agendas (#40121) 2020-03-20 13:03:34 +01:00
Emmanuel Cazenave 06f542f851 virtual agendas: balance fill rate (#40056) 2020-03-20 13:03:34 +01:00
Emmanuel Cazenave e2f041511f manager: add views for virtual agendas (#37123) 2020-03-20 13:03:34 +01:00
Emmanuel Cazenave 565d471d07 start virtual agendas (#37123) 2020-03-20 13:03:34 +01:00
Lauréline Guérin f675e0e7ef
api: return overbooked_places in accept endpoint response (#40017) 2020-03-19 16:16:57 +01:00
Lauréline Guérin 8ea7b2ae37
api: endpoint to resize a booking (#40039) 2020-03-17 15:00:29 +01:00
Lauréline Guérin bccba482b4
api: can not cancel, accept or suspend a secondary booking (#40039) 2020-03-17 14:21:50 +01:00
Lauréline Guérin 5636c001ac
api: agendas endpoint with filtering (#37436) 2020-03-13 10:51:01 +01:00
Lauréline Guérin 65b1286d5e
make tests insensible to postgres/sqlite (#39583) 2020-03-13 10:20:43 +01:00
Lauréline Guérin 769f77c4c8
jenkins: run tests using postgres (#39583) 2020-03-13 10:20:43 +01:00
Lauréline Guérin 7062e587fb
agenda: fix sync_desks_timeperiod_exceptions command (#40497) 2020-03-06 14:12:33 +01:00
Frédéric Péters f6bb6282ac manager: display exceptions in day/month views (#39906) 2020-03-04 16:28:25 +01:00
Emmanuel Cazenave 3d9ea06ec7 general: reformat using black 2020-03-04 16:17:54 +01:00
Lauréline Guérin bd40148eed
api: add a param force_waiting_list to fillslot (#40022) 2020-03-03 15:26:24 +01:00
Frédéric Péters 04018eba29 misc: treat empty strings as null value when importing event slugs (#40327) 2020-03-02 13:58:32 +01:00
Lauréline Guérin 03cfebd156
event: show booking sorted by creation (#40019) 2020-02-28 09:58:33 +01:00
Lauréline Guérin 8d327c0dfe
api: add a suspend action on Booking (#40018) 2020-02-21 16:15:12 +01:00
Lauréline Guérin af17dc072f
agendas: keep the file of an exception source (#39259) 2020-02-14 09:50:46 +01:00
Frédéric Péters b2b1b82591 api: anchor routes at the start of strings (#39618) 2020-02-06 19:19:16 +01:00
Frédéric Péters baf109b11a manager: fix display of Januaries starting on week 52 or 53 (#39246) 2020-01-24 15:12:27 +01:00
Frédéric Péters 35bdf92dec manager: extend CSV import support to new attributes (#39128) 2020-01-20 20:03:51 +01:00
Valentin Deniaud 63853d67e8 templates: delete event from detail view (#38954) 2020-01-18 10:28:22 +01:00
Frédéric Péters 2bf1f8672a manager: use independent date/time inputs for datetime input (#27013) 2020-01-14 16:10:34 +01:00
Frédéric Péters 47829f9d76 agendas: treat remote ICS as UTF-8 if it looks like it (#38510) 2020-01-14 15:27:16 +01:00
Frédéric Péters 6988b225c9 manager: reduce number of queries when listing events (#38699) 2020-01-14 15:25:53 +01:00
Frédéric Péters 61496b5cdf general: add pricing & url attributes to events (#37979) 2020-01-14 15:25:53 +01:00
Frédéric Péters 6907bb1d3b manager: add direct links from event view to event options/delete (#20279) 2020-01-14 15:25:53 +01:00
Frédéric Péters 07e8f284ed manager: add detail view for events (#20279) 2020-01-14 15:25:53 +01:00
Frédéric Péters 7ada884db3 manager: update event URIs to be under /agendas/<pk>/ (#20279) 2020-01-14 15:25:53 +01:00
Frédéric Péters f1f7d8a7d7 manager: add view of events agenda for restricted users (#20279) 2020-01-14 15:25:53 +01:00
Benjamin Dauvergne 41d68d6fd7 tests: pin current time (#38737)
Recurring time period exceptions are computed for the next 600 days, on
a yearly recurrence there can be one or two occurences in the next 600
days. We pin time to 2018-12-01 to be sure there a two new years eve in
the following 600 days making tests on time period exceptions import
deterministic.
2020-01-04 10:49:57 +01:00
Valentin Deniaud d63a039bf2 manager: prevent emtpy first row in monthly view (#38700)
It could occur when weekend was hidden.
2019-12-24 12:16:16 +01:00
Valentin Deniaud ba94214d55 manager: hide weekend in monthly view when appropriate (#38687) 2019-12-24 11:02:27 +01:00