pub struct PartnerRecord {
pub gln: MarktpartnerCode,
pub display_name: Option<Box<str>>,
pub channels: Vec<CommunicationChannel>,
pub roles: Vec<MarketRole>,
pub valid_from: Option<OffsetDateTime>,
pub contacts: Vec<ContactPerson>,
pub country_code: Option<Box<str>>,
pub updated_at: OffsetDateTime,
}Expand description
Full trading-partner master record as stored in the PartnerStore.
Populated either from static makod.toml config (minimal — GLN + AS4 URL
only) or from an inbound PARTIN EDIFACT message (complete). Records from
different sources coexist: a bootstrapped config record is upgraded in-place
when the same partner later sends a PARTIN.
§Constructors
PartnerRecord::minimal— for bootstrapping fromGLN=URLconfig pairsPartnerRecord::from_cli_pairs— parse[as4] partnerslist from config
§Merging
Use PartnerRecord::merge_from_partin to update an existing record with
fields from a newer inbound PARTIN (respects validity dates).
Fields§
§gln: MarktpartnerCodeThe partner’s 13-digit Global Location Number.
display_name: Option<Box<str>>Company name from the PARTIN NAD segment.
channels: Vec<CommunicationChannel>All communication channels from PARTIN COM segments.
The AS4 endpoint is the entry with qualifier "AK" (PARTIN AHB 1.0f
DE 3155 convention). Use as4_endpoint for direct access.
roles: Vec<MarketRole>Market roles this partner has declared via PARTIN.
valid_from: Option<OffsetDateTime>Date from which this record version is valid (DTM/137).
None when bootstrapped from static config (no validity date known).
contacts: Vec<ContactPerson>Contact persons from the PARTIN Ansprechpartner group.
country_code: Option<Box<str>>ISO 3166-1 alpha-2 country code from NAD+MS+++...+DE (usually DE).
updated_at: OffsetDateTimeWall-clock time when this record was last written to the store.
Implementations§
Source§impl PartnerRecord
impl PartnerRecord
Sourcepub fn minimal(
gln: impl Into<MarktpartnerCode>,
as4_url: impl Into<Box<str>>,
) -> Self
pub fn minimal( gln: impl Into<MarktpartnerCode>, as4_url: impl Into<Box<str>>, ) -> Self
Create a minimal record from a GLN and an AS4 endpoint URL.
Used when bootstrapping from [as4] partners = ["GLN=URL", …] in
makod.toml. The record has no PARTIN-derived metadata — only the
GLN and a single AS4 channel.
Sourcepub fn from_cli_pairs(
pairs: &[impl AsRef<str>],
) -> Result<Vec<Self>, EngineError>
pub fn from_cli_pairs( pairs: &[impl AsRef<str>], ) -> Result<Vec<Self>, EngineError>
Parse ["GLN=HTTPS-URL", …] configuration entries into minimal records.
Returns an error on the first malformed or non-HTTPS entry.
§Errors
Returns EngineError::Partner when an entry lacks =, has an empty
GLN, or uses a non-HTTPS URL.
Sourcepub fn as4_endpoint(&self) -> Option<&str>
pub fn as4_endpoint(&self) -> Option<&str>
Return the AS4 endpoint URL if one has been registered.
Looks for a channel with qualifier "AK" (PARTIN AHB 1.0f
convention for the AS4 endpoint). Falls back to "AS4" for records
that were imported with a non-standard qualifier.
Sourcepub fn email(&self) -> Option<&str>
pub fn email(&self) -> Option<&str>
Return the primary email address if one has been registered.
Looks for a channel with qualifier "EM".
Sourcepub fn api_webdienste_endpoint(&self) -> Option<&str>
pub fn api_webdienste_endpoint(&self) -> Option<&str>
Return the API-Webdienste Strom base URL if one has been registered.
Looks for a channel with qualifier "AW". This URL is typically
populated by the Verzeichnisdienst discovery worker and is
used by MaloIdentSender to reach the LF’s callback endpoint.
Sourcepub fn merge_from_partin(&mut self, incoming: PartnerRecord)
pub fn merge_from_partin(&mut self, incoming: PartnerRecord)
Merge fields from a newer PARTIN-derived record into self.
Only updates self when incoming.valid_from is newer than
self.valid_from (or when self.valid_from is None). Config-
bootstrapped records (no valid_from) are always overwritten.
The GLN must match — mismatches are silently ignored (the caller is responsible for routing PARTIN messages to the correct record).
Trait Implementations§
Source§impl Clone for PartnerRecord
impl Clone for PartnerRecord
Source§fn clone(&self) -> PartnerRecord
fn clone(&self) -> PartnerRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PartnerRecord
impl Debug for PartnerRecord
Source§impl<'de> Deserialize<'de> for PartnerRecord
impl<'de> Deserialize<'de> for PartnerRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PartnerRecord
impl PartialEq for PartnerRecord
Source§fn eq(&self, other: &PartnerRecord) -> bool
fn eq(&self, other: &PartnerRecord) -> bool
self and other values to be equal, and is used by ==.