@infrab4a/connect 0.9.11-beta.0 → 0.9.13

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.
@@ -1878,6 +1878,23 @@
1878
1878
  _this.model = Coupon;
1879
1879
  return _this;
1880
1880
  }
1881
+ CouponFirestoreRepository.prototype.buildModelInstance = function () {
1882
+ var _a = _super.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
1883
+ return {
1884
+ toFirestore: function (data) {
1885
+ var plain = toFirestore(data);
1886
+ if (!!data.expiresIn)
1887
+ plain.expiresIn = data.expiresIn.getTime();
1888
+ return plain;
1889
+ },
1890
+ fromFirestore: function (snap) {
1891
+ var instance = fromFirestore(snap);
1892
+ if (!lodash.isNil(instance.expiresIn))
1893
+ instance.expiresIn = new Date(snap.data().expiresIn);
1894
+ return instance;
1895
+ },
1896
+ };
1897
+ };
1881
1898
  return CouponFirestoreRepository;
1882
1899
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1883
1900