From d0d174207faec9d7c02f0274d6f7dc039f320c4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20S=C3=A9nave?=
<59770457+nsenave@users.noreply.github.com>
Date: Thu, 12 Dec 2024 17:07:49 +0100
Subject: [PATCH] fix: unit objects in body cells (#275)
---
pom.xml | 2 +-
.../fr/insee/lunatic/model/flat/BodyCell.java | 49 ++++++++++++++++-
.../conversion/BodyCellSerializationTest.java | 54 +++++++++++++++++--
3 files changed, 100 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index 77c9479a..5fae31af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
lunatic-model
jar
- 3.15.1
+ 3.15.2
Lunatic Model
Classes and converters for the Lunatic model
https://inseefr.github.io/Lunatic-Model/
diff --git a/src/main/java/fr/insee/lunatic/model/flat/BodyCell.java b/src/main/java/fr/insee/lunatic/model/flat/BodyCell.java
index 6776514a..83d7ec7b 100644
--- a/src/main/java/fr/insee/lunatic/model/flat/BodyCell.java
+++ b/src/main/java/fr/insee/lunatic/model/flat/BodyCell.java
@@ -1,6 +1,8 @@
package fr.insee.lunatic.model.flat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Getter;
import lombok.Setter;
@@ -41,7 +43,10 @@ public class BodyCell {
protected LabelType label;
protected String format;
protected String dateFormat;
- protected String unit;
+
+ /** For input number cells. */
+ protected InputNumber.Unit unit;
+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
protected List