Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding additional event fields from vcal to enable additional use cases. #131

Merged
merged 7 commits into from
Nov 29, 2024

Conversation

bpannier
Copy link
Contributor

Adding the organizer email&name of an event, created&lastmodified dates of the event, and the sequence id to make events versions comparable.

Adding parameter from an ical event: organizer, created, lastmodified, sequence
Adding known parameter: created, sequence, lastModified, organizer interface
fix version
@bpannier bpannier closed this Nov 20, 2024
@bpannier bpannier reopened this Nov 20, 2024
adding recurrent flag
add recurrent flag
add recurrent id
@muness muness self-requested a review November 22, 2024 17:41
@muness
Copy link
Member

muness commented Nov 22, 2024

Hi @bpannier , thanks for this! Ready for review now?

@bpannier
Copy link
Contributor Author

bpannier commented Nov 23, 2024

@muness , yes for now all vcal flags are passed through. I am wondering if it would help if you would add helper methods that interpret the content of some of the flags:

  • attendee.status (ACCEPTED,DECLINED,TENTATIVE,DELEGATED,NEEDS-ACTION)
  • attendee.type (GROUP,INDIVIDUAL,RESOURCE,ROOM,UNKNOWN)
  • attendee.role (OPT-PARTICIPANT,NON-PARTICIPANT,CHAIR,REQ-PARTICIPANT)

I added a wrapper around this:

export class CalendarEventAttendee {
    name : string;
    email : string;

    status : CalendarEventAttendee.AttendeeStatus;
    role : CalendarEventAttendee.AttendeeRole;
    type : CalendarEventAttendee.AttendeeType;
    
    constructor(attendee: IAttendee) {
        //console.log("A: name " + attendee.name + "\n - email " + attendee.email + "\n - role " + attendee.role + "\n - status " + attendee.status + "\n - type " + attendee.type);

        this.name = attendee.name;
        this.email = attendee.email;

        if (attendee.status === "ACCEPTED") {
            this.status = CalendarEventAttendee.AttendeeStatus.Accepted;
        } else if (attendee.status === "DECLINED") {
            this.status = CalendarEventAttendee.AttendeeStatus.Declined;
        } else if (attendee.status === "TENTATIVE") {
            this.status = CalendarEventAttendee.AttendeeStatus.Tentative;
        } else if (attendee.status === "DELEGATED") {
            this.status = CalendarEventAttendee.AttendeeStatus.Delegated;
        } else if (attendee.status === "NEEDS-ACTION") {
            this.status = CalendarEventAttendee.AttendeeStatus.NeedsAction;
        } else {
            // as defined in RFC
            this.status = CalendarEventAttendee.AttendeeStatus.NeedsAction;
        }

        if (attendee.role === "OPT-PARTICIPANT") {
            this.role = CalendarEventAttendee.AttendeeRole.Optional;
        } else if (attendee.role === "NON-PARTICIPANT") {
            this.role = CalendarEventAttendee.AttendeeRole.NonParticipant;
        } else if (attendee.role === "CHAIR") {
            this.role = CalendarEventAttendee.AttendeeRole.Chair;
        } else if (attendee.role === "REQ-PARTICIPANT") {
            this.role = CalendarEventAttendee.AttendeeRole.Required;
        } else {
            // as defined in RFC
            this.role = CalendarEventAttendee.AttendeeRole.Required;
        }

        if (attendee.type === "GROUP") {
            this.type = CalendarEventAttendee.AttendeeType.Group;
        } else if (attendee.type === "INDIVIDUAL") {
            this.type = CalendarEventAttendee.AttendeeType.Individual;
        } else if (attendee.type === "RESOURCE") {
            this.type = CalendarEventAttendee.AttendeeType.Resource;
        } else if (attendee.type === "ROOM") {
            this.type = CalendarEventAttendee.AttendeeType.Room;
        } else if (attendee.type === "UNKNOWN") {
            this.type = CalendarEventAttendee.AttendeeType.Unknown;
        } else {
            // as defined in RFC
            this.type = CalendarEventAttendee.AttendeeType.Individual;
        }
    }
}

export namespace CalendarEventAttendee {
    export enum AttendeeStatus {
        Accepted = "accepted",
        Declined = "declined",
        Tentative = "tentative",
        Delegated = "delegated",
        NeedsAction = "needsaction"
    };

    export enum AttendeeRole {
        Chair = "chair",
        Required = "required",
        Optional = "optional",
        NonParticipant = "nonparticipant"
    };

    export enum AttendeeType {
        Individual = "individual",
        Group = "group",
        Resource = "resource",
        Room = "room",
        Unknown = "unknown"
    };
}

@muness muness merged commit 96c2f4e into cloud-atlas-ai:master Nov 29, 2024
@muness
Copy link
Member

muness commented Nov 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants