// Service
service/event.go -> CreateEventInvitation()
service/email.go -> PublishEventInvitation()
// Models
model/event_invitation.go
model/event_invitation_event_guest.go
// Create invitation
POST /api/v1/events/create_invitation
Request {
event_id: uint32
user_ids: []uint32
user_emails: []string
group_ids: []uint32
invitation_state: {
new_invitation: {
subject: string
message: string
file: FileDto (optional)
}
// OR
existing_invitation: {
event_invitation_id: uint32
}
}
}
// Service
service/event_guest.go -> RsvpToEvent()
// Repository
repository/event_guest.go -> GetByRsvpToken()
repository/event_guest.go -> RsvpToEvent()
// Models
model/rsvp.go (Enum: Pending, Yes, No, Maybe)
// RSVP to event
POST /api/v1/event-guests/rsvp
Request {
rsvp_token: string
first_name: string
last_name: string
phone_number: string
rsvp_id: RsvpEnum
additional_guests: [{
first_name: string
last_name: string
email: string
}]
}
// Get RSVP info
GET /api/v1/event-guests/rsvp-info
Request {
rsvp_token: string
}
Thoughts:
seems the same code from RSVP System section, area handling plus one handling.
// Service
service/event_guest.go -> RsvpToEvent()
// Repository
repository/event_guest.go -> GetByRsvpToken()
repository/event_guest.go -> RsvpToEvent()
// Models
model/rsvp.go (Enum: Pending, Yes, No, Maybe)
Available through RSVP endpoint (same as above)
// Service
service/event.go -> GetEventGuestStatistics()
// Models
model/event_invitation_event_guest.go (tracks RSVP status)
// Get guest statistics
GET /api/v1/events/{event_id}/guest-statistics
Response {
total: uint32
yes: uint32
no: uint32
maybe: uint32
pending: uint32
}
Looking at the group model, we can link a guest to a group, but this group does not belong to any event.
Thoughts:
The model group has a column IsGuestGroup but doesn't have any direct reference to event.
Can I create two groups with the same name but for different events or can be the same group from one event be reused on other event ?
// Models
model/event_guest.go -> UserGroupInternals relationship
model/user_group_internal.go
Thoughts:
- is implemented only service to publish event invitation and publish additional guest message.
// Service
service/email.go -> PublishEventInvitation()
service/email.go -> PublishAdditionalGuestMessage()
Templates are handled in the email service with the following data:
{
link: string
message: string
event_name: string
start_date: string
start_time: string
company_name: string
event_image_url: string (optional)
company_logo: string (optional)
location: string (optional)
}
They are using archived package: mapstructure ( github.com/mitchellh/mapstructure ).