Temporal
Applies to: Section, Session, Event, Assignment
Methods
- isActive(now = new Date())
- daysUntilStart()
- durationMinutes()
- Wraps Temporal facet; ensures start/end logic lives with data.
Beta
How to turn facets into reusable behaviors (Temporal.isActive, Visibility.canEdit, etc.) so domain models gain real methods.
See Phase plan (Session mixins) and Architecture review.
Applies to: Section, Session, Event, Assignment
Methods
Applies to: Section, Session, Resource, Discussion
Methods
Applies to: Section, Session, Assignment
Methods
Applies to: Composition, Document, Signal (blocks)
Methods
Applies to: Signal, Resource, Task, Idea
Methods
Applies to: Section, Assignment, Task
Methods
Applies to: Composition, Signal, Resource
Methods
Mixins wrap the raw Convex document type so we can call methods on Section/Session instances without building brand new ORM layers. This is the pattern to reference when we actually wire them up.
type Constructor<T = {}> = new (...args: any[]) => T;
function TemporalMixin<TBase extends Constructor>(Base: TBase) {
return class extends Base {
isActive(now = new Date()) {
return now >= this.temporal.start && now <= this.temporal.end;
}
};
}
class Section extends TemporalMixin(VisibilityMixin(BaseSection)) {
publish() {
if (!this.canEdit(currentUser)) throw new Error('Nope');
// ...
}
}