application capa

application-parties

Forge parties module — Person/Organization/Group/Animal with relationships + contact info. Wraps identity-parties + identity-party-places.

Forge parties module — Person/Organization/Group/Animal with relationships + contact info. Wraps identity-parties + identity-party-places.

Tierapplication
Roleunclassified (baselined)
Pathcrates/application/parties
Edition2024
Targetsapplication_parties, pg_forge_parties, pg_party_addresses
Public items53 across 5 modules
Tests118

What it is for

application-parties — Person/Organization/Group/Animal modeling.

Capabilities

PartiesModule

application-parties — Person/Organization/Group/Animal modeling.

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

api (other)

HTTP API routers for application-parties.

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

api::organizations_admin (other)

Organizations admin REST router.

Item
pub const MAX_PAGE_SIZE: u32
pub const DEFAULT_PAGE_SIZE: u32
fn opt(s : & str) -> Option <String>
fn to_summary(o : & Organization) -> OrganizationSummary
fn to_detail(o : & Organization) -> OrganizationDetail
fn organization_from_create(req : & CreateOrganizationRequest,) -> Result <Organization, PartyError>
fn apply_update(o : & mut Organization, req : & UpdateOrganizationRequest)
fn clamp_paging(page : Option <u32>, page_size : Option <u32>) ->(u32, u32)
fn page_offset(page : u32, page_size : u32) -> i64
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,

ListOrganizationsQuery

Organizations admin REST router.

Item
pub struct ListOrganizationsQuery

TenantQuery

Organizations admin REST router.

Item
pub struct TenantQuery

api::party_places_admin (other)

Party-address admin REST router.

Item
fn party_address_from_create(req : & CreatePartyAddressRequest,) -> Result <NewPartyAddress, PartyAddressRequestError>
fn apply_update_fields(existing : & PartyAddress, req : & UpdatePartyAddressRequest,) -> Result <UpdatedPartyAddress, PartyAddressRequestError>
fn to_dto(a : & PartyAddress) -> PartyAddressDto
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,

ListPartyAddressesQuery

Party-address admin REST router.

Item
pub struct ListPartyAddressesQuery

NewPartyAddress

Party-address admin REST router.

Item
pub struct NewPartyAddress

PartyAddressRequestError

Party-address admin REST router.

Item
pub enum PartyAddressRequestError

TenantQuery

Organizations admin REST router.

Item
pub struct TenantQuery

UpdatedPartyAddress

Party-address admin REST router.

Item
pub struct UpdatedPartyAddress

api::persons_admin (other)

Persons admin REST router — the backend the staff-ui parties module has

Item
pub const MAX_PAGE_SIZE: u32
pub const DEFAULT_PAGE_SIZE: u32
fn opt(s : & str) -> Option <String>
fn parse_lead_source(s : & str) -> Option <LeadSource>
fn to_summary(p : & Person) -> PersonSummary
fn to_detail(p : & Person) -> PersonDetail
fn person_from_create(req : & CreatePersonRequest) -> Result <Person, PartyError>
fn apply_update(p : & mut Person, req : & UpdatePersonRequest) -> Result <(), PartyError>
fn clamp_paging(page : Option <u32>, page_size : Option <u32>) ->(u32, u32)
fn page_offset(page : u32, page_size : u32) -> i64
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,

ListPersonsQuery

Persons admin REST router — the backend the staff-ui parties module has

Item
pub struct ListPersonsQuery

TenantQuery

Organizations admin REST router.

Item
pub struct TenantQuery

api::relationships_admin (other)

Relationships admin REST router.

Item
pub const MAX_PAGE_SIZE: u32
pub const DEFAULT_PAGE_SIZE: u32
fn opt(s : & str) -> Option <String>
fn to_dto(r : & PartyRelationship) -> RelationshipDto
fn relationship_from_create(req : & CreateRelationshipRequest,) -> Result <PartyRelationship, PartyError>
fn apply_update(r : & mut PartyRelationship, req : & UpdateRelationshipRequest)
fn clamp_paging(page : Option <u32>, page_size : Option <u32>) ->(u32, u32)
fn page_offset(page : u32, page_size : u32) -> i64
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,

ListRelationshipsQuery

Relationships admin REST router.

Item
pub struct ListRelationshipsQuery

TenantQuery

Organizations admin REST router.

Item
pub struct TenantQuery

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_parties

flowchart TD
  n_application_parties["application_parties"]
  n_application_parties --> n_api["api"]
  n_api --> n_api__organizations_admin["organizations_admin"]
  n_api --> n_api__party_places_admin["party_places_admin"]
  n_api --> n_api__persons_admin["persons_admin"]
  n_api --> n_api__relationships_admin["relationships_admin"]

Public surface

`crate root`

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

`api`

ItemWhat it is
fn admin_router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Admin router composing all parties admin sub-routers.

`api::organizations_admin`

ItemWhat it is
pub const MAX_PAGE_SIZE: u32Largest page the list endpoint will serve, whatever the caller asks for.
pub const DEFAULT_PAGE_SIZE: u32Page size used when the caller does not specify one.
pub struct ListOrganizationsQueryGET /organizationstenant_id has no #serde(default) on purpose: an absent tenant must be a 400 from axum's Query rejection, not a silent Uuid::nil().
pub struct TenantQuery`GET\
fn opt(s : & str) -> Option <String>A denormalized contact column is "" when unset in identity-parties, but the wire DTO is Option<String>
fn to_summary(o : & Organization) -> OrganizationSummaryProject an organization onto the list DTO.
fn to_detail(o : & Organization) -> OrganizationDetailProject an organization onto the detail/edit DTO.
fn organization_from_create(req : & CreateOrganizationRequest,) -> Result <Organization, PartyError>Build a new organization from a create request
fn apply_update(o : & mut Organization, req : & UpdateOrganizationRequest)Apply a partial update in place
fn clamp_paging(page : Option <u32>, page_size : Option <u32>) ->(u32, u32)Clamp caller-supplied paging into a served range
fn page_offset(page : u32, page_size : u32) -> i64The OFFSET for a 1-based page at page_size
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Organizations admin router

`api::party_places_admin`

ItemWhat it is
pub struct ListPartyAddressesQueryGET /party-addressestenant_id AND party_id are both required, no #serde(default), matching ListContactsQuery's/ ListRelationshipsQuery's contract exactly: a request for "every address in the tenant" with no anchor party isn't served by this admin surface
pub struct TenantQuery`GET\
pub enum PartyAddressRequestErrorErrors raised before any query runs — either the domain crate's own FromStr validation (PartyPlaceError, reused rather than re-invented per Gate 0.5) or this router's own required-field/length checks (Gate 1.5.6 item 1, which the domain crate has no opinion on).
pub struct NewPartyAddressA validated create request, ready for repo::create_party_address_for_tenant.
fn party_address_from_create(req : & CreatePartyAddressRequest,) -> Result <NewPartyAddress, PartyAddressRequestError>Build + validate a create request
pub struct UpdatedPartyAddressResolved fields for an update, ready for repo::update_party_address_for_tenant
fn apply_update_fields(existing : & PartyAddress, req : & UpdatePartyAddressRequest,) -> Result <UpdatedPartyAddress, PartyAddressRequestError>Resolve an update request against the existing row
fn to_dto(a : & PartyAddress) -> PartyAddressDtoProject a party address onto the wire DTO.
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Party-address admin router

`api::persons_admin`

ItemWhat it is
pub const MAX_PAGE_SIZE: u32Largest page the list endpoint will serve, whatever the caller asks for.
pub const DEFAULT_PAGE_SIZE: u32Page size used when the caller does not specify one.
pub struct ListPersonsQueryGET /personstenant_id has no #serde(default) on purpose: an absent tenant must be a 400 from axum's Query rejection, not a silent Uuid::nil().
pub struct TenantQuery`GET\
fn opt(s : & str) -> Option <String>A denormalized contact column is "" when unset in identity-parties, but the wire DTO is Option<String>
fn parse_lead_source(s : & str) -> Option <LeadSource>Parse a wire lead_source string into the typed enum
fn to_summary(p : & Person) -> PersonSummaryProject a person onto the list DTO.
fn to_detail(p : & Person) -> PersonDetailProject a person onto the detail/edit DTO.
fn person_from_create(req : & CreatePersonRequest) -> Result <Person, PartyError>Build a new person from a create request
fn apply_update(p : & mut Person, req : & UpdatePersonRequest) -> Result <(), PartyError>Apply a partial update in place
fn clamp_paging(page : Option <u32>, page_size : Option <u32>) ->(u32, u32)Clamp caller-supplied paging into a served range
fn page_offset(page : u32, page_size : u32) -> i64The OFFSET for a 1-based page at page_size
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Persons admin router

`api::relationships_admin`

ItemWhat it is
pub const MAX_PAGE_SIZE: u32Largest page the list endpoint will serve, whatever the caller asks for.
pub const DEFAULT_PAGE_SIZE: u32Page size used when the caller does not specify one.
pub struct ListRelationshipsQueryGET /relationshipstenant_id AND party_id are both required, no #serde(default): a request for "every relationship in the tenant" with no anchor party isn't a query this admin surface serves (see repo::list_relationships_for_party_for_tenant's doc for why an anchor party is required, not optional).
pub struct TenantQuery`GET\
fn opt(s : & str) -> Option <String>A blank title is "" in the model but None on the wire — same convention as organizations_admin::opt.
fn to_dto(r : & PartyRelationship) -> RelationshipDtoProject a relationship onto the wire DTO.
fn relationship_from_create(req : & CreateRelationshipRequest,) -> Result <PartyRelationship, PartyError>Build a new relationship from a create request
fn apply_update(r : & mut PartyRelationship, req : & UpdateRelationshipRequest)Apply a partial update in place
fn clamp_paging(page : Option <u32>, page_size : Option <u32>) ->(u32, u32)Clamp caller-supplied paging into a served range.
fn page_offset(page : u32, page_size : u32) -> i64The OFFSET for a 1-based page at page_size.
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Relationships admin router

Re-exports. Exported here, defined elsewhere.

ExportDefined in
identity_party_placesasparty_placesidentity_party_placesasparty_places

Boundary

Reaches into 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/parties
Vocabulary in force (lexicon)current

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

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

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`application-core`applicationnoalways
`identity-parties`identitynoalways
`identity-party-places`identitynoalways
`platform-dto`platformnoalways

Runtime, from outside the workspace.

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

Development, in this workspace.

CrateTierOptionalOnly on
`application-engine`applicationnoalways
`application-geo`applicationnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
serde_json^1noalways
tokio^1fullnoalways
tower^0.5noalways

Build. None.

Depended on by. 10 workspace crates.

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

flowchart LR
  n_application_auth["application-auth"] -->|uses| SELF
  n_application_billing["application-billing"] -->|uses| SELF
  n_application_calendar["application-calendar"] -->|uses| SELF
  n_application_calendar_recurrence["application-calendar-recurrence"] -->|uses| SELF
  n_application_catalog["application-catalog"] -->|uses| SELF
  n_application_encounters["application-encounters"] -->|uses| SELF
  n_application_identifiers["application-identifiers"] -->|uses| SELF
  n_application_messaging["application-messaging"] -->|uses| SELF
  n_application_party_discovery["application-party-discovery"] -->|uses| SELF
  n_application_planning["application-planning"] -->|uses| SELF
  SELF["application-parties"]
  SELF -->|development| n_application_engine["application-engine"]
  SELF -->|development| n_application_geo["application-geo"]
  SELF -->|runtime| n_application_core["application-core"]
  SELF -->|runtime| n_identity_parties["identity-parties"]
  SELF -->|runtime| n_identity_party_places["identity-party-places"]
  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_parties`src/lib.rs`
testpg_forge_parties`tests/pg_forge_parties.rs`
testpg_party_addresses`tests/pg_party_addresses.rs`

Error model

Error typeNamed by
PartyAddressRequestErrorapply_update_fields, party_address_from_create

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

10 workspace crates depend on this one: application-auth, application-billing, application-calendar, application-calendar-recurrence, application-catalog, application-encounters, application-identifiers, application-messaging, application-party-discovery, application-planning.

Verification

KindCount
Unit tests87
Integration tests31
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root100
api105
api::organizations_admin12013
api::party_places_admin907
api::persons_admin13013
api::relationships_admin11013

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc4653
Public modules with a //! block55
pie showData
    title Public items with rustdoc
    "Documented" : 46
    "No rustdoc detected" : 7

Metrics

MetricValue
Rust source files6
Source lines3685
Code lines2957
Public API items53
Public modules5
Tests118
Examples0
Cargo features0
Direct runtime dependencies10
Workspace reverse dependencies10
pie showData
    title Public API by kind
    "constant" : 6
    "enum" : 1
    "function" : 29
    "method" : 6
    "struct" : 11
pie showData
    title Rust source composition
    "Code" : 2957
    "Blank or comment" : 728

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