tango-api-schema 2.6.4 → 2.6.5

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/index.js CHANGED
@@ -127,6 +127,7 @@ import pidAllocationEngine from "./schema/pidAllocationEngine.model.js";
127
127
  import audioStaticValueModel from "./schema/audioStaticValue.model.js";
128
128
  import recurringFlagTrackerModel from "./schema/recurringFlagTracker.model.js";
129
129
  import regionKeyModel from "./schema/regionKey.model.js";
130
+ import lookPlanoCollectionModel from "./schema/lookPlanoCollection.model.js";
130
131
 
131
132
 
132
133
  export default {
@@ -255,5 +256,6 @@ export default {
255
256
  pidAllocationEngine,
256
257
  audioStaticValueModel,
257
258
  recurringFlagTrackerModel,
258
- regionKeyModel
259
+ regionKeyModel,
260
+ lookPlanoCollectionModel
259
261
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "2.6.4",
3
+ "version": "2.6.5",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -661,6 +661,26 @@ const checklistconfigSchema = new mongoose.Schema({
661
661
  },
662
662
  },
663
663
  },
664
+ schedule:{
665
+ scheduletype: {
666
+ type: String
667
+ },
668
+ times:{
669
+ type:Array
670
+ },
671
+ recurrence: {
672
+ status: {
673
+ type: Boolean,
674
+ default: false
675
+ },
676
+ time: {
677
+ type: Number
678
+ },
679
+ type: {
680
+ type: String
681
+ }
682
+ }
683
+ },
664
684
  },
665
685
  rawVideoUpload: {
666
686
  type: Boolean,
@@ -160,6 +160,11 @@ const fixtureLibrarySchema = new mongoose.Schema(
160
160
  type: [ String ],
161
161
  enum: [ 'IN', 'SG', 'SA', 'TH', 'AE' ],
162
162
  default: [],
163
+ },
164
+ fixtureSubType: {
165
+ type: String,
166
+ enum: ['panel', 'shelf'],
167
+ default: 'panel',
163
168
  },
164
169
  },
165
170
  {
@@ -0,0 +1,75 @@
1
+ import mongoose from 'mongoose';
2
+
3
+ // Coerce empty strings (sent by the form when no ref is picked) to undefined
4
+ // so Mongoose doesn't try to cast "" to an ObjectId.
5
+ const emptyToUndefined = ( v ) => ( v === '' || v === null ? undefined : v );
6
+
7
+ const placementSchema = new mongoose.Schema(
8
+ {
9
+ position: String,
10
+ kind: { type: String, enum: [ 'pid', 'vm' ] },
11
+ rawValue: String,
12
+ // For PID placements we store the selected product/SKU collection names
13
+ // as an array (multi-select). VM placements keep using `rawValue`.
14
+ rawValues: [ String ],
15
+ vmRef: { type: mongoose.Schema.Types.ObjectId, ref: 'planovms', set: emptyToUndefined },
16
+ skuCollectionRef: { type: mongoose.Schema.Types.ObjectId, set: emptyToUndefined },
17
+ },
18
+ { _id: false, strict: false },
19
+ );
20
+
21
+ const fixtureSlotSchema = new mongoose.Schema(
22
+ {
23
+ slotIndex: Number,
24
+ slotType: { type: String, enum: [ 'shelf', 'eurocenter' ], default: 'shelf' },
25
+ brand: String,
26
+ fixtureLevelZone: String,
27
+ fixtureLibraryRef: { type: mongoose.Schema.Types.ObjectId, ref: 'planolibraries', set: emptyToUndefined },
28
+ fixtureLibraryLabel: String,
29
+ fixtureLibraryRefs: [ { type: mongoose.Schema.Types.ObjectId, ref: 'planolibraries' } ],
30
+ // Free-text CAD header variant tags entered as chips in the UI.
31
+ cadHeaderVariants: [ String ],
32
+ placements: [ placementSchema ],
33
+ // Per-library snapshot of the fixture template editor (shelfConfig + VM/PID
34
+ // placements). Stored free-form so we can round-trip whatever the editor produces.
35
+ librarySnapshots: [ {
36
+ libraryRef: { type: mongoose.Schema.Types.ObjectId, ref: 'planolibraries', set: emptyToUndefined },
37
+ snapshot: { type: mongoose.Schema.Types.Mixed },
38
+ } ],
39
+ },
40
+ { _id: false, strict: false },
41
+ );
42
+
43
+ const lookSchema = new mongoose.Schema(
44
+ {
45
+ keyType: { type: String, enum: [ 'mbq', 'brandCategory' ], default: 'mbq' },
46
+ mbqBucket: String,
47
+ brandCategory: String,
48
+ fixtureCount: Number,
49
+ layoutVariant: { type: String, enum: [ 'shelf', 'shelf+euro', 'euro-only' ], default: 'shelf' },
50
+ storeProto: String,
51
+ fixtureSlots: [ fixtureSlotSchema ],
52
+ },
53
+ { strict: false },
54
+ );
55
+
56
+ const lookPlanoCollectionSchema = new mongoose.Schema(
57
+ {
58
+ clientId: { type: String, required: true, index: true },
59
+ name: { type: String, required: true },
60
+ description: String,
61
+ isActive: { type: Boolean, default: false },
62
+ looks: [ lookSchema ],
63
+ createdBy: String,
64
+ createdByName: String,
65
+ updatedBy: String,
66
+ updatedByName: String,
67
+ },
68
+ {
69
+ strict: false,
70
+ versionKey: false,
71
+ timestamps: true,
72
+ },
73
+ );
74
+
75
+ export default mongoose.model( 'lookplanocollection', lookPlanoCollectionSchema );
@@ -1,92 +1,92 @@
1
- import mongoose from 'mongoose';
2
-
3
- const recurringFlagTrackerSchema = new mongoose.Schema({
4
- client_id: {
5
- type: String,
6
- required: true,
7
- },
8
- sourceCheckList_id: {
9
- type: mongoose.SchemaTypes.ObjectId,
10
- ref: 'checklistconfig',
11
- required: true,
12
- },
13
- checkListName: {
14
- type: String,
15
- },
16
- coverage: {
17
- type: String,
18
- enum: ['store', 'user'],
19
- default: 'store',
20
- },
21
- store_id: {
22
- type: String,
23
- default: '',
24
- },
25
- storeName: {
26
- type: String,
27
- },
28
- user_id: {
29
- type: String,
30
- default: '',
31
- },
32
- userName: {
33
- type: String,
34
- },
35
- userEmail: {
36
- type: String,
37
- },
38
- section_id: {
39
- type: String,
40
- },
41
- sectionName: {
42
- type: String,
43
- },
44
- qno: {
45
- type: String,
46
- },
47
- qname: {
48
- type: String,
49
- },
50
- consecutiveCount: {
51
- type: Number,
52
- default: 0,
53
- },
54
- lastFlaggedDate: {
55
- type: String,
56
- },
57
- lastEmailDate: {
58
- type: String,
59
- },
60
- runAICount: {
61
- type: Number,
62
- default: 0,
63
- },
64
- lastRunAIFlaggedDate: {
65
- type: String,
66
- },
67
- emailHistory: {
68
- type: [ String ],
69
- default: [],
70
- },
71
- lastSubmittedBy: {
72
- type: String,
73
- },
74
- lastSubmissionDate: {
75
- type: String,
76
- },
77
- }, {
78
- strict: true,
79
- versionKey: false,
80
- timestamps: true,
81
- });
82
-
83
- recurringFlagTrackerSchema.index({
84
- client_id: 1,
85
- sourceCheckList_id: 1,
86
- store_id: 1,
87
- user_id: 1,
88
- section_id: 1,
89
- qno: 1,
90
- }, { unique: true });
91
-
92
- export default mongoose.model('recurringFlagTracker', recurringFlagTrackerSchema);
1
+ import mongoose from 'mongoose';
2
+
3
+ const recurringFlagTrackerSchema = new mongoose.Schema({
4
+ client_id: {
5
+ type: String,
6
+ required: true,
7
+ },
8
+ sourceCheckList_id: {
9
+ type: mongoose.SchemaTypes.ObjectId,
10
+ ref: 'checklistconfig',
11
+ required: true,
12
+ },
13
+ checkListName: {
14
+ type: String,
15
+ },
16
+ coverage: {
17
+ type: String,
18
+ enum: ['store', 'user'],
19
+ default: 'store',
20
+ },
21
+ store_id: {
22
+ type: String,
23
+ default: '',
24
+ },
25
+ storeName: {
26
+ type: String,
27
+ },
28
+ user_id: {
29
+ type: String,
30
+ default: '',
31
+ },
32
+ userName: {
33
+ type: String,
34
+ },
35
+ userEmail: {
36
+ type: String,
37
+ },
38
+ section_id: {
39
+ type: String,
40
+ },
41
+ sectionName: {
42
+ type: String,
43
+ },
44
+ qno: {
45
+ type: String,
46
+ },
47
+ qname: {
48
+ type: String,
49
+ },
50
+ consecutiveCount: {
51
+ type: Number,
52
+ default: 0,
53
+ },
54
+ lastFlaggedDate: {
55
+ type: String,
56
+ },
57
+ lastEmailDate: {
58
+ type: String,
59
+ },
60
+ runAICount: {
61
+ type: Number,
62
+ default: 0,
63
+ },
64
+ lastRunAIFlaggedDate: {
65
+ type: String,
66
+ },
67
+ emailHistory: {
68
+ type: [ String ],
69
+ default: [],
70
+ },
71
+ lastSubmittedBy: {
72
+ type: String,
73
+ },
74
+ lastSubmissionDate: {
75
+ type: String,
76
+ },
77
+ }, {
78
+ strict: true,
79
+ versionKey: false,
80
+ timestamps: true,
81
+ });
82
+
83
+ recurringFlagTrackerSchema.index({
84
+ client_id: 1,
85
+ sourceCheckList_id: 1,
86
+ store_id: 1,
87
+ user_id: 1,
88
+ section_id: 1,
89
+ qno: 1,
90
+ }, { unique: true });
91
+
92
+ export default mongoose.model('recurringFlagTracker', recurringFlagTrackerSchema);