@timardex/cluemart-server-shared 3.0.0 → 3.0.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.
@@ -53,7 +53,7 @@ import {
53
53
  termsAgreementSchema,
54
54
  userLicenseSchema,
55
55
  vendorProductTypeSchema
56
- } from "../chunk-YMDOR6W2.mjs";
56
+ } from "../chunk-GDXPPYDN.mjs";
57
57
  export {
58
58
  AD_BILLING_CATALOG_COLLECTION_NAME,
59
59
  APP_SETTINGS_ID,
@@ -372,9 +372,8 @@ var AdBookingModel = import_mongoose3.default.models.AdBooking || import_mongoos
372
372
  // src/mongoose/ad/AdMetrics.ts
373
373
  var import_cluemart_shared4 = require("@timardex/cluemart-shared");
374
374
  var import_mongoose4 = __toESM(require("mongoose"));
375
- var schema4 = new import_mongoose4.default.Schema(
375
+ var ResourceMetricsSchema = new import_mongoose4.default.Schema(
376
376
  {
377
- adId: { ref: "Ad", required: true, type: String },
378
377
  clicks: { default: 0, required: true, type: Number },
379
378
  date: {
380
379
  immutable: true,
@@ -399,9 +398,25 @@ var schema4 = new import_mongoose4.default.Schema(
399
398
  type: String
400
399
  }
401
400
  },
401
+ { _id: false }
402
+ );
403
+ var schema4 = new import_mongoose4.default.Schema(
404
+ {
405
+ adId: { ref: "Ad", required: true, type: String },
406
+ resource: { default: [], type: [ResourceMetricsSchema] }
407
+ },
402
408
  { timestamps: true }
403
409
  );
404
- schema4.index({ adId: 1, date: 1, placement: 1, platform: 1 }, { unique: true });
410
+ schema4.index({ adId: 1 }, { unique: true });
411
+ schema4.index(
412
+ {
413
+ adId: 1,
414
+ "resource.date": 1,
415
+ "resource.placement": 1,
416
+ "resource.platform": 1
417
+ },
418
+ { unique: true }
419
+ );
405
420
  var AdMetricsModel = import_mongoose4.default.models.AdMetrics || import_mongoose4.default.model("AdMetrics", schema4);
406
421
 
407
422
  // src/mongoose/BillingCatalog.ts