@grapadigital/shared-schemas 2.11.0 → 2.12.0
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.
|
@@ -11,6 +11,9 @@ export declare class StoreVisitData {
|
|
|
11
11
|
token: string;
|
|
12
12
|
rulesAccepted: boolean;
|
|
13
13
|
acceptedAt?: Date | null;
|
|
14
|
+
/** Caminhos no bucket; a leitura sai assinada. Anexadas pela equipe no Flow. */
|
|
15
|
+
tagPhotos: string[];
|
|
16
|
+
lookPhotos: string[];
|
|
14
17
|
}
|
|
15
18
|
export declare const StoreVisitDataSchema: MongooseSchema<StoreVisitData, import("mongoose").Model<StoreVisitData, any, any, any, import("mongoose").Document<unknown, any, StoreVisitData, any, {}> & StoreVisitData & {
|
|
16
19
|
_id: Types.ObjectId;
|
|
@@ -66,6 +66,16 @@ __decorate([
|
|
|
66
66
|
(0, mongoose_1.Prop)({ type: Date, required: false, default: null }),
|
|
67
67
|
__metadata("design:type", Object)
|
|
68
68
|
], StoreVisitData.prototype, "acceptedAt", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, swagger_1.ApiProperty)({ type: [String], example: [] }),
|
|
71
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
72
|
+
__metadata("design:type", Array)
|
|
73
|
+
], StoreVisitData.prototype, "tagPhotos", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiProperty)({ type: [String], example: [] }),
|
|
76
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
77
|
+
__metadata("design:type", Array)
|
|
78
|
+
], StoreVisitData.prototype, "lookPhotos", void 0);
|
|
69
79
|
exports.StoreVisitData = StoreVisitData = __decorate([
|
|
70
80
|
(0, mongoose_1.Schema)({ _id: false })
|
|
71
81
|
], StoreVisitData);
|
|
@@ -193,14 +193,17 @@ exports.TaskSchema.index({ businessUnit: 1 });
|
|
|
193
193
|
exports.TaskSchema.index({ "storeVisit.token": 1 }, { unique: true, sparse: true });
|
|
194
194
|
exports.TaskSchema.index({ "storeVisit.store": 1 }, { sparse: true });
|
|
195
195
|
// Uma única ida em loja por loja e por dia, qualquer que seja o período.
|
|
196
|
+
// O índice parcial não aceita $ne, por isso os status entram listados em $in:
|
|
197
|
+
// com $ne o índice era recusado pelo Mongo e nunca chegou a existir.
|
|
196
198
|
exports.TaskSchema.index({
|
|
197
199
|
"storeVisit.store": 1,
|
|
198
200
|
"storeVisit.scheduledDate": 1,
|
|
199
201
|
}, {
|
|
202
|
+
name: "store_visit_unique_store_day",
|
|
200
203
|
unique: true,
|
|
201
204
|
partialFilterExpression: {
|
|
202
205
|
type: "store_visit",
|
|
203
|
-
status: { $
|
|
206
|
+
status: { $in: ["awaiting_confirmation", "confirmed", "finished"] },
|
|
204
207
|
"storeVisit.store": { $exists: true },
|
|
205
208
|
"storeVisit.scheduledDate": { $exists: true },
|
|
206
209
|
},
|