@infrab4a/connect 0.10.0 → 0.10.1

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.
@@ -1492,12 +1492,14 @@
1492
1492
  if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
1493
1493
  return queryReference;
1494
1494
  if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
1495
+ if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1496
+ return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
1495
1497
  queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
1496
1498
  queryReference = queryReference.where(fieldName.toString(), '<=', options.value + "~");
1497
1499
  return queryReference;
1498
1500
  }
1499
1501
  if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1500
- return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
1502
+ return queryReference.where(fieldName.toString(), 'array-contains', options.value);
1501
1503
  if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value))
1502
1504
  return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
1503
1505
  return queryReference.where(fieldName.toString(), (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
@@ -2124,6 +2126,23 @@
2124
2126
  _this.model = Coupon;
2125
2127
  return _this;
2126
2128
  }
2129
+ CouponFirestoreRepository.prototype.buildModelInstance = function () {
2130
+ var _a = _super.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2131
+ return {
2132
+ toFirestore: function (data) {
2133
+ var plain = toFirestore(data);
2134
+ if (!!data.expiresIn)
2135
+ plain.expiresIn = data.expiresIn.getTime();
2136
+ return plain;
2137
+ },
2138
+ fromFirestore: function (snap) {
2139
+ var instance = fromFirestore(snap);
2140
+ if (!lodash.isNil(instance.expiresIn))
2141
+ instance.expiresIn = new Date(snap.data().expiresIn);
2142
+ return instance;
2143
+ },
2144
+ };
2145
+ };
2127
2146
  return CouponFirestoreRepository;
2128
2147
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2129
2148