@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.
package/dist/index.mjs CHANGED
@@ -287,9 +287,8 @@ import {
287
287
  isUtcMidnight as isUtcMidnight3
288
288
  } from "@timardex/cluemart-shared";
289
289
  import mongoose4 from "mongoose";
290
- var schema4 = new mongoose4.Schema(
290
+ var ResourceMetricsSchema = new mongoose4.Schema(
291
291
  {
292
- adId: { ref: "Ad", required: true, type: String },
293
292
  clicks: { default: 0, required: true, type: Number },
294
293
  date: {
295
294
  immutable: true,
@@ -314,9 +313,25 @@ var schema4 = new mongoose4.Schema(
314
313
  type: String
315
314
  }
316
315
  },
316
+ { _id: false }
317
+ );
318
+ var schema4 = new mongoose4.Schema(
319
+ {
320
+ adId: { ref: "Ad", required: true, type: String },
321
+ resource: { default: [], type: [ResourceMetricsSchema] }
322
+ },
317
323
  { timestamps: true }
318
324
  );
319
- schema4.index({ adId: 1, date: 1, placement: 1, platform: 1 }, { unique: true });
325
+ schema4.index({ adId: 1 }, { unique: true });
326
+ schema4.index(
327
+ {
328
+ adId: 1,
329
+ "resource.date": 1,
330
+ "resource.placement": 1,
331
+ "resource.platform": 1
332
+ },
333
+ { unique: true }
334
+ );
320
335
  var AdMetricsModel = mongoose4.models.AdMetrics || mongoose4.model("AdMetrics", schema4);
321
336
 
322
337
  // src/mongoose/BillingCatalog.ts