pub struct ContractorEvaluation {
pub id: Uuid,
pub contractor_user_id: Uuid,
pub technical_spec_id: Uuid,
pub linked_ticket_ids: Vec<Uuid>,
pub evaluator_user_id: Uuid,
pub scores: EvaluationScores,
pub comment: String,
pub created_at: DateTime<Utc>,
}Fields§
§id: Uuid§contractor_user_id: UuidUser id of the contractor being evaluated (role = Contractor).
technical_spec_id: UuidREQUIRED — gating signed TechnicalSpec (Story 3.8). The application
layer additionally checks the spec is in status Approved.
linked_ticket_ids: Vec<Uuid>Tickets that motivated the evaluation (works carried out, complaints
handled, etc.). Bounded to MAX_LINKED_TICKETS entries, no
duplicates.
evaluator_user_id: UuidSyndic or mandated owner who signed off the evaluation.
scores: EvaluationScores§comment: StringFree-form justification ([10, 2000] chars). Audit-grade — the
contractor can request access to it via the GDPR data export
endpoints.
created_at: DateTime<Utc>Implementations§
Source§impl ContractorEvaluation
impl ContractorEvaluation
Sourcepub fn new(
contractor_user_id: Uuid,
technical_spec_id: Uuid,
linked_ticket_ids: Vec<Uuid>,
evaluator_user_id: Uuid,
scores: EvaluationScores,
comment: String,
) -> Result<Self, AppError>
pub fn new( contractor_user_id: Uuid, technical_spec_id: Uuid, linked_ticket_ids: Vec<Uuid>, evaluator_user_id: Uuid, scores: EvaluationScores, comment: String, ) -> Result<Self, AppError>
Build a new ContractorEvaluation. Enforces every structural invariant (cf. module-level docs). Workflow invariants (TechnicalSpec must be Approved, evaluator must hold a valid role) live in the use-case.
Sourcepub fn average_score(&self) -> f64
pub fn average_score(&self) -> f64
Convenience: arithmetic mean of the 5 dimensions. Delegates to
EvaluationScores::average.
Trait Implementations§
Source§impl Clone for ContractorEvaluation
impl Clone for ContractorEvaluation
Source§fn clone(&self) -> ContractorEvaluation
fn clone(&self) -> ContractorEvaluation
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 ContractorEvaluation
impl Debug for ContractorEvaluation
Source§impl<'de> Deserialize<'de> for ContractorEvaluation
impl<'de> Deserialize<'de> for ContractorEvaluation
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>,
impl Eq for ContractorEvaluation
Source§impl From<ContractorEvaluation> for ContractorEvaluationDto
impl From<ContractorEvaluation> for ContractorEvaluationDto
Source§fn from(e: ContractorEvaluation) -> Self
fn from(e: ContractorEvaluation) -> Self
Source§impl PartialEq for ContractorEvaluation
impl PartialEq for ContractorEvaluation
Source§fn eq(&self, other: &ContractorEvaluation) -> bool
fn eq(&self, other: &ContractorEvaluation) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ContractorEvaluation
impl Serialize for ContractorEvaluation
impl StructuralPartialEq for ContractorEvaluation
Auto Trait Implementations§
impl Freeze for ContractorEvaluation
impl RefUnwindSafe for ContractorEvaluation
impl Send for ContractorEvaluation
impl Sync for ContractorEvaluation
impl Unpin for ContractorEvaluation
impl UnsafeUnpin for ContractorEvaluation
impl UnwindSafe for ContractorEvaluation
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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>
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