@7365admin1/core 3.50.2-staging.224 → 3.51.1-staging.225
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/.changeset/visitor-guest-status-filter.md +10 -0
- package/CHANGELOG.md +6 -0
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/test/visitor-status.util.test.mjs +51 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Visitor list: decide the Guests tab by "every requested status is pre-arrival"
|
|
6
|
+
instead of matching one specific status set, so the tab keeps filtering on the
|
|
7
|
+
expected arrival date for both the approved+pending request sent by
|
|
8
|
+
layer-common `main` and the approved+pending+rejected request sent by
|
|
9
|
+
layer-common `staging` (DV-0080). Extracted as `isPreCheckInStatusOnly` with
|
|
10
|
+
tests pinning each case.
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -19944,6 +19944,17 @@ async function sendEmail({ to, subject, text: text2, html }) {
|
|
|
19944
19944
|
}
|
|
19945
19945
|
}
|
|
19946
19946
|
|
|
19947
|
+
// src/utils/visitor-status.util.ts
|
|
19948
|
+
var PRE_CHECK_IN_STATUSES = [
|
|
19949
|
+
"approved" /* APPROVED */,
|
|
19950
|
+
"pending" /* PENDING */,
|
|
19951
|
+
"rejected" /* REJECTED */
|
|
19952
|
+
];
|
|
19953
|
+
function isPreCheckInStatusOnly(status) {
|
|
19954
|
+
const requested = Array.isArray(status) ? status : status ? [status] : [];
|
|
19955
|
+
return requested.length > 0 && requested.every((s) => PRE_CHECK_IN_STATUSES.includes(s));
|
|
19956
|
+
}
|
|
19957
|
+
|
|
19947
19958
|
// src/repositories/visitor-transaction.repo.ts
|
|
19948
19959
|
var visitors_namespace_collection = "visitor.transactions";
|
|
19949
19960
|
function useVisitorTransactionRepo() {
|
|
@@ -20018,7 +20029,7 @@ function useVisitorTransactionRepo() {
|
|
|
20018
20029
|
}) {
|
|
20019
20030
|
page = page > 0 ? page - 1 : 0;
|
|
20020
20031
|
const skip = page * limit;
|
|
20021
|
-
const isGuest =
|
|
20032
|
+
const isGuest = isPreCheckInStatusOnly(status);
|
|
20022
20033
|
const checkInFilter = {};
|
|
20023
20034
|
const expectedCheckInFilter = {};
|
|
20024
20035
|
if (!isGuest) {
|