{"id":25176297,"url":"https://github.com/redturtle/redturtle.prenotazioni","last_synced_at":"2026-03-02T02:35:08.694Z","repository":{"id":43177009,"uuid":"304312837","full_name":"RedTurtle/redturtle.prenotazioni","owner":"RedTurtle","description":"  A booking product for Plone which allows to reserve time slots throughout the week.","archived":false,"fork":false,"pushed_at":"2025-02-24T13:38:21.000Z","size":3089,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-01T05:05:19.998Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedTurtle.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE.GPL","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-10-15T12:03:43.000Z","updated_at":"2025-02-24T13:38:23.000Z","dependencies_parsed_at":"2024-02-12T10:47:18.090Z","dependency_job_id":"b360630b-09a2-451e-bcd0-23e5c4f02768","html_url":"https://github.com/RedTurtle/redturtle.prenotazioni","commit_stats":{"total_commits":269,"total_committers":13,"mean_commits":"20.692307692307693","dds":0.6840148698884758,"last_synced_commit":"e03ba6ba970dc2623fe2e3c5ba55db418148aeea"},"previous_names":[],"tags_count":95,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedTurtle%2Fredturtle.prenotazioni","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedTurtle%2Fredturtle.prenotazioni/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedTurtle%2Fredturtle.prenotazioni/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedTurtle%2Fredturtle.prenotazioni/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedTurtle","download_url":"https://codeload.github.com/RedTurtle/redturtle.prenotazioni/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252783640,"owners_count":21803546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2025-02-09T13:16:50.557Z","updated_at":"2026-03-02T02:35:08.683Z","avatar_url":"https://github.com/RedTurtle.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n.. image:: https://img.shields.io/pypi/v/redturtle.prenotazioni.svg\n    :target: https://pypi.org/project/redturtle.prenotazioni/\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/pyversions/redturtle.prenotazioni.svg?style=plastic\n    :target: https://pypi.org/project/redturtle.prenotazioni/\n    :alt: Supported - Python Versions\n\n.. image:: https://img.shields.io/pypi/dm/redturtle.prenotazioni.svg\n    :target: https://pypi.org/project/redturtle.prenotazioni/\n    :alt: Number of PyPI downloads\n\n.. image:: https://img.shields.io/pypi/l/redturtle.prenotazioni.svg\n    :target: https://pypi.org/project/redturtle.prenotazioni/\n    :alt: License\n\n.. image:: https://github.com/RedTurtle/redturtle.prenotazioni/actions/workflows/tests.yml/badge.svg\n    :target: https://github.com/RedTurtle/redturtle.prenotazioni/actions\n    :alt: Tests\n\n.. image:: https://coveralls.io/repos/github/RedTurtle/redturtle.prenotazioni/badge.svg?branch=master\n    :target: https://coveralls.io/github/RedTurtle/redturtle.prenotazioni?branch=master\n    :alt: Coverage\n\n======================\nredturtle.prenotazioni\n======================\n\nA **booking product for Plone** which allows to reserve time slots throughout the week.\n\n.. contents::\n\nInstallation\n============\n\nAdd **redturtle.prenotazioni** to the egg section of your instance:\n\n::\n\n  [instance]\n  eggs=\n        ...\n        redturtle.prenotazioni\n\nTo avoid spam, there is a background validation with `collective.honeypot`_ .\n\n.. _collective.honeypot: https://pypi.org/project/collective.honeypot\n\n\nWith a version of `plone.app.dexterity` lower than 3.* (ie Plone 5.2) you need to add\n`collective.dexteritytextindexer`_ as requirement.\n\n::\n\n    [instance]\n    eggs=\n        ...\n        redturtle.prenotazioni\n        collective.dexteritytextindexer\n\n.. _collective.dexteritytextindexer: https://pypi.org/project/collective.dexteritytextindexer\n\nIntroduction\n============\n\nThis product introduces two new `content types`_ to your Plone site:\n\n.. _content types: http://developer.plone.org/content/types.html\n\n- `Booking`\n- `Booking Folder`\n\nBooking content\n---------------\n\n**Booking** is a `content type` used to store information about reservation.\n\nThe product interface provides a way to add new booking elements, by clicking on one of the plus signs available in the slots calendar.\n\nEach booking element once created is storerd into its own **Booking Folder**.\n\n\nBooking Folder content\n----------------------\n\n**Booking Folder** is a folderish content type which store your **Booking** objects.\n\n\nUsing redturtle.prenotazioni\n============================\n\nCreating a new Booking Folder\n-----------------------------\n\nIf the product is correctly installed the **Booking Folder** entry is available on the `add new` action menu.\n\nYou can configure:\n- hidden booking types for the internal usage\n- more then one gate\n- booking vacations\n- custom duration for booking types\n- week schedule for morning and afternoon time tables\n\nCreating the hidden booking types\n---------------------------------\n\nYou can hide your booking types from simple and anonymous users by using the 'Hidden Booking' flag\nin your booking types definition. This way, it will only be available to users with the 'Bookings Manager'\npermission. This feature may be useful if you want to restrict booking types for internal corporate use.\n\nCreating a new booking content\n------------------------------\n\nAnonymous and authenticated users are allowed to add new booking content\nby clicking on the plus signs on the default booking folder view.\n\nAfter its creation the slot will be displayed as \"busy\" for anonymous user\nand the slot won't be available anymore.\n\nBack-end users can see and manage the reservation according to the assigned Plone roles.\n\n\nWorkflow\n--------\n\nThe product comes with its own workflow \"prenotazioni_workflow\".\n\nHere below a list of all the states available:\n\n**Private**: booking object initial state:\n\n* `submit` (Automatic transition to pending)\n\n**Pending**\n\nTransaction available:\n\n* `publish` (to published)\n* `refuse` (to refused)\n\n**Published**\n\nTransaction available:\n\n* `refuse` (to refused)\n\n**Refused**\n\nTransaction available:\n\n* `restore` (to pending)\n\nManagers can confirm a Booking using workflow transitions.\nThe workflow transition triggers an email to be sent to the booker (see below).\n\n\nBooking Notifications\n---------------------\n\nThere are automated notifications implementend by the following behaviors:\n\n* `redturtle.prenotazioni.behavior.notification_appio` (Notify via AppIO gateway)\n* `redturtle.prenotazioni.behavior.notification_email` (Notify via Email gateway)\n* `redturtle.prenotazioni.behavior.notification_sms` (Notify via SMS gateway)\n\nEach behavior is implementing the following notification types:\n* `booking-accepted` (An notification if the booking had been accepted)\n* `booking-moved` (An notification if the booking had been moved)\n* `booking-created` (An notification if the booking had been created)\n* `booking-refuse` (An notification if the booking had been refused)\n* `booking-reminder` (An notification reminder)\n\nNotifications are **NOT automatically** enabled in every Booking Folder.\nIf you want to send some notification, you only need to enable them by assigning the behavior to PrenotazioniFolder c.t.\n\nYou can create your own notification templates for the booking events(confirm, refuse, create, delete, reminder).\nThe temlates are being saved in the PrenotazioniFolder object.\n\nThe template variables list:\n\n* ``${title}`` - Booking title.\n* ``${booking_gate}`` - Booking gate.\n* ``${booking_human_readable_start}`` - Booking human readable start datetime.\n* ``${booking_date}`` - Booking date.\n* ``${booking_end_date}`` - Booking end date.\n* ``${booking_time}`` - Booking time.\n* ``${booking_time_end}`` - Booking time end.\n* ``${booking_code}`` - Booking code.\n* ``${booking_type}`` - Booking type.\n* ``${booking_print_url}`` - Booking summary url.\n* ``${booking_url_with_delete_token}`` - Booking url to delete page.\n* ``${booking_user_phone}`` - Booking user phone.\n* ``${booking_user_email}`` - Booking user email.\n* ``${booking_user_details}`` - Booking user details.\n* ``${booking_office_contact_phone}`` - Booking office contact phone.\n* ``${booking_office_contact_pec}`` - Booking office contact pec.\n* ``${booking_office_contact_fax}`` - Booking office contact fax.\n* ``${booking_how_to_get_to_office}`` - Booking how to get to office.\n* ``${booking_office_complete_address}`` - Booking office complete address.\n* ``${booking_user_details}`` - Booking details inserted by user.\n* ``${booking_requirements}`` - Booking requeirements.\n* ``${prenotazioni_folder_title}`` - Booking folder title.\n* ``${booking_requirements}`` - Related PrenotazioneType.booking_requirements field\n\nNote that the sms can be used only if you implement an own sender adapter\nExample:\n\nYou just need to register a new adapter::\n\n    \u003cadapter\n      factory = \".my_adapter.CustomSMSSenderAdapter\"\n      name=\"booking_transition_sms_sender\"\n    /\u003e\n\nAnd here the `send` method must be implementend::\n\n    from zope.component import adapter\n    from zope.interface import implementer\n\n    from redturtle.prenotazioni.content.prenotazione import IPrenotazione\n    from redturtle.prenotazioni.interfaces import IBookingNotificationSender\n    from redturtle.prenotazioni.interfaces import IBookingSMSMessage\n    from redturtle.prenotazioni.behaviors.booking_folder.sms.adapters import BookingNotificationSender\n\n\n    @implementer(IBookingNotificationSender)\n    @adapter(IBookingSMSMessage5, IPrenotazione, YourAddonLayerInterface)\n    class CustomSMSSenderAdapter(BookingNotificationSender):\n\n        def send(self):\n            if self.is_notification_allowed():\n                # the message is automatically generated basing on the event type\n                message = self.message_adapter.message\n                phone = self.booking.phone\n\n                # Your custom send logics integration below\n                custom_send_function(message, phone)\n\n\nVacations\n---------\n\nYou can specify days when the Booking Folder will not accept\nbookings.\nThose days are called \"Vacation days\".\n\nVacation days can be specified compiling the \"Vacation days\"\nfield in the Booking Folder edit form.\nValues are allowed in the format DD/MM/YYYY.\nInstead of the year you can put an asterisk, in this case every here\nthe day DD of month MM will be considered a vacation day.\n\nIt is also possible to specify a vacation period\nfor a single gate using the vacation booking form with a link that you can see in the toolbar.\n\n\nSearching\n---------\n\nUsing the prenotazioni_search view it is possible to search\nbookings within a given time interval.\nYou can also filter the results specifying a searchable text,\na gate or a review state.\n\nBooking code generation\n-----------------------\n\nEvery booking has an unique code generated on creation.\n\nBy default this code is based on its UID.\nIf you need to change this logic, you can do it registering a more specific adapter::\n\n    \u003cadapter factory=\".my_new_code.MyNewBookingCodeGenerator\" /\u003e\n\n\nAnd the adapter should be something like this::\n\n    from redturtle.prenotazioni.adapters.booking_code import BookingCodeGenerator\n    from redturtle.prenotazioni.adapters.booking_code import IBookingCodeGenerator\n    from redturtle.prenotazioni.content.prenotazione import IPrenotazione\n    from my.package.interfaces import IMyPackageLayer\n    from zope.component import adapter\n    from zope.interface import implementer\n\n\n    @implementer(IBookingCodeGenerator)\n    @adapter(IPrenotazione, IMyPackageLayer)\n    class MyNewBookingCodeGenerator(BookingCodeGenerator):\n        def __call__(self, *args, **kwargs):\n            return \"XXXXX\"\n\n\nRest API\n========\n\nThere are some endpoints useful to use this tool also with external frontends (like Volto).\n\n@booking\n--------\n\nGET\n~~~\n\nThis endpoint allows to retrieve a booking by its UID.\n\nExample::\n\n    curl http://localhost:8080/Plone/++api++/@booking/\u003cbooking UID\u003e -H 'Accept: application/json'\n\nResponse::\n\n    {\n        \"booking_code\": \"17E3E6\",\n        \"booking_date\": \"2023-05-22T09:09:00\",\n        \"booking_expiration_date\": \"2023-05-22T09:10:00\",\n        \"booking_type\": \"SPID: SOLO riconoscimento \\\"de visu\\\" (no registrazione)\",\n        \"company\": null,\n        \"cosa_serve\": null,\n        \"description\": \"\",\n        \"email\": \"mario.rossi@example\",\n        \"fiscalcode\": \"\",\n        \"gate\": \"postazione2\",\n        \"id\": \"mario-rossi\",\n        \"phone\": \"\",\n        \"staff_notes\": null,\n        \"title\": \"Mario Rossi\"\n    }\n\nPOST\n~~~~\n\nThis endpoint allows to create a new booking.\n\nExample::\n\n    curl http://localhost:8080/Plone/++api++/\u003cbooking_folder_path\u003e/@booking \\\n        -X POST \\\n        -H 'Accept: application/json' \\\n        -H 'Content-Type: application/json' \\\n        -d '{\n            \"booking_date\": \"2023-05-23T09:00:00+02:00\",\n            \"booking_type\": \"SPID: SOLO riconoscimento \\\"de visu\\\" (no registrazione)\",\n            \"fields\": [\n                {\"name\": \"fullname\", \"value\": \"Mario Rossi\"},\n                {\"name\": \"email\", \"value\": \"mario.rossi@example\"}\n            ],\n        }'\n\nResponse::\n\n    {\n        \"booking_code\": \"17E3E6\",\n        \"booking_date\": \"2023-05-22T09:09:00\",\n        \"booking_expiration_date\": \"2023-05-22T09:10:00\",\n        \"booking_type\": \"SPID: SOLO riconoscimento \\\"de visu\\\" (no registrazione)\",\n        \"company\": null,\n        \"cosa_serve\": null,\n        \"description\": \"\",\n        \"email\": \"mario.rossi@example\",\n        \"fiscalcode\": \"\",\n        \"gate\": \"postazione1\",\n        \"id\": \"mario-rossi-1\",\n        \"phone\": \"\",\n        \"staff_notes\": null,\n        \"title\": \"Mario Rossi\"\n    }\n\nDELETE\n~~~~~~\n\nThis endpoint allows to delete a booking by its UID.\n\nExample::\n\n    curl -X DELETE http://localhost:8080/Plone/++api++/@booking/\u003cbooking UID\u003e -H 'Accept: application/json'\n\nA booking can be deleted only if on of the following rules are satisfied:\n\n- Anonymous user and booking has been created by an anonymous user\n- Booking created by current logged-in user\n- Current logged-in user has `redturtle.prenotazioni.ManagePrenotazioni` permission\n- Booking has a date \u003e today\n\n\nMOVE\n~~~~\n\nThis endpoint allows to move a booking by its UID to a different date/time slot.\n\nExample::\n\n    curl http://localhost:8080/Plone/++api++/\u003cbooking_folder_path\u003e/@booking-move \\\n        -X POST \\\n        -H 'Accept: application/json' \\\n        -H 'Content-Type: application/json' \\\n        -d '{\n            \"booking_date\": \"2023-05-23T09:00:00+02:00\",\n            \"booking_id\": \"\u003cbooking UID\u003e\",\n        }'\n\n\n@prenotazione\n-------------\n\nLeave for compatibility reasons (identical to `@booking`'s GET). Could be removed in future.\n\nExample::\n\n   curl http://localhost:8080/Plone/@prenotazione?uid=\u003cbooking UID\u003e -H 'Accept: application/json'\n\nResponse, see: @booking\n\n@vacation\n---------\n\nPOST\n~~~~\n\nThis endpoint allows to create a new vacation.\n\nExample::\n\n    curl http://localhost:8080/Plone/++api++/\u003cbooking_folder_path\u003e/@vacation \\\n        -X POST \\\n        -H 'Accept: application/json' \\\n        -H 'Content-Type: application/json' \\\n        -d '{\n            \"start\": \"2023-05-23T09:00:00+02:00\",\n            \"end\": \"2023-05-23T10:00:00+02:00\",\n            \"gate\": \"gate A\",\n            \"title\": \"vacation\"\n        }'\n\n\n@available-slots\n----------------\n\nEndpoint that need to be called on a PrenotazioniFolder.\nIt returns the list of all available slots based on some parameters.\n\nAn available slot is the first free time on each hour slot (each day is split in 1h slots).\n\nBy default (without parameters) the endpoint returns available slots for the current month, starting from today.\n\nParameters:\n\n- **start** a start date. If not given, the start will be today.\n- **end** an end date. If not given, the end will be the last day of current month.\n- **first_available** a boolean flag, if valiorized, the first available slot returned without the current month search limit but the one year.\n\nExample::\n\n   curl -i http://localhost:8080/Plone/folder/@available-slots -H 'Accept: application/json'\n\nResponse::\n\n    {\n        \"@id\": \"http://localhost:8080/Plone/folder/@available-slots\",\n        \"items\": [\n            '2023-04-10T07:30:00',\n            '2023-04-10T08:00:00',\n            '2023-04-10T09:00:00',\n            '2023-04-17T07:00:00',\n            '2023-04-17T08:00:00',\n            '2023-04-17T09:00:00',\n            '2023-04-24T07:00:00',\n            '2023-04-24T08:00:00',\n            '2023-04-24T09:00:00'\n        ]\n    }\n\n\nExample::\n\n   curl -i http://localhost:8080/Plone/folder/@available-slots?start=2023-04-12 -H 'Accept: application/json'\n\nResponse::\n\n    {\n        \"@id\": \"http://localhost:8080/Plone/folder/@available-slots\",\n        \"items\": [\n            '2023-04-17T07:00:00',\n            '2023-04-17T08:00:00',\n            '2023-04-17T09:00:00',\n            '2023-04-24T07:00:00',\n            '2023-04-24T08:00:00',\n            '2023-04-24T09:00:00'\n        ]\n    }\n\n@booking-schema\n---------------\n\nEndpoint that need to be called on a PrenotazioniFolder.\nIt returns the list of all fields to fill in for the booking.\n\nThe booking date is passed via querystring (e.g ?booking_date=2023-04-13+10%3A00')\n\nExample::\n\n   curl -i -X GET 'http://localhost:8080/Plone/prenotazioni/@prenotazione-schema?booking_date=2023-05-15T13:00:00' -H 'Accept: application/json'\n\nResponse::\n\n    {\n        \"booking_types\": {\n            \"bookable\": [],\n            \"unbookable\": [\n                {\n                \"duration\": \"60\",\n                \"name\": \"Rilascio CIE\"\n                \"booking_additional_fields_schema\": {\"name\": \"field1\", \"description\": \"Field number 1\", \"type\": \"text\", \"required\": true}\n              }\n            ]\n        },\n        \"fields\": [\n          {\n            \"desc\": \"Inserisci l'email\",\n            \"label\": \"Email\",\n            \"name\": \"email\",\n            \"readonly\": false,\n            \"required\": false,\n            \"type\": \"text\",\n            \"value\": \"\"\n          },\n          {\n            \"desc\": \"Inserisci il numero di telefono\",\n            \"label\": \"Numero di telefono\",\n            \"name\": \"phone\",\n            \"readonly\": false,\n            \"required\": false,\n            \"type\": \"text\",\n            \"value\": \"\"\n          },\n          {\n            \"desc\": \"Inserisci ulteriori informazioni\",\n            \"label\": \"Note\",\n            \"name\": \"description\",\n            \"readonly\": false,\n            \"required\": false,\n            \"type\": \"textarea\",\n            \"value\": \"\"\n          },\n          {\n            \"desc\": \"Inserisci il codice fiscale\",\n            \"label\": \"Codice Fiscale\",\n            \"name\": \"fiscalcode\",\n            \"readonly\": false,\n            \"required\": true,\n            \"type\": \"text\",\n            \"value\": \"\"\n          },\n          {\n            \"desc\": \"Inserire il nome completo\",\n            \"label\": \"Nome completo\",\n            \"name\": \"Nome\",\n            \"readonly\": false,\n            \"required\": true,\n            \"type\": \"text\",\n            \"value\": \"\"\n          }\n        ]\n    }\n\n@bookings\n---------\n\nEndpoint that returns a list of own *Prenotazione* content by parameters.\nNote that HTTP 400 is returned if no search parameters were passed.\n\nParameters:\n\n- **SearchableText**: The SearchableText of content;\n- **from**: The start date of research (with YYYY-MM-DD format);\n- **to**: The end date of research (with YYYY-MM-DD format);\n- **modified_after**: To filter bookings modified only after given date (needed also a timezone: YYYY-MM-DDThh:mm:ss+02:00);\n- **gate**: The booking gate;\n- **userid**: The userid(basically it is the fiscalcode). Allowed to be used by users having the 'redturtle.prenotazioni: search prenotazioni' permission;\n- **booking_type**: The booking_type, available values are stored in 'redturtle.prenotazioni.booking_types' vocabulary;\n- **review_state**: The booking status, one of: 'confirmed', 'refused', 'private', 'pending';\n- **sort_on**: The index by which to order (default 'Date' aka the booking datetime);\n- **sort_order**: The order in which to sort, possible values: 'ascending', 'descending' (default 'descending');\n- **fullobjects**: If `fullobjects=1` is passed, the endpoint will return the full objects instead of a list of brains (actually the only information added is the `requirements` field. (aka `cosa_serve`).\n\nExample::\n\n   curl -i http://localhost:8080/Plone/@bookings?from=2023-10-22\u0026to=2023-10-22\u0026gate=Gate1\u0026userid=user1\u0026booking_type=type1\u0026SearchableText=text1 \\\n     -H 'Accept: application/json'\n\nResponse::\n\n    {\n        \"@id\": \"http://localhost:8080/Plone/folder/@bookings\",\n        \"items\": [\n             {\n                \"title\": \"Booking Title\",\n                \"booking_id\": \"abcdefgh1234567890\",\n                \"booking_url\": \"https://url.ioprenoto.it/prenotazione/abcd\",\n                \"booking_date\": \"2018-04-25T10:00:00\",\n                \"booking_expiration_date\": \"2018-04-30T10:00:00\",\n                \"booking_type\": \"Servizio di prova\",\n                \"booking_room\": \"stanza-1\",\n                \"booking_gate\": \"sportello-urp-polifunzionale\",\n                \"booking_status\": \"confirmed\",\n                \"booking_status_label\": \"Confermata\",\n                \"booking_status_date\": \"2018-04-25T10:00:00\",\n                \"booking_status_notes\": \"Prenotazione confermata\",\n                \"userid\": \"FISCALCODE\",\n            },\n            ...\n            ],\n          }\n    }\n\nIf a user is authenticated and, he is not a site operator, returns all own bookings.\n\nWith an experimental envionment `SEE_OWN_ANONYMOUS_BOOKINGS` set to `True`, the endpoint will return\nalso the bookings created by anonymous users with the same fiscalcode of the authenticated user.\n\n@booking-notify\n---------------\n\nEndpoint that fires the confirm email to user\n\n\nExample::\n\n   curl -i http://localhost:8080/Plone/booking_folder/@booking-notify/\u003cbooking UID\u003e \\\n     -H 'Accept: application/json'\n\n\nIf the user is not logged in, the endpoint will return a 401 error.\n\nResponse::\n    HTTP 200 OK\n\n\n@day-busy-slots\n---------------\n\nEndpoint that returns a list of busy slots and pauses based on the passed date\n\nParameters:\n\n- **date**: Date\n\nExample::\n\n    curl -i  \"http://localhost:8080/Plone/prenotazioni_folder/@day-busy-slots?date=2023/05/22\"\\\n        -H 'Accept: application/json'\\\n\nResponse::\n\n    {\n        \"@id\": \"http://localhost:8080/Plone/prenotazioni_folder/@day-busy-slots\",\n        \"bookings\": {\n            \"gate1\":\n                [\n                    {\n                        \"booking_code\": \"17E3E6\",\n                        \"booking_date\": \"2023-05-22T09:09:00\",\n                        \"booking_expiration_date\": \"2023-05-22T09:10:00\",\n                        \"booking_type\": \"SPID: SOLO riconoscimento \\\"de visu\\\" (no registrazione)\",\n                        \"company\": null,\n                        \"cosa_serve\": null,\n                        \"description\": \"\",\n                        \"email\": \"mario.rossi@example\",\n                        \"fiscalcode\": \"\",\n                        \"gate\": \"postazione1\",\n                        \"id\": \"mario-rossi-1\",\n                        \"phone\": \"\",\n                        \"staff_notes\": null,\n                        \"title\": \"Mario Rossi\"\n                    },\n                    ...\n                ],\n            \"gate2\":\n                [\n                    {\n                        \"booking_code\": \"17E3E6\",\n                        \"booking_date\": \"2023-05-22T09:09:00\",\n                        \"booking_expiration_date\": \"2023-05-22T09:10:00\",\n                        \"booking_type\": \"SPID: SOLO riconoscimento \\\"de visu\\\" (no registrazione)\",\n                        \"company\": null,\n                        \"cosa_serve\": null,\n                        \"description\": \"\",\n                        \"email\": \"mario.rossi@example\",\n                        \"fiscalcode\": \"\",\n                        \"gate\": \"postazione2\",\n                        \"id\": \"mario-rossi\",\n                        \"phone\": \"\",\n                        \"staff_notes\": null,\n                        \"title\": \"Mario Rossi\"\n                    },\n                    ...\n                ]\n        },\n        \"pauses\": [\n            {\n                \"start\": \"2023-05-22T07:15:00+00:00\",\n                \"stop\": \"2023-05-22T08:30:00+00:00\"\n            },\n            ...\n        ]\n    }\n\nBooking Additional Fields\n=========================\n\nYou can also create the addtional fields for your booking, you just need to compile\nthem in your PrenotazioneType.\nAnd they will appear in the [\"booking_types\"][\"booking_additional_fields_schema\"]\nin your booking schema so you can compile them for your booking in this way:\n\n@booking\n--------\n\nCreate booking with an additional field\n\nPOST\n~~~~\n\nThis endpoint allows to create a new booking.\n\nExample::\n\n    curl http://localhost:8080/Plone/++api++/\u003cbooking_folder_path\u003e/@booking \\\n        -X POST \\\n        -H 'Accept: application/json' \\\n        -H 'Content-Type: application/json' \\\n        -d '{\n            \"booking_date\": \"2023-05-23T09:00:00+02:00\",\n            \"booking_type\": \"Type x\",\n            \"fields\": [\n                {\"name\": \"fullname\", \"value\": \"Mario Rossi\"},\n                {\"name\": \"email\", \"value\": \"mario.rossi@example\"}\n            ],\n            \"additional_fields\": [{\"name\": \"field1\", \"value\": \"Addional field text\"}]\n        }'\n\nResponse::\n\n    {\n        \"booking_code\": \"17E3E6\",\n        \"booking_date\": \"2023-05-22T09:09:00\",\n        \"booking_expiration_date\": \"2023-05-22T09:10:00\",\n        \"booking_type\": \"Type x\",\n        \"company\": null,\n        \"cosa_serve\": null,\n        \"description\": \"\",\n        \"email\": \"mario.rossi@example\",\n        \"fiscalcode\": \"\",\n        \"gate\": \"gate 1\",\n        \"id\": \"mario-rossi-1\",\n        \"phone\": \"\",\n        \"staff_notes\": null,\n        \"title\": \"Mario Rossi\",\n        \"additional_fields\": [{\"name\": \"field1\", \"value\": \"Addional field text\"}]\n    }\n\nAvailable types are\n-------------------\n\n- **text**: Text which uses default zope.schema.TextLine validation\n\n\nSpecial Views\n==============\n\n@@download/bookings.xlsx\n------------------------\n\nThis view allows to download the bookings filtered by passed parameters\n\n- **text**: The SearchableText of content.\n- **from**: The start date of research.\n- **to**: The end date of research.\n- **gate**: The booking gate.\n- **userid**: The userid(basically it is the fiscalcode). Allowed to be used by users having the 'redturtle.prenotazioni: search prenotazioni' permission.\n- **booking_type**: The booking_type, available values are stored in 'redturtle.prenotazioni.booking_types' vocabulary.\n- **review_state**: The booking status, one of: 'confirmed', 'refused', 'private', 'pending'\n\n\nExample::\n    curl -i http://localhost:8080/Plone/folder/@@download/bookings.xlsx?text=Text\u0026review_state=confirmed\u0026gate=Gate1\u0026start=2010-10-10\u0026end=2025-10-10\u0026booking_type=Type1\n\nResponse::\n    Binary file\n\n@@send-booking-reminders\n------------------------\n\nThis view sends a booking reminder email to all the bookings inside PrenotazioniFolders that\nhave the Reminder Notification Gap field populated. If you intend to set up a cronjob to call this view, you might use a special script call.\nThe script is located at src/redturtle/prenotazioni/scripts/notify_upcoming_bookings.py.\n\n\n@@bookings-export\n-----------------\n\nAll the time parameters below are ISO formatted datetime strings\n\n- **booking_start_from** - booking start from range.\n- **booking_start_to** - booking start to range.\n- **booking_creation_from** - booking created from range.\n- **booking_creation_to** - bookking createtd to range\n- **path** - booking folder path (es: \"/Plone/booking_folder\")\n\nExample::\n    curl -i http://localhost:8080/Plone/@@bookings-export?booking_start_from=2023-10-22T12:27:18\n\nResponse::\n    Binary csv file\n\nScripts\n=======\n\nnotify_upcoming_bookings\n------------------------\n\nThe script is supposed to be used to call the **@@send-booking-reminders** view.\nIt is supposed to be ran once a day otherwise, duplicate emails will be sent.\n\nUsage::\n\n    bin/instance1 -OPlone run bin/notify_upcoming_bookings\n\nBuildout config example::\n\n    [buildout]\n    # You can change it in according to your policy\n    cron_instance = instance1\n    parts +=\n        notify-upcoming-bookings\n\n    [notify-upcoming-bookings]\n    recipe = z3c.recipe.usercrontab\n    times = 0 3 * * *\n    command = flock -n ${buildout:directory}/var/notify_upcoming_bookings.lock ${buildout:directory}/bin/${buildout:cron_instance} -OPlone run bin/notify_upcoming_bookings \u003e\u003e ${buildout:directory}/var/log/notify_upcoming_bookings.log 2\u003e\u00261\n\n\n\nBehaviors\n=========\n\nredturtle.prenotazioni.behavior.notification_appio\n--------------------------------------------------\n\nIf you mind to use this behavior note that first of all you also need to assign\nthis **redturtle.prenotazioni.behavior.notification_appio_booking_type** to PrenotazioneType c.t.\n\nTo send the messages via AppIO gateway the **service_code** field defined by **redturtle.prenotazioni.behavior.notification_appio_booking_type**\nmust be compiled in the PrenotazioniType object. All the possible values of this field are being\ntaken from an **yaml** file with the following format.\n\nappio_config_keys.yaml::\n\n    - name: Service1\n      key: ABC123\n\n    - name: Service2\n      key: ABC231\n\n    - name: Service3\n      key: ABC312\n      api_key: scret123\n\nThe file path is being taken from the **APPIO_CONFIG_FILE** env var.\nThis variable can be configured automatically in the buildout using the following config.\n\nBackward comptability: if `api_key` is missing, `key` is used also as a secret.\n\nbuildout.cfg::\n\n    [instance]\n    environment-vars =\n        APPIO_CONFIG_FILE ${buildout:directory}/appio_config_keys.yaml\n\n\nContent-transfer-encoding\n=========================\n\nIt is possible to set the content-transfer-encoding for the email body, settings the environment\nvariable `MAIL_CONTENT_TRANSFER_ENCODING`::\n\n    [instance]\n    environment-vars =\n        MAIL_CONTENT_TRANSFER_ENCODING base64\n\nThis is useful for some SMTP servers that have problems with `quoted-printable` encoding.\n\nBy default the content-transfer-encoding is `quoted-printable` as overrided in\nhttps://github.com/zopefoundation/Products.MailHost/blob/master/src/Products/MailHost/MailHost.py#L65\n\n\nHow to develop\n==============\n\nFrontend\n--------\n\nThere is a custom widget made in React and registered as bundle.\nTo develop it, you should do following steps:\n\nFirst of all, enable nvm::\n\n    \u003e nvm use\n\nInstall dependencies::\n\n    \u003e yarn\n\nRun webpack::\n\n    \u003e yarn start\n\nThis will start webpack with autoreload.\nTo see changes on your site, you need to enable development mode in Resources Registry in your Plone site, and enable CSS and js development of \"week-table-overrides-widget-bundle\" bundle.\n\n\nWhen changes are ok, you need to make a production build::\n\n    \u003e yarn build\n\nContribute\n==========\n\n- Issue Tracker: https://github.com/RedTurtle/redturtle.prenotazioni/issues\n- Source Code: https://github.com/RedTurtle/redturtle.prenotazioni\n\n\nNotes\n=====\n\n**redturtle.prenotazioni** has been tested with Plone 5.2 and works with Python 3.\n\nThis is a merge from other two booking products:\n\n- `rg.prenotazioni`__.\n- `pd.prenotazioni`__.\n\n__ https://github.com/PloneGov-IT/rg.prenotazioni/\n__ https://github.com/PloneGov-IT/pd.prenotazioni/\n\n\nCredits\n=======\n\nDeveloped with the support of:\n\n* `Unione Reno Galliera`__\n\n  .. image:: http://blog.redturtle.it/pypi-images/redturtle.prenotazioni/logo-urg.jpg/image_mini\n     :alt: Logo Unione Reno Galliera\n\n* `S. Anna Hospital, Ferrara`__\n\n  .. image:: http://www.ospfe.it/ospfe-logo.jpg\n     :alt: S. Anna Hospital - logo\n\n* `Comune di Padova`__;\n\n  .. image:: https://raw.githubusercontent.com/PloneGov-IT/pd.prenotazioni/master/docs/logo-comune-pd-150x200.jpg\n     :alt: Comune di Padova's logo\n\nAll of them supports the `PloneGov initiative`__.\n\n__ http://www.renogalliera.it/\n__ http://www.ospfe.it/\n__ http://www.padovanet.it/\n__ http://www.plonegov.it/\n\nAuthors\n=======\n\nThis product was developed by **RedTurtle Technology** team.\n\n.. image:: https://avatars1.githubusercontent.com/u/1087171?s=100\u0026v=4\n   :alt: RedTurtle Technology Site\n   :target: http://www.redturtle.it/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredturtle%2Fredturtle.prenotazioni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredturtle%2Fredturtle.prenotazioni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredturtle%2Fredturtle.prenotazioni/lists"}