pub struct LienNotaire {
pub id: Uuid,
pub etat_date_id: Uuid,
pub token_hash: String,
pub emis_par: Uuid,
pub cree_le: DateTime<Utc>,
pub expire_le: DateTime<Utc>,
pub revoque_le: Option<DateTime<Utc>>,
pub revoque_par: Option<Uuid>,
pub renouvele_le: Option<DateTime<Utc>>,
pub mis_a_jour_le: DateTime<Utc>,
}Expand description
Un lien notaire vers un état daté précis.
Fields§
§id: Uuid§etat_date_id: UuidL’état daté que ce lien donne le droit de lire — jamais réinterprété : une lecture qui vise un autre état daté avec ce jeton doit échouer.
token_hash: StringSHA-256 hex du jeton clair. Le jeton clair n’est JAMAIS stocké.
emis_par: UuidLe syndic qui a émis le lien (traçabilité).
cree_le: DateTime<Utc>§expire_le: DateTime<Utc>§revoque_le: Option<DateTime<Utc>>Some si le syndic a révoqué le lien avant terme.
revoque_par: Option<Uuid>§renouvele_le: Option<DateTime<Utc>>Date du dernier renouvellement, s’il y en a eu un.
mis_a_jour_le: DateTime<Utc>Implementations§
Source§impl LienNotaire
impl LienNotaire
Sourcepub fn emettre(
etat_date_id: Uuid,
emis_par: Uuid,
) -> Result<(Self, String), LienNotaireError>
pub fn emettre( etat_date_id: Uuid, emis_par: Uuid, ) -> Result<(Self, String), LienNotaireError>
Émet un nouveau lien. Retourne l’entité persistée ET le jeton clair, qui doit être renvoyé UNE FOIS au syndic et jamais stocké ailleurs.
Sourcepub fn hacher(clair: &str) -> String
pub fn hacher(clair: &str) -> String
SHA-256 hex du jeton clair. Public pour que le repository/handler puisse hacher un jeton reçu et le chercher.
pub fn est_expire(&self, moment: DateTime<Utc>) -> bool
pub fn est_revoque(&self) -> bool
Sourcepub fn est_valide(&self, moment: DateTime<Utc>) -> bool
pub fn est_valide(&self, moment: DateTime<Utc>) -> bool
Valide = ni expiré, ni révoqué. Aucune notion de consommation : un même lien reste valide sur plusieurs lectures (ADR 0051).
Sourcepub fn renouveler(
&mut self,
moment: DateTime<Utc>,
) -> Result<(), LienNotaireError>
pub fn renouveler( &mut self, moment: DateTime<Utc>, ) -> Result<(), LienNotaireError>
Renouvelle le lien pour sept nouveaux jours à partir de moment.
C’est un ACTE explicite du syndic, pas un automatisme (ADR 0051) — autorisé même après expiration : une vente qui dépasse sept jours est normale, et c’est au syndic de le constater. Seule la révocation est terminale.
Trait Implementations§
Source§impl Clone for LienNotaire
impl Clone for LienNotaire
Source§fn clone(&self) -> LienNotaire
fn clone(&self) -> LienNotaire
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 LienNotaire
impl Debug for LienNotaire
Source§impl<'de> Deserialize<'de> for LienNotaire
impl<'de> Deserialize<'de> for LienNotaire
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 From<&LienNotaire> for LienNotaireStatusDto
impl From<&LienNotaire> for LienNotaireStatusDto
Source§fn from(lien: &LienNotaire) -> Self
fn from(lien: &LienNotaire) -> Self
Source§impl PartialEq for LienNotaire
impl PartialEq for LienNotaire
Source§fn eq(&self, other: &LienNotaire) -> bool
fn eq(&self, other: &LienNotaire) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for LienNotaire
impl Serialize for LienNotaire
impl StructuralPartialEq for LienNotaire
Auto Trait Implementations§
impl Freeze for LienNotaire
impl RefUnwindSafe for LienNotaire
impl Send for LienNotaire
impl Sync for LienNotaire
impl Unpin for LienNotaire
impl UnsafeUnpin for LienNotaire
impl UnwindSafe for LienNotaire
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<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