domain capa

domain-storage-locations

_No description in Cargo.toml._

Tierdomain
Roleunclassified (baselined)
Pathcrates/domain/storage-locations
Edition2021
Targetsdomain_storage_locations
Public items26 across 0 modules
Tests36

What it is for

Storage location library crates: nested physical containment hierarchies.

Models the "Russian doll" pattern of physical storage — a building contains floors, floors contain rooms, rooms contain shelves, shelves contain bins. Each level nests inside exactly one parent, forming a strict tree.

This is NOT geographic (use domain-geo::Place for that). This models the internal organization of space within a physical location.

# Examples

use domain_storage_locations::{StorageLocation, LocationType};
use foundation_basemodels::HasId;

let building = StorageLocation::new("Warehouse A", LocationType::Building);
let room = StorageLocation::new("Room 101", LocationType::Room)
.with_parent(building.id());
let shelf = StorageLocation::new("Shelf 3", LocationType::Shelf)
.with_parent(room.id());

Capabilities

crate root

Storage location library crates: nested physical containment hierarchies.

Item
fn validate_nesting(parent_type : & LocationType, child_type : & LocationType) -> Result <()>
fn validate_root(location_type : & LocationType) -> Result <()>
fn build_path(ancestors : & & str, name : & str) -> String

LocationType

Storage location library crates: nested physical containment hierarchies.

Item
pub enum LocationType
LocationType :: fn depth(& self) -> u8
LocationType :: fn can_contain(& self, child : & LocationType) -> bool
LocationType :: fn can_be_root(& self) -> bool
LocationType :: fn as_str(& self) -> & 'static str
LocationType :: fn parse(s : & str) -> Option <Self>
LocationType :: fn all() -> & 'static LocationType
LocationType :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

Result

Storage location library crates: nested physical containment hierarchies.

Item
pub type Result<T>: std::result::Result <T, StorageLocationError>

StorageLocation:StorageLocation

Storage location library crates: nested physical containment hierarchies.

Item
pub struct StorageLocation

StorageLocation:created

Storage location library crates: nested physical containment hierarchies.

Item
StorageLocation :: fn created_at(& self) -> DateTime <Utc>

StorageLocation:deleted

Storage location library crates: nested physical containment hierarchies.

Item
StorageLocation :: fn deleted_at(& self) -> Option <DateTime <Utc>>

StorageLocation:id

Storage location library crates: nested physical containment hierarchies.

Item
StorageLocation :: fn id(& self) -> Uuid

StorageLocation:is

Storage location library crates: nested physical containment hierarchies.

Item
StorageLocation :: fn is_root(& self) -> bool

StorageLocation:new

Storage location library crates: nested physical containment hierarchies.

Item
StorageLocation :: fn new(name : impl Into <String>, location_type : LocationType) -> Self

StorageLocation:updated

Storage location library crates: nested physical containment hierarchies.

Item
StorageLocation :: fn updated_at(& self) -> DateTime <Utc>

StorageLocation:with

Storage location library crates: nested physical containment hierarchies.

Item
StorageLocation :: fn with_parent(mut self, parent_id : Uuid) -> Self
StorageLocation :: fn with_place(mut self, place_id : Uuid) -> Self
StorageLocation :: fn with_description(mut self, description : impl Into <String>) -> Self
StorageLocation :: fn with_code(mut self, code : impl Into <String>) -> Self
StorageLocation :: fn with_default_workflow(mut self, workflow : impl Into <String>) -> Self
StorageLocation :: fn with_category_tag(mut self, tag_id : Uuid) -> Self

StorageLocationError

Storage location library crates: nested physical containment hierarchies.

Item
pub enum StorageLocationError

How to use it

From this crate's own rustdoc:

use domain_storage_locations::{StorageLocation, LocationType};
use foundation_basemodels::HasId;

let building = StorageLocation::new("Warehouse A", LocationType::Building);
let room = StorageLocation::new("Room 101", LocationType::Room)
    .with_parent(building.id());
let shelf = StorageLocation::new("Shelf 3", LocationType::Shelf)
    .with_parent(room.id());

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub enum StorageLocationErrorErrors for storage location operations.
pub type Result<T>: std::result::Result <T, StorageLocationError>Result type for storage location operations.
pub enum LocationTypeType of storage location in the containment hierarchy
LocationType :: fn depth(& self) -> u8Returns the nesting depth (0 = outermost).
LocationType :: fn can_contain(& self, child : & LocationType) -> boolReturns true if this type can contain the given child type
LocationType :: fn can_be_root(& self) -> boolReturns true if this type can be a root (no parent).
LocationType :: fn as_str(& self) -> & 'static strString representation.
LocationType :: fn parse(s : & str) -> Option <Self>Parse from string (case-insensitive).
LocationType :: fn all() -> & 'static LocationTypeReturns all valid types.
LocationType :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub struct StorageLocationA node in a physical containment hierarchy
StorageLocation :: fn new(name : impl Into <String>, location_type : LocationType) -> SelfCreate a new storage location.
StorageLocation :: fn with_parent(mut self, parent_id : Uuid) -> SelfSet the parent location.
StorageLocation :: fn with_place(mut self, place_id : Uuid) -> SelfLink to a geo Place.
StorageLocation :: fn with_description(mut self, description : impl Into <String>) -> SelfSet description.
StorageLocation :: fn with_code(mut self, code : impl Into <String>) -> SelfSet the location code.
StorageLocation :: fn with_default_workflow(mut self, workflow : impl Into <String>) -> SelfSet the per-location default entry workflow slug (Sprint 0.10)
StorageLocation :: fn with_category_tag(mut self, tag_id : Uuid) -> SelfSet the category tag soft-reference (Sprint 0.10).
StorageLocation :: fn is_root(& self) -> boolCheck if this is a root location (no parent).
StorageLocation :: fn id(& self) -> Uuid
StorageLocation :: fn created_at(& self) -> DateTime <Utc>
StorageLocation :: fn updated_at(& self) -> DateTime <Utc>
StorageLocation :: fn deleted_at(& self) -> Option <DateTime <Utc>>
fn validate_nesting(parent_type : & LocationType, child_type : & LocationType) -> Result <()>Validate that a child type can nest inside a parent type
fn validate_root(location_type : & LocationType) -> Result <()>Validate that a location can be a root (no parent)
fn build_path(ancestors : & & str, name : & str) -> StringBuild the full path string for a location given its ancestors (root first)

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

Boundary

Reaches into foundation.

Shares tier domain with 41 other crates: domain-agreements, domain-ai-report, domain-billing, domain-catalog, domain-classify, domain-comments, domain-competitive-intel, domain-contact, … (41 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)domain
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/domain/storage-locations
Vocabulary in force (lexicon)current

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

flowchart LR
  n_domain["domain"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-basemodels`foundationnoalways

Runtime, from outside the workspace.

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

Development. None.

Build. None.

Depended on by. 2 workspace crates.

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

flowchart LR
  n_application_catalog["application-catalog"] -->|uses| SELF
  n_application_storage_locations["application-storage-locations"] -->|uses| SELF
  SELF["domain-storage-locations"]
  SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"]
  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
libdomain_storage_locations`src/lib.rs`

Error model

Error typeNamed by
StorageLocationErrorResult

Operational characteristics

PropertyEvidence
async public surfacenone detected
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-catalog, application-storage-locations.

Verification

KindCount
Unit tests36
Integration tests0
Examples0
Doctests1

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

ModuleTestsExamplesConsumers
crate root704

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc2126
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 21
    "No rustdoc detected" : 5

Metrics

MetricValue
Rust source files1
Source lines681
Code lines490
Public API items26
Public modules0
Tests36
Examples0
Cargo features2
Direct runtime dependencies7
Workspace reverse dependencies2
pie showData
    title Public API by kind
    "enum" : 2
    "function" : 3
    "method" : 19
    "struct" : 1
    "type alias" : 1
pie showData
    title Rust source composition
    "Code" : 490
    "Blank or comment" : 191

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.

Todas las domain · Manual