CXwudi / youcal

Inspired by YouTrack Due Day Calendar, export YouTrack Issue Due to other calendar services (through iCalendar)
MIT License
2 stars 0 forks source link

Refactor the modelling of the alarm setting to be consistent with RFC5545 #8

Open CXwudi opened 1 year ago

CXwudi commented 1 year ago

This is similar to #7 but for VAlarm. Since we only support Display type of alarm without any repeating. So modelling of this alarm is simply:

  1. make AlarmSetting a sealed interface of:
    1. Triggered by a fixed datetime, using field mapping
    2. Triggered by a duration, using field mapping, asking if the duration is positive or negative (since YouTrack doesn't support negative duration), also asking if it is related to either start or end
    3. Triggered by a fixed duration, the duration can be either positive or negative, can be either related to start or end
  2. the info will include a list of AlarmSetting instead of one AlarmSetting

⚠ One day event can not have a trigger related to the end date time. So the AlarmMapper should check if the ToBeMappedYouTrackIssueInfo has no EndDateTimeField instances and the trigger is related to dtend. If it is, discard such trigger

CXwudi commented 1 year ago

Although there is a modelling (by using multiple interfaces) which can make one day event has to use AlarmTriggerSetting that is related to start datetime only, it is very complicated, and I would rather rely on the validator to avoid bad config