linagora / tmail-backend

GNU Affero General Public License v3.0
36 stars 17 forks source link

[ICS Reply] ICS patching core process #949

Closed Arsnael closed 5 months ago

Arsnael commented 5 months ago

Write a method that would take an ICS as an input file, being an invitation to a calendar event (METHOD: REQUEST), that would the transform it in output into a METHOD: REPLY ICS event with the attendance of the participant (accept / reject / maybe)

Note:

Example

Given I have this ics file as input:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.1.3//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Europe/Paris
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:8eae5147-f2df-4853-8fe0-c88678bc8b9f
TRANSP:OPAQUE
DTSTART;TZID=Europe/Paris:20240223T160000
DTEND;TZID=Europe/Paris:20240223T163000
CLASS:PUBLIC
SUMMARY:Simple event
ORGANIZER;CN=comptetest15.linagora@avocat.fr:mailto:comptetest15.linagora@a
 vocat.fr
ATTENDEE;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=INDIVI
 DUAL:mailto:btellier@linagora.com
ATTENDEE;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=INDIVI
 DUAL:mailto:other@linagora.com
ATTENDEE;PARTSTAT=ACCEPTED;RSVP=FALSE;ROLE=CHAIR;CUTYPE=INDIVIDUAL:mailto:c
 omptetest15.linagora@avocat.fr
DTSTAMP:20240222T204008Z
SEQUENCE:0
END:VEVENT
END:VCALENDAR

Accepting the invitation might result in something like this:

BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REPLY
BEGIN:VTIMEZONE
TZID:Europe/Paris
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:8eae5147-f2df-4853-8fe0-c88678bc8b9f
DTSTAMP:20240222T204343Z
SEQUENCE:0
DTSTART:20240223T150000Z
DTEND:20240223T153000Z
SUMMARY:Simple event
ORGANIZER;CN=comptetest15.linagora@avocat.fr:mailto:comptetest15.linagora@a
 vocat.fr
ATTENDEE;PARTSTAT=ACCEPTED:mailto:btellier@linagora.com
END:VEVENT
END:VCALENDAR

DoD: Unit tests

vttranlina commented 5 months ago

pr https://github.com/linagora/tmail-backend/pull/955