-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
4283 create calendareventattendee data model #4333
Changes from all commits
151867f
6f8fca8
8a75bde
bca9b85
4534c55
dc1c761
a97abe1
5218bc2
787376b
682da77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity'; | ||
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator'; | ||
import { Gate } from 'src/workspace/workspace-sync-metadata/decorators/gate.decorator'; | ||
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator'; | ||
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator'; | ||
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator'; | ||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata'; | ||
import { CalendarEventObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event.object-metadata'; | ||
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata'; | ||
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata'; | ||
|
||
export enum CalendarEventAttendeeResponseStatus { | ||
NEEDS_ACTION = 'NEEDS_ACTION', | ||
DECLINED = 'DECLINED', | ||
TENTATIVE = 'TENTATIVE', | ||
ACCEPTED = 'ACCEPTED', | ||
} | ||
|
||
@ObjectMetadata({ | ||
namePlural: 'calendarEventAttendees', | ||
labelSingular: 'Calendar event attendee', | ||
labelPlural: 'Calendar event attendees', | ||
description: 'Calendar event attendees', | ||
icon: 'IconCalendar', | ||
}) | ||
@IsSystem() | ||
@Gate({ | ||
featureFlag: 'IS_CALENDAR_ENABLED', | ||
}) | ||
export class CalendarEventAttendeeObjectMetadata extends BaseObjectMetadata { | ||
@FieldMetadata({ | ||
type: FieldMetadataType.RELATION, | ||
label: 'Event ID', | ||
description: 'Event ID', | ||
icon: 'IconCalendar', | ||
joinColumn: 'calendarEventId', | ||
}) | ||
calendarEvent: CalendarEventObjectMetadata; | ||
|
||
@FieldMetadata({ | ||
type: FieldMetadataType.TEXT, | ||
label: 'Handle', | ||
description: 'Handle', | ||
icon: 'IconMail', | ||
}) | ||
handle: string; | ||
|
||
@FieldMetadata({ | ||
type: FieldMetadataType.TEXT, | ||
label: 'Display Name', | ||
description: 'Display Name', | ||
icon: 'IconUser', | ||
}) | ||
displayName: string; | ||
|
||
@FieldMetadata({ | ||
type: FieldMetadataType.BOOLEAN, | ||
label: 'Is Organizer', | ||
description: 'Is Organizer', | ||
icon: 'IconUser', | ||
}) | ||
isOrganizer: boolean; | ||
|
||
@FieldMetadata({ | ||
type: FieldMetadataType.SELECT, | ||
label: 'Response Status', | ||
description: 'Response Status', | ||
icon: 'IconUser', | ||
options: [ | ||
{ | ||
value: CalendarEventAttendeeResponseStatus.NEEDS_ACTION, | ||
label: 'Needs Action', | ||
position: 0, | ||
color: 'orange', | ||
}, | ||
{ | ||
value: CalendarEventAttendeeResponseStatus.DECLINED, | ||
label: 'Declined', | ||
position: 1, | ||
color: 'red', | ||
}, | ||
{ | ||
value: CalendarEventAttendeeResponseStatus.TENTATIVE, | ||
label: 'Tentative', | ||
position: 2, | ||
color: 'yellow', | ||
}, | ||
{ | ||
value: CalendarEventAttendeeResponseStatus.ACCEPTED, | ||
label: 'Accepted', | ||
position: 3, | ||
color: 'green', | ||
}, | ||
], | ||
defaultValue: { value: CalendarEventAttendeeResponseStatus.NEEDS_ACTION }, | ||
}) | ||
responseStatus: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's create an enum here too? Also I feel like "response" is not really clear, is it "availability status" or something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Availability is another concept, it could be interpreted as "is the person available" rather than "is the person coming to the event" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is also responseStatus on outlook api: https://learn.microsoft.com/en-us/graph/api/resources/responseStatus?view=graph-rest-1.0#json-representation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's true 👍 @bosiraphael |
||
|
||
@FieldMetadata({ | ||
type: FieldMetadataType.RELATION, | ||
label: 'Person', | ||
description: 'Person', | ||
icon: 'IconUser', | ||
joinColumn: 'personId', | ||
}) | ||
@IsNullable() | ||
person: PersonObjectMetadata; | ||
|
||
@FieldMetadata({ | ||
type: FieldMetadataType.RELATION, | ||
label: 'Workspace Member', | ||
description: 'Workspace Member', | ||
icon: 'IconUser', | ||
joinColumn: 'workspaceMemberId', | ||
}) | ||
@IsNullable() | ||
workspaceMember: WorkspaceMemberObjectMetadata; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this was not needed in the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe needed for the way we display events (first person to appear on the right)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we confirm with @Bonapara? The closest thing to this field would be "role" inside messageParticipant where we need to display from/to/bcc/etc differently but here I'm not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed offline, ok lgtm