Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/dpp-dal/src/in_memory_repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
use std::collections::HashMap;
use std::sync::{Arc, Mutex};

use dpp_domain::domain::error::DppError;
use dpp_domain::domain::passport::{Passport, PassportId};
use dpp_domain::domain::status::PassportStatus;
use dpp_domain::error::DppError;
use dpp_domain::passport::{Passport, PassportId};
use dpp_domain::ports::passport_repo::PassportRepository;
use dpp_domain::status::PassportStatus;

/// A [`PassportRepository`] backed by a `HashMap`.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-dal/src/pg/repo_evidence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use async_trait::async_trait;
use sqlx::Row;

use dpp_domain::{DppError, domain::passport::PassportId};
use dpp_domain::{DppError, passport::PassportId};
use dpp_types::evidence::{
DossierV1, EvidenceDossierRecord, EvidenceDossierRepository, EvidenceDossierSummary,
};
Expand Down
10 changes: 4 additions & 6 deletions crates/dpp-dal/src/pg/repo_passport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ use uuid::Uuid;

use dpp_domain::{
catalog::ProductGroupCatalog,
domain::{
error::DppError,
passport::{Passport, PassportId},
product_identity::ProductIdentity,
status::PassportStatus,
},
error::DppError,
passport::{Passport, PassportId},
ports::passport_repo::PassportRepository,
product::ProductIdentity,
schemas::lens::LensRegistry,
status::PassportStatus,
};

use super::{PgDal, db_err};
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-dal/src/pg/repo_registry_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use uuid::Uuid;

use dpp_domain::{
DppError,
domain::passport::{Passport, PassportId},
passport::{Passport, PassportId},
};
use dpp_types::{
RegistryStatusIntent, RegistrySyncCounts, RegistrySyncOutbox, RegistrySyncRow,
Expand Down
5 changes: 1 addition & 4 deletions crates/dpp-dal/src/pg/repo_registry_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ use chrono::{DateTime, Utc};
use sqlx::Row;
use uuid::Uuid;

use dpp_domain::{
DppError,
domain::{passport::PassportId, transfer::TransferChain},
};
use dpp_domain::{DppError, passport::PassportId, transfer::TransferChain};
use dpp_types::{
RegistryTransferCounts, RegistryTransferOutbox, RegistryTransferRow, RegistryTransferStatus,
};
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-dal/src/pg/repo_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use async_trait::async_trait;
use sqlx::Row;

use dpp_domain::{DppError, domain::passport::PassportId};
use dpp_domain::{DppError, passport::PassportId};
use dpp_types::scan::{
DailyScanCount, OperatorScanStats, PassportScanStats, QrRenderIncrement, ScanIncrement,
ScanPruneCounts, ScanTelemetryRepository,
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-dal/src/pg/repo_seal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use async_trait::async_trait;
use sqlx::Row;
use uuid::Uuid;

use dpp_domain::{DppError, domain::passport::PassportId, ports::seal::SealedEnvelope};
use dpp_domain::{DppError, passport::PassportId, seal::SealedEnvelope};
use dpp_types::{SealOutbox, SealOutboxCounts, SealRow};

use super::{PgDal, db_err, require_updated};
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-dal/src/pg/repo_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use async_trait::async_trait;
use sqlx::Row;
use uuid::Uuid;

use dpp_domain::{DppError, domain::passport::PassportId};
use dpp_domain::{DppError, passport::PassportId};
use dpp_types::{SnapshotOutbox, SnapshotOutboxCounts, SnapshotReconcileRow};

use super::{PgDal, db_err, require_updated};
Expand Down
5 changes: 1 addition & 4 deletions crates/dpp-dal/src/pg/repo_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
use async_trait::async_trait;
use sqlx::Row;

use dpp_domain::{
DppError,
domain::{passport::PassportId, transfer::TransferChain},
};
use dpp_domain::{DppError, passport::PassportId, transfer::TransferChain};
use dpp_types::TransferStore;

use super::{PgDal, db_err};
Expand Down
4 changes: 2 additions & 2 deletions crates/dpp-dal/tests/passport_read_upcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use dpp_domain::Passport;
use dpp_domain::catalog::ProductGroupCatalog;
use dpp_domain::domain::error::DppError;
use dpp_domain::error::DppError;
use dpp_domain::schemas::lens::LensRegistry;
use serde_json::json;

Expand Down Expand Up @@ -52,7 +52,7 @@ fn a_document_written_under_the_old_country_key_reads_successfully() {
let passport = Passport::from_stored(old_textile_doc(), &lenses, &catalog)
.expect("the registered textile 1.1.0 -> 1.2.0 lens must bridge this document");

let Some(dpp_domain::domain::product_group::ProductGroupData::Textile(textile)) =
let Some(dpp_domain::product_group::ProductGroupData::Textile(textile)) =
passport.product_group_data
else {
panic!("expected textile product_group data");
Expand Down
16 changes: 6 additions & 10 deletions crates/dpp-dal/tests/pg_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ use dpp_dal::pg::{
};
use dpp_dal::test_harness::start_pg;
use dpp_domain::{
domain::{
gtin::Gtin,
passport::{FacilitySnapshot, ManufacturerInfo, Passport, PassportId},
product_group::{
BatteryChemistry, BatteryData, BatteryType, ProductGroup, ProductGroupData,
},
product_identity::ProductIdentity,
status::PassportStatus,
},
identifier::gtin::Gtin,
passport::{FacilitySnapshot, ManufacturerInfo, Passport, PassportId},
ports::passport_repo::PassportRepository,
product::ProductIdentity,
product_group::{BatteryChemistry, BatteryData, BatteryType, ProductGroup, ProductGroupData},
status::PassportStatus,
};
use dpp_types::{
api_key::{ApiKey, ApiKeyRecord, ApiKeyRepository},
Expand Down Expand Up @@ -632,7 +628,7 @@ async fn t9_find_by_identity_matches_draft_and_published_via_index() {
/// generate 200 distinct, individually valid GTIN-14s.
fn check_digit_for(data13: &str) -> u8 {
let digits: Vec<u8> = data13.bytes().map(|b| b - b'0').collect();
dpp_domain::domain::gtin::gs1_check_digit(&digits)
dpp_domain::gs1_check_digit(&digits)
}

/// A structurally-valid but unsigned dossier — enough to persist/round-trip
Expand Down
8 changes: 4 additions & 4 deletions crates/dpp-dal/tests/pg_seal_outbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
use chrono::Utc;
use dpp_dal::pg::{PgPassportRepo, PgSealOutboxRepo};
use dpp_dal::test_harness::start_pg;
use dpp_domain::domain::passport::{ManufacturerInfo, Passport, PassportId};
use dpp_domain::domain::product_group::ProductGroup;
use dpp_domain::domain::status::PassportStatus;
use dpp_domain::passport::{ManufacturerInfo, Passport, PassportId};
use dpp_domain::ports::passport_repo::PassportRepository;
use dpp_domain::ports::seal::{SealFormat, SealedEnvelope};
use dpp_domain::product_group::ProductGroup;
use dpp_domain::seal::{SealFormat, SealedEnvelope};
use dpp_domain::status::PassportStatus;
use dpp_types::SealOutbox;

/// A passport in the state the drain actually finds one in: published, signed,
Expand Down
6 changes: 3 additions & 3 deletions crates/dpp-integrator/src/domain/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use std::collections::HashMap;

use dpp_domain::domain::gtin::Gtin;
use dpp_domain::domain::passport::MaterialEntry;
use dpp_domain::identifier::gtin::Gtin;
use dpp_domain::passport::MaterialEntry;

use super::request::RowError;

Expand Down Expand Up @@ -178,7 +178,7 @@ pub(super) fn optional_commodity_code(
) -> Option<String> {
let raw = get_field(row, field).filter(|v| !v.trim().is_empty())?;
let trimmed = raw.trim();
match dpp_domain::domain::commodity_code::CommodityCode::parse(trimmed) {
match dpp_domain::identifier::commodity_code::CommodityCode::parse(trimmed) {
Ok(_) => Some(trimmed.to_owned()),
Err(e) => {
errors.push(RowError {
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-integrator/src/domain/import_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct RowFinding {
/// Set only for `Lint` findings — validation findings have no severity
/// tier of their own (they simply block the row).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub severity: Option<dpp_domain::domain::lint::LintSeverity>,
pub severity: Option<dpp_domain::lint::LintSeverity>,
}

/// One row's validation outcome.
Expand Down
4 changes: 2 additions & 2 deletions crates/dpp-integrator/src/domain/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::collections::HashMap;
use futures::stream::{self, StreamExt};
use sha2::{Digest, Sha256};

use dpp_domain::domain::product_identity::ProductIdentity;
use dpp_domain::product::ProductIdentity;

use crate::domain::request::CreatePassportRequest;
use crate::infra::vault_client::{VaultClientError, VaultHttpClient};
Expand Down Expand Up @@ -87,7 +87,7 @@ pub fn identity_from_request(req: &CreatePassportRequest) -> Option<ProductIdent
let product_group = req.product_group.clone().or_else(|| {
req.product_group_data
.as_ref()
.map(dpp_domain::domain::product_group::ProductGroupData::product_group)
.map(dpp_domain::product_group::ProductGroupData::product_group)
})?;
let gtin = req.product_group_data.as_ref()?.gtin()?.to_owned();
Some(ProductIdentity {
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-integrator/src/domain/validate/aluminium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::collections::HashMap;

use dpp_domain::domain::{
use dpp_domain::{
passport::ManufacturerInfo,
product_group::{AluminiumData, ProductGroup, ProductGroupData, ProductionRoute},
};
Expand Down
4 changes: 2 additions & 2 deletions crates/dpp-integrator/src/domain/validate/battery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use std::collections::HashMap;

use dpp_domain::domain::{
gtin::Gtin,
use dpp_domain::{
identifier::gtin::Gtin,
passport::ManufacturerInfo,
product_group::{
BatteryChemistry, BatteryData, BatteryType, CarbonFootprintClass, ProductGroup,
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-integrator/src/domain/validate/steel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::collections::HashMap;

use dpp_domain::domain::{
use dpp_domain::{
passport::ManufacturerInfo,
product_group::{ProductGroup, ProductGroupData, ProductionRoute, SteelData},
};
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-integrator/src/domain/validate/textile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::collections::HashMap;

use dpp_domain::domain::{
use dpp_domain::{
passport::ManufacturerInfo,
product_group::{FibreEntry, ProductGroup, ProductGroupData, TextileData},
};
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-integrator/src/domain/validate/tyre.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::collections::HashMap;

use dpp_domain::domain::{
use dpp_domain::{
passport::ManufacturerInfo,
product_group::{ProductGroup, ProductGroupData, TyreData},
};
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-integrator/src/handlers/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ mod tests {
fn nth_valid_gtin(n: u32) -> String {
let data13 = format!("{n:013}");
let digits: Vec<u8> = data13.bytes().map(|b| b - b'0').collect();
let check = dpp_domain::domain::gtin::gs1_check_digit(&digits);
let check = dpp_domain::gs1_check_digit(&digits);
format!("{data13}{check}")
}

Expand Down
4 changes: 2 additions & 2 deletions crates/dpp-integrator/src/infra/vault_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::fmt;

use dpp_domain::domain::product_identity::ProductIdentity;
use dpp_domain::product::ProductIdentity;

use crate::domain::request::CreatePassportRequest;

Expand Down Expand Up @@ -233,7 +233,7 @@ mod tests {
response::{IntoResponse, Response},
routing::{get, post},
};
use dpp_domain::domain::passport::ManufacturerInfo;
use dpp_domain::passport::ManufacturerInfo;
use std::sync::Arc;

struct MockResponse {
Expand Down
4 changes: 2 additions & 2 deletions crates/dpp-node/src/boot/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ fn set_seal_gauges(c: &SealOutboxCounts) {
pub async fn spawn_seal_drain(
outbox: Arc<dyn SealOutbox>,
seal: Arc<dyn SealPort>,
key_ref: dpp_domain::ports::seal::SealCredentialRef,
conformance_level: dpp_domain::ports::seal::SealConformanceLevel,
key_ref: dpp_domain::seal::SealCredentialRef,
conformance_level: dpp_domain::seal::SealConformanceLevel,
) {
match outbox.status_counts().await {
Ok(c) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-node/src/infra/registry/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use std::sync::Arc;

use dpp_common::event_codes;
use dpp_domain::domain::error::DppError;
use dpp_domain::error::DppError;
use reqwest::Client;
use tokio::sync::RwLock;

Expand Down
6 changes: 3 additions & 3 deletions crates/dpp-node/src/infra/registry/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use super::client::{EuRegistrySync, RetryableError};
use async_trait::async_trait;
use chrono::Utc;
use dpp_domain::{
domain::error::DppError,
domain::passport::PassportId,
domain::transfer::{ResponsibleOperator, TransferRecord},
error::DppError,
passport::PassportId,
ports::registry_sync::{
RegistrationGranularity, RegistrationRequest, RegistryIdentifiers, RegistryRecord,
RegistryStatus, RegistrySyncPort,
},
transfer::{ResponsibleOperator, TransferRecord},
};
use dpp_registry::{
EuRegistryEnvelope, EuRegistryResponse, FacilityIdentifier, Granularity, OperatorIdentifier,
Expand Down
6 changes: 2 additions & 4 deletions crates/dpp-node/src/infra/registry/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ use std::sync::atomic::Ordering;
use std::time::{Duration, Instant};

use chrono::Utc;
use dpp_domain::domain::passport::PassportId;
use dpp_domain::passport::PassportId;
use dpp_registry::{EuRegistryResponse, RegistryStatusCode};
use uuid::Uuid;

use dpp_domain::DppError;
use dpp_domain::domain::transfer::{
OperatorRole, ResponsibleOperator, TransferReason, TransferRecord,
};
use dpp_domain::ports::registry_sync::{
RegistrationGranularity, RegistrationRequest, RegistryStatus, RegistrySyncPort,
};
use dpp_domain::transfer::{OperatorRole, ResponsibleOperator, TransferReason, TransferRecord};

use super::client::EuRegistrySync;
use super::config::EuRegistrySyncConfig;
Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-node/src/infra/registry_drain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub async fn drain_once(
/// either way.
async fn apply_outcome(
outbox: &Arc<dyn RegistrySyncOutbox>,
pid: dpp_domain::domain::passport::PassportId,
pid: dpp_domain::passport::PassportId,
outcome: Result<dpp_domain::ports::registry_sync::RegistryRecord, dpp_domain::DppError>,
stats: &mut DrainStats,
) {
Expand Down
6 changes: 2 additions & 4 deletions crates/dpp-node/src/infra/s3_archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use async_trait::async_trait;
use chrono::Utc;
use dpp_domain::{
domain::{
error::DppError,
passport::{Passport, PassportId},
},
error::DppError,
passport::{Passport, PassportId},
ports::archive::{ArchivePort, ArchiveReceipt, ArchiveStatus, ArchiveVerification},
};

Expand Down
2 changes: 1 addition & 1 deletion crates/dpp-node/src/infra/s3_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use aws_sdk_s3::{
config::{BehaviorVersion, Builder as ConfigBuilder, Credentials, Region},
primitives::ByteStream,
};
use dpp_domain::domain::error::DppError;
use dpp_domain::error::DppError;
use dpp_types::snapshot::SnapshotStore;

pub struct S3SnapshotConfig {
Expand Down
5 changes: 4 additions & 1 deletion crates/dpp-node/src/infra/seal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
use std::sync::Arc;

use anyhow::{Context, Result};
use dpp_domain::ports::seal::{SealConformanceLevel, SealCredentialRef, SealPort};
use dpp_domain::{
ports::seal::SealPort,
seal::{SealConformanceLevel, SealCredentialRef},
};
use dpp_types::trust::TrustMode;

/// A selected seal backend, and the three facts about it the node needs.
Expand Down
Loading
Loading