application capa

application-reviews

Forge reviews module. Sprint 61.

Forge reviews module. Sprint 61.

Tierapplication
Roleunclassified (baselined)
Pathcrates/application/reviews
Edition2024
Targetsapplication_reviews, pg_forge_reviews
Public items20 across 5 modules
Tests7

What it is for

application-reviews — Layer 3 module. Sprint 61.

B-009 Gate-0.5 investigation: before this, migrations() returned Vec::new() and migrate_pending returned Ok(0) while ignoring the pool, even though services::reviews is itself a thin adapter over the reviews / review_summaries tables + triggers owned by domain-reviews (crates/domain/reviews, migrations/001_reviews_init.sql + 002_curation_fields.sql) — this crate's own Cargo.toml didn't even depend on domain-reviews before this pass, despite services/reviews.rs's and api/reviews_admin.rs's doc comments explicitly naming it as the schema owner. Mirrors application-catalog's and application-encounters's pattern: vendor the library crate's own migration files via include_str! so a host mounting application-reviews alone still gets the schema.

Note: application-engine's central platform set already vendors both files (migrations/014_primitives_reviews_init.sql, 015_primitives_reviews_curation.sql) for its own review widgets, so on a DB where the central set has already run, this module's own migrate_pending is a no-op (both source files use IF NOT EXISTS / idempotent forms throughout, so re-applying is safe rather than erroring — unlike application-tenant's documented CREATE TABLE non-idempotency gap).

No permission_codes() added: neither domain-reviews nor this crate defines permission/capability constants to draw from.

Capabilities

ReviewsModule

application-reviews — Layer 3 module. Sprint 61.

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

api (other)

HTTP routers for application-reviews. Sprint 65: extracted from rust-cms-engine.

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

api::reviews_admin (other)

Reviews admin REST router.

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

api::reviews_public (other)

Reviews public read endpoint.

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

TopQuery

Reviews public read endpoint.

Item
pub struct TopQuery

services::reviews (other)

Reviews service — wraps the reviews table from

Item
async fn list(pool : & PgPool, filter : ListFilter) -> Result <Vec <Review>, ReviewError>
async fn get(pool : & PgPool, id : Uuid) -> Result <Option <Review>, ReviewError>
async fn create(pool : & PgPool, input : UpsertReviewInput) -> Result <Review, ReviewError>
async fn update(pool : & PgPool, id : Uuid, input : UpsertReviewInput,) -> Result <Review, ReviewError>

ListFilter

Reviews service — wraps the reviews table from

Item
pub struct ListFilter

Review

Reviews service — wraps the reviews table from

Item
pub struct Review

ReviewError

Reviews service — wraps the reviews table from

Item
pub enum ReviewError
async fn delete(pool : & PgPool, id : Uuid) -> Result <(), ReviewError>

UpsertReviewInput

Reviews service — wraps the reviews table from

Item
pub struct UpsertReviewInput

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_reviews

flowchart TD
  n_application_reviews["application_reviews"]
  n_application_reviews --> n_api["api"]
  n_api --> n_api__reviews_admin["reviews_admin"]
  n_api --> n_api__reviews_public["reviews_public"]
  n_application_reviews --> n_services["services"]
  n_services --> n_services__reviews["reviews"]

Public surface

`crate root`

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

`api`

ItemWhat it is
fn admin_router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Admin-facing reviews routes (/reviews, /reviews/:id).
fn public_router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Public customer-facing reviews routes (/reviews/top).

`api::reviews_admin`

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

`api::reviews_public`

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

`services::reviews`

ItemWhat it is
pub enum ReviewError
pub struct ReviewEngine-side row struct that maps to the reviews table
pub struct UpsertReviewInput
pub struct ListFilter
async fn list(pool : & PgPool, filter : ListFilter) -> Result <Vec <Review>, ReviewError>List reviews with optional filtering
async fn get(pool : & PgPool, id : Uuid) -> Result <Option <Review>, ReviewError>
async fn create(pool : & PgPool, input : UpsertReviewInput) -> Result <Review, ReviewError>
async fn update(pool : & PgPool, id : Uuid, input : UpsertReviewInput,) -> Result <Review, ReviewError>
async fn delete(pool : & PgPool, id : Uuid) -> Result <(), ReviewError>

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

Boundary

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

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

flowchart LR
  n_application["application"] --> n_domain["domain"]
  n_application["application"] --> n_platform["platform"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`application-core`applicationnoalways
`domain-reviews`domainnoalways
`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
tracing^0.1noalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1fullnoalways

Build. None.

Depended on by. Nothing in this workspace.

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

flowchart LR
  SELF["application-reviews"]
  SELF -->|runtime| n_application_core["application-core"]
  SELF -->|runtime| n_domain_reviews["domain-reviews"]
  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_reviews`src/lib.rs`
testpg_forge_reviews`tests/pg_forge_reviews.rs`

Error model

Error typeNamed by
ReviewErrorcreate, delete, get, list, update

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 tests6
Integration tests1
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root100
api200
api::reviews_admin100
api::reviews_public200
services::reviews900

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc420
Public modules with a //! block45
pie showData
    title Public items with rustdoc
    "Documented" : 4
    "No rustdoc detected" : 16

Metrics

MetricValue
Rust source files6
Source lines698
Code lines548
Public API items20
Public modules5
Tests7
Examples0
Cargo features0
Direct runtime dependencies12
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "enum" : 1
    "function" : 9
    "method" : 5
    "struct" : 5
pie showData
    title Rust source composition
    "Code" : 548
    "Blank or comment" : 150

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