@7365admin1/core 3.43.0 → 3.44.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.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +24 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -22035,7 +22035,8 @@ function useVisitorTransactionRepo() {
|
|
|
22035
22035
|
type = "",
|
|
22036
22036
|
checkedOut,
|
|
22037
22037
|
plateNumber = "",
|
|
22038
|
-
tab = ""
|
|
22038
|
+
tab = "",
|
|
22039
|
+
passOrKey
|
|
22039
22040
|
}) {
|
|
22040
22041
|
page = page > 0 ? page - 1 : 0;
|
|
22041
22042
|
const skip = page * limit;
|
|
@@ -22066,7 +22067,9 @@ function useVisitorTransactionRepo() {
|
|
|
22066
22067
|
},
|
|
22067
22068
|
...plateNumber && { plateNumber },
|
|
22068
22069
|
...status && { status },
|
|
22069
|
-
...tab == "Overnight Parking" && { isOvernightParking: true }
|
|
22070
|
+
...tab == "Overnight Parking" && { isOvernightParking: true },
|
|
22071
|
+
...passOrKey?.type == "pass" && { visitorPass: { $elemMatch: { keyId: new ObjectId44(passOrKey.keyId) } } },
|
|
22072
|
+
...passOrKey?.type == "key" && { passKeys: { $elemMatch: { keyId: new ObjectId44(passOrKey.keyId) } } }
|
|
22070
22073
|
};
|
|
22071
22074
|
const finalSort = Object.keys(sort).length > 0 ? sort : { latestDate: -1 };
|
|
22072
22075
|
try {
|
|
@@ -31067,7 +31070,7 @@ function useBuildingController() {
|
|
|
31067
31070
|
const requiredFields = ["block", "name"];
|
|
31068
31071
|
const rowSchema = Joi48.object({
|
|
31069
31072
|
block: Joi48.number().integer().min(0).required(),
|
|
31070
|
-
name: Joi48.string().trim().required(),
|
|
31073
|
+
name: Joi48.alternatives().try(Joi48.string(), Joi48.number()).custom((value) => String(value).trim()).required(),
|
|
31071
31074
|
level: Joi48.alternatives().try(Joi48.string(), Joi48.number()).custom((value) => String(value)).optional().allow(null, ""),
|
|
31072
31075
|
unit: Joi48.alternatives().try(Joi48.string(), Joi48.number()).custom((value) => String(value)).optional().allow(null, ""),
|
|
31073
31076
|
category: Joi48.string().trim().optional().allow(null, ""),
|
|
@@ -38997,7 +39000,20 @@ function useVisitorTransactionController() {
|
|
|
38997
39000
|
checkedOut: Joi58.boolean().allow(null, ""),
|
|
38998
39001
|
plateNumber: Joi58.string().optional().allow(null, ""),
|
|
38999
39002
|
order: Joi58.string().valid(...Object.values(SortOrder)).default("asc" /* ASC */),
|
|
39000
|
-
tab: Joi58.string().optional().allow(null, "")
|
|
39003
|
+
tab: Joi58.string().optional().allow(null, ""),
|
|
39004
|
+
passOrKey: Joi58.alternatives().try(
|
|
39005
|
+
Joi58.object({
|
|
39006
|
+
keyId: Joi58.string().regex(/^[0-9a-fA-F]{24}$/).required(),
|
|
39007
|
+
type: Joi58.string().required()
|
|
39008
|
+
}),
|
|
39009
|
+
Joi58.string().custom((value2, helpers) => {
|
|
39010
|
+
try {
|
|
39011
|
+
return JSON.parse(value2);
|
|
39012
|
+
} catch (e) {
|
|
39013
|
+
return helpers.error("any.invalid");
|
|
39014
|
+
}
|
|
39015
|
+
})
|
|
39016
|
+
).optional().allow(null)
|
|
39001
39017
|
});
|
|
39002
39018
|
const { error, value } = validation.validate(req.query, {
|
|
39003
39019
|
abortEarly: false
|
|
@@ -39022,7 +39038,8 @@ function useVisitorTransactionController() {
|
|
|
39022
39038
|
sort,
|
|
39023
39039
|
order,
|
|
39024
39040
|
plateNumber,
|
|
39025
|
-
tab
|
|
39041
|
+
tab,
|
|
39042
|
+
passOrKey
|
|
39026
39043
|
} = value;
|
|
39027
39044
|
const sortObj = {
|
|
39028
39045
|
[sort ? sort : "_id" /* ID */]: order === "asc" /* ASC */ ? 1 : -1
|
|
@@ -39040,7 +39057,8 @@ function useVisitorTransactionController() {
|
|
|
39040
39057
|
type,
|
|
39041
39058
|
checkedOut,
|
|
39042
39059
|
plateNumber,
|
|
39043
|
-
tab
|
|
39060
|
+
tab,
|
|
39061
|
+
passOrKey
|
|
39044
39062
|
});
|
|
39045
39063
|
res.status(200).json(data);
|
|
39046
39064
|
return;
|