@chevre/domain 28.0.0-alpha.3 → 28.0.0-alpha.31
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/eventEmitter/transaction.d.ts +2 -2
- package/lib/chevre/eventEmitter/transaction.js +1 -1
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/factory/event.js +1 -5
- package/lib/chevre/repo/acceptedOffer.d.ts +6 -5
- package/lib/chevre/repo/acceptedOffer.js +14 -9
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +6 -8
- package/lib/chevre/repo/acceptedOfferInReserve.js +13 -7
- package/lib/chevre/repo/adminAcceptedOffer.d.ts +25 -12
- package/lib/chevre/repo/adminAcceptedOffer.js +20 -10
- package/lib/chevre/repo/adminEvent.d.ts +1 -7
- package/lib/chevre/repo/adminEvent.js +3 -9
- package/lib/chevre/repo/adminEventSeries.d.ts +67 -0
- package/lib/chevre/repo/adminEventSeries.js +178 -0
- package/lib/chevre/repo/{paymentServiceChannel.d.ts → adminPaymentServiceChannel.d.ts} +13 -11
- package/lib/chevre/repo/{paymentServiceChannel.js → adminPaymentServiceChannel.js} +20 -19
- package/lib/chevre/repo/adminTask.d.ts +2 -2
- package/lib/chevre/repo/adminTransaction.d.ts +20 -30
- package/lib/chevre/repo/adminTransaction.js +0 -98
- package/lib/chevre/repo/aggregateEvent.js +0 -1
- package/lib/chevre/repo/aggregateTransaction.d.ts +0 -1
- package/lib/chevre/repo/aggregateTransaction.js +0 -1
- package/lib/chevre/repo/categoryCode.js +0 -21
- package/lib/chevre/repo/event.d.ts +2 -2
- package/lib/chevre/repo/event.js +71 -110
- package/lib/chevre/repo/eventSeries.d.ts +5 -84
- package/lib/chevre/repo/eventSeries.js +21 -212
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +1 -1
- package/lib/chevre/repo/issuer.d.ts +2 -6
- package/lib/chevre/repo/memberProgram.d.ts +1 -38
- package/lib/chevre/repo/memberProgram.js +1 -62
- package/lib/chevre/repo/mongoose/schemas/civicStructure.d.ts +1 -0
- package/lib/chevre/repo/mongoose/schemas/event.js +0 -13
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +1 -18
- package/lib/chevre/repo/mongoose/schemas/issuer.d.ts +1 -3
- package/lib/chevre/repo/mongoose/schemas/issuer.js +0 -10
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +22 -1
- package/lib/chevre/repo/mongoose/schemas/paymentServiceChannel.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/place.js +0 -9
- package/lib/chevre/repo/mongoose/schemas/seller.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/seller.js +0 -2
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.js +81 -70
- package/lib/chevre/repo/order.d.ts +2 -2
- package/lib/chevre/repo/order.js +0 -31
- package/lib/chevre/repo/orderInTransaction.d.ts +5 -25
- package/lib/chevre/repo/orderInTransaction.js +0 -6
- package/lib/chevre/repo/place/movieTheater.d.ts +3 -1
- package/lib/chevre/repo/place/movieTheater.js +3 -1
- package/lib/chevre/repo/place/{hasPOS.d.ts → pos.d.ts} +13 -20
- package/lib/chevre/repo/place/{hasPOS.js → pos.js} +66 -29
- package/lib/chevre/repo/place/screeningRoom.d.ts +24 -3
- package/lib/chevre/repo/place/screeningRoom.js +28 -17
- package/lib/chevre/repo/priceSpecification.d.ts +8 -8
- package/lib/chevre/repo/role.d.ts +1 -1
- package/lib/chevre/repo/role.js +1 -30
- package/lib/chevre/repo/seller.d.ts +11 -4
- package/lib/chevre/repo/seller.js +31 -58
- package/lib/chevre/repo/sellerPaymentAccepted.d.ts +14 -21
- package/lib/chevre/repo/sellerPaymentAccepted.js +65 -38
- package/lib/chevre/repo/task.d.ts +3 -3
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -8
- package/lib/chevre/repo/transaction/placeOrder.js +31 -112
- package/lib/chevre/repo/transaction.js +0 -1
- package/lib/chevre/repository.d.ts +15 -10
- package/lib/chevre/repository.js +30 -19
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +2 -2
- package/lib/chevre/service/aggregation/system.js +1 -3
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateAcceptedPaymentMethodIfNeeded.js +1 -2
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/start.js +2 -1
- package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -1
- package/lib/chevre/service/event/saveScreeningEventSeries.d.ts +2 -2
- package/lib/chevre/service/event/saveScreeningEventSeries.js +2 -3
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -0
- package/lib/chevre/service/event/saveScreeningEvents.js +4 -4
- package/lib/chevre/service/event.d.ts +2 -0
- package/lib/chevre/service/event.js +0 -1
- package/lib/chevre/service/offer/any.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +1 -8
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.js +1 -4
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -12
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +3 -9
- package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +2 -8
- package/lib/chevre/service/offer/event/searchOffersByIds.js +3 -9
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -5
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -9
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +0 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -4
- package/lib/chevre/service/offer/onEventChanged.js +9 -21
- package/lib/chevre/service/offer.js +1 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +4 -6
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +23 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/sendOrder.js +2 -14
- package/lib/chevre/service/payment/any/authorize.js +1 -1
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +1 -4
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.js +1 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +3 -3
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.js +1 -1
- package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
- package/lib/chevre/service/task/importEventsFromCOA.js +2 -0
- package/lib/chevre/service/task/onResourceDeleted.js +8 -8
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +7 -3
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +51 -50
- package/lib/chevre/service/task/onResourceUpdated.js +5 -25
- package/lib/chevre/service/task/syncResourcesFromCOA.js +5 -3
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +1 -1
- 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 +1 -7
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -4
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -4
- package/lib/chevre/service/transaction/returnOrder/preStart/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -2
- package/package.json +2 -2
- package/lib/chevre/service/delivery/factory.d.ts +0 -16
- package/lib/chevre/service/delivery/factory.js +0 -124
|
@@ -10,7 +10,7 @@ export declare function acceptOffer(params: {
|
|
|
10
10
|
id: string;
|
|
11
11
|
};
|
|
12
12
|
placeOrderId: string;
|
|
13
|
-
acceptedOffers: IMinimizedAcceptedOffer[] | factory.
|
|
13
|
+
acceptedOffers: IMinimizedAcceptedOffer[] | factory.acceptedOffer.ICOAAcceptedOffer[];
|
|
14
14
|
}): IAcceptOfferOperation<void>;
|
|
15
15
|
export declare function voidAcceptedOffer(params: {
|
|
16
16
|
/**
|
|
@@ -31,11 +31,11 @@ declare function acceptedOffers2authorizeResult(params: {
|
|
|
31
31
|
onlyPrice?: boolean;
|
|
32
32
|
};
|
|
33
33
|
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
34
|
-
export type IResultAcceptedOffer = Omit<factory.
|
|
35
|
-
itemOffered: factory.
|
|
34
|
+
export type IResultAcceptedOffer = Omit<factory.acceptedOffer.IOptimizedAcceptedOffer, 'priceSpecification'> & {
|
|
35
|
+
itemOffered: factory.acceptedOffer.IEventReservation;
|
|
36
36
|
offeredThrough: factory.offer.IOfferedThrough;
|
|
37
37
|
serialNumber: string;
|
|
38
|
-
priceSpecification?: factory.
|
|
38
|
+
priceSpecification?: factory.acceptedOffer.ITicketPriceSpecification;
|
|
39
39
|
};
|
|
40
40
|
declare function responseBody2acceptedOffers4result(params: {
|
|
41
41
|
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
@@ -346,17 +346,10 @@ function createReservation(params) {
|
|
|
346
346
|
id: event.superEvent.id,
|
|
347
347
|
location: event.superEvent.location,
|
|
348
348
|
name: event.superEvent.name,
|
|
349
|
-
soundFormat: event.superEvent.soundFormat,
|
|
349
|
+
// soundFormat: event.superEvent.soundFormat, // discontinue(2026-10-05~)
|
|
350
350
|
workPerformed,
|
|
351
351
|
...(typeof event.superEvent.duration === 'string') ? { duration: event.superEvent.duration } : undefined,
|
|
352
352
|
...(event.superEvent.headline !== undefined) ? { headline: event.superEvent.headline } : undefined
|
|
353
|
-
// videoFormatをデータとしても廃止(万が一に備えてUSE_DEPRECATED_VIDEO_FORMATで再設定可能)(2026-02-03~)
|
|
354
|
-
// ...(USE_DEPRECATED_VIDEO_FORMAT)
|
|
355
|
-
// ? {
|
|
356
|
-
// // 現時点で型廃止済だがデータとしては互換性維持(2026-01-15~)
|
|
357
|
-
// videoFormat: (<any>event.superEvent).videoFormat
|
|
358
|
-
// }
|
|
359
|
-
// : undefined
|
|
360
353
|
};
|
|
361
354
|
const reservationFor = {
|
|
362
355
|
typeOf: event.typeOf,
|
|
@@ -25,7 +25,7 @@ declare function processStartReserve4chevre(params: {
|
|
|
25
25
|
acceptedOffers: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail[];
|
|
26
26
|
event: Pick<IMinimizedIndividualEvent, 'id'> & {
|
|
27
27
|
offers?: {
|
|
28
|
-
validForMemberTier?:
|
|
28
|
+
validForMemberTier?: never;
|
|
29
29
|
identifier?: string;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
@@ -121,10 +121,7 @@ function minimizeItemOffered(itemOffered, options) {
|
|
|
121
121
|
}
|
|
122
122
|
function validateCreateRequest(params) {
|
|
123
123
|
return async (repos) => {
|
|
124
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
125
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
126
|
-
id: params.transaction.id
|
|
127
|
-
}, ['agent', 'expires', 'project', 'seller', 'typeOf', 'instrument']);
|
|
124
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.transaction.id }, ['agent', 'expires', 'project', 'seller', 'typeOf', 'instrument']);
|
|
128
125
|
if (transaction.agent.id !== params.agent.id) {
|
|
129
126
|
throw new factory_1.factory.errors.Forbidden('Transaction not yours');
|
|
130
127
|
}
|
|
@@ -63,7 +63,7 @@ function issueEventOfferTicket(params) {
|
|
|
63
63
|
return async (repos) => {
|
|
64
64
|
const { now, audience, eventId, eventOfferId, ticketedOffer, author, project, instrument } = params;
|
|
65
65
|
// 取引は存在するか
|
|
66
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
66
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: audience.id }, ['expires', 'typeOf', 'seller']);
|
|
67
67
|
// イベントは存在するか
|
|
68
68
|
const event = await repos.event.projectEventFieldsById({ id: eventId }, ['project', 'offers', 'identifier']);
|
|
69
69
|
const { seller } = transaction;
|
|
@@ -73,8 +73,6 @@ function issueEventOfferTicket(params) {
|
|
|
73
73
|
typeOf: seller.typeOf,
|
|
74
74
|
...(typeof seller.name.ja === 'string') ? { name: seller.name.ja } : undefined
|
|
75
75
|
};
|
|
76
|
-
// const validForMemberTierToken = ticketedOffer?.validForMemberTier?.token;
|
|
77
|
-
// const validForMemberProgramIdentifier = ticketedOffer?.validForMemberTier?.isTierOf.identifier;
|
|
78
76
|
const authorizationObject = {
|
|
79
77
|
typeOf: factory_1.factory.offerType.Offer,
|
|
80
78
|
itemOffered: {
|
|
@@ -88,15 +86,6 @@ function issueEventOfferTicket(params) {
|
|
|
88
86
|
...(typeof ticketedOffer?.token === 'string' && ticketedOffer.token !== '')
|
|
89
87
|
? { token: ticketedOffer.token }
|
|
90
88
|
: undefined,
|
|
91
|
-
// ...(typeof validForMemberTierToken === 'string' && validForMemberTierToken !== ''
|
|
92
|
-
// && typeof validForMemberProgramIdentifier === 'string' && validForMemberProgramIdentifier !== '')
|
|
93
|
-
// ? {
|
|
94
|
-
// validForMemberTier: {
|
|
95
|
-
// token: validForMemberTierToken,
|
|
96
|
-
// isTierOf: { identifier: validForMemberProgramIdentifier }
|
|
97
|
-
// }
|
|
98
|
-
// }
|
|
99
|
-
// : undefined
|
|
100
89
|
};
|
|
101
90
|
// validations(eventId,eventOfferIdentifier,offerToken...)
|
|
102
91
|
await (0, validateStartRequest_1.validEventOfferByApplicationExists)({
|
|
@@ -115,23 +115,17 @@ function searchTicketOffersByItemOffered(params) {
|
|
|
115
115
|
function searchEventTicketOffersByEvent(params) {
|
|
116
116
|
return async (repos) => {
|
|
117
117
|
const event = params.event;
|
|
118
|
-
let soundFormatTypes = [];
|
|
119
118
|
let videoFormatTypes = [];
|
|
120
119
|
if (event.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
121
|
-
const superEvents = await repos.eventSeries.
|
|
120
|
+
const superEvents = await repos.eventSeries.findEventSeries({
|
|
122
121
|
limit: 1,
|
|
123
122
|
page: 1,
|
|
124
123
|
id: { $eq: event.superEvent.id }
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
// ['soundFormat', 'videoFormat', 'subEvent']
|
|
128
|
-
['soundFormat', 'subEvent']);
|
|
124
|
+
}, ['subEvent']);
|
|
129
125
|
const superEvent = superEvents.shift();
|
|
130
126
|
if (superEvent === undefined) {
|
|
131
127
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEventSeries);
|
|
132
128
|
}
|
|
133
|
-
soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
|
|
134
|
-
// videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
|
|
135
129
|
videoFormatTypes = (Array.isArray(superEvent.subEvent?.videoFormat)) ? superEvent.subEvent.videoFormat : [];
|
|
136
130
|
}
|
|
137
131
|
const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event });
|
|
@@ -155,7 +149,7 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
155
149
|
})(repos);
|
|
156
150
|
const { soundFormatChargeSpecs, videoFormatChargeSpecs, movieTicketTypeChargeSpecs } = await (0, searchPriceSpecs4event_1.searchPriceSpecs4event)({
|
|
157
151
|
project: { id: event.project.id },
|
|
158
|
-
soundFormatTypes,
|
|
152
|
+
soundFormatTypes: [], // 現時点で音響方式区分は存在しない(2026-10-05~),
|
|
159
153
|
videoFormatTypes,
|
|
160
154
|
availableOffers
|
|
161
155
|
})(repos);
|
|
@@ -20,23 +20,17 @@ function searchOfferAppliesToMovieTicket(params) {
|
|
|
20
20
|
return async (repos) => {
|
|
21
21
|
// optimize(2024-07-18~)
|
|
22
22
|
const event = await repos.event.projectEventFieldsById({ id: params.event.id }, ['project', 'startDate', 'typeOf', 'superEvent.id', 'offers.itemOffered.id', 'offers.unacceptedPaymentMethod']);
|
|
23
|
-
// let soundFormatTypes: string[] = [];
|
|
24
23
|
let videoFormatTypes = [];
|
|
25
24
|
if (event.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
26
|
-
const superEvents = await repos.eventSeries.
|
|
25
|
+
const superEvents = await repos.eventSeries.findEventSeries({
|
|
27
26
|
limit: 1,
|
|
28
27
|
page: 1,
|
|
29
28
|
id: { $eq: event.superEvent.id }
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
// ['soundFormat', 'videoFormat', 'subEvent']
|
|
33
|
-
['soundFormat', 'subEvent']);
|
|
29
|
+
}, ['subEvent']);
|
|
34
30
|
const superEvent = superEvents.shift();
|
|
35
31
|
if (superEvent === undefined) {
|
|
36
32
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEventSeries);
|
|
37
33
|
}
|
|
38
|
-
// soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
|
|
39
|
-
// videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
|
|
40
34
|
videoFormatTypes = (Array.isArray(superEvent.subEvent?.videoFormat)) ? superEvent.subEvent.videoFormat : [];
|
|
41
35
|
}
|
|
42
36
|
const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event });
|
|
@@ -101,23 +101,17 @@ function searchTicketOffersByItemOffered(params) {
|
|
|
101
101
|
function searchEventTicketOffersByEvent(params) {
|
|
102
102
|
return async (repos) => {
|
|
103
103
|
const event = params.event;
|
|
104
|
-
let soundFormatTypes = [];
|
|
105
104
|
let videoFormatTypes = [];
|
|
106
105
|
if (event.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
107
|
-
const superEvents = await repos.eventSeries.
|
|
106
|
+
const superEvents = await repos.eventSeries.findEventSeries({
|
|
108
107
|
limit: 1,
|
|
109
108
|
page: 1,
|
|
110
109
|
id: { $eq: event.superEvent.id }
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
// ['soundFormat', 'videoFormat', 'subEvent']
|
|
114
|
-
['soundFormat', 'subEvent']);
|
|
110
|
+
}, ['subEvent']);
|
|
115
111
|
const superEvent = superEvents.shift();
|
|
116
112
|
if (superEvent === undefined) {
|
|
117
113
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEventSeries);
|
|
118
114
|
}
|
|
119
|
-
soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
|
|
120
|
-
// videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
|
|
121
115
|
videoFormatTypes = (Array.isArray(superEvent.subEvent?.videoFormat)) ? superEvent.subEvent.videoFormat : [];
|
|
122
116
|
}
|
|
123
117
|
const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event });
|
|
@@ -142,7 +136,7 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
142
136
|
})(repos);
|
|
143
137
|
const { soundFormatChargeSpecs, videoFormatChargeSpecs, movieTicketTypeChargeSpecs } = await (0, searchPriceSpecs4event_1.searchPriceSpecs4event)({
|
|
144
138
|
project: { id: event.project.id },
|
|
145
|
-
soundFormatTypes,
|
|
139
|
+
soundFormatTypes: [], // 現時点で音響方式区分は存在しない(2026-10-05~)
|
|
146
140
|
videoFormatTypes,
|
|
147
141
|
availableOffers
|
|
148
142
|
})(repos);
|
|
@@ -22,7 +22,7 @@ function voidTransaction(params) {
|
|
|
22
22
|
agent: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
23
23
|
...(typeof params.sameAs?.id === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined
|
|
24
24
|
};
|
|
25
|
-
const transaction = await repos.placeOrder.findPlaceOrderById({
|
|
25
|
+
const transaction = await repos.placeOrder.findPlaceOrderById({ id: params.purpose.id }, ['typeOf', 'status', 'object']);
|
|
26
26
|
// 興行オファー承認アクション検索
|
|
27
27
|
let authorizeActions = await repos.actions.authorizeOffer.findAuthorizeOfferActionsByPurpose({
|
|
28
28
|
// typeOf: factory.actionType.AuthorizeAction,
|
|
@@ -115,10 +115,7 @@ function cancelAcceptActions(params) {
|
|
|
115
115
|
agent: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
116
116
|
...(typeof params.sameAs?.id === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined
|
|
117
117
|
};
|
|
118
|
-
const transaction = await repos.placeOrder.findPlaceOrderById({
|
|
119
|
-
typeOf: params.purpose.typeOf,
|
|
120
|
-
id: params.purpose.id
|
|
121
|
-
}, ['typeOf', 'status']);
|
|
118
|
+
const transaction = await repos.placeOrder.findPlaceOrderById({ id: params.purpose.id }, ['typeOf', 'status']);
|
|
122
119
|
// 興行オファー承認アクション検索
|
|
123
120
|
const completedAuthorizeActions = await repos.actions.authorizeOffer.findAuthorizeOfferActionsByPurpose({
|
|
124
121
|
// typeOf: factory.actionType.AuthorizeAction,
|
|
@@ -19,10 +19,7 @@ function voidTransactionByActionId(params) {
|
|
|
19
19
|
agent: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
20
20
|
...(typeof params.sameAs?.id === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined
|
|
21
21
|
};
|
|
22
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
23
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
24
|
-
id: params.purpose.id
|
|
25
|
-
}, ['typeOf']);
|
|
22
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.purpose.id }, ['typeOf']);
|
|
26
23
|
// if (transaction.agent.id !== params.agent.id) {
|
|
27
24
|
// throw new factory.errors.Forbidden('Transaction not yours');
|
|
28
25
|
// }
|
|
@@ -12,7 +12,6 @@ function findCOAInfo(params) {
|
|
|
12
12
|
project: { id: { $eq: params.project.id } },
|
|
13
13
|
limit: 1,
|
|
14
14
|
page: 1,
|
|
15
|
-
typeOf: factory_1.factory.eventType.ScreeningEvent,
|
|
16
15
|
id: { $eq: params.id }
|
|
17
16
|
}, ['coaInfo'])).shift();
|
|
18
17
|
if (event === undefined) {
|
|
@@ -33,10 +32,7 @@ function acceptOffer(params) {
|
|
|
33
32
|
if (typeof params.sameAs.id !== 'string' || params.sameAs.id === '') {
|
|
34
33
|
throw new factory_1.factory.errors.ArgumentNull('sameAs.id');
|
|
35
34
|
}
|
|
36
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
37
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
38
|
-
id: params.purpose.id
|
|
39
|
-
}, ['project', 'agent', 'typeOf']);
|
|
35
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.purpose.id }, ['project', 'agent', 'typeOf']);
|
|
40
36
|
// // 注文ドキュメントを参照(2026-06-24~)
|
|
41
37
|
// const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
42
38
|
// identifier: transaction.id,
|
|
@@ -118,10 +114,7 @@ function reAcceptOffer(params) {
|
|
|
118
114
|
if (typeof params.potentialActions?.id !== 'string' || params.potentialActions.id === '') {
|
|
119
115
|
throw new factory_1.factory.errors.ArgumentNull('potentialActions.id');
|
|
120
116
|
}
|
|
121
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
122
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
123
|
-
id: params.purpose.id
|
|
124
|
-
}, ['project', 'agent', 'typeOf']);
|
|
117
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.purpose.id }, ['project', 'agent', 'typeOf']);
|
|
125
118
|
// const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: transaction.id });
|
|
126
119
|
// if (typeof orderNumber !== 'string') {
|
|
127
120
|
// // 事前に発行されているはず
|
|
@@ -22,7 +22,7 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
22
22
|
export declare function offers2resultPrice(offers: IAcceptedOffer4COA[]): {
|
|
23
23
|
price: number;
|
|
24
24
|
};
|
|
25
|
-
type IResultAcceptedOffer = factory.
|
|
25
|
+
type IResultAcceptedOffer = factory.acceptedOffer.ICOAAcceptedOffer;
|
|
26
26
|
/**
|
|
27
27
|
* COA仮予約結果から注文アイテムを生成する
|
|
28
28
|
*/
|
|
@@ -104,13 +104,6 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
104
104
|
workPerformed: workPerformed,
|
|
105
105
|
duration: event.superEvent.duration,
|
|
106
106
|
coaInfo: event.superEvent.coaInfo
|
|
107
|
-
// videoFormatをデータとしても廃止(万が一に備えてUSE_DEPRECATED_VIDEO_FORMATで再設定可能)(2026-02-03~)
|
|
108
|
-
// ...(USE_DEPRECATED_VIDEO_FORMAT)
|
|
109
|
-
// ? {
|
|
110
|
-
// // 現時点で型廃止済だがデータとしては互換性維持(2026-01-15~)
|
|
111
|
-
// videoFormat: (<any>event.superEvent).videoFormat
|
|
112
|
-
// }
|
|
113
|
-
// : undefined
|
|
114
107
|
};
|
|
115
108
|
const reservationFor = {
|
|
116
109
|
typeOf: event.typeOf,
|
|
@@ -14,10 +14,7 @@ const factory_2 = require("../../../factory");
|
|
|
14
14
|
*/
|
|
15
15
|
function authorize(params) {
|
|
16
16
|
return async (repos) => {
|
|
17
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
18
|
-
typeOf: factory_2.factory.transactionType.PlaceOrder,
|
|
19
|
-
id: params.transaction.id
|
|
20
|
-
}, ['agent', 'project', 'seller', 'typeOf', 'instrument']);
|
|
17
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.transaction.id }, ['agent', 'project', 'seller', 'typeOf', 'instrument']);
|
|
21
18
|
if (transaction.agent.id !== params.agent.id) {
|
|
22
19
|
throw new factory_2.factory.errors.Forbidden('Transaction not yours');
|
|
23
20
|
}
|
|
@@ -14,10 +14,7 @@ const factory_2 = require("../../../factory");
|
|
|
14
14
|
*/
|
|
15
15
|
function changeOffers(params) {
|
|
16
16
|
return async (repos) => {
|
|
17
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
18
|
-
typeOf: factory_2.factory.transactionType.PlaceOrder,
|
|
19
|
-
id: params.transaction.id
|
|
20
|
-
}, ['typeOf', 'agent', 'project', 'seller']);
|
|
17
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.transaction.id }, ['typeOf', 'agent', 'project', 'seller']);
|
|
21
18
|
if (transaction.agent.id !== params.agent.id) {
|
|
22
19
|
throw new factory_2.factory.errors.Forbidden('Transaction not yours');
|
|
23
20
|
}
|
|
@@ -66,7 +66,7 @@ function syncEventSeries2screeningEvents(params) {
|
|
|
66
66
|
return async (repos) => {
|
|
67
67
|
const now = new Date();
|
|
68
68
|
for (const eventSeriesId of params.ids) {
|
|
69
|
-
const superEvents = await repos.eventSeries.
|
|
69
|
+
const superEvents = await repos.eventSeries.findEventSeries({
|
|
70
70
|
limit: 1,
|
|
71
71
|
page: 1,
|
|
72
72
|
// typeOf: factory.eventType.ScreeningEventSeries,
|
|
@@ -75,8 +75,7 @@ function syncEventSeries2screeningEvents(params) {
|
|
|
75
75
|
}, [
|
|
76
76
|
'additionalProperty', 'alternativeHeadline', 'description', 'dubLanguage',
|
|
77
77
|
'endDate', 'headline', 'kanaName', 'location', 'name',
|
|
78
|
-
'
|
|
79
|
-
// 'videoFormat', // 参照廃止(2026-02-10~)
|
|
78
|
+
'startDate', 'subtitleLanguage', 'typeOf',
|
|
80
79
|
'workPerformed'
|
|
81
80
|
]);
|
|
82
81
|
const superEventFromDB = superEvents.shift();
|
|
@@ -101,8 +100,7 @@ function createInformTasks(params, setting) {
|
|
|
101
100
|
const informEvents = setting?.onResourceUpdated?.informResource;
|
|
102
101
|
if (params.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
103
102
|
const screeningEvents4inform = await repos.event.projectEventFields({
|
|
104
|
-
id: { $in: params.ids }
|
|
105
|
-
typeOf: params.typeOf
|
|
103
|
+
id: { $in: params.ids }
|
|
106
104
|
}, [
|
|
107
105
|
'project', 'organizer', 'typeOf', 'name', 'doorTime', 'endDate',
|
|
108
106
|
'eventStatus', 'location', 'startDate', 'superEvent', 'offers', 'additionalProperty', 'identifier'
|
|
@@ -118,9 +116,6 @@ function createInformTasks(params, setting) {
|
|
|
118
116
|
validFrom: eventSellerMakesOffer.validFrom,
|
|
119
117
|
validThrough: eventSellerMakesOffer.validThrough,
|
|
120
118
|
availableAtOrFrom: [eventSellerMakesOffer.availableAtOrFrom],
|
|
121
|
-
...(typeof eventSellerMakesOffer.identifier === 'string')
|
|
122
|
-
? { identifier: eventSellerMakesOffer.identifier }
|
|
123
|
-
: undefined // support notify identifier(2025-11-01~)
|
|
124
119
|
};
|
|
125
120
|
})
|
|
126
121
|
: [];
|
|
@@ -163,25 +158,21 @@ function createInformTasks(params, setting) {
|
|
|
163
158
|
});
|
|
164
159
|
}
|
|
165
160
|
else {
|
|
166
|
-
const screeningEventSeries4inform = await repos.eventSeries.
|
|
161
|
+
const screeningEventSeries4inform = await repos.eventSeries.findEventSeries({
|
|
167
162
|
id: { $in: params.ids }
|
|
168
163
|
// typeOf: params.typeOf
|
|
169
164
|
}, [
|
|
170
|
-
'project', 'organizer', 'typeOf', 'name', 'location', '
|
|
165
|
+
'project', 'organizer', 'typeOf', 'name', 'location', 'workPerformed', 'kanaName', 'eventStatus',
|
|
171
166
|
'endDate', 'startDate', 'additionalProperty', 'subtitleLanguage', 'dubLanguage',
|
|
172
167
|
'alternativeHeadline', 'description', 'duration', 'headline', 'subEvent'
|
|
173
168
|
] // inclusion(2024-07-30~)
|
|
174
169
|
);
|
|
175
170
|
// 最適化(2024-03-25~)
|
|
176
|
-
events4inform = screeningEventSeries4inform.map(({ project, organizer, typeOf, name, location, id,
|
|
171
|
+
events4inform = screeningEventSeries4inform.map(({ project, organizer, typeOf, name, location, id, workPerformed, kanaName, eventStatus, endDate, startDate, additionalProperty, subtitleLanguage, dubLanguage, alternativeHeadline, description, duration, headline, subEvent }) => {
|
|
177
172
|
return {
|
|
178
|
-
project, organizer, typeOf, name, location, id,
|
|
173
|
+
project, organizer, typeOf, name, location, id, workPerformed, kanaName, eventStatus,
|
|
179
174
|
endDate, startDate,
|
|
180
|
-
videoFormat: (Array.isArray(subEvent?.videoFormat))
|
|
181
|
-
? subEvent.videoFormat.map((codeValue) => ({ typeOf: codeValue, name: codeValue }))
|
|
182
|
-
: [],
|
|
183
|
-
// ...(endDate !== undefined) ? { endDate } : undefined,
|
|
184
|
-
// ...(startDate !== undefined) ? { startDate } : undefined,
|
|
175
|
+
videoFormat: (Array.isArray(subEvent?.videoFormat)) ? subEvent.videoFormat : [], // videoFormat通知をstring[]に変更(2026-10-07~)
|
|
185
176
|
...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
|
|
186
177
|
...(subtitleLanguage !== undefined) ? {} : undefined,
|
|
187
178
|
...(dubLanguage !== undefined) ? { dubLanguage } : undefined,
|
|
@@ -198,8 +189,6 @@ function createInformTasks(params, setting) {
|
|
|
198
189
|
informEvents?.forEach((informEvent) => {
|
|
199
190
|
const informUrl = String(informEvent.recipient?.url);
|
|
200
191
|
events4inform.forEach((event4inform) => {
|
|
201
|
-
// _idは不要であり、存在すると予期せぬ影響を及ぼす可能性がある
|
|
202
|
-
delete event4inform._id; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
203
192
|
const informActionAttributes = {
|
|
204
193
|
object: event4inform,
|
|
205
194
|
recipient: {
|
|
@@ -296,8 +285,7 @@ function syncEventEndDate2pendingReservations(params) {
|
|
|
296
285
|
const events = await repos.event.projectEventFields({
|
|
297
286
|
limit: 1,
|
|
298
287
|
page: 1,
|
|
299
|
-
id: { $eq: eventId }
|
|
300
|
-
typeOf: params.typeOf
|
|
288
|
+
id: { $eq: eventId }
|
|
301
289
|
}, ['endDate']);
|
|
302
290
|
const endDate = events.shift()?.endDate;
|
|
303
291
|
if (endDate instanceof Date) {
|
|
@@ -169,8 +169,7 @@ function findEventSeatOffersBySection(params) {
|
|
|
169
169
|
page: 1,
|
|
170
170
|
project: { id: { $eq: projectId } },
|
|
171
171
|
organizer: { id: { $eq: sellerId } },
|
|
172
|
-
id: { $eq: eventId }
|
|
173
|
-
typeOf: factory_1.factory.eventType.ScreeningEvent
|
|
172
|
+
id: { $eq: eventId }
|
|
174
173
|
}, ['startDate', 'offers.itemOffered', 'location', 'superEvent'])).shift();
|
|
175
174
|
if (event === undefined) {
|
|
176
175
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEvent);
|
package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { factory } from '../../../../factory';
|
|
2
2
|
import type { ISetting } from '../../../../repo/setting';
|
|
3
3
|
type IInTransitOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'project' | 'typeOf' | 'seller' | 'orderNumber' | 'price' | 'priceCurrency' | 'orderDate' | 'customer' | 'id'> & {
|
|
4
|
+
/**
|
|
5
|
+
* 何ページ目の配送か
|
|
6
|
+
*/
|
|
4
7
|
acceptedOffers: {
|
|
5
8
|
limit: number;
|
|
6
9
|
page: number;
|
|
7
10
|
};
|
|
8
|
-
deliveredAcceptedOffers:
|
|
9
|
-
/**
|
|
10
|
-
* COA以外では注文ドキュメントにpriceSpecificationが存在しないのでIFを補完
|
|
11
|
-
*/
|
|
12
|
-
priceSpecification?: factory.order.ITicketPriceSpecification;
|
|
13
|
-
})[];
|
|
11
|
+
deliveredAcceptedOffers: Pick<factory.acceptedOffer.IAcceptedOffer, 'priceSpecification' | 'id' | 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'typeOf'>[];
|
|
14
12
|
orderStatus: factory.orderStatus.OrderInTransit;
|
|
15
13
|
};
|
|
16
14
|
declare function createInformTasks(params: {
|
|
@@ -4,11 +4,30 @@ exports.createInformTasks = createInformTasks;
|
|
|
4
4
|
exports.createNextSendOrderTasks = createNextSendOrderTasks;
|
|
5
5
|
const factory_1 = require("../../../../factory");
|
|
6
6
|
function creteOrder4inform(order) {
|
|
7
|
+
const { deliveredAcceptedOffers, project, typeOf, orderNumber } = order;
|
|
8
|
+
const acceptedOffers = deliveredAcceptedOffers.map((acceptedOffer) => {
|
|
9
|
+
if (acceptedOffer.offeredThrough?.identifier === factory_1.factory.service.webAPI.Identifier.COA) {
|
|
10
|
+
// COAでは最小化しない
|
|
11
|
+
return acceptedOffer;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
const { itemOffered, ...acceptedOfferWithtoutItemOffered } = acceptedOffer;
|
|
15
|
+
const { reservationFor, issuedThrough: _issuedThrough, programMembershipUsed: _programMembershipUsed, ...itemOfferedWithoutReservationFor } = itemOffered;
|
|
16
|
+
const itemOffered4inform = {
|
|
17
|
+
...itemOfferedWithoutReservationFor,
|
|
18
|
+
reservationFor: { id: reservationFor.id, typeOf: reservationFor.typeOf } // minimize reservationFor(2026-09-28~)
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
...acceptedOfferWithtoutItemOffered,
|
|
22
|
+
itemOffered: itemOffered4inform
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
7
26
|
return {
|
|
8
|
-
project
|
|
9
|
-
typeOf
|
|
10
|
-
orderNumber
|
|
11
|
-
acceptedOffers
|
|
27
|
+
project,
|
|
28
|
+
typeOf,
|
|
29
|
+
orderNumber,
|
|
30
|
+
acceptedOffers,
|
|
12
31
|
orderStatus: factory_1.factory.orderStatus.OrderInTransit,
|
|
13
32
|
// ↓hub側で使用している可能性もあるので念のため
|
|
14
33
|
...(typeof order.id === 'string') ? { id: order.id } : undefined
|
|
@@ -3,7 +3,7 @@ import { factory } from '../../../../factory';
|
|
|
3
3
|
import { IProcessingOrder } from './factory';
|
|
4
4
|
declare function processOrder(params: {
|
|
5
5
|
order: Pick<IProcessingOrder, 'confirmationNumber' | 'orderDate' | 'orderNumber' | 'project' | 'typeOf'> & {
|
|
6
|
-
itemOfferedTypeOf: factory.
|
|
6
|
+
itemOfferedTypeOf: factory.reservationType.EventReservation;
|
|
7
7
|
serialNumbers: string[];
|
|
8
8
|
offeredThroughIdentifier?: factory.service.webAPI.Identifier;
|
|
9
9
|
};
|
|
@@ -7,7 +7,7 @@ import { IExternalOrder, IProcessingOrder } from './onOrderProcessing/factory';
|
|
|
7
7
|
import { processOrder } from './onOrderProcessing/processOrder';
|
|
8
8
|
declare function onOrderProcessing(params: {
|
|
9
9
|
order: IProcessingOrder & {
|
|
10
|
-
itemOfferedTypeOf: factory.
|
|
10
|
+
itemOfferedTypeOf: factory.reservationType.EventReservation;
|
|
11
11
|
serialNumbers: string[];
|
|
12
12
|
offeredThroughIdentifier?: factory.service.webAPI.Identifier;
|
|
13
13
|
};
|
|
@@ -3,6 +3,6 @@ import { factory } from '../../../../factory';
|
|
|
3
3
|
* 受入オファーを注文アイテムに変換する
|
|
4
4
|
*/
|
|
5
5
|
declare function acceptedOffers2orderedItem(params: {
|
|
6
|
-
eventReservationAcceptedOffers: Pick<factory.
|
|
6
|
+
eventReservationAcceptedOffers: Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered'>[];
|
|
7
7
|
}): factory.order.IOrderedItem[];
|
|
8
8
|
export { acceptedOffers2orderedItem };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IPlacingOrder } from '../../../repo/orderInTransaction';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
3
|
type IPlaceOrderTransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'project' | 'typeOf' | 'result' | 'object' | 'seller'>;
|
|
4
|
-
type IOrderAcceptedOffer = Pick<factory.
|
|
4
|
+
type IOrderAcceptedOffer = Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered' | 'serialNumber'>;
|
|
5
5
|
declare function createPaymentMethods(params: {
|
|
6
6
|
authorizePaymentActions: Pick<factory.action.authorize.paymentMethod.any.IAction, 'result'>[];
|
|
7
7
|
}): {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendOrder = sendOrder;
|
|
4
|
-
// import { createOwnershipInfosFromOrder } from '../delivery/factory';
|
|
5
4
|
const onOrderStatusChanged_1 = require("./onOrderStatusChanged");
|
|
6
5
|
const factory_1 = require("../../factory");
|
|
7
6
|
/**
|
|
@@ -61,26 +60,15 @@ function sendOrder(params) {
|
|
|
61
60
|
const action = await repos.actions.sendOrder.start(sendOrderActionAttributes);
|
|
62
61
|
let allOffersDelivered = false;
|
|
63
62
|
let acceptedOffers;
|
|
64
|
-
// 所有権管理はひとまず廃止(2026-08-10~)
|
|
65
|
-
// // 所有権生成を最小化(2024-03-01~)
|
|
66
|
-
// let createOwnerships = false;
|
|
67
|
-
// switch (order.customer.typeOf) {
|
|
68
|
-
// case factory.personType.Person:
|
|
69
|
-
// createOwnerships = true; // Personのみに限定(2026-03-15~)
|
|
70
|
-
// break;
|
|
71
|
-
// default:
|
|
72
|
-
// }
|
|
73
63
|
try {
|
|
74
64
|
const offerIndexBase = (limit * (page - 1));
|
|
75
|
-
const
|
|
65
|
+
const { partialAcceptedOffers } = await repos.acceptedOffer.findPartialAcceptedOffersByOrderNumber({
|
|
76
66
|
$slice: [offerIndexBase, limit],
|
|
77
67
|
orderNumber: { $eq: order.orderNumber },
|
|
78
68
|
project: { id: { $eq: order.project.id } }
|
|
79
69
|
});
|
|
80
|
-
acceptedOffers =
|
|
70
|
+
acceptedOffers = partialAcceptedOffers;
|
|
81
71
|
// 所有権管理はひとまず廃止(2026-08-10~)
|
|
82
|
-
// if (createOwnerships) {
|
|
83
|
-
// }
|
|
84
72
|
if (acceptedOffers.length === 0) {
|
|
85
73
|
order = await repos.order.changeStatus({
|
|
86
74
|
project: { id: order.project.id },
|
|
@@ -59,7 +59,7 @@ function authorize(params) {
|
|
|
59
59
|
if (purpose.typeOf !== factory_1.factory.transactionType.PlaceOrder) {
|
|
60
60
|
throw new factory_1.factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
|
|
61
61
|
}
|
|
62
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
62
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
|
|
63
63
|
if (project.id !== transaction.project.id) {
|
|
64
64
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
|
|
65
65
|
}
|
|
@@ -12,10 +12,7 @@ function invalidatePaymentUrl(params) {
|
|
|
12
12
|
if (params.purpose.typeOf !== factory_1.factory.transactionType.PlaceOrder) {
|
|
13
13
|
throw new factory_1.factory.errors.Argument('purpose.typeOf', `must be ${factory_1.factory.transactionType.PlaceOrder}`);
|
|
14
14
|
}
|
|
15
|
-
const transaction = await repos.placeOrder.findPlaceOrderById({
|
|
16
|
-
typeOf: params.purpose.typeOf,
|
|
17
|
-
id: params.purpose.id
|
|
18
|
-
}, ['typeOf', 'status', 'object', 'project', 'seller', 'agent']);
|
|
15
|
+
const transaction = await repos.placeOrder.findPlaceOrderById({ id: params.purpose.id }, ['typeOf', 'status', 'object', 'project', 'seller', 'agent']);
|
|
19
16
|
// const orderCancelled: boolean = params.purpose.result?.order?.orderStatus === factory.orderStatus.OrderCancelled;
|
|
20
17
|
// if (transaction.status === factory.transactionStatusType.Confirmed) {
|
|
21
18
|
// if (!orderCancelled) {
|
|
@@ -50,10 +50,10 @@ function processVoidPayTransaction(params) {
|
|
|
50
50
|
let transaction;
|
|
51
51
|
// アクションID指定の場合、進行中取引検証(2023-02-24~)
|
|
52
52
|
if (typeof params.id === 'string') {
|
|
53
|
-
transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
53
|
+
transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.purpose.id }, ['typeOf', 'status']);
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
transaction = await repos.placeOrder.findPlaceOrderById({
|
|
56
|
+
transaction = await repos.placeOrder.findPlaceOrderById({ id: params.purpose.id }, ['typeOf', 'status', 'result']);
|
|
57
57
|
}
|
|
58
58
|
// 承認アクションを取得
|
|
59
59
|
let authorizeActions;
|
|
@@ -48,7 +48,7 @@ function publishPaymentUrl(params) {
|
|
|
48
48
|
throw new factory_1.factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
|
|
49
49
|
}
|
|
50
50
|
try {
|
|
51
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
51
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: purpose.id }, ['expires', 'seller', 'project']);
|
|
52
52
|
if (project.id !== transaction.project.id) {
|
|
53
53
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
|
|
54
54
|
}
|
|
@@ -6,7 +6,7 @@ function getGMOInfoFromSeller(params) {
|
|
|
6
6
|
return async (repos) => {
|
|
7
7
|
if (params.requirePaymentAccepted) {
|
|
8
8
|
const paymentAccepted = await repos.paymentAccepted.isAcceptedBySeller({
|
|
9
|
-
|
|
9
|
+
sellerId: params.seller.id,
|
|
10
10
|
codeValue: params.paymentMethodType
|
|
11
11
|
});
|
|
12
12
|
if (paymentAccepted !== true) {
|