From 0124e5b4c217a9b760b4d21128b3802562583f3a Mon Sep 17 00:00:00 2001
From: Marjolaine Bodin <bodin@esrf.fr>
Date: Thu, 19 Dec 2024 08:17:24 +0100
Subject: [PATCH] icat/icat-plus#674 defaul tvalue

---
 app/models/parcel.model.js                  | 2 +-
 app/models/returnparcelinformation.model.js | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/models/parcel.model.js b/app/models/parcel.model.js
index 71785815..fea1907f 100644
--- a/app/models/parcel.model.js
+++ b/app/models/parcel.model.js
@@ -46,7 +46,7 @@ const ParcelSchema = mongoose.Schema(
         return this.isReimbursed === true;
       },
     },
-    returnParcelInformation: { type: ReturnParcelInformation.schema },
+    returnParcelInformation: { type: ReturnParcelInformation.schema, default: () => ({ returnType: "USER_MANAGE_PAPERS" }) },
     returnInstructions: { type: String },
     shippingTrackingInformation: TrackingInformation.schema,
     returnTrackingInformation: TrackingInformation.schema,
diff --git a/app/models/returnparcelinformation.model.js b/app/models/returnparcelinformation.model.js
index a9d6f3ed..2b160ced 100644
--- a/app/models/returnparcelinformation.model.js
+++ b/app/models/returnparcelinformation.model.js
@@ -12,6 +12,7 @@ const ReturnParcelInformationSchema = mongoose.Schema(
       type: String,
       enum: ["USER_MANAGE_PAPERS", "USER_ORGANIZE_RETURN"],
       required: true,
+      default: "USER_MANAGE_PAPERS",
     },
     forwarderName: {
       type: String,
-- 
GitLab