@chevre/domain 24.1.0-alpha.10 → 24.1.0-alpha.11
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/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +1 -0
- package/lib/chevre/repo/assetTransaction/reserve.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
- package/lib/chevre/repo/reservation.d.ts +1 -4
- package/lib/chevre/repo/reservation.js +13 -10
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
- package/lib/chevre/service/reserve/confirmReservation.js +7 -7
- package/lib/chevre/service/reserve/factory.js +2 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +3 -1
- package/lib/chevre/service/reserve/findReservations.js +11 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +2 -1
- package/package.json +2 -2
|
@@ -30,7 +30,7 @@ export type IRecipeAsActionAttributes<T extends factory.recipe.RecipeCategory> =
|
|
|
30
30
|
export type IMinimizedPurchaseNumberAuthResult = Pick<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult, 'mkknmiNumSum' | 'resultInfo' | 'ykknmiNumSum'> & {
|
|
31
31
|
knyknrNoInfoOut: Omit<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberInfo, 'ykknInfo' | 'mkknInfo'>[] | null;
|
|
32
32
|
};
|
|
33
|
-
export type IKeyOfProjection = keyof IAction<factory.actionType> | keyof IAction<factory.actionType.AuthorizeAction> | keyof IAction<factory.actionType.
|
|
33
|
+
export type IKeyOfProjection = keyof IAction<factory.actionType> | keyof IAction<factory.actionType.AuthorizeAction> | keyof IAction<factory.actionType.ReplaceAction> | 'identifier';
|
|
34
34
|
export declare const AVAILABLE_PROJECT_FIELDS: IKeyOfProjection[];
|
|
35
35
|
/**
|
|
36
36
|
* アクション状態管理リポジトリ
|
|
@@ -4,6 +4,7 @@ type ISubReservationAsFindResult = Pick<factory.reservation.eventReservation.IRe
|
|
|
4
4
|
price?: factory.reservation.eventReservation.IPrice;
|
|
5
5
|
reservedTicket?: Pick<factory.reservation.eventReservation.IReservedTicket, 'ticketType'>;
|
|
6
6
|
reservationFor?: factory.assetTransaction.reserve.IReservationFor;
|
|
7
|
+
issuedThrough?: factory.assetTransaction.reserve.IIssuedThrough;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* 予約取引リポジトリ
|
|
@@ -66,48 +66,48 @@ const indexes = [
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
[
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
],
|
|
75
|
-
[
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
],
|
|
84
|
-
[
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
],
|
|
93
|
-
[
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
],
|
|
102
|
-
[
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
],
|
|
69
|
+
// [
|
|
70
|
+
// { 'mainEntity.orderStatus': 1, 'mainEntity.orderDate': -1 },
|
|
71
|
+
// {
|
|
72
|
+
// name: 'searchByOrderStatus'
|
|
73
|
+
// }
|
|
74
|
+
// ],
|
|
75
|
+
// [
|
|
76
|
+
// { 'mainEntity.confirmationNumber': 1, 'mainEntity.orderDate': -1 },
|
|
77
|
+
// {
|
|
78
|
+
// name: 'searchByConfirmationNumber',
|
|
79
|
+
// partialFilterExpression: {
|
|
80
|
+
// 'mainEntity.confirmationNumber': { $exists: true }
|
|
81
|
+
// }
|
|
82
|
+
// }
|
|
83
|
+
// ],
|
|
84
|
+
// [
|
|
85
|
+
// { 'mainEntity.customer.id': 1, 'mainEntity.orderDate': -1 },
|
|
86
|
+
// {
|
|
87
|
+
// name: 'searchByCustomerId',
|
|
88
|
+
// partialFilterExpression: {
|
|
89
|
+
// 'mainEntity.customer.id': { $exists: true }
|
|
90
|
+
// }
|
|
91
|
+
// }
|
|
92
|
+
// ],
|
|
93
|
+
// [
|
|
94
|
+
// { 'mainEntity.paymentMethods.accountId': 1, 'mainEntity.orderDate': -1 },
|
|
95
|
+
// {
|
|
96
|
+
// name: 'searchByPaymentMethodsAccountId',
|
|
97
|
+
// partialFilterExpression: {
|
|
98
|
+
// 'mainEntity.paymentMethods.accountId': { $exists: true }
|
|
99
|
+
// }
|
|
100
|
+
// }
|
|
101
|
+
// ],
|
|
102
|
+
// [
|
|
103
|
+
// { 'mainEntity.paymentMethods.typeOf': 1, 'mainEntity.orderDate': -1 },
|
|
104
|
+
// {
|
|
105
|
+
// name: 'searchByPaymentMethodTypeOf',
|
|
106
|
+
// partialFilterExpression: {
|
|
107
|
+
// 'mainEntity.paymentMethods.typeOf': { $exists: true }
|
|
108
|
+
// }
|
|
109
|
+
// }
|
|
110
|
+
// ],
|
|
111
111
|
[
|
|
112
112
|
{ 'mainEntity.paymentMethods.paymentMethodId': 1, 'mainEntity.orderDate': -1 },
|
|
113
113
|
{
|
|
@@ -8,9 +8,7 @@ export interface IUpdatePartiallyParams {
|
|
|
8
8
|
export type ICancelResult = UpdateWriteOpResult;
|
|
9
9
|
export type ICheckedInResult = UpdateWriteOpResult;
|
|
10
10
|
type ISavingReservedTicket = Omit<factory.assetTransaction.reserve.ISubReservationReservedTicket, 'ticketType'> & {
|
|
11
|
-
ticketType
|
|
12
|
-
id?: string;
|
|
13
|
-
};
|
|
11
|
+
ticketType?: never;
|
|
14
12
|
};
|
|
15
13
|
/**
|
|
16
14
|
* ドキュメントとして保管する予約
|
|
@@ -63,7 +61,6 @@ export declare class ReservationRepo {
|
|
|
63
61
|
};
|
|
64
62
|
provider: factory.reservation.IProvider;
|
|
65
63
|
subReservation: factory.assetTransaction.reserve.IObjectSubReservation[];
|
|
66
|
-
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
67
64
|
reservationFor: factory.assetTransaction.reserve.IReservationFor;
|
|
68
65
|
reservationNumber: string;
|
|
69
66
|
underName?: factory.reservation.IUnderName;
|
|
@@ -114,15 +114,18 @@ class ReservationRepo {
|
|
|
114
114
|
const bulkWriteOps = [];
|
|
115
115
|
if (Array.isArray(params.subReservation)) {
|
|
116
116
|
params.subReservation.forEach((subReservation) => {
|
|
117
|
-
const { price: _discontinuePrice, reservedTicket,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
117
|
+
const { price: _discontinuePrice, reservedTicket, priceCurrency: _discontinuePriceCurrency, // discontinue priceCurrency
|
|
118
|
+
...subReservationWithoutPrice } = subReservation;
|
|
119
|
+
const { ticketType: _ticketType, ...reservedTicketWithoutTicketType } = reservedTicket;
|
|
120
|
+
// discontinue ticketType(2026-05-09~)
|
|
121
|
+
const savingReservedTicket = reservedTicketWithoutTicketType;
|
|
122
|
+
// // 予約ドキュメントのticketTypeを最小化(2026-04-03~)
|
|
123
|
+
// const savingReservedTicket: ISavingReservedTicket = {
|
|
124
|
+
// ...reservedTicketWithoutTicketType,
|
|
125
|
+
// ticketType: {
|
|
126
|
+
// ...((typeof ticketType.id === 'string') && { id: ticketType.id })
|
|
127
|
+
// }
|
|
128
|
+
// };
|
|
126
129
|
// reservationFor最小化(2026-04-06~)
|
|
127
130
|
const { minimizedReservationFor } = (0, minimizeReservationFor_1.minimizeReservationFor)(params.reservationFor);
|
|
128
131
|
const setOnInsert = {
|
|
@@ -132,7 +135,7 @@ class ReservationRepo {
|
|
|
132
135
|
bookingTime: params.bookingTime,
|
|
133
136
|
checkedIn: false,
|
|
134
137
|
attended: false,
|
|
135
|
-
issuedThrough: params.issuedThrough,
|
|
138
|
+
// issuedThrough: params.issuedThrough, // discontinue issuedThrough
|
|
136
139
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
137
140
|
reservationFor: minimizedReservationFor,
|
|
138
141
|
reservationNumber: params.reservationNumber,
|
|
@@ -69,10 +69,11 @@ function createPotentialActions(params) {
|
|
|
69
69
|
const reservationForByReserveTransaction = transaction.object.transaction?.object.reservationFor;
|
|
70
70
|
if (reservationForByReserveTransaction !== undefined && typeof reservationNumber === 'string') {
|
|
71
71
|
const cancelObject = {
|
|
72
|
-
reservationFor
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
// discontinue reservationFor(2026-05-09~)
|
|
73
|
+
// reservationFor: {
|
|
74
|
+
// typeOf: reservationForByReserveTransaction.typeOf,
|
|
75
|
+
// id: String(reservationForByReserveTransaction.id)
|
|
76
|
+
// },
|
|
76
77
|
reservationNumber,
|
|
77
78
|
// ReservationConfirmed->ReservationCancelledのみ処理されるように保証する
|
|
78
79
|
reservationStatus: factory_1.factory.reservationStatusType.ReservationConfirmed,
|
|
@@ -100,13 +101,15 @@ function createPotentialActions(params) {
|
|
|
100
101
|
cancelObject = {
|
|
101
102
|
typeOf: reservation.typeOf,
|
|
102
103
|
id: reservation.id,
|
|
103
|
-
issuedThrough
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
// discontinue issuedThrough(2026-05-08~)
|
|
105
|
+
// issuedThrough: {
|
|
106
|
+
// typeOf: reservation.issuedThrough?.typeOf
|
|
107
|
+
// },
|
|
108
|
+
// discontinue reservationFor(2026-05-09~)
|
|
109
|
+
// reservationFor: {
|
|
110
|
+
// typeOf: reservation.reservationFor.typeOf,
|
|
111
|
+
// id: String(reservation.reservationFor.id)
|
|
112
|
+
// },
|
|
110
113
|
reservationNumber: reservation.reservationNumber,
|
|
111
114
|
// ReservationConfirmed->ReservationCancelledのみ処理されるように保証する
|
|
112
115
|
reservationStatus: factory_1.factory.reservationStatusType.ReservationConfirmed
|
|
@@ -61,7 +61,8 @@ function confirmReservation(params) {
|
|
|
61
61
|
...rawReservation.reservedTicket,
|
|
62
62
|
ticketType: ticketTypeByTransaction
|
|
63
63
|
},
|
|
64
|
-
reservationFor: reserveTransaction.object.reservationFor // reservationForは予約取引から参照する(2026-04-05~)
|
|
64
|
+
reservationFor: reserveTransaction.object.reservationFor, // reservationForは予約取引から参照する(2026-04-05~)
|
|
65
|
+
issuedThrough: reserveTransaction.object.issuedThrough // issuedThroughは予約取引から補完する(2026-05-08~)
|
|
65
66
|
};
|
|
66
67
|
});
|
|
67
68
|
confirmedReservations = confirmedReservations.map((r) => {
|
|
@@ -189,25 +190,24 @@ params, options) {
|
|
|
189
190
|
if (reserveTransaction.object.disablePendingReservations === true) {
|
|
190
191
|
const reservationFor = reserveTransaction.object.reservationFor;
|
|
191
192
|
const subReservations = reserveTransaction.object.subReservation;
|
|
192
|
-
const issuedThrough = reserveTransaction.object.issuedThrough;
|
|
193
|
+
// const issuedThrough = reserveTransaction.object.issuedThrough;
|
|
193
194
|
if (Array.isArray(subReservations)
|
|
194
195
|
&& typeof reservationFor?.typeOf === 'string'
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
// && typeof issuedThrough?.typeOf === 'string'
|
|
197
|
+
) {
|
|
198
|
+
await repos.reservation.confirmManyIfNotExist({
|
|
198
199
|
bookingTime: reserveTransaction.startDate, // startDateに設定(2024-04-08~)
|
|
199
200
|
project: { id: reserveTransaction.project.id },
|
|
200
201
|
provider: (typeof reserveTransaction.object.provider?.id === 'string')
|
|
201
202
|
? reserveTransaction.object.provider
|
|
202
203
|
: { id: reserveTransaction.agent.id, typeOf: factory_1.factory.organizationType.Corporation },
|
|
203
204
|
subReservation: subReservations,
|
|
204
|
-
issuedThrough,
|
|
205
|
+
// issuedThrough,
|
|
205
206
|
reservationFor,
|
|
206
207
|
reservationNumber: reserveTransaction.object.reservationNumber,
|
|
207
208
|
underName,
|
|
208
209
|
broker: reserveTransaction.object.broker
|
|
209
210
|
});
|
|
210
|
-
debug('confirmManyIfNotExistResult:', confirmManyIfNotExistResult, 'reservationNumber:', reservationPackage.reservationNumber);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
@@ -21,7 +21,8 @@ function createCancelPendingReservationAction(params) {
|
|
|
21
21
|
const reservationPackage = {
|
|
22
22
|
typeOf: factory_1.factory.reservationType.ReservationPackage,
|
|
23
23
|
reservationNumber: transaction.transactionNumber,
|
|
24
|
-
|
|
24
|
+
// discontinue reservationFor(2026-05-09~)
|
|
25
|
+
// reservationFor: { typeOf: reservationFor.typeOf, id: String(reservationFor.id) },
|
|
25
26
|
reservationStatus: (typeof params.transaction.object.reservationStatus === 'string')
|
|
26
27
|
? params.transaction.object.reservationStatus
|
|
27
28
|
: factory_1.factory.reservationStatusType.ReservationPending
|
|
@@ -5,11 +5,13 @@ import type { IDeprecatedField, IKeyOfProjection, ReservationRepo } from '../../
|
|
|
5
5
|
* 予約検索レスポンスとしての予約
|
|
6
6
|
* 予約ドキュメントに予約取引の情報を補完する
|
|
7
7
|
*/
|
|
8
|
-
type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName' | 'reservedTicket' | 'reservationFor'> & {
|
|
8
|
+
type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'priceCurrency' | 'underName' | 'reservedTicket' | 'reservationFor' | 'issuedThrough'> & {
|
|
9
9
|
price?: factory.reservation.eventReservation.IPrice;
|
|
10
|
+
priceCurrency?: factory.priceCurrency.JPY;
|
|
10
11
|
underName?: factory.assetTransaction.reserve.IUnderName;
|
|
11
12
|
reservedTicket?: factory.assetTransaction.reserve.IObjectSubReservation['reservedTicket'];
|
|
12
13
|
reservationFor?: factory.assetTransaction.reserve.IReservationFor;
|
|
14
|
+
issuedThrough?: factory.assetTransaction.reserve.IIssuedThrough;
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
17
|
* 予約を検索する
|
|
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.findReservations = findReservations;
|
|
7
7
|
const debug_1 = __importDefault(require("debug"));
|
|
8
|
+
// import { isDeepStrictEqual } from 'util';
|
|
9
|
+
const factory_1 = require("../../factory");
|
|
8
10
|
const debug = (0, debug_1.default)('chevre-domain:service:reserve:findReservations');
|
|
9
11
|
/**
|
|
10
12
|
* 予約を検索する
|
|
@@ -18,9 +20,11 @@ function findReservations(params, options) {
|
|
|
18
20
|
}
|
|
19
21
|
else {
|
|
20
22
|
const requirePrice = Object.keys(inclusion).includes('price');
|
|
23
|
+
const requirePriceCurrency = Object.keys(inclusion).includes('priceCurrency');
|
|
21
24
|
const requireUnderName = Object.keys(inclusion).includes('underName');
|
|
22
25
|
const requireReservedTicket = Object.keys(inclusion).includes('reservedTicket');
|
|
23
26
|
const requireReservationFor = Object.keys(inclusion).includes('reservationFor');
|
|
27
|
+
const requireIssuedThrough = Object.keys(inclusion).includes('issuedThrough');
|
|
24
28
|
const reservationIds = rawReservations.map(({ id }) => id);
|
|
25
29
|
const subReservations = await repos.assetTransaction.reserve.findSubReservationsById({
|
|
26
30
|
ids: reservationIds
|
|
@@ -33,6 +37,7 @@ function findReservations(params, options) {
|
|
|
33
37
|
const underNameByTransaction = subReservationByTransaction?.underName;
|
|
34
38
|
const ticketTypeByTransaction = subReservationByTransaction?.reservedTicket?.ticketType;
|
|
35
39
|
const reservationForByTransaction = subReservationByTransaction?.reservationFor;
|
|
40
|
+
const issuedThroughByTransaction = subReservationByTransaction?.issuedThrough;
|
|
36
41
|
// 予約ドキュメントを最適化し始めたため、もう等しくない(2026-04-06~)
|
|
37
42
|
// // 予約取引から参照した属性と全く等しいはず
|
|
38
43
|
// if (requirePrice) {
|
|
@@ -48,10 +53,11 @@ function findReservations(params, options) {
|
|
|
48
53
|
// console.error('reservationForMatched: false!!!', reservation.id);
|
|
49
54
|
// }
|
|
50
55
|
// }
|
|
51
|
-
const { reservationFor, reservedTicket, ...rawReservation4result } = reservation;
|
|
56
|
+
const { reservationFor: _reservationFor, issuedThrough: _issuedThrough, priceCurrency: _priceCurrency, reservedTicket, ...rawReservation4result } = reservation;
|
|
52
57
|
return {
|
|
53
58
|
...rawReservation4result, // 予約ドキュメントはそのまま返す
|
|
54
59
|
...(requirePrice && priceByTransaction !== undefined) ? { price: priceByTransaction } : undefined, // priceがあれば上書き
|
|
60
|
+
...(requirePriceCurrency) ? { priceCurrency: factory_1.factory.priceCurrency.JPY } : undefined, // 必要あらば固定値を補完(2026-05-08~)
|
|
55
61
|
...(requireUnderName && underNameByTransaction !== undefined) ? { underName: underNameByTransaction } : undefined, // underNameがあれば上書き
|
|
56
62
|
...(requireReservedTicket && ticketTypeByTransaction !== undefined) // ticketTypeがあれば上書き
|
|
57
63
|
? {
|
|
@@ -63,7 +69,10 @@ function findReservations(params, options) {
|
|
|
63
69
|
: undefined,
|
|
64
70
|
...(requireReservationFor && reservationForByTransaction !== undefined)
|
|
65
71
|
? { reservationFor: reservationForByTransaction }
|
|
66
|
-
: undefined, // reservationForがあれば上書き(2026-04-06~)
|
|
72
|
+
: undefined, // reservationForがあれば上書き(2026-04-06~),
|
|
73
|
+
...(requireIssuedThrough && issuedThroughByTransaction !== undefined)
|
|
74
|
+
? { issuedThrough: issuedThroughByTransaction }
|
|
75
|
+
: undefined, // issuedThroughがあれば上書き(2026-05-09~)
|
|
67
76
|
};
|
|
68
77
|
});
|
|
69
78
|
}
|
|
@@ -5,13 +5,14 @@ import { factory } from '../../../factory';
|
|
|
5
5
|
import { AuthorizationRepo } from '../../../repo/authorization';
|
|
6
6
|
import type { SettingRepo } from '../../../repo/setting';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
|
-
export type IConfirmedReservation = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName' | 'reservedTicket' | 'reservationFor'> & {
|
|
8
|
+
export type IConfirmedReservation = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName' | 'reservedTicket' | 'reservationFor' | 'issuedThrough'> & {
|
|
9
9
|
price?: factory.reservation.eventReservation.IPrice;
|
|
10
10
|
underName?: Pick<factory.reservation.IUnderName, 'id' | 'typeOf'>;
|
|
11
11
|
reservedTicket: Omit<factory.assetTransaction.reserve.ISubReservationReservedTicket, 'ticketType'> & {
|
|
12
12
|
ticketType: factory.reservation.eventReservation.ITicketType;
|
|
13
13
|
};
|
|
14
14
|
reservationFor: factory.assetTransaction.reserve.IReservationFor;
|
|
15
|
+
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
18
|
* 予約確定後のアクション
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "8.1.0-alpha.
|
|
14
|
+
"@chevre/factory": "8.1.0-alpha.6",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"postversion": "git push origin --tags",
|
|
92
92
|
"prepublishOnly": "npm run clean && npm run build"
|
|
93
93
|
},
|
|
94
|
-
"version": "24.1.0-alpha.
|
|
94
|
+
"version": "24.1.0-alpha.11"
|
|
95
95
|
}
|