@chevre/domain 21.2.0-alpha.85 → 21.2.0-alpha.86
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.
|
@@ -23,10 +23,26 @@ function checkInReservation(params) {
|
|
|
23
23
|
// 発券処理(Array対応)
|
|
24
24
|
let checkedInReservationIds;
|
|
25
25
|
if (Array.isArray(params.object.ids) && params.object.ids.length > 0) {
|
|
26
|
+
const existingReservationCount = yield repos.reservation.count({
|
|
27
|
+
id: { $in: params.object.ids },
|
|
28
|
+
typeOf: factory.reservationType.EventReservation
|
|
29
|
+
});
|
|
30
|
+
if (existingReservationCount !== params.object.ids.length) {
|
|
31
|
+
throw new factory.errors.NotFound(factory.reservationType.EventReservation, `Some reservations dot not exist. ${params.object.ids.join(',')}`);
|
|
32
|
+
}
|
|
26
33
|
yield repos.reservation.checkInIfNot({ id: { $in: params.object.ids }, now });
|
|
27
34
|
checkedInReservationIds = params.object.ids;
|
|
28
35
|
}
|
|
29
36
|
if (Array.isArray(params.object.reservationNumbers) && params.object.reservationNumbers.length > 0) {
|
|
37
|
+
for (const reservationNumber of params.object.reservationNumbers) {
|
|
38
|
+
const existingReservationCount = yield repos.reservation.count({
|
|
39
|
+
reservationNumber: { $eq: reservationNumber },
|
|
40
|
+
typeOf: factory.reservationType.EventReservation
|
|
41
|
+
});
|
|
42
|
+
if (existingReservationCount === 0) {
|
|
43
|
+
throw new factory.errors.NotFound(factory.reservationType.EventReservation, `Some reservations dot not exist. ${params.object.reservationNumbers.join(',')}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
30
46
|
yield repos.reservation.checkInIfNot({ reservationNumber: { $in: params.object.reservationNumbers }, now });
|
|
31
47
|
// 予約番号リストを予約IDリストに変換
|
|
32
48
|
checkedInReservationIds = yield repos.reservation.searchIdsByReservationNumber({
|
package/package.json
CHANGED