application tier

application-calendar

Forge calendar module — calendar events (1:1 extension of encounters with public submission workflow).

Forge calendar module — calendar events (1:1 extension of encounters with public submission workflow).

Tierapplication
Roleunclassified (baselined)
Pathcrates/application/calendar
Edition2024
Targetsapplication_calendar, pg_forge_calendar
Public items25 across 4 modules
Tests23

What it is for

full model, repo/postgres layer, migrations, tests) into a real Forge module. Before this sprint migrations() returned Vec::new() and migrate_pending() was a no-op returning Ok(0) (B-009's umbrella defect, docs/bugs/B-009-forge-module-shims-not-wired.md), so calendar_events/calendar_scopes/calendar_submitter_trust were never created by anything that actually called this module's own migration path.

Capabilities

crate root

_No module-level documentation is present in the source._

Item
fn assert_single_tenant_mount(is_multi_tenant_host : bool) -> Result <(), & 'static str>

CalendarModule

_No module-level documentation is present in the source._

Item
pub struct CalendarModule
CalendarModule :: fn new() -> Self
CalendarModule :: fn name(& self) -> & 'static str
CalendarModule :: fn version(& self) -> & 'static str
CalendarModule :: fn migrations(& self) -> Vec <MigrationSet>
CalendarModule :: async fn migrate_pending(& self, pool : & PgPool) -> std::result::Result <u32, MigrationError>
CalendarModule :: fn permission_codes(& self) -> Vec <String>

api (other)

application-calendar HTTP API. Sprint 3.54.

Item
fn admin_router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,

api::calendar_admin (other)

Calendar admin REST router.

Item
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,

ModerateBody

Calendar admin REST router.

Item
pub struct ModerateBody

PublicListQuery

Calendar admin REST router.

Item
pub struct PublicListQuery

SubmitEventBody

Calendar admin REST router.

Item
pub struct SubmitEventBody

services::calendar (other)

Calendar service — thin wrapper over content_calendar's postgres

Item
pub const MAX_TITLE_LEN: usize
pub const MAX_LOCATION_LEN: usize
pub const MAX_CATEGORY_LEN: usize
pub const MAX_NOTES_LEN: usize
pub const MAX_EVENT_SPAN_DAYS: i64
async fn submit_event(pool : & PgPool, input : SubmitEventInput,) -> Result <CalendarEvent, CalendarServiceError>

CalendarServiceError

Calendar service — thin wrapper over content_calendar's postgres

Item
pub enum CalendarServiceError
async fn approve_event(pool : & PgPool, encounter_id : Uuid, reviewer : PartyId, notes : Option <String>,) -> Result <(), CalendarServiceError>
async fn reject_event(pool : & PgPool, encounter_id : Uuid, reviewer : PartyId, notes : Option <String>,) -> Result <(), CalendarServiceError>
async fn list_pending(pool : & PgPool,) -> Result <Vec <CalendarEventWithEncounter>, CalendarServiceError>
async fn list_public(pool : & PgPool, from : DateTime <Utc>, to : DateTime <Utc>,) -> Result <Vec <CalendarEventWithEncounter>, CalendarServiceError>

SubmitEventInput

Calendar service — thin wrapper over content_calendar's postgres

Item
pub struct SubmitEventInput

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

application_calendar

flowchart TD
  n_application_calendar["application_calendar"]
  n_application_calendar --> n_api["api"]
  n_api --> n_api__calendar_admin["calendar_admin"]
  n_application_calendar --> n_services["services"]
  n_services --> n_services__calendar["calendar"]

Public surface

`crate root`

ItemWhat it is
pub struct CalendarModule
CalendarModule :: fn new() -> Self
CalendarModule :: fn name(& self) -> & 'static str
CalendarModule :: fn version(& self) -> & 'static str
CalendarModule :: fn migrations(& self) -> Vec <MigrationSet>
CalendarModule :: async fn migrate_pending(& self, pool : & PgPool) -> std::result::Result <u32, MigrationError>
CalendarModule :: fn permission_codes(& self) -> Vec <String>
fn assert_single_tenant_mount(is_multi_tenant_host : bool) -> Result <(), & 'static str>

`api`

ItemWhat it is
fn admin_router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Admin router for the calendar moderation queue, generic over consumer state S

`api::calendar_admin`

ItemWhat it is
pub struct SubmitEventBody
pub struct ModerateBody
pub struct PublicListQuery
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Calendar admin router

`services::calendar`

ItemWhat it is
pub const MAX_TITLE_LEN: usizeMatches encounters.title VARCHAR(255).
pub const MAX_LOCATION_LEN: usizeMatches encounters.location VARCHAR(255).
pub const MAX_CATEGORY_LEN: usize
pub const MAX_NOTES_LEN: usize
pub const MAX_EVENT_SPAN_DAYS: i64Sanity bound on event span — rejects multi-decade schedules.
pub enum CalendarServiceError
pub struct SubmitEventInputInput for submit_event
async fn submit_event(pool : & PgPool, input : SubmitEventInput,) -> Result <CalendarEvent, CalendarServiceError>
async fn approve_event(pool : & PgPool, encounter_id : Uuid, reviewer : PartyId, notes : Option <String>,) -> Result <(), CalendarServiceError>Approve a pending event
async fn reject_event(pool : & PgPool, encounter_id : Uuid, reviewer : PartyId, notes : Option <String>,) -> Result <(), CalendarServiceError>Reject a pending event
async fn list_pending(pool : & PgPool,) -> Result <Vec <CalendarEventWithEncounter>, CalendarServiceError>List the moderation queue (moderation_status = 'pending' only)
async fn list_public(pool : & PgPool, from : DateTime <Utc>, to : DateTime <Utc>,) -> Result <Vec <CalendarEventWithEncounter>, CalendarServiceError>List approved + public events in [from, to)

No pub use re-exports: every item above is declared in this crate.

Boundary

Reaches into content, identity, platform.

Shares tier application with 120 other crates: application-agreements, application-ai, application-analytics, application-approvals, application-assessments, application-audit-log, application-auth, application-billing, … (120 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)application
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/application/calendar
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_application["application"] --> n_content["content"]
  n_application["application"] --> n_identity["identity"]
  n_application["application"] --> n_platform["platform"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`application-core`applicationnoalways
`content-calendar`contentnoalways
`identity-parties`identitynoalways
`platform-dto`platformnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
axum^0.7multipartnoalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
thiserror^2noalways
uuid^1v4, v7, serde, jsnoalways

Development, in this workspace.

CrateTierOptionalOnly on
`application-engine`applicationnoalways
`application-parties`applicationnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1fullnoalways
tower^0.5noalways

Build. None.

Depended on by. Nothing in this workspace.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  SELF["application-calendar"]
  SELF -->|development| n_application_engine["application-engine"]
  SELF -->|development| n_application_parties["application-parties"]
  SELF -->|runtime| n_application_core["application-core"]
  SELF -->|runtime| n_content_calendar["content-calendar"]
  SELF -->|runtime| n_identity_parties["identity-parties"]
  SELF -->|runtime| n_platform_dto["platform-dto"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libapplication_calendar`src/lib.rs`
testpg_forge_calendar`tests/pg_forge_calendar.rs`

Error model

Error typeNamed by
CalendarServiceErrorapprove_event, list_pending, list_public, reject_event, submit_event

Operational characteristics

PropertyEvidence
async public surfaceyes
async runtimenone detected
database accessyes
network I/Oyes
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
CARGO_PKG_VERSIONsrc/lib.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests19
Integration tests4
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root200
api100
api::calendar_admin400
services::calendar1200

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc1025
Public modules with a //! block34
pie showData
    title Public items with rustdoc
    "Documented" : 10
    "No rustdoc detected" : 15

Metrics

MetricValue
Rust source files5
Source lines874
Code lines651
Public API items25
Public modules4
Tests23
Examples0
Cargo features0
Direct runtime dependencies12
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "constant" : 5
    "enum" : 1
    "function" : 8
    "method" : 6
    "struct" : 5
pie showData
    title Rust source composition
    "Code" : 651
    "Blank or comment" : 223

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All application · Manual