#
# PUT a fancy RRULE
#
# To test https://gitlab.com/davical-project/davical/-/issues/283
#
TYPE=PUT
URL=http://regression.host/caldav.php/user1/home/takeoutthethrash.ics
HEADER=User-Agent: DAViCal/1.12
HEADER=Accept: text/xml,application/xml
HEADER=Content-Type: text/calendar; charset=utf-8

HEAD


BEGINDATA
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Client//EN
BEGIN:VTODO
UID:takeoutthethrash
DTSTAMP:20221013T151313Z
DTSTART:20221017T065500Z
STATUS:NEEDS-ACTION
DURATION:PT10M
SUMMARY:Take out the thrash before the collectors come.
RRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=6;BYMINUTE=55;COUNT=3
CATEGORIES:CHORE
PRIORITY:3
END:VTODO
END:VCALENDAR
ENDDATA


QUERY
SELECT caldav_data.user_no, caldav_data.dav_etag, caldav_type, logged_user, 
       uid, dtstamp, dtstart, dtend, due, summary, location,
       description, priority, class, transp, rrule, url,
       percent_complete, status,
       caldav_data AS " CalDAV Data",
      ((current_timestamp AT TIME ZONE 'GMT' - calendar_item.last_modified) < '2 seconds'::interval) AS "~ Modified Now"
FROM caldav_data JOIN calendar_item USING(dav_name)
WHERE caldav_data.dav_name =
'/user1/home/takeoutthethrash.ics';
ENDQUERY

