operations tier

operations-planning

Event planning: tasks/checklists with due dates relative to event start

Event planning: tasks/checklists with due dates relative to event start

Tieroperations
Roleunclassified (baselined)
Pathcrates/operations/planning
Edition2021
Targetsoperations_planning, integration
Public items9 across 1 module
Tests27

What it is for

# operations-planning

Event planning library crate: tasks/checklists with due dates relative to event start.

Architecture

This crate provides planning items (tasks/checklists) that can be linked to:

Key Design Decisions

1. FK XOR Constraint: Each planning item must link to exactly one of:

This prevents polymorphic linking while maintaining referential integrity.

2. Relative Due Dates: Items can have:

3. Task Dependencies: Items can depend on other items for simple task graphs.

Example

use operations_planning::{PlanningItem, compute_due_date};
use chrono::{Duration, Utc};

// Create a task due 2 weeks before event start
let item = PlanningItem::for_encounter(encounter_id, "Book venue")
.with_description("Reserve the meeting room")
.due_offset(-14);

// Compute actual due date based on event start
let event_start = Utc::now() + Duration::days(30);
let due_date = compute_due_date(&item, event_start);

Capabilities

postgres (other)

PostgreSQL storage for planning items.

Item
async fn create_item(pool : & PgPool, item : & PlanningItem) -> Result <(), PlanningError>
async fn get_item(pool : & PgPool, id : PlanningItemId) -> Result <PlanningItem, PlanningError>
async fn update_item(pool : & PgPool, item : & PlanningItem) -> Result <(), PlanningError>
async fn update_status(pool : & PgPool, id : PlanningItemId, status : PlanningStatus,) -> Result <(), PlanningError>
async fn delete_item(pool : & PgPool, id : PlanningItemId) -> Result <(), PlanningError>
async fn list_items_for_encounter(pool : & PgPool, encounter_id : EncounterId,) -> Result <Vec <PlanningItem>, PlanningError>
async fn list_items_for_series(pool : & PgPool, series_id : SeriesId,) -> Result <Vec <PlanningItem>, PlanningError>
async fn list_items_for_assignee(pool : & PgPool, party_id : identity_parties::PartyId,) -> Result <Vec <PlanningItem>, PlanningError>
async fn list_incomplete_items(pool : & PgPool) -> Result <Vec <PlanningItem>, PlanningError>

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

operations_planning

Public surface

`postgres`

ItemWhat it is
async fn create_item(pool : & PgPool, item : & PlanningItem) -> Result <(), PlanningError>Create a new planning item.
async fn get_item(pool : & PgPool, id : PlanningItemId) -> Result <PlanningItem, PlanningError>Get a planning item by ID.
async fn update_item(pool : & PgPool, item : & PlanningItem) -> Result <(), PlanningError>Update a planning item.
async fn update_status(pool : & PgPool, id : PlanningItemId, status : PlanningStatus,) -> Result <(), PlanningError>Update the status of a planning item.
async fn delete_item(pool : & PgPool, id : PlanningItemId) -> Result <(), PlanningError>Delete a planning item.
async fn list_items_for_encounter(pool : & PgPool, encounter_id : EncounterId,) -> Result <Vec <PlanningItem>, PlanningError>List planning items for an encounter.
async fn list_items_for_series(pool : & PgPool, series_id : SeriesId,) -> Result <Vec <PlanningItem>, PlanningError>List planning items for a series.
async fn list_items_for_assignee(pool : & PgPool, party_id : identity_parties::PartyId,) -> Result <Vec <PlanningItem>, PlanningError>List all items assigned to a party.
async fn list_incomplete_items(pool : & PgPool) -> Result <Vec <PlanningItem>, PlanningError>List all incomplete items (for dashboard).

Re-exports. Exported here, defined elsewhere.

ExportDefined in
PartyIdidentity_parties::PartyId
PlanningErrorerror::PlanningError
{compute_due_date,EncounterId,PlanningItem,PlanningItemId,PlanningLink,PlanningStatus,SeriesId,}models::{compute_due_date,EncounterId,PlanningItem,PlanningItemId,PlanningLink,PlanningStatus,SeriesId,}
{create_item,delete_item,get_item,list_incomplete_items,list_items_for_assignee,list_items_for_encounter,list_items_for_series,update_item,update_status,}postgres::{create_item,delete_item,get_item,list_incomplete_items,list_items_for_assignee,list_items_for_encounter,list_items_for_series,update_item,update_status,}

Boundary

Reaches into foundation, identity.

Shares tier operations with 40 other crates: operations-approval-workflow, operations-assessments, operations-block-imaging, operations-boot-media, operations-browser-agent-worker, operations-camera-discovery, operations-camera-liveview, operations-camera-registry, … (40 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)operations
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/operations/planning
Vocabulary in force (lexicon)current

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

flowchart LR
  n_operations["operations"] --> n_foundation["foundation"]
  n_operations["operations"] --> n_identity["identity"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-basemodels`foundationnoalways
`identity-parties`identitynoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonyesalways
thiserror^2noalways
uuid^1v4, serdenoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
dotenvy^0.15noalways
tokio^1fullnoalways
tokio-test^0.4noalways

Build. None.

Depended on by. 2 workspace crates.

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

flowchart LR
  n_application_planning["application-planning"] -->|uses| SELF
  n_foundation_test_support["foundation-test-support"] -->|uses| SELF
  SELF["operations-planning"]
  SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"]
  SELF -->|runtime| n_identity_parties["identity-parties"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

FeatureEnablesOn by default
defaultyes
postgresdep:sqlxno
flowchart LR
  n_default["default"]
  n_postgres["postgres"] --> n_dep_sqlx["dep:sqlx"]

Targets

KindNameSource
liboperations_planning`src/lib.rs`
testintegration`tests/integration.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfaceyes
async runtimenone detected
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

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

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

2 workspace crates depend on this one: application-planning, foundation-test-support.

Verification

KindCount
Unit tests9
Integration tests18
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
postgres900

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc99
Public modules with a //! block11
pie showData
    title Public items with rustdoc
    "Documented" : 9
    "No rustdoc detected" : 0

Metrics

MetricValue
Rust source files4
Source lines716
Code lines520
Public API items9
Public modules1
Tests27
Examples0
Cargo features2
Direct runtime dependencies9
Workspace reverse dependencies2
pie showData
    title Public API by kind
    "function" : 9
pie showData
    title Rust source composition
    "Code" : 520
    "Blank or comment" : 196

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 operations · Manual