@7365admin1/core 3.32.2-staging.51 → 3.32.2-staging.52
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.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27372,14 +27372,10 @@ function useVehicleService() {
|
|
|
27372
27372
|
if (hasSecurityBypass) {
|
|
27373
27373
|
addedByPM = true;
|
|
27374
27374
|
}
|
|
27375
|
-
|
|
27376
|
-
value.status = "active" /* ACTIVE */;
|
|
27377
|
-
}
|
|
27375
|
+
value.status = "active" /* ACTIVE */;
|
|
27378
27376
|
if (addedBySecurity && !hasSecurityBypass) {
|
|
27379
27377
|
value.status = "pending" /* PENDING */;
|
|
27380
27378
|
}
|
|
27381
|
-
if (isBlocklist)
|
|
27382
|
-
value.status = "inactive" /* INACTIVE */;
|
|
27383
27379
|
const _type = value.type;
|
|
27384
27380
|
const _mode = isBlocklist ? "TrafficBlackList" /* TRAFFIC_BLACKLIST */ : "TrafficRedList" /* TRAFFIC_REDLIST */;
|
|
27385
27381
|
const hasStart = typeof value.start === "string" ? value.start.trim() !== "" : !!value.start;
|
|
@@ -27445,6 +27441,11 @@ function useVehicleService() {
|
|
|
27445
27441
|
end
|
|
27446
27442
|
};
|
|
27447
27443
|
if (vehicleValue.status && vehicleValue.status !== "pending" /* PENDING */) {
|
|
27444
|
+
const siteObjectId = new import_mongodb50.ObjectId(vehicleValue.site);
|
|
27445
|
+
const existingPlateNumber = await findOne({ plateNumber, site: siteObjectId });
|
|
27446
|
+
if (existingPlateNumber) {
|
|
27447
|
+
throw new import_node_server_utils78.BadRequestError(`Vehicle plate number ${plateNumber} already exists.`);
|
|
27448
|
+
}
|
|
27448
27449
|
for (const camera of siteCameras) {
|
|
27449
27450
|
const { host, username, password } = camera;
|
|
27450
27451
|
const plateNumber2 = vehicleValue.plateNumber;
|