- tags
- #events
events¶
NorthConf, a made-up two-day tech conference, as a domain model: the event and its venue, the programme, the people, tickets, and what happens on the day. Its sample data is in events-samples; the flows (registrations, the double-booking guard, payments, reminders, check-in, feedback) are in the events-… topics, explained in FlowsGuide.
Conventions (d2 class syntax): X* is a list, <>X / <>X* a reference by key, a bare X is containment (a class with no @key is kept inside its owner). @label marks the display field, ? an optional field, @calc(…) a field worked out from the others.
The event¶
$class Event (
@key id: String,
@label name: String,
venue: <>Venue,
starts: Date,
ends: Date,
status: String,
capacity: Number,
registered: Number,
@calc(capacity - registered) seatsLeft: Number,
) @group("Event")
$class Room (
@label name: String,
capacity: Number,
) @group("Event")
$class Venue (
@key id: String,
@label name: String,
city: String,
rooms: Room*,
) @group("Event")
$class Track (
@key id: String,
@label name: String,
colour: String,
) @group("Event")
$class Session (
@key id: String,
event: <>Event,
@label title: String,
room: String,
track: <>Track,
start: Date,
end: Date,
speakers: <>Speaker*,
status: String,
) @group("Event")
$class Speaker (
@key id: String,
@label name: String,
email: String,
bio: String,
) @group("Event")
$class Sponsor (
@key id: String,
@label name: String,
level: String,
) @group("Event")
People¶
$class Attendee (
@key id: String,
@label name: String,
email: String,
) @group("People")
$class Organizer (
@key id: String,
@label name: String,
email: String,
) @group("People")
$class Shift (
role: String,
start: Date,
end: Date,
) @group("People")
$class Volunteer (
@key id: String,
@label name: String,
email: String,
shifts: Shift*,
) @group("People")
Tickets¶
$class TicketType (
@key id: String,
event: <>Event,
@label name: String,
price: Number,
capacity: Number,
sold: Number,
status: String,
@calc(capacity - sold) remaining: Number,
) @group("Tickets")
$class Registration (
@key id: String,
attendee: <>Attendee,
ticketType: <>TicketType,
status: String,
discount: <>Discount?,
) @group("Tickets")
$class Payment (
@key id: String,
registration: <>Registration,
amount: Number,
method: String,
) @group("Tickets")
$class Discount (
@key code: String,
pct: Number,
) @group("Tickets")
$class Invoice (
@key number: String,
registration: <>Registration,
amount: Number,
issued: Date,
) @group("Tickets")
On the day¶
$class CheckIn (
@key id: String,
registration: <>Registration,
session: <>Session?,
at: Date,
) @group("On the day")
$class Feedback (
@key id: String,
session: <>Session,
attendee: <>Attendee,
stars: Number,
@label text: String,
) @group("On the day")
$class Announcement (
@key id: String,
event: <>Event,
@label text: String,
at: Date,
) @group("On the day")
$class Badge (
@key id: String,
registration: <>Registration,
@label name: String,
printed: Boolean,
) @group("On the day")
The outbox¶
Every message the flows send goes through events.notify (events-notify), which keeps it here, so you can see what would go out and to whom.
$class Message (
@key id: String,
to: String,
@label text: String,
at: Date,
) @group("Outbox")