pub struct TechnicalSpecUseCases { /* private fields */ }Implementations§
Source§impl TechnicalSpecUseCases
impl TechnicalSpecUseCases
pub fn new(repo: Arc<dyn TechnicalSpecRepository>) -> Self
pub async fn create_spec( &self, acp_id: Uuid, building_id: Option<Uuid>, title: String, description: String, version: SemVer, deliverables: Vec<String>, required_signatures: Vec<SignatoryRole>, attachments: Vec<String>, created_by: Uuid, ) -> Result<TechnicalSpec, AppError>
Sourcepub async fn bump_version(
&self,
previous_spec_id: Uuid,
new_version: SemVer,
new_title: Option<String>,
new_description: Option<String>,
new_deliverables: Option<Vec<String>>,
new_required_signatures: Option<Vec<SignatoryRole>>,
new_attachments: Option<Vec<String>>,
) -> Result<TechnicalSpec, AppError>
pub async fn bump_version( &self, previous_spec_id: Uuid, new_version: SemVer, new_title: Option<String>, new_description: Option<String>, new_deliverables: Option<Vec<String>>, new_required_signatures: Option<Vec<SignatoryRole>>, new_attachments: Option<Vec<String>>, ) -> Result<TechnicalSpec, AppError>
Create a new version of an existing spec. The previous spec is moved
to Superseded so list views can flag the live version. The returned
spec is always a fresh Draft.
Sourcepub async fn submit_for_signatures(
&self,
spec_id: Uuid,
) -> Result<TechnicalSpec, AppError>
pub async fn submit_for_signatures( &self, spec_id: Uuid, ) -> Result<TechnicalSpec, AppError>
Draft -> PendingSignatures.
Sourcepub async fn sign_spec(
&self,
spec_id: Uuid,
signatory_user_id: Uuid,
role: SignatoryRole,
mandate_id: Option<Uuid>,
) -> Result<TechnicalSpecSignature, AppError>
pub async fn sign_spec( &self, spec_id: Uuid, signatory_user_id: Uuid, role: SignatoryRole, mandate_id: Option<Uuid>, ) -> Result<TechnicalSpecSignature, AppError>
Sign a TechnicalSpec.
Guards (in order):
- spec MUST exist (404 NotFound),
- spec MUST be in
PendingSignatures(elseValidationerror: the workflow has not opened the signature window yet), roleMUST be inspec.required_signatures(elseSignatoryNotAuthorized),- Mandataire roles (AMO / Lawyer / Architect) MUST carry a
mandate_id(entity-level guard surfacesSignatoryNotAuthorized), - duplicate (spec_id, user, role) tuples return
SignatureAlreadyExists.
When this signature completes the required set, the spec auto-promotes
to Approved (idempotent at the SQL level: update_status is safe to
repeat).
pub async fn get(&self, spec_id: Uuid) -> Result<TechnicalSpec, AppError>
pub async fn list_for_acp( &self, acp_id: Uuid, ) -> Result<Vec<TechnicalSpec>, AppError>
pub async fn list_signatures_for_spec( &self, spec_id: Uuid, ) -> Result<Vec<TechnicalSpecSignature>, AppError>
Auto Trait Implementations§
impl !RefUnwindSafe for TechnicalSpecUseCases
impl !UnwindSafe for TechnicalSpecUseCases
impl Freeze for TechnicalSpecUseCases
impl Send for TechnicalSpecUseCases
impl Sync for TechnicalSpecUseCases
impl Unpin for TechnicalSpecUseCases
impl UnsafeUnpin for TechnicalSpecUseCases
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.