Commit Graph

45 Commits

Author SHA1 Message Date
Benjamin Dauvergne dbffe4bef0 api: simplify push_rdv()/upload_rdvs() (#89609)
gitea/ants-hub/pipeline/head This commit looks good Details
* all errors are transmitted through exceptions
* last_upload is always updated even if no API call is necessary
* report when DELETE returns rowcount=0 or POST is not success
2024-04-18 17:58:32 +02:00
Benjamin Dauvergne 99a25b6df9 misc: add logo_url to JSON schema of rdv-disponibles (#89726)
gitea/ants-hub/pipeline/head This commit looks good Details
2024-04-18 16:18:51 +02:00
Benjamin Dauvergne 13a9f6e7af api: do not return canceled rendez-vous in searchApplicationIds (#89729)
gitea/ants-hub/pipeline/head This commit looks good Details
2024-04-18 14:15:24 +02:00
Benjamin Dauvergne a8553f0c72 api: send a correct management_url to /api/appointments (#89529)
gitea/ants-hub/pipeline/head This commit looks good Details
2024-04-14 12:58:35 +02:00
Benjamin Dauvergne 8fafb09a47 api/chrono: does not return HTTP 500 with error "too busy" (#84817)
gitea/ants-hub/pipeline/head This commit looks good Details
2023-12-17 14:12:57 +01:00
Benjamin Dauvergne 0d4155ed3d api/ants: check existing appointments before creating/deleting (#83558)
gitea/ants-hub/pipeline/head This commit looks good Details
2023-11-15 22:54:48 +01:00
Benjamin Dauvergne 455218cdc0 api/ants: fix setting of last_upload (#83553)
gitea/ants-hub/pipeline/head This commit looks good Details
2023-11-15 18:51:35 +01:00
Benjamin Dauvergne 64cbac4ccc chrono: normalize identifiant_predemande when received (#83552)
gitea/ants-hub/pipeline/head This commit looks good Details
2023-11-15 18:06:40 +01:00
Benjamin Dauvergne 98c1546c48 ants: normalize and check identifiant_predemande on push (#83552) 2023-11-15 17:58:07 +01:00
Benjamin Dauvergne 0fa00339c6 Reimplement predemandes API over the new rdv-status API (#76412)
gitea/ants-hub/pipeline/head This commit looks good Details
To simplify migration from the old to the new API.
2023-11-15 15:31:19 +01:00
Benjamin Dauvergne 2f9cd366b3 Implement new rdv-status endpoint (#76412)
* Use the new /api/status endpoint the "Optimisation des rendez-vous en
  mairies" to check status of some "application_ids" / "identifiants de
  pré-demande".
* Always return "err": 0 if the web-service responds, and return a
  simple "accept_rdv" boolean to test in w.c.s. conditions. It prevents
  useless logged errors,
* When accept_rdv is false, the message key contains the reason to show
  to users and an eventual list of appointments with the concerned
  identifiant_predemande:

    {
      "data": {
         "accept_rdv": false,
         "message": "Prédemande·\"ABCDE12345\"·déjà·liée·à·un·ou·des·rendez-vous.",
         "appointments": [
             {
                "appointment_date": "2023-09-20T09:00:11",
                "identifiant_predemande": "ABCDE12345",
                "management_url": "https://rdvenmairie.fr/gestion/login?ants=83AHERZY8F&appointment_id=64594c435d7bfc0012fa8c87&canceled=true",
                "meeting_point": "Mairie de Luisant",
             }
         ],
    }
2023-11-15 13:02:54 +01:00
Benjamin Dauvergne d5e6f79257 Implement API v2 "Optimistion des rendez-vous en mairies" (#76412)
Swagger: https://rdvmairie-optimisation-dev.osc-secnum-fr1.scalingo.io/docs

* RendezVous models are now soft-deleted through the canceled datetime
  field when specifically stated as 'annule' on the
  rendez-vous-disponible endpoint or when absent from a full update,
* last-upload timestamp field on the RendezVous model allow filtering of
  created/updated RendezVous instances to push,
* new configuration keys are added to store the authentication token and
  base URL of the new API endpoints.
* new command upload-rdvs is run every 3 minutes by uwsgi cron to push
  new/deleted rendez-vous into the ANTS database.
* soft-deleted rendez-vous are excluded from aggregated statistics on
  active rendez-vous
* Tests added for success and error path in ants_hub.api.ants routines.
2023-11-15 13:02:54 +01:00
Benjamin Dauvergne b0c2736d63 Revert "use correct iso8601 datetime in availableTimeSlots (#80133)"
gitea/ants-hub/pipeline/head This commit looks good Details
This reverts commit ee5bda2f36.
2023-09-13 15:17:48 +02:00
Benjamin Dauvergne ee5bda2f36 use correct iso8601 datetime in availableTimeSlots (#80133)
gitea/ants-hub/pipeline/head This commit looks good Details
2023-09-05 19:09:33 +02:00
Benjamin Dauvergne 3c4b0b50b5 chrono: allow asking for many pre-demandes statuses (#80597)
gitea/ants-hub/pipeline/head This commit looks good Details
2023-08-28 11:58:24 +02:00
Benjamin Dauvergne 1927c358f7 retry on exception 'database is locked' (#80538)
gitea/ants-hub/pipeline/head This commit looks good Details
2023-08-24 17:27:12 +02:00
Valentin Deniaud 6931c3cee1 misc: apply double-quote-string-fixer (#79788) 2023-08-16 11:52:13 +02:00
Benjamin Dauvergne a4dfa63d98 tests: use different latitude and longitude in fixture
gitea/ants-hub/pipeline/head This commit looks good Details
2023-06-22 18:30:24 +02:00
Benjamin Dauvergne 8ec5582d9b api/chrono: fix cancellation of a rendez-vous with full synchronisation (#78692)
gitea/ants-hub/pipeline/head This commit looks good Details
2023-06-19 08:44:37 +02:00
Benjamin Dauvergne b4ee48df65 tests: fix pylint warning
gitea/ants-hub/pipeline/head This commit looks good Details
2023-06-19 08:05:44 +02:00
Benjamin Dauvergne 6e6855e408 misc: typo applications_ids -> application_ids
gitea/ants-hub/pipeline/head There was a failure building this commit Details
2023-06-19 07:57:54 +02:00
Benjamin Dauvergne 67e5c8578c allow value 5 for documents_number
gitea/ants-hub/pipeline/head This commit looks good Details
2023-06-15 18:59:41 +02:00
Benjamin Dauvergne cafe298c22 api/chrono: use more idiomatic code for update
gitea/ants-hub/pipeline/head This commit looks good Details
2023-06-14 10:36:30 +02:00
Benjamin Dauvergne f3e91b384a admin: show the URL to configure in hobo (bis)
gitea/ants-hub/pipeline/head This commit looks good Details
Fix tests.
2023-06-14 09:46:43 +02:00
Benjamin Dauvergne 631f060f71 chrono: do not check uniqueness on id and source_id when updating
gitea/ants-hub/pipeline/head This commit looks good Details
2023-06-12 18:21:44 +02:00
Benjamin Dauvergne 674509af00 chrono: reorder plage periods before injection in horaire list
gitea/ants-hub/pipeline/head This commit looks good Details
2023-06-12 13:01:28 +02:00
Benjamin Dauvergne f93fb4f705 tests: fix typo 2023-06-12 12:58:02 +02:00
Benjamin Dauvergne 3a8c844535 misc: optimize use of middlewares
Middleware are useless for the API endpoints, so we only apply them to
views of the admin site.
2023-04-14 01:14:57 +02:00
Benjamin Dauvergne 0cc9bcdd4f tests: test display of URL for chrono
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-12 18:55:44 +02:00
Benjamin Dauvergne 179abf7cda tests: add test on naive times in update to rendez-vous-disponibles
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-12 18:25:59 +02:00
Benjamin Dauvergne bac95b8367 tests: add more
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-12 12:23:32 +02:00
Benjamin Dauvergne 789e5aa6e9 tests: add more
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-12 11:54:40 +02:00
Benjamin Dauvergne d0809a11d6 misc: fix trace when count_by_model is empty
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-07 23:47:41 +02:00
Benjamin Dauvergne 2ba66c24f6 misc: correctly report deleted lieux/plages/rdvs on full update
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-07 15:08:03 +02:00
Benjamin Dauvergne f29d36f3d8 misc: implement full synchronization
gitea/ants-hub/pipeline/head This commit looks good Details
* use full=True to delete missing lieu/plage/rendez-vous
* prevent useless update/insert/delete of unchanged models
2023-04-07 14:12:15 +02:00
Benjamin Dauvergne 7199504489 misc: improve TypeDeRdv interface
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-05 16:18:53 +02:00
Benjamin Dauvergne 47b3f038d3 misc: adapt to py39 datetime.fromisoformat
gitea/ants-hub/pipeline/head This commit looks good Details
Python3.9 datetime library does not parse datetimes with Z suffix.
2023-04-05 10:52:27 +02:00
Benjamin Dauvergne 3253207ee2 api: fix typo in searchApplicationIds endpoint
gitea/ants-hub/pipeline/head There was a failure building this commit Details
2023-04-05 10:47:08 +02:00
Benjamin Dauvergne e5349dc1ce misc: integrate review by ANTS
gitea/ants-hub/pipeline/head There was a failure building this commit Details
* format/parse date as localtime of Paris with 'Z' suffix
* move settings in the database with a Config model
* add a different setting for auth token toward and from ANTS
* add setting for the base URL of the ANTS API
* use timezone module from chrono to prevent bugs with dst
2023-04-05 10:18:46 +02:00
Benjamin Dauvergne 633c50b5d0 tests: augment test on searchApplicationIds parameters parsing 2023-04-04 09:51:53 +02:00
Benjamin Dauvergne ab88a71116 ants: change handling of reason and documents_number
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-04 09:48:10 +02:00
Benjamin Dauvergne 3c7e767d62 tests: augment tests on parameters parsing 2023-04-04 08:00:07 +02:00
Benjamin Dauvergne d754442fb9 tests: add tests on ANTS endpoints
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-04 07:20:07 +02:00
Benjamin Dauvergne 5670296daf tests: augment test on GET rendez-vous-disponibles
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-04 01:34:06 +02:00
Benjamin Dauvergne 5d3e537c26 initial commit
gitea/ants-hub/pipeline/head This commit looks good Details
2023-04-03 18:03:30 +02:00