openchs-models 1.33.6 → 1.33.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,9 +56,12 @@ class RealmProxy {
56
56
  // Extract the underlying data from entity wrapper if needed
57
57
  const rawObject = (0, _RealmCollectionHelper.getUnderlyingRealmObject)(object) || object;
58
58
 
59
- // 🚀 FRAMEWORK-LEVEL: Automatically process embedded objects for Realm 12+ safety
59
+ // Automatically process embedded objects for Realm 12+ safety
60
60
  const processedObject = _RealmEmbeddedObjectHandler.default.processEmbeddedObjects(rawObject, schema);
61
- const mandatoryObjectSchemaProperties = _lodash.default.keys(_lodash.default.pickBy(schema.properties, property => !property.optional));
61
+
62
+ // Only validate properties that are truly mandatory (no optional: true AND no default value)
63
+ // This maintains backward compatibility with existing data and Realm's native behavior
64
+ const mandatoryObjectSchemaProperties = _lodash.default.keys(_lodash.default.pickBy(schema.properties, property => !property.optional && !property.hasOwnProperty('default')));
62
65
  const emptyMandatoryProperties = [];
63
66
  const saveObjectKeys = Object.keys(processedObject);
64
67
  if (updateMode === "never" || updateMode === false || _lodash.default.intersection(mandatoryObjectSchemaProperties, saveObjectKeys).length > 0) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "openchs-models",
3
3
  "description": "OpenCHS data model to be used by front end clients",
4
- "version": "1.33.6",
4
+ "version": "1.33.7",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",