pub struct SupportWriteService { /* private fields */ }Implementations§
Source§impl SupportWriteService
impl SupportWriteService
pub fn new(pool: PgPool) -> Self
Sourcepub async fn create_sla(&self, s: NewSla) -> Result<Uuid, SupportError>
pub async fn create_sla(&self, s: NewSla) -> Result<Uuid, SupportError>
Define an SLA with its per-priority first-response + resolution targets. Each target’s resolution time must be >= its response time; at least one priority row is required.
Sourcepub async fn raise_issue(
&self,
i: NewIssue,
now: DateTime<Utc>,
) -> Result<Uuid, SupportError>
pub async fn raise_issue( &self, i: NewIssue, now: DateTime<Utc>, ) -> Result<Uuid, SupportError>
Raise a ticket. It binds an SLA (the given one, else the default) and snapshots concrete
response_by / resolution_by deadlines from the matching priority target. With no SLA the clock
is untracked (deadlines NULL).
Sourcepub async fn record_first_response(
&self,
issue_id: Uuid,
now: DateTime<Utc>,
) -> Result<(), SupportError>
pub async fn record_first_response( &self, issue_id: Uuid, now: DateTime<Utc>, ) -> Result<(), SupportError>
Record the first response — moves the clock from first-response to resolution tracking, and
judges the response leg: a response after response_by breaches the SLA. The breach is
persisted (response_breached) and immediately flips agreement_status to failed, because a
missed first response fails the SLA even if the resolution later lands on time (a met resolution
no longer masks a blown response — completeness council 2026-07-07). Judged inside the gated
UPDATE against the row’s live response_by (pause-adjusted), never a stale read.
Sourcepub async fn pause_sla(
&self,
issue_id: Uuid,
now: DateTime<Utc>,
) -> Result<(), SupportError>
pub async fn pause_sla( &self, issue_id: Uuid, now: DateTime<Utc>, ) -> Result<(), SupportError>
Pause the SLA clock (ticket on hold — waiting on customer / third party).
Sourcepub async fn resume_sla(
&self,
issue_id: Uuid,
now: DateTime<Utc>,
) -> Result<(), SupportError>
pub async fn resume_sla( &self, issue_id: Uuid, now: DateTime<Utc>, ) -> Result<(), SupportError>
Resume the SLA clock — add the paused span back to the outstanding deadlines so a hold never counts against the SLA. Restores the running status (open if not yet responded, else replied).
Sourcepub async fn resolve_issue(
&self,
issue_id: Uuid,
now: DateTime<Utc>,
sink: &dyn SupportEventSink,
) -> Result<bool, SupportError>
pub async fn resolve_issue( &self, issue_id: Uuid, now: DateTime<Utc>, sink: &dyn SupportEventSink, ) -> Result<bool, SupportError>
Resolve a ticket. Judged fulfilled iff resolved at/before the (pause-adjusted) resolution
deadline — a ticket with no SLA is always fulfilled (no promise to breach). Emits IssueResolved.
Sourcepub async fn close_issue(&self, issue_id: Uuid) -> Result<(), SupportError>
pub async fn close_issue(&self, issue_id: Uuid) -> Result<(), SupportError>
Close a resolved ticket (terminal).
Sourcepub async fn escalate_to_project(
&self,
issue_id: Uuid,
project: &dyn ProjectPort,
sink: &dyn SupportEventSink,
) -> Result<Uuid, SupportError>
pub async fn escalate_to_project( &self, issue_id: Uuid, project: &dyn ProjectPort, sink: &dyn SupportEventSink, ) -> Result<Uuid, SupportError>
Escalate a ticket into a real backbone-project delivery Project (drives ProjectPort, idempotent
per issue). Transition-gates on escalated_project_id IS NULL so a ticket escalates once.
Emits IssueEscalated.
Sourcepub async fn file_warranty_claim(
&self,
c: NewWarrantyClaim,
now: DateTime<Utc>,
sink: &dyn SupportEventSink,
) -> Result<Uuid, SupportError>
pub async fn file_warranty_claim( &self, c: NewWarrantyClaim, now: DateTime<Utc>, sink: &dyn SupportEventSink, ) -> Result<Uuid, SupportError>
File a warranty claim. Coverage is computed at file time: is_under_warranty = claim_date <= warranty_expiry (an unknown/absent expiry is out of warranty). Emits WarrantyClaimFiled.
Sourcepub async fn resolve_warranty_claim(
&self,
claim_id: Uuid,
accepted: bool,
resolution: Option<String>,
) -> Result<(), SupportError>
pub async fn resolve_warranty_claim( &self, claim_id: Uuid, accepted: bool, resolution: Option<String>, ) -> Result<(), SupportError>
Adjudicate an open warranty claim (accept or reject) with a resolution note.
Auto Trait Implementations§
impl !RefUnwindSafe for SupportWriteService
impl !UnwindSafe for SupportWriteService
impl Freeze for SupportWriteService
impl Send for SupportWriteService
impl Sync for SupportWriteService
impl Unpin for SupportWriteService
impl UnsafeUnpin for SupportWriteService
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> 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