@chevre/domain 24.1.0-alpha.2 → 24.1.0-alpha.21
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/README.md +0 -2
- package/lib/chevre/repo/acceptedOffer.d.ts +22 -11
- package/lib/chevre/repo/acceptedOffer.js +199 -50
- package/lib/chevre/repo/accountingReport.d.ts +9 -2
- package/lib/chevre/repo/accountingReport.js +6 -34
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/aggregateReservation.d.ts +6 -0
- package/lib/chevre/repo/aggregateReservation.js +9 -0
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +3 -1
- package/lib/chevre/repo/assetTransaction/reserve.js +3 -1
- package/lib/chevre/repo/event.js +12 -8
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +9 -0
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +72 -0
- package/lib/chevre/repo/factory/reservation/createMongoConditions.js +155 -180
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
- package/lib/chevre/repo/mongoose/schemas/order.js +108 -108
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.js +128 -146
- package/lib/chevre/repo/order.d.ts +2 -1
- package/lib/chevre/repo/order.js +171 -170
- package/lib/chevre/repo/orderInTransaction.d.ts +32 -2
- package/lib/chevre/repo/orderInTransaction.js +77 -0
- package/lib/chevre/repo/reservation.d.ts +20 -7
- package/lib/chevre/repo/reservation.js +14 -10
- package/lib/chevre/repo/role.d.ts +1 -15
- package/lib/chevre/repo/role.js +7 -14
- package/lib/chevre/repo/transaction.d.ts +6 -6
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +22 -26
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +0 -12
- package/lib/chevre/service/assetTransaction/reserve/start/factory/price.d.ts +1 -1
- package/lib/chevre/service/offer/any.d.ts +3 -1
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +2 -1
- package/lib/chevre/service/offer/event/authorize/factory.js +4 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -0
- package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -3
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +67 -72
- package/lib/chevre/service/order/deleteOrder.js +21 -44
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +9 -11
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -5
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/sendOrder.js +2 -4
- package/lib/chevre/service/reserve/confirmReservation.js +7 -7
- package/lib/chevre/service/reserve/factory.js +2 -1
- package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
- package/lib/chevre/service/reserve/findByCode.js +2 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +5 -2
- package/lib/chevre/service/reserve/findReservations.js +15 -9
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -9
- package/lib/chevre/service/reserve/searchByOrder.js +8 -3
- package/lib/chevre/service/reserve/useReservation.d.ts +1 -1
- package/lib/chevre/service/reserve/useReservation.js +20 -24
- package/lib/chevre/service/task/confirmReserveTransaction.js +2 -1
- package/lib/chevre/service/task/createAccountingReport.js +7 -9
- package/lib/chevre/service/task/payment/payByTask.js +3 -2
- package/lib/chevre/service/task/useReservation.d.ts +2 -2
- package/lib/chevre/service/task/useReservation.js +6 -18
- package/lib/chevre/service/taskHandler.js +1 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +5 -2
- package/lib/chevre/service/transaction/returnOrder/preStart.js +2 -4
- package/lib/chevre/service/validation/validateOrder.js +5 -79
- package/package.json +2 -2
|
@@ -114,15 +114,19 @@ 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
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
117
|
+
const { price: _discontinuePrice, reservedTicket, priceCurrency: _discontinuePriceCurrency, // discontinue priceCurrency
|
|
118
|
+
numSeats: _numSeats, // discontinue(2026-05-11~)
|
|
119
|
+
...subReservationWithoutPrice } = subReservation;
|
|
120
|
+
const { ticketType: _ticketType, ...reservedTicketWithoutTicketType } = reservedTicket;
|
|
121
|
+
// discontinue ticketType(2026-05-09~)
|
|
122
|
+
const savingReservedTicket = reservedTicketWithoutTicketType;
|
|
123
|
+
// // 予約ドキュメントのticketTypeを最小化(2026-04-03~)
|
|
124
|
+
// const savingReservedTicket: ISavingReservedTicket = {
|
|
125
|
+
// ...reservedTicketWithoutTicketType,
|
|
126
|
+
// ticketType: {
|
|
127
|
+
// ...((typeof ticketType.id === 'string') && { id: ticketType.id })
|
|
128
|
+
// }
|
|
129
|
+
// };
|
|
126
130
|
// reservationFor最小化(2026-04-06~)
|
|
127
131
|
const { minimizedReservationFor } = (0, minimizeReservationFor_1.minimizeReservationFor)(params.reservationFor);
|
|
128
132
|
const setOnInsert = {
|
|
@@ -132,7 +136,7 @@ class ReservationRepo {
|
|
|
132
136
|
bookingTime: params.bookingTime,
|
|
133
137
|
checkedIn: false,
|
|
134
138
|
attended: false,
|
|
135
|
-
issuedThrough: params.issuedThrough,
|
|
139
|
+
// issuedThrough: params.issuedThrough, // discontinue issuedThrough
|
|
136
140
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
137
141
|
reservationFor: minimizedReservationFor,
|
|
138
142
|
reservationNumber: params.reservationNumber,
|
|
@@ -59,23 +59,9 @@ export declare class RoleRepo {
|
|
|
59
59
|
} & {
|
|
60
60
|
__v: number;
|
|
61
61
|
}) | null>;
|
|
62
|
-
addMember(params: Pick<IRole, 'member' | 'memberOf' | 'roleName'>): Promise<(import("mongoose").FlattenMaps<{
|
|
63
|
-
typeOf: import("@chevre/factory/lib/chevre/role").RoleType;
|
|
64
|
-
memberOf: {
|
|
65
|
-
typeOf: factory.organizationType.Corporation | factory.organizationType.Project;
|
|
66
|
-
};
|
|
67
|
-
member: {
|
|
68
|
-
typeOf: import("@chevre/factory/lib/chevre/role/organizationRole").IMemberType;
|
|
69
|
-
};
|
|
70
|
-
roleName: import("@chevre/factory/lib/chevre/role/organizationRole").RoleName;
|
|
71
|
-
permissions: string[];
|
|
72
|
-
}> & {
|
|
73
|
-
_id: import("mongoose").Types.ObjectId;
|
|
74
|
-
} & {
|
|
75
|
-
__v: number;
|
|
76
|
-
}) | null>;
|
|
77
62
|
create(params: Pick<IRole, 'member' | 'memberOf' | 'permissions' | 'roleName'>): Promise<{
|
|
78
63
|
id: string;
|
|
79
64
|
}>;
|
|
65
|
+
deleteByRoleName(params: Pick<IRole, 'roleName'>): Promise<import("mongodb").DeleteResult>;
|
|
80
66
|
}
|
|
81
67
|
export {};
|
package/lib/chevre/repo/role.js
CHANGED
|
@@ -139,20 +139,6 @@ class RoleRepo {
|
|
|
139
139
|
.lean()
|
|
140
140
|
.exec();
|
|
141
141
|
}
|
|
142
|
-
async addMember(params) {
|
|
143
|
-
const { roleName, member, memberOf } = params;
|
|
144
|
-
return this.roleModel.findOneAndUpdate({
|
|
145
|
-
roleName: { $eq: roleName },
|
|
146
|
-
'member.typeOf': { $ne: member.typeOf }
|
|
147
|
-
}, {
|
|
148
|
-
$set: { member, memberOf }
|
|
149
|
-
}, {
|
|
150
|
-
new: true,
|
|
151
|
-
projection: { _id: 1 }
|
|
152
|
-
})
|
|
153
|
-
.lean()
|
|
154
|
-
.exec();
|
|
155
|
-
}
|
|
156
142
|
async create(params) {
|
|
157
143
|
const { member, memberOf, permissions, roleName } = params;
|
|
158
144
|
const creatingRole = {
|
|
@@ -167,5 +153,12 @@ class RoleRepo {
|
|
|
167
153
|
const savedId = insertedId;
|
|
168
154
|
return { id: savedId };
|
|
169
155
|
}
|
|
156
|
+
async deleteByRoleName(params) {
|
|
157
|
+
const { roleName } = params;
|
|
158
|
+
return this.roleModel.deleteOne({
|
|
159
|
+
roleName: { $eq: roleName }
|
|
160
|
+
})
|
|
161
|
+
.exec();
|
|
162
|
+
}
|
|
170
163
|
}
|
|
171
164
|
exports.RoleRepo = RoleRepo;
|
|
@@ -136,11 +136,11 @@ export declare class TransactionRepo {
|
|
|
136
136
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
137
137
|
startDate: Date;
|
|
138
138
|
endDate?: Date | undefined;
|
|
139
|
-
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
140
139
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
141
|
-
|
|
140
|
+
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
142
141
|
status: factory.transactionStatusType;
|
|
143
142
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
143
|
+
potentialActions?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IPotentialActions | undefined;
|
|
144
144
|
} & {
|
|
145
145
|
_id: import("mongoose").Types.ObjectId;
|
|
146
146
|
} & {
|
|
@@ -156,10 +156,10 @@ export declare class TransactionRepo {
|
|
|
156
156
|
startDate: Date;
|
|
157
157
|
endDate?: Date | undefined;
|
|
158
158
|
agent: import("@chevre/factory/lib/chevre/transaction").IAgent;
|
|
159
|
-
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
160
159
|
recipient?: undefined;
|
|
161
160
|
status: factory.transactionStatusType;
|
|
162
161
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
162
|
+
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
163
163
|
} & {
|
|
164
164
|
_id: import("mongoose").Types.ObjectId;
|
|
165
165
|
} & {
|
|
@@ -174,11 +174,11 @@ export declare class TransactionRepo {
|
|
|
174
174
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
175
175
|
startDate: Date;
|
|
176
176
|
endDate?: Date | undefined;
|
|
177
|
-
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
178
177
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
179
|
-
|
|
178
|
+
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
180
179
|
status: factory.transactionStatusType;
|
|
181
180
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
181
|
+
potentialActions?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IPotentialActions | undefined;
|
|
182
182
|
} & {
|
|
183
183
|
_id: import("mongoose").Types.ObjectId;
|
|
184
184
|
} & {
|
|
@@ -194,10 +194,10 @@ export declare class TransactionRepo {
|
|
|
194
194
|
startDate: Date;
|
|
195
195
|
endDate?: Date | undefined;
|
|
196
196
|
agent: import("@chevre/factory/lib/chevre/transaction").IAgent;
|
|
197
|
-
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
198
197
|
recipient?: undefined;
|
|
199
198
|
status: factory.transactionStatusType;
|
|
200
199
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
200
|
+
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
201
201
|
} & {
|
|
202
202
|
_id: import("mongoose").Types.ObjectId;
|
|
203
203
|
} & {
|
|
@@ -125,48 +125,44 @@ function aggregateOfferByEvent(params) {
|
|
|
125
125
|
function aggregateReservationByOffer(params) {
|
|
126
126
|
return async (repos) => {
|
|
127
127
|
let reservationCount4offer;
|
|
128
|
-
// let attendeeCount4offer: number | undefined;
|
|
129
|
-
// let checkInCount4offer: number | undefined;
|
|
130
128
|
const reservationType = factory_1.factory.reservationType.EventReservation;
|
|
131
129
|
const offerIdsWithSameCategory = params.availableOffers.filter(({ category }) => {
|
|
132
130
|
return typeof category?.codeValue === 'string' && category.codeValue === params.offer.category?.codeValue;
|
|
133
131
|
})
|
|
134
132
|
.map(({ id }) => id);
|
|
135
133
|
if (offerIdsWithSameCategory.length > 0) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
reservationFor: { id: { $eq: params.event.id } },
|
|
139
|
-
reservationStatuses: [factory_1.factory.reservationStatusType.ReservationConfirmed],
|
|
140
|
-
// オファーカテゴリーごとに集計する(2024-11-10~)
|
|
141
|
-
// reservedTicket: { ticketType: { ids: [<string>params.offer.id] } }
|
|
142
|
-
reservedTicket: { ticketType: { ids: offerIdsWithSameCategory } }
|
|
143
|
-
});
|
|
144
|
-
// attendeeCount4offer = await repos.reservation.count({
|
|
134
|
+
// オファーIDによる集計を座席区分(オファーの適用座席区分を参照)による集計に変更(2026-05-05~)
|
|
135
|
+
// reservationCount4offer = await repos.reservation.count({
|
|
145
136
|
// typeOf: reservationType,
|
|
146
137
|
// reservationFor: { id: { $eq: params.event.id } },
|
|
147
138
|
// reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
|
|
148
|
-
//
|
|
149
|
-
// // reservedTicket: { ticketType: { ids: [<string>params.offer.id] } },
|
|
150
|
-
// reservedTicket: { ticketType: { ids: offerIdsWithSameCategory } },
|
|
151
|
-
// attended: true
|
|
152
|
-
// });
|
|
153
|
-
// checkInCount4offer = await repos.reservation.count({
|
|
154
|
-
// typeOf: reservationType,
|
|
155
|
-
// reservationFor: { id: { $eq: params.event.id } },
|
|
156
|
-
// reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
|
|
157
|
-
// // オファーカテゴリーごとに集計する(2024-11-10~)
|
|
158
|
-
// // reservedTicket: { ticketType: { ids: [<string>params.offer.id] } },
|
|
159
|
-
// reservedTicket: { ticketType: { ids: offerIdsWithSameCategory } },
|
|
160
|
-
// checkedIn: true
|
|
139
|
+
// reservedTicket: { ticketType: { ids: offerIdsWithSameCategory } }
|
|
161
140
|
// });
|
|
141
|
+
const aggregateSeatingType = params.offer.eligibleSeatingType?.at(0)?.codeValue;
|
|
142
|
+
if (typeof aggregateSeatingType === 'string') {
|
|
143
|
+
reservationCount4offer = await repos.reservation.count({
|
|
144
|
+
typeOf: reservationType,
|
|
145
|
+
reservationFor: { id: { $eq: params.event.id } },
|
|
146
|
+
reservationStatuses: [factory_1.factory.reservationStatusType.ReservationConfirmed],
|
|
147
|
+
reservedTicket: {
|
|
148
|
+
ticketedSeat: {
|
|
149
|
+
seatingType: { $in: [aggregateSeatingType] }
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
// console.log(
|
|
154
|
+
// 'aggregateReservationByOffer: reservationCount4offer:', reservationCount4offer,
|
|
155
|
+
// 'aggregateSeatingType:', aggregateSeatingType,
|
|
156
|
+
// 'offer.id:', params.offer.id,
|
|
157
|
+
// 'offer.category:', params.offer.category?.codeValue
|
|
158
|
+
// );
|
|
159
|
+
}
|
|
162
160
|
}
|
|
163
161
|
const { maximumAttendeeCapacity, remainingAttendeeCapacity } = await calculateCapacityByOffer(params)(repos);
|
|
164
162
|
return {
|
|
165
163
|
aggregateReservation: {
|
|
166
164
|
typeOf: 'AggregateReservation',
|
|
167
165
|
reservationCount: reservationCount4offer
|
|
168
|
-
// attendeeCount: attendeeCount4offer, // discontinue(2024-11-10~)
|
|
169
|
-
// checkInCount: checkInCount4offer // discontinue(2024-11-10~)
|
|
170
166
|
},
|
|
171
167
|
...(typeof maximumAttendeeCapacity === 'number') ? { maximumAttendeeCapacity } : undefined,
|
|
172
168
|
...(typeof remainingAttendeeCapacity === 'number') ? { remainingAttendeeCapacity } : undefined
|
|
@@ -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
|
|
@@ -18,7 +18,7 @@ export declare function validateStartParams(params: IStartParams): (repos: {
|
|
|
18
18
|
assetTransaction: AssetTransactionRepo;
|
|
19
19
|
}) => Promise<{
|
|
20
20
|
reserveTransaction: import("@chevre/factory/lib/chevre/assetTransaction/reserve").ITransaction | undefined;
|
|
21
|
-
reservations: (Pick<import("@chevre/factory/lib/chevre/reservation/event").IReservation, "id" | "typeOf" | "
|
|
21
|
+
reservations: (Pick<import("@chevre/factory/lib/chevre/reservation/event").IReservation, "id" | "typeOf" | "reservationNumber"> & {
|
|
22
22
|
reservationFor: Pick<factory.reservation.eventReservation.IReservationForMinimized, "id" | "typeOf">;
|
|
23
23
|
})[] | undefined;
|
|
24
24
|
}>;
|
|
@@ -43,7 +43,7 @@ function validateStartParams(params) {
|
|
|
43
43
|
const reservation = await repos.reservation.findReservationById({
|
|
44
44
|
id: params.object.reservation.id,
|
|
45
45
|
inclusion: [
|
|
46
|
-
'
|
|
46
|
+
'typeOf', 'reservationNumber', 'reservationFor.id', 'reservationFor.typeOf', 'provider', 'reservationStatus'
|
|
47
47
|
]
|
|
48
48
|
});
|
|
49
49
|
// 販売者検証(2023-08-01~)
|
|
@@ -328,27 +328,17 @@ function createReservation(params) {
|
|
|
328
328
|
const price4reservation = (0, price_1.createPrice)(params);
|
|
329
329
|
if (params.reservationFor.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
330
330
|
return {
|
|
331
|
-
// project: params.project, // 廃止(2024-04-08~)
|
|
332
331
|
typeOf: factory_1.factory.reservationType.EventReservation,
|
|
333
332
|
id: params.id,
|
|
334
333
|
// reservationPackage保管に移行(2023-06-06~)
|
|
335
334
|
// issuedThrough,
|
|
336
335
|
additionalProperty: params.additionalProperty,
|
|
337
|
-
// bookingTime: params.reserveDate, // 廃止(2024-04-08~)
|
|
338
|
-
// modifiedTime: params.reserveDate, // 廃止(2024-04-08~)
|
|
339
336
|
numSeats: 1,
|
|
340
337
|
price: price4reservation,
|
|
341
338
|
priceCurrency: factory_1.factory.priceCurrency.JPY,
|
|
342
|
-
// reservationNumber: params.reservationNumber, // 廃止(2024-04-08~)
|
|
343
339
|
// statusは不要なので削除(2023-07-19~)
|
|
344
340
|
// reservationStatus: factory.reservationStatusType.ReservationPending,
|
|
345
341
|
reservedTicket: params.reservedTicket,
|
|
346
|
-
// underName: { // 廃止(2024-04-08~)
|
|
347
|
-
// typeOf: params.agent.typeOf,
|
|
348
|
-
// name: params.agent.name
|
|
349
|
-
// },
|
|
350
|
-
// checkedIn: false, // 廃止(2024-04-08~)
|
|
351
|
-
// attended: false, // 廃止(2024-04-08~)
|
|
352
342
|
...(typeof params.additionalTicketText === 'string') ? { additionalTicketText: params.additionalTicketText } : undefined,
|
|
353
343
|
...(Array.isArray(params.subReservation))
|
|
354
344
|
? {
|
|
@@ -362,8 +352,6 @@ function createReservation(params) {
|
|
|
362
352
|
})
|
|
363
353
|
}
|
|
364
354
|
: undefined,
|
|
365
|
-
// reservationPackage保管に移行(2023-06-06~)
|
|
366
|
-
// ...(typeof params.broker?.typeOf === 'string') ? { broker: params.broker } : undefined,
|
|
367
355
|
...(typeof params.programMembershipUsed?.identifier === 'string')
|
|
368
356
|
? { programMembershipUsed: params.programMembershipUsed }
|
|
369
357
|
: undefined
|
|
@@ -14,4 +14,4 @@ export declare function createPrice(params: {
|
|
|
14
14
|
seatPriceComponent: factory.place.seat.IPriceComponent[];
|
|
15
15
|
acceptedAddOns: IAcceptedAddOn[];
|
|
16
16
|
appliesToMovieTicket?: factory.assetTransaction.reserve.IAcceptedAppliesToMovieTicket;
|
|
17
|
-
}): factory.
|
|
17
|
+
}): factory.assetTransaction.reserve.IPrice;
|
|
@@ -10,7 +10,9 @@ export declare function acceptOffer(params: {
|
|
|
10
10
|
project: {
|
|
11
11
|
id: string;
|
|
12
12
|
};
|
|
13
|
-
acceptedOffers: factory.order.IAcceptedOffer
|
|
13
|
+
acceptedOffers: (factory.order.IAcceptedOffer & {
|
|
14
|
+
offeredThrough: factory.offer.IOfferedThrough;
|
|
15
|
+
})[];
|
|
14
16
|
}): IAcceptOfferOperation<void>;
|
|
15
17
|
export declare function voidAcceptedOffer(params: {
|
|
16
18
|
/**
|
|
@@ -23,7 +23,7 @@ declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
23
23
|
transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
24
24
|
}): factory.action.authorize.offer.eventService.IAttributes;
|
|
25
25
|
declare function acceptedOffers2amount(params: {
|
|
26
|
-
acceptedOffers: IResultAcceptedOffer[];
|
|
26
|
+
acceptedOffers: Pick<IResultAcceptedOffer, 'priceSpecification' | 'id'>[];
|
|
27
27
|
}): number;
|
|
28
28
|
declare function acceptedOffers2authorizeResult(params: {
|
|
29
29
|
acceptedOffers: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail[];
|
|
@@ -34,6 +34,7 @@ declare function acceptedOffers2authorizeResult(params: {
|
|
|
34
34
|
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
35
35
|
export type IResultAcceptedOffer = factory.order.IAcceptedOffer & {
|
|
36
36
|
itemOffered: factory.order.IReservation;
|
|
37
|
+
offeredThrough: factory.offer.IOfferedThrough;
|
|
37
38
|
};
|
|
38
39
|
declare function responseBody2acceptedOffers4result(params: {
|
|
39
40
|
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
@@ -302,7 +302,6 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
302
302
|
* 注文データの予約を生成する
|
|
303
303
|
*/
|
|
304
304
|
function createReservation(params) {
|
|
305
|
-
// const { itemOffered, event, reservationFor } = params;
|
|
306
305
|
const { itemOffered } = params;
|
|
307
306
|
const event = params.reservationFor;
|
|
308
307
|
let reservationItem;
|
|
@@ -367,19 +366,17 @@ function createReservation(params) {
|
|
|
367
366
|
if (params.issuedThrough.typeOf !== factory_1.factory.product.ProductType.EventService) {
|
|
368
367
|
throw new factory_1.factory.errors.Argument('issuedThrough', `issuedThrough.typeOf must be ${factory_1.factory.product.ProductType.EventService}`);
|
|
369
368
|
}
|
|
369
|
+
const { additionalProperty, additionalTicketText, programMembershipUsed } = itemOffered;
|
|
370
370
|
reservationItem = {
|
|
371
371
|
typeOf: itemOffered.typeOf,
|
|
372
|
-
additionalProperty: itemOffered.additionalProperty,
|
|
373
|
-
additionalTicketText: itemOffered.additionalTicketText,
|
|
374
372
|
id: itemOffered.id,
|
|
375
373
|
issuedThrough: params.issuedThrough,
|
|
376
374
|
reservationNumber: params.reservationNumber,
|
|
377
375
|
reservationFor,
|
|
378
376
|
reservedTicket,
|
|
379
|
-
|
|
380
|
-
...(typeof
|
|
381
|
-
|
|
382
|
-
: undefined
|
|
377
|
+
...((Array.isArray(additionalProperty)) && { additionalProperty }),
|
|
378
|
+
...((typeof additionalTicketText === 'string') && { additionalTicketText }),
|
|
379
|
+
...((typeof programMembershipUsed?.typeOf === 'string') && { programMembershipUsed }) // 使用メンバーシップがあれば追加
|
|
383
380
|
};
|
|
384
381
|
}
|
|
385
382
|
else {
|
|
@@ -23,6 +23,7 @@ export declare function offers2resultPrice(offers: IAcceptedOffer4COA[]): {
|
|
|
23
23
|
};
|
|
24
24
|
type IResultAcceptedOffer = Omit<factory.order.IAcceptedOffer, 'itemOffered'> & {
|
|
25
25
|
itemOffered: factory.order.ICOAEventReservation;
|
|
26
|
+
offeredThrough: factory.offer.IOfferedThrough;
|
|
26
27
|
};
|
|
27
28
|
/**
|
|
28
29
|
* COA仮予約結果から注文アイテムを生成する
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { AccountingReportRepo } from '../../repo/accountingReport';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
|
-
export declare function createAccountingReportIfNotExist(params: Pick<factory.order.IOrder, 'id' | 'orderNumber' | 'project' | '
|
|
4
|
-
acceptedOffers: factory.order.IAcceptedOffer[];
|
|
5
|
-
}): (repos: {
|
|
3
|
+
export declare function createAccountingReportIfNotExist(params: Pick<factory.order.IOrder, 'id' | 'orderNumber' | 'project' | 'paymentMethods' | 'seller' | 'typeOf' | 'orderDate'> & {}): (repos: {
|
|
6
4
|
accountingReport: AccountingReportRepo;
|
|
7
5
|
}) => Promise<void>;
|
|
@@ -19,84 +19,79 @@ function createAccountingReportIfNotExist(params) {
|
|
|
19
19
|
}
|
|
20
20
|
// 最適化(2023-06-30~)
|
|
21
21
|
function createOrder4report(params) {
|
|
22
|
-
if (!Array.isArray(params.acceptedOffers)) {
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
const numItems = params.acceptedOffers.length;
|
|
26
|
-
// 必要な属性についてDate型に変換(でないと検索クエリを効率的に使えない)
|
|
27
|
-
const acceptedOffers = (Array.isArray(params.acceptedOffers))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
: []
|
|
76
|
-
};
|
|
22
|
+
// if (!Array.isArray(params.acceptedOffers)) {
|
|
23
|
+
// throw new factory.errors.ArgumentNull('order.acceptedOffers');
|
|
24
|
+
// }
|
|
25
|
+
// const numItems: number = params.acceptedOffers.length;
|
|
26
|
+
// // 必要な属性についてDate型に変換(でないと検索クエリを効率的に使えない)
|
|
27
|
+
// const acceptedOffers = (Array.isArray(params.acceptedOffers))
|
|
28
|
+
// ? params.acceptedOffers.map((o) => {
|
|
29
|
+
// if (o.itemOffered.typeOf === factory.reservationType.EventReservation) {
|
|
30
|
+
// let itemOffered = o.itemOffered;
|
|
31
|
+
// const reservationFor = itemOffered.reservationFor;
|
|
32
|
+
// itemOffered = {
|
|
33
|
+
// ...itemOffered,
|
|
34
|
+
// reservationFor: {
|
|
35
|
+
// ...reservationFor,
|
|
36
|
+
// ...(reservationFor.doorTime !== undefined)
|
|
37
|
+
// ? {
|
|
38
|
+
// doorTime: moment(reservationFor.doorTime)
|
|
39
|
+
// .toDate()
|
|
40
|
+
// }
|
|
41
|
+
// : undefined,
|
|
42
|
+
// ...(reservationFor.endDate !== undefined)
|
|
43
|
+
// ? {
|
|
44
|
+
// endDate: moment(reservationFor.endDate)
|
|
45
|
+
// .toDate()
|
|
46
|
+
// }
|
|
47
|
+
// : undefined,
|
|
48
|
+
// ...(reservationFor.startDate !== undefined)
|
|
49
|
+
// ? {
|
|
50
|
+
// startDate: moment(reservationFor.startDate)
|
|
51
|
+
// .toDate()
|
|
52
|
+
// }
|
|
53
|
+
// : undefined
|
|
54
|
+
// }
|
|
55
|
+
// } as factory.order.IReservation;
|
|
56
|
+
// return {
|
|
57
|
+
// ...o,
|
|
58
|
+
// itemOffered
|
|
59
|
+
// };
|
|
60
|
+
// } else {
|
|
61
|
+
// return o;
|
|
62
|
+
// }
|
|
63
|
+
// })
|
|
64
|
+
// : [];
|
|
65
|
+
// const customer: factory.report.accountingReport.IOptimizedCustomer = {
|
|
66
|
+
// id: params.customer.id,
|
|
67
|
+
// typeOf: params.customer.typeOf,
|
|
68
|
+
// additionalProperty: (Array.isArray(params.customer.additionalProperty))
|
|
69
|
+
// ? params.customer.additionalProperty
|
|
70
|
+
// : [],
|
|
71
|
+
// identifier: (Array.isArray(params.customer.identifier))
|
|
72
|
+
// ? params.customer.identifier
|
|
73
|
+
// : []
|
|
74
|
+
// };
|
|
77
75
|
return {
|
|
78
|
-
// ...params,
|
|
79
|
-
confirmationNumber: params.confirmationNumber,
|
|
80
76
|
id: params.id,
|
|
81
77
|
orderNumber: params.orderNumber,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
paymentMethods: params.paymentMethods.map(({ paymentMethodId }) => ({ paymentMethodId })),
|
|
79
|
+
seller: {
|
|
80
|
+
id: params.seller.id,
|
|
81
|
+
name: params.seller.name,
|
|
82
|
+
typeOf: params.seller.typeOf
|
|
83
|
+
},
|
|
87
84
|
typeOf: params.typeOf,
|
|
88
|
-
customer,
|
|
89
85
|
orderDate: (0, moment_timezone_1.default)(params.orderDate)
|
|
90
86
|
.toDate(),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
// : undefined
|
|
87
|
+
// confirmationNumber: params.confirmationNumber, // discontinue(2026-05-06~)
|
|
88
|
+
// price: params.price, // discontinue(2026-05-06~)
|
|
89
|
+
// priceCurrency: params.priceCurrency, // discontinue(2026-05-06~)
|
|
90
|
+
// customer, // discontinue(2026-05-06~)
|
|
91
|
+
// numItems, // discontinue(2026-05-06~)
|
|
92
|
+
// orderedItem: params.orderedItem, // discontinue(2026-05-06~)
|
|
93
|
+
// acceptedOffers, // discontinue(2026-05-06~)
|
|
94
|
+
// ...(typeof params.broker?.typeOf === 'string') ? { broker: params.broker } : undefined // discontinue(2026-05-06~)
|
|
100
95
|
};
|
|
101
96
|
}
|
|
102
97
|
function createAccountingReport(params) {
|