pub struct PostingRequest {
pub company_id: Uuid,
pub branch_id: Option<Uuid>,
pub source_type: String,
pub source_id: Uuid,
pub source_reference: Option<String>,
pub posting_date: NaiveDate,
pub currency: String,
pub posting_type: String,
pub reverses_post_id: Option<Uuid>,
pub description: Option<String>,
pub lines: Vec<PostingLine>,
pub idempotency_key: Option<String>,
}Expand description
A request to record a balanced set of lines in the GL (the inbound contract shape).
Fields§
§company_id: UuidThe legacy tenancy twin (ADR-0029) — see the module-level note. Unstripped producers keep passing it; nothing keys a statement on it.
branch_id: Option<Uuid>§source_type: String§source_id: Uuid§source_reference: Option<String>§posting_date: NaiveDate§currency: String§posting_type: String§reverses_post_id: Option<Uuid>§description: Option<String>§lines: Vec<PostingLine>§idempotency_key: Option<String>The REAL dedup key when set: two posts with the same (company_id, idempotency_key) collapse
to one, and the producer may reuse source_id across its several posts. When None, dedup
falls back to the tuple (company_id, source_type, source_id, posting_type). The company_id
element of those tuples is the caller’s own identity (the legacy twin, ADR-0029); the module
scopes dedup by the ambient org scope instead — on a decorated deployment the decorator’s
per-unit unique index keeps the tuple per-org.
Implementations§
Source§impl PostingRequest
impl PostingRequest
Sourcepub fn original(
company_id: Uuid,
source_type: &str,
source_id: Uuid,
posting_date: NaiveDate,
) -> Self
pub fn original( company_id: Uuid, source_type: &str, source_id: Uuid, posting_date: NaiveDate, ) -> Self
Convenience constructor for an original posting. company_id is the legacy tenancy twin
(ADR-0029) — kept so unstripped producers compile and run unchanged.
Sourcepub fn with_idempotency_key(self, key: impl Into<String>) -> Self
pub fn with_idempotency_key(self, key: impl Into<String>) -> Self
Set the idempotency key (the real per-post dedup identity).
Trait Implementations§
Source§impl Clone for PostingRequest
impl Clone for PostingRequest
Auto Trait Implementations§
impl Freeze for PostingRequest
impl RefUnwindSafe for PostingRequest
impl Send for PostingRequest
impl Sync for PostingRequest
impl Unpin for PostingRequest
impl UnsafeUnpin for PostingRequest
impl UnwindSafe for PostingRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more