pub struct CreateUnitDto {
pub acp_id: Option<String>,
pub building_id: String,
pub unit_number: String,
pub unit_type: UnitType,
pub floor: Option<i32>,
pub surface_area: f64,
pub quota: Decimal,
}Fields§
§acp_id: Option<String>Story H15 — FK vers acps.id (anciennement organization_id).
Le lot dérive son ACP de son building parent (cf. #602) ; le scoping
org se fait via acps.organization_id.
OPTIONNEL depuis 2026-08-27. Le champ était obligatoire, ce qui contredisait la ligne au-dessus : si l’ACP se dérive du building, le client n’a pas à la fournir. Deux conséquences mesurées :
-
Un
POST /unitssansacp_idétait rejeté par serde AVANT d’atteindre le handler, avec un corps en TEXTE BRUT (« Json deserialize error: missing fieldacp_id»). Le garde-fouif dto.acp_id.is_empty()du handler, qui rend un JSON propre, était donc mort pour ce cas : il ne se déclenchait que sur une chaîne vide explicite. -
Tout appelant faisant
.json()sur cette réponse recevait « Unexpected token ‘J’ », un message qui ne dit rien du défaut. C’est ce qui faisait échouer02-ag-full-cycle(gate de caractérisation) et taireseedConformantUnitsenstatus=400.
Absent ou vide, l’ACP est désormais lue sur le building parent, qui est la source de vérité. Fournie, elle est utilisée telle quelle : le comportement des appelants existants est inchangé.
building_id: String§unit_number: String§unit_type: UnitType§floor: Option<i32>§surface_area: f64§quota: DecimalQuote-part en millièmes (Decimal exact, range 0.1..=1000 enforced en domain).
Trait Implementations§
Source§impl Clone for CreateUnitDto
impl Clone for CreateUnitDto
Source§fn clone(&self) -> CreateUnitDto
fn clone(&self) -> CreateUnitDto
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for CreateUnitDto
impl ComposeSchema for CreateUnitDto
Source§impl Debug for CreateUnitDto
impl Debug for CreateUnitDto
Source§impl<'de> Deserialize<'de> for CreateUnitDto
impl<'de> Deserialize<'de> for CreateUnitDto
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 ToSchema for CreateUnitDto
impl ToSchema for CreateUnitDto
Auto Trait Implementations§
impl Freeze for CreateUnitDto
impl RefUnwindSafe for CreateUnitDto
impl Send for CreateUnitDto
impl Sync for CreateUnitDto
impl Unpin for CreateUnitDto
impl UnsafeUnpin for CreateUnitDto
impl UnwindSafe for CreateUnitDto
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