@chevre/domain 28.0.0-alpha.18 → 28.0.0-alpha.19
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/acceptedOffer.d.ts +3 -3
- package/lib/chevre/repo/acceptedOffer.js +14 -9
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +2 -2
- package/lib/chevre/repo/adminTask.d.ts +2 -2
- package/lib/chevre/repo/adminTransaction.d.ts +15 -15
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +21 -1
- 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/place/screeningRoom.d.ts +2 -2
- package/lib/chevre/repo/priceSpecification.d.ts +8 -8
- package/lib/chevre/repo/seller.d.ts +2 -2
- package/lib/chevre/repo/task.d.ts +3 -3
- package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -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/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -6
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +24 -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/factory/createPayObjectServiceOutput.d.ts +3 -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 +0 -5
- package/lib/chevre/service/transaction/returnOrder/preStart/factory.d.ts +1 -1
- package/package.json +2 -2
- package/lib/chevre/service/delivery/factory.d.ts +0 -16
- package/lib/chevre/service/delivery/factory.js +0 -124
|
@@ -2,8 +2,7 @@ import type { Connection } from 'mongoose';
|
|
|
2
2
|
import { AcceptedOfferInReserveRepo, IAcceptedOffer } from './acceptedOfferInReserve';
|
|
3
3
|
type IDistinctField = 'acceptedOffers.id' | 'acceptedOffers.itemOffered.reservationNumber' | 'acceptedOffers.itemOffered.reservationFor.id' | 'acceptedOffers.serialNumber' | 'acceptedOffers.offeredThrough.identifier' | 'acceptedOffers.itemOffered.reservationFor.superEvent.location.branchCode';
|
|
4
4
|
interface ISearchSlicedAcceptedOffersResult {
|
|
5
|
-
|
|
6
|
-
numAcceptedOffers: number;
|
|
5
|
+
partialAcceptedOffers: Pick<IAcceptedOffer, 'id' | 'itemOffered' | 'offeredThrough' | 'priceSpecification' | 'serialNumber' | 'typeOf'>[];
|
|
7
6
|
}
|
|
8
7
|
/**
|
|
9
8
|
* 注文オファーリポジトリ
|
|
@@ -44,8 +43,9 @@ export declare class AcceptedOfferRepo extends AcceptedOfferInReserveRepo {
|
|
|
44
43
|
}): Promise<Pick<IAcceptedOffer, 'id' | 'itemOffered' | 'offeredThrough' | 'priceSpecification' | 'serialNumber' | 'typeOf'>[]>;
|
|
45
44
|
/**
|
|
46
45
|
* 注文オファーをsliceして検索する(2024-01-10~)
|
|
46
|
+
* 注文通知に渡すオファーを参照するためにのみ使用
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
findPartialAcceptedOffersByOrderNumber(filter: {
|
|
49
49
|
$slice: [number, number];
|
|
50
50
|
orderNumber: {
|
|
51
51
|
$eq: string;
|
|
@@ -69,17 +69,22 @@ class AcceptedOfferRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveR
|
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* 注文オファーをsliceして検索する(2024-01-10~)
|
|
72
|
+
* 注文通知に渡すオファーを参照するためにのみ使用
|
|
72
73
|
*/
|
|
73
|
-
async
|
|
74
|
+
async findPartialAcceptedOffersByOrderNumber(filter) {
|
|
74
75
|
const aggregate = this.orderModel.aggregate([
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
{
|
|
77
|
+
$match: {
|
|
78
|
+
orderNumber: { $eq: filter.orderNumber.$eq },
|
|
79
|
+
'project.id': { $eq: filter.project.id.$eq },
|
|
80
|
+
typeOf: { $eq: factory_1.factory.order.OrderType.Order }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
78
83
|
{
|
|
79
84
|
$project: {
|
|
80
85
|
_id: 0,
|
|
81
|
-
|
|
82
|
-
numAcceptedOffers: { $size: '$acceptedOffers' }
|
|
86
|
+
partialAcceptedOffers: { $slice: ['$acceptedOffers', ...filter.$slice] },
|
|
87
|
+
// numAcceptedOffers: { $size: '$acceptedOffers' }
|
|
83
88
|
}
|
|
84
89
|
}
|
|
85
90
|
]);
|
|
@@ -89,11 +94,11 @@ class AcceptedOfferRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveR
|
|
|
89
94
|
if (result === undefined) {
|
|
90
95
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.order.OrderType.Order);
|
|
91
96
|
}
|
|
92
|
-
const {
|
|
97
|
+
const { partialAcceptedOffers } = result;
|
|
93
98
|
// 予約取引を参照(2026-05-18~)
|
|
94
99
|
return {
|
|
95
|
-
|
|
96
|
-
numAcceptedOffers
|
|
100
|
+
partialAcceptedOffers: await this.addAcceptedOffersDetails(partialAcceptedOffers),
|
|
101
|
+
// numAcceptedOffers
|
|
97
102
|
};
|
|
98
103
|
}
|
|
99
104
|
async countByOrderNumber(filter) {
|
|
@@ -2,11 +2,11 @@ import type { Connection } from 'mongoose';
|
|
|
2
2
|
import { factory } from '../factory';
|
|
3
3
|
import { IModel } from './mongoose/schemas/assetTransaction';
|
|
4
4
|
import { IAcceptedOfferByReserveTransaction } from './factory/acceptedOffer/reserveTransaction2itemOffered';
|
|
5
|
-
export type IAcceptedOffer = Pick<factory.
|
|
5
|
+
export type IAcceptedOffer = Pick<factory.acceptedOffer.IAcceptedOffer, 'id' | 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'typeOf'> & {
|
|
6
6
|
/**
|
|
7
7
|
* COA以外では注文ドキュメントにpriceSpecificationが存在しないのでIFを補完
|
|
8
8
|
*/
|
|
9
|
-
priceSpecification?: factory.
|
|
9
|
+
priceSpecification?: factory.acceptedOffer.ITicketPriceSpecification;
|
|
10
10
|
name?: never;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
@@ -33,13 +33,13 @@ export declare class AdminTaskRepo {
|
|
|
33
33
|
}): Promise<{
|
|
34
34
|
count: number;
|
|
35
35
|
}>;
|
|
36
|
-
getCursor(conditions: FilterQuery<factory.task.ITask<factory.taskName>>, projection: ProjectionType<factory.task.ITask<factory.taskName>>): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<import("@chevre/factory/lib/chevre/task").ITask | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/createAccountingReport").ITask | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/chevre/task/onEventChanged").ITask | import("@chevre/factory/lib/chevre/task/onResourceDeleted").ITask | import("@chevre/factory/lib/chevre/task/onResourceUpdated").ITask | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/chevre/task/placeOrder").ITask | import("@chevre/factory/lib/chevre/task/returnOrder").ITask | import("@chevre/factory/lib/chevre/task/returnPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/sendEmailMessage").ITask | import("@chevre/factory/lib/chevre/task/sendOrder").ITask | import("@chevre/factory/lib/chevre/task/triggerWebhook").ITask | import("@chevre/factory/lib/chevre/task/useReservation").ITask | import("@chevre/factory/lib/chevre/task/voidPayTransaction").ITask, "
|
|
36
|
+
getCursor(conditions: FilterQuery<factory.task.ITask<factory.taskName>>, projection: ProjectionType<factory.task.ITask<factory.taskName>>): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<import("@chevre/factory/lib/chevre/task").ITask | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/createAccountingReport").ITask | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/chevre/task/onEventChanged").ITask | import("@chevre/factory/lib/chevre/task/onResourceDeleted").ITask | import("@chevre/factory/lib/chevre/task/onResourceUpdated").ITask | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/chevre/task/placeOrder").ITask | import("@chevre/factory/lib/chevre/task/returnOrder").ITask | import("@chevre/factory/lib/chevre/task/returnPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/sendEmailMessage").ITask | import("@chevre/factory/lib/chevre/task/sendOrder").ITask | import("@chevre/factory/lib/chevre/task/triggerWebhook").ITask | import("@chevre/factory/lib/chevre/task/useReservation").ITask | import("@chevre/factory/lib/chevre/task/voidPayTransaction").ITask, "identifier" | "name" | "description" | "project" | "data" | "status" | "runsAt" | "dateAborted" | "executionResults" | "executor" | "lastTriedAt" | "remainingNumberOfTries" | "numberOfTried"> & {
|
|
37
37
|
expires?: never;
|
|
38
38
|
} & {
|
|
39
39
|
_id: import("mongoose").Types.ObjectId;
|
|
40
40
|
} & {
|
|
41
41
|
__v: number;
|
|
42
|
-
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<import("@chevre/factory/lib/chevre/task").ITask | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/createAccountingReport").ITask | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/chevre/task/onEventChanged").ITask | import("@chevre/factory/lib/chevre/task/onResourceDeleted").ITask | import("@chevre/factory/lib/chevre/task/onResourceUpdated").ITask | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/chevre/task/placeOrder").ITask | import("@chevre/factory/lib/chevre/task/returnOrder").ITask | import("@chevre/factory/lib/chevre/task/returnPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/sendEmailMessage").ITask | import("@chevre/factory/lib/chevre/task/sendOrder").ITask | import("@chevre/factory/lib/chevre/task/triggerWebhook").ITask | import("@chevre/factory/lib/chevre/task/useReservation").ITask | import("@chevre/factory/lib/chevre/task/voidPayTransaction").ITask, "
|
|
42
|
+
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<import("@chevre/factory/lib/chevre/task").ITask | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/createAccountingReport").ITask | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/chevre/task/onEventChanged").ITask | import("@chevre/factory/lib/chevre/task/onResourceDeleted").ITask | import("@chevre/factory/lib/chevre/task/onResourceUpdated").ITask | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/chevre/task/placeOrder").ITask | import("@chevre/factory/lib/chevre/task/returnOrder").ITask | import("@chevre/factory/lib/chevre/task/returnPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/sendEmailMessage").ITask | import("@chevre/factory/lib/chevre/task/sendOrder").ITask | import("@chevre/factory/lib/chevre/task/triggerWebhook").ITask | import("@chevre/factory/lib/chevre/task/useReservation").ITask | import("@chevre/factory/lib/chevre/task/voidPayTransaction").ITask, "identifier" | "name" | "description" | "project" | "data" | "status" | "runsAt" | "dateAborted" | "executionResults" | "executor" | "lastTriedAt" | "remainingNumberOfTries" | "numberOfTried"> & {
|
|
43
43
|
expires?: never;
|
|
44
44
|
} & {
|
|
45
45
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -52,26 +52,26 @@ export declare class AdminTransactionRepo {
|
|
|
52
52
|
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
53
53
|
getCursor(conditions: any, projection: any, sort?: factory.sortType): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, {
|
|
54
54
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
55
|
+
endDate?: Date | undefined;
|
|
56
|
+
startDate: Date;
|
|
57
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
55
58
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
56
59
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
57
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
58
60
|
expires: Date;
|
|
59
61
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
60
|
-
startDate: Date;
|
|
61
|
-
endDate?: Date | undefined;
|
|
62
62
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
63
63
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
64
64
|
status: factory.transactionStatusType;
|
|
65
65
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
66
66
|
}, import("./mongoose/virtuals").IVirtuals, {}> & {
|
|
67
67
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
68
|
+
endDate?: Date | undefined;
|
|
69
|
+
startDate: Date;
|
|
70
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
68
71
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
69
72
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
70
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
71
73
|
expires: Date;
|
|
72
74
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
73
|
-
startDate: Date;
|
|
74
|
-
endDate?: Date | undefined;
|
|
75
75
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
76
76
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
77
77
|
status: factory.transactionStatusType;
|
|
@@ -82,39 +82,39 @@ export declare class AdminTransactionRepo {
|
|
|
82
82
|
__v: number;
|
|
83
83
|
}, import("mongoose").QueryOptions<{
|
|
84
84
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
85
|
+
endDate?: Date | undefined;
|
|
86
|
+
startDate: Date;
|
|
87
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
85
88
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
86
89
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
87
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
88
90
|
expires: Date;
|
|
89
91
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
90
|
-
startDate: Date;
|
|
91
|
-
endDate?: Date | undefined;
|
|
92
92
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
93
93
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
94
94
|
status: factory.transactionStatusType;
|
|
95
95
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
96
96
|
}>, (import("mongoose").Document<unknown, Record<string, never>, {
|
|
97
97
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
98
|
+
endDate?: Date | undefined;
|
|
99
|
+
startDate: Date;
|
|
100
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
98
101
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
99
102
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
100
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
101
103
|
expires: Date;
|
|
102
104
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
103
|
-
startDate: Date;
|
|
104
|
-
endDate?: Date | undefined;
|
|
105
105
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
106
106
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
107
107
|
status: factory.transactionStatusType;
|
|
108
108
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
109
109
|
}, import("./mongoose/virtuals").IVirtuals, {}> & {
|
|
110
110
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
111
|
+
endDate?: Date | undefined;
|
|
112
|
+
startDate: Date;
|
|
113
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
111
114
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
112
115
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
113
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
114
116
|
expires: Date;
|
|
115
117
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
116
|
-
startDate: Date;
|
|
117
|
-
endDate?: Date | undefined;
|
|
118
118
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
119
119
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
120
120
|
status: factory.transactionStatusType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
|
-
type IAcceptedOfferByReserveTransaction = Pick<factory.
|
|
2
|
+
type IAcceptedOfferByReserveTransaction = Pick<factory.acceptedOffer.IOptimizedAcceptedOffer, 'itemOffered' | 'priceSpecification' | 'name'>;
|
|
3
3
|
/**
|
|
4
4
|
* 予約取引を注文のitemOfferedへ変換する
|
|
5
5
|
*/
|
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
+
export type IMinimizedReservationFor = Pick<factory.acceptedOffer.IEventAsReservationFor, 'endDate' | 'id' | 'startDate' | 'typeOf'> & {
|
|
5
|
+
location: Pick<factory.acceptedOffer.IEventAsReservationFor['location'], 'branchCode' | 'typeOf'>;
|
|
6
|
+
superEvent: Pick<factory.acceptedOffer.ISuperEvent, 'id' | 'typeOf'> & {
|
|
7
|
+
location: Pick<factory.acceptedOffer.ISuperEvent['location'], 'branchCode' | 'typeOf'>;
|
|
8
|
+
workPerformed: Pick<factory.acceptedOffer.ISuperEvent['workPerformed'], 'identifier' | 'typeOf'>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type IMinimizedItemOffered = Pick<factory.acceptedOffer.IEventReservation, 'id' | 'reservationNumber' | 'typeOf'> & {
|
|
12
|
+
/**
|
|
13
|
+
* 予約番号ごとに、ひとつめのオファーのみreservationForを含むように変更するのでoptionalに
|
|
14
|
+
* 2026-06-04~
|
|
15
|
+
*/
|
|
16
|
+
reservationFor?: IMinimizedReservationFor;
|
|
17
|
+
reservedTicket?: never;
|
|
18
|
+
};
|
|
19
|
+
export type IMinimizedAcceptedOffer = Pick<factory.acceptedOffer.IOptimizedAcceptedOffer, 'id' | 'offeredThrough' | 'serialNumber' | 'typeOf'> & {
|
|
20
|
+
itemOffered: IMinimizedItemOffered;
|
|
21
|
+
priceSpecification?: never;
|
|
22
|
+
name?: never;
|
|
23
|
+
};
|
|
4
24
|
type IDocType = Omit<factory.order.IOrder, 'id'> & {
|
|
5
|
-
acceptedOffers?: factory.
|
|
25
|
+
acceptedOffers?: IMinimizedAcceptedOffer[] | factory.acceptedOffer.ICOAAcceptedOffer[];
|
|
6
26
|
/**
|
|
7
27
|
* 注文取引IDとして再定義(2026-06-22~)
|
|
8
28
|
*/
|
|
@@ -133,7 +133,7 @@ export declare class OrderRepo {
|
|
|
133
133
|
id: string;
|
|
134
134
|
})[]>;
|
|
135
135
|
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.order.IOrder, "id"> & {
|
|
136
|
-
acceptedOffers?: factory.
|
|
136
|
+
acceptedOffers?: import("./mongoose/schemas/order").IMinimizedAcceptedOffer[] | factory.acceptedOffer.ICOAAcceptedOffer[];
|
|
137
137
|
identifier?: string;
|
|
138
138
|
paymentMethodId?: string;
|
|
139
139
|
} & {
|
|
@@ -141,7 +141,7 @@ export declare class OrderRepo {
|
|
|
141
141
|
} & {
|
|
142
142
|
__v: number;
|
|
143
143
|
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.order.IOrder, "id"> & {
|
|
144
|
-
acceptedOffers?: factory.
|
|
144
|
+
acceptedOffers?: import("./mongoose/schemas/order").IMinimizedAcceptedOffer[] | factory.acceptedOffer.ICOAAcceptedOffer[];
|
|
145
145
|
identifier?: string;
|
|
146
146
|
paymentMethodId?: string;
|
|
147
147
|
} & {
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -487,37 +487,6 @@ class OrderRepo {
|
|
|
487
487
|
}
|
|
488
488
|
return andConditions;
|
|
489
489
|
}
|
|
490
|
-
// OrderInTransactionリポジトリにて注文ドキュメントが生成されるように変更したのでもう不要
|
|
491
|
-
// /**
|
|
492
|
-
// * なければ作成する
|
|
493
|
-
// */
|
|
494
|
-
// public async createIfNotExist(order: IOrderWithoutAcceptedOffers & {
|
|
495
|
-
// acceptedOffers: factory.order.IAcceptedOffer[];
|
|
496
|
-
// }): Promise<void> {
|
|
497
|
-
// try {
|
|
498
|
-
// // 存在しなければ上書き
|
|
499
|
-
// // updateOneに変更(2024-01-14~)
|
|
500
|
-
// // await this.orderModel.findOneAndUpdate(
|
|
501
|
-
// await this.orderModel.updateOne(
|
|
502
|
-
// { orderNumber: order.orderNumber },
|
|
503
|
-
// { $setOnInsert: order },
|
|
504
|
-
// {
|
|
505
|
-
// // new: true,
|
|
506
|
-
// upsert: true
|
|
507
|
-
// }
|
|
508
|
-
// )
|
|
509
|
-
// .exec();
|
|
510
|
-
// } catch (error) {
|
|
511
|
-
// let throwsError = true;
|
|
512
|
-
// if (await isMongoDuplicateError(error)) {
|
|
513
|
-
// // すでにorderNumberが存在する場合ok
|
|
514
|
-
// throwsError = false;
|
|
515
|
-
// }
|
|
516
|
-
// if (throwsError) {
|
|
517
|
-
// throw error;
|
|
518
|
-
// }
|
|
519
|
-
// }
|
|
520
|
-
// }
|
|
521
490
|
/**
|
|
522
491
|
* 注文ステータスを変更する
|
|
523
492
|
*/
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Connection } from 'mongoose';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
|
+
import { IMinimizedAcceptedOffer, IMinimizedReservationFor, IMinimizedItemOffered } from './mongoose/schemas/order';
|
|
3
4
|
import { AcceptedOfferInReserveRepo } from './acceptedOfferInReserve';
|
|
5
|
+
export { IMinimizedAcceptedOffer, IMinimizedReservationFor, IMinimizedItemOffered };
|
|
4
6
|
export type IOrderInTransaction = Pick<factory.order.IOrder, 'orderNumber' | 'project' | 'broker'> & {
|
|
5
7
|
typeOf: factory.transactionType.PlaceOrder;
|
|
6
8
|
orderDate: Date;
|
|
@@ -8,7 +10,7 @@ export type IOrderInTransaction = Pick<factory.order.IOrder, 'orderNumber' | 'pr
|
|
|
8
10
|
* 注文取引IDとして再定義(2026-06-22~)
|
|
9
11
|
*/
|
|
10
12
|
identifier: string;
|
|
11
|
-
acceptedOffers: factory.
|
|
13
|
+
acceptedOffers: IMinimizedAcceptedOffer[] | factory.acceptedOffer.ICOAAcceptedOffer[];
|
|
12
14
|
customer?: factory.order.ICustomer;
|
|
13
15
|
seller?: factory.order.ISeller;
|
|
14
16
|
confirmationNumber?: string;
|
|
@@ -47,26 +49,6 @@ export type IPlacingOrder = Pick<factory.order.IOrder, 'orderDate' | 'orderStatu
|
|
|
47
49
|
*/
|
|
48
50
|
seller?: never;
|
|
49
51
|
};
|
|
50
|
-
export type IMinimizedReservationFor = Pick<factory.order.IEventAsReservationFor, 'endDate' | 'id' | 'startDate' | 'typeOf'> & {
|
|
51
|
-
location: Pick<factory.order.IEventAsReservationFor['location'], 'branchCode' | 'typeOf'>;
|
|
52
|
-
superEvent: Pick<factory.order.ISuperEvent, 'id' | 'typeOf'> & {
|
|
53
|
-
location: Pick<factory.order.ISuperEvent['location'], 'branchCode' | 'typeOf'>;
|
|
54
|
-
workPerformed: Pick<factory.order.ISuperEvent['workPerformed'], 'identifier' | 'typeOf'>;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
export type IMinimizedItemOffered = Pick<factory.order.IEventReservation, 'id' | 'reservationNumber' | 'typeOf'> & {
|
|
58
|
-
/**
|
|
59
|
-
* 予約番号ごとに、ひとつめのオファーのみreservationForを含むように変更するのでoptionalに
|
|
60
|
-
* 2026-06-04~
|
|
61
|
-
*/
|
|
62
|
-
reservationFor?: IMinimizedReservationFor;
|
|
63
|
-
reservedTicket?: never;
|
|
64
|
-
};
|
|
65
|
-
export type IMinimizedAcceptedOffer = Pick<factory.order.IOptimizedAcceptedOffer, 'id' | 'offeredThrough' | 'serialNumber' | 'typeOf'> & {
|
|
66
|
-
itemOffered: IMinimizedItemOffered;
|
|
67
|
-
priceSpecification?: never;
|
|
68
|
-
name?: never;
|
|
69
|
-
};
|
|
70
52
|
export interface IPaymentMethodByPaymentUrl {
|
|
71
53
|
/**
|
|
72
54
|
* 決済採用時に発行済の決済方法ID
|
|
@@ -117,9 +99,7 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
|
117
99
|
* 注文取引タイプのドキュメントのみを参照対象にするかどうか
|
|
118
100
|
*/
|
|
119
101
|
onlyPlaceOrder: boolean;
|
|
120
|
-
}): Promise<
|
|
121
|
-
priceSpecification?: factory.order.ITicketPriceSpecification;
|
|
122
|
-
})[]>;
|
|
102
|
+
}): Promise<Pick<factory.acceptedOffer.IAcceptedOffer, 'id' | 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'typeOf' | 'priceSpecification'>[]>;
|
|
123
103
|
/**
|
|
124
104
|
* 注文を受注する
|
|
125
105
|
* typeOf: PlaceOrder -> typeOf: Order
|
|
@@ -132,7 +112,7 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
|
132
112
|
* このメソッドでdocumentが初めて生成される(typeOf:PlaceOrderとして)
|
|
133
113
|
*/
|
|
134
114
|
acceptOfferByIdentifier(params: Pick<IOrderInTransaction, 'project' | 'identifier'> & {
|
|
135
|
-
acceptedOffers: IMinimizedAcceptedOffer[] | factory.
|
|
115
|
+
acceptedOffers: IMinimizedAcceptedOffer[] | factory.acceptedOffer.ICOAAcceptedOffer[];
|
|
136
116
|
}): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
|
|
137
117
|
/**
|
|
138
118
|
* serialNumberからオファーを除外する
|
|
@@ -149,7 +149,7 @@ export declare class ScreeningRoomRepo {
|
|
|
149
149
|
description?: any;
|
|
150
150
|
openingHoursSpecification?: any;
|
|
151
151
|
smokingAllowed?: boolean;
|
|
152
|
-
containsPlace: (Pick<import("@chevre/factory/lib/chevre/place/screeningRoomSection").IPlace, "name" | "typeOf" | "
|
|
152
|
+
containsPlace: (Pick<import("@chevre/factory/lib/chevre/place/screeningRoomSection").IPlace, "name" | "typeOf" | "branchCode" | "additionalProperty"> & {
|
|
153
153
|
containsPlace?: factory.place.seat.IPlace[];
|
|
154
154
|
})[];
|
|
155
155
|
} & {
|
|
@@ -160,7 +160,7 @@ export declare class ScreeningRoomRepo {
|
|
|
160
160
|
description?: any;
|
|
161
161
|
openingHoursSpecification?: any;
|
|
162
162
|
smokingAllowed?: boolean;
|
|
163
|
-
containsPlace: (Pick<import("@chevre/factory/lib/chevre/place/screeningRoomSection").IPlace, "name" | "typeOf" | "
|
|
163
|
+
containsPlace: (Pick<import("@chevre/factory/lib/chevre/place/screeningRoomSection").IPlace, "name" | "typeOf" | "branchCode" | "additionalProperty"> & {
|
|
164
164
|
containsPlace?: factory.place.seat.IPlace[];
|
|
165
165
|
})[];
|
|
166
166
|
} & {
|
|
@@ -37,11 +37,11 @@ export declare class PriceSpecificationRepo {
|
|
|
37
37
|
};
|
|
38
38
|
}): Promise<void>;
|
|
39
39
|
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
40
|
-
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
41
40
|
name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
|
|
41
|
+
typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification;
|
|
42
|
+
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
42
43
|
price: number;
|
|
43
44
|
priceCurrency: factory.priceCurrency;
|
|
44
|
-
typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification;
|
|
45
45
|
valueAddedTaxIncluded: boolean;
|
|
46
46
|
accounting?: never | undefined;
|
|
47
47
|
appliesToCategoryCode: import("@chevre/factory/lib/chevre/priceSpecification/categoryCodeChargeSpecification").IAppliesToCategoryCode[];
|
|
@@ -53,11 +53,11 @@ export declare class PriceSpecificationRepo {
|
|
|
53
53
|
} & {
|
|
54
54
|
__v: number;
|
|
55
55
|
}) | ({
|
|
56
|
-
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
57
56
|
name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
|
|
57
|
+
typeOf: factory.priceSpecificationType.MovieTicketTypeChargeSpecification;
|
|
58
|
+
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
58
59
|
price: number;
|
|
59
60
|
priceCurrency: factory.priceCurrency;
|
|
60
|
-
typeOf: factory.priceSpecificationType.MovieTicketTypeChargeSpecification;
|
|
61
61
|
valueAddedTaxIncluded: boolean;
|
|
62
62
|
accounting?: never | undefined;
|
|
63
63
|
appliesToMovieTicket: import("@chevre/factory/lib/chevre/priceSpecification/movieTicketTypeChargeSpecification").IAppliesToMovieTicket;
|
|
@@ -70,11 +70,11 @@ export declare class PriceSpecificationRepo {
|
|
|
70
70
|
} & {
|
|
71
71
|
__v: number;
|
|
72
72
|
})), import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
73
|
-
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
74
73
|
name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
|
|
74
|
+
typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification;
|
|
75
|
+
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
75
76
|
price: number;
|
|
76
77
|
priceCurrency: factory.priceCurrency;
|
|
77
|
-
typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification;
|
|
78
78
|
valueAddedTaxIncluded: boolean;
|
|
79
79
|
accounting?: never | undefined;
|
|
80
80
|
appliesToCategoryCode: import("@chevre/factory/lib/chevre/priceSpecification/categoryCodeChargeSpecification").IAppliesToCategoryCode[];
|
|
@@ -86,11 +86,11 @@ export declare class PriceSpecificationRepo {
|
|
|
86
86
|
} & {
|
|
87
87
|
__v: number;
|
|
88
88
|
}) | ({
|
|
89
|
-
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
90
89
|
name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
|
|
90
|
+
typeOf: factory.priceSpecificationType.MovieTicketTypeChargeSpecification;
|
|
91
|
+
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
91
92
|
price: number;
|
|
92
93
|
priceCurrency: factory.priceCurrency;
|
|
93
|
-
typeOf: factory.priceSpecificationType.MovieTicketTypeChargeSpecification;
|
|
94
94
|
valueAddedTaxIncluded: boolean;
|
|
95
95
|
accounting?: never | undefined;
|
|
96
96
|
appliesToMovieTicket: import("@chevre/factory/lib/chevre/priceSpecification/movieTicketTypeChargeSpecification").IAppliesToMovieTicket;
|
|
@@ -75,13 +75,13 @@ export declare class SellerRepo {
|
|
|
75
75
|
id: string;
|
|
76
76
|
makesOffer: factory.seller.IMakesOffer;
|
|
77
77
|
}): Promise<void>;
|
|
78
|
-
getCursor(conditions: FilterQuery<factory.seller.ISeller>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.seller.ISeller, "
|
|
78
|
+
getCursor(conditions: FilterQuery<factory.seller.ISeller>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.seller.ISeller, "name" | "typeOf" | "branchCode" | "additionalProperty" | "project" | "url" | "telephone" | "makesOffer" | "hasMerchantReturnPolicy"> & {
|
|
79
79
|
paymentAccepted?: factory.seller.IPaymentAccepted[];
|
|
80
80
|
} & {
|
|
81
81
|
_id: Types.ObjectId;
|
|
82
82
|
} & {
|
|
83
83
|
__v: number;
|
|
84
|
-
}, QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.seller.ISeller, "
|
|
84
|
+
}, QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.seller.ISeller, "name" | "typeOf" | "branchCode" | "additionalProperty" | "project" | "url" | "telephone" | "makesOffer" | "hasMerchantReturnPolicy"> & {
|
|
85
85
|
paymentAccepted?: factory.seller.IPaymentAccepted[];
|
|
86
86
|
} & {
|
|
87
87
|
_id: Types.ObjectId;
|
|
@@ -39,13 +39,13 @@ export declare class TaskRepo {
|
|
|
39
39
|
id: string;
|
|
40
40
|
};
|
|
41
41
|
}): Promise<(import("mongoose").FlattenMaps<{
|
|
42
|
+
identifier?: string | undefined;
|
|
43
|
+
name: factory.taskName;
|
|
44
|
+
description?: string | undefined;
|
|
42
45
|
project: {
|
|
43
46
|
id: string;
|
|
44
47
|
typeOf: factory.organizationType.Project;
|
|
45
48
|
};
|
|
46
|
-
name: factory.taskName;
|
|
47
|
-
identifier?: string | undefined;
|
|
48
|
-
description?: string | undefined;
|
|
49
49
|
data: import("@chevre/factory/lib/chevre/task").IData;
|
|
50
50
|
status: factory.taskStatus;
|
|
51
51
|
runsAt: Date;
|
|
@@ -6,7 +6,7 @@ export declare function createReservationOwnershipInfo(params: {
|
|
|
6
6
|
id: string;
|
|
7
7
|
};
|
|
8
8
|
ownedBy: factory.ownershipInfo.IOwner[];
|
|
9
|
-
acceptedOffer: Pick<factory.
|
|
9
|
+
acceptedOffer: Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered'>;
|
|
10
10
|
ownedFrom: Date;
|
|
11
11
|
identifier: string;
|
|
12
12
|
acquiredFrom: factory.ownershipInfo.IAcquiredFrom;
|
|
@@ -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;
|
|
@@ -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
|
*/
|
package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts
CHANGED
|
@@ -5,12 +5,7 @@ type IInTransitOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'projec
|
|
|
5
5
|
limit: number;
|
|
6
6
|
page: number;
|
|
7
7
|
};
|
|
8
|
-
deliveredAcceptedOffers:
|
|
9
|
-
/**
|
|
10
|
-
* COA以外では注文ドキュメントにpriceSpecificationが存在しないのでIFを補完
|
|
11
|
-
*/
|
|
12
|
-
priceSpecification?: factory.order.ITicketPriceSpecification;
|
|
13
|
-
})[];
|
|
8
|
+
deliveredAcceptedOffers: Pick<factory.acceptedOffer.IAcceptedOffer, 'priceSpecification' | 'id' | 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'typeOf'>[];
|
|
14
9
|
orderStatus: factory.orderStatus.OrderInTransit;
|
|
15
10
|
};
|
|
16
11
|
declare function createInformTasks(params: {
|
|
@@ -4,11 +4,31 @@ 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
|
+
let acceptedOffers = deliveredAcceptedOffers;
|
|
9
|
+
const offeredThroughIdentifier = acceptedOffers.at(0)?.offeredThrough?.identifier;
|
|
10
|
+
if (offeredThroughIdentifier === factory_1.factory.service.webAPI.Identifier.COA) {
|
|
11
|
+
// COAでは最小化しない
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
acceptedOffers = acceptedOffers.map((acceptedOffer) => {
|
|
15
|
+
const { itemOffered, ...acceptedOfferWithtoutItemOffered } = acceptedOffer;
|
|
16
|
+
const { reservationFor, ...itemOfferedWithoutReservationFor } = itemOffered;
|
|
17
|
+
const itemOffered4inform = {
|
|
18
|
+
...itemOfferedWithoutReservationFor,
|
|
19
|
+
reservationFor: { id: reservationFor.id, typeOf: reservationFor.typeOf } // minimize reservationFor(2026-09-28~)
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
...acceptedOfferWithtoutItemOffered,
|
|
23
|
+
itemOffered: itemOffered4inform
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
}
|
|
7
27
|
return {
|
|
8
|
-
project
|
|
9
|
-
typeOf
|
|
10
|
-
orderNumber
|
|
11
|
-
acceptedOffers
|
|
28
|
+
project,
|
|
29
|
+
typeOf,
|
|
30
|
+
orderNumber,
|
|
31
|
+
acceptedOffers,
|
|
12
32
|
orderStatus: factory_1.factory.orderStatus.OrderInTransit,
|
|
13
33
|
// ↓hub側で使用している可能性もあるので念のため
|
|
14
34
|
...(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 },
|
|
@@ -15,9 +15,9 @@ declare function createPayObjectServiceOutput(params: {
|
|
|
15
15
|
/**
|
|
16
16
|
* 決済カードの適用された注文オファー
|
|
17
17
|
*/
|
|
18
|
-
type IAcceptedOfferMovieTicketUsed = Pick<factory.
|
|
19
|
-
itemOffered: Pick<factory.
|
|
20
|
-
reservedTicket: Pick<factory.
|
|
18
|
+
type IAcceptedOfferMovieTicketUsed = Pick<factory.acceptedOffer.IAcceptedOffer, 'priceSpecification'> & {
|
|
19
|
+
itemOffered: Pick<factory.acceptedOffer.IEventReservation | factory.acceptedOffer.ICOAEventReservation, 'reservationFor' | 'reservationNumber'> & {
|
|
20
|
+
reservedTicket: Pick<factory.acceptedOffer.IReservedTicket, 'identifier' | 'ticketedSeat' | 'ticketToken'> | Pick<factory.acceptedOffer.ICOAReservedTicket, 'identifier' | 'ticketedSeat' | 'ticketToken'>;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
export { createPayObjectServiceOutput, IAcceptedOfferMovieTicketUsed };
|
package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OfferRepo } from '../../../../repo/offer/unitPriceInCatalog';
|
|
2
2
|
import { factory } from '../../../../factory';
|
|
3
3
|
export type IAuthorizeEventServiceOffer = factory.action.authorize.offer.eventService.IAction;
|
|
4
|
-
type IOrderAcceptedOffer = Pick<factory.
|
|
4
|
+
type IOrderAcceptedOffer = Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'priceSpecification' | 'id'>;
|
|
5
5
|
interface IAcceptedOfferInResult extends Pick<factory.product.ITicketOffer, 'acceptedPaymentMethod' | 'id' | 'typeOf'> {
|
|
6
6
|
typeOf: factory.offerType.Offer;
|
|
7
7
|
id: string;
|
|
@@ -4,5 +4,5 @@ declare function validateInvoiceReferencesOrder(authorizePaymentActions: IAuthor
|
|
|
4
4
|
/**
|
|
5
5
|
* 受け入れられた興行オファー
|
|
6
6
|
*/
|
|
7
|
-
eventReservationAcceptedOffers: Pick<factory.
|
|
7
|
+
eventReservationAcceptedOffers: Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered'>[]): void;
|
|
8
8
|
export { validateInvoiceReferencesOrder };
|
package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ authorizedMovieTickets: IMovieTicket4validate[],
|
|
|
18
18
|
/**
|
|
19
19
|
* 受け入れられた興行オファー
|
|
20
20
|
*/
|
|
21
|
-
eventReservationAcceptedOffers: Pick<factory.
|
|
21
|
+
eventReservationAcceptedOffers: Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered' | 'priceSpecification'>[]): void;
|
|
@@ -8,7 +8,7 @@ export { IAcceptPayAction, IAuthorizeEventServiceOffer, IAuthorizePaymentAction,
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function validateTransaction(transaction: {
|
|
10
10
|
id: string;
|
|
11
|
-
}, acceptPayActions: IAcceptPayAction[], authorizePaymentActions: IAuthorizePaymentAction[], authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[], eventReservationAcceptedOffers: Pick<factory.
|
|
11
|
+
}, acceptPayActions: IAcceptPayAction[], authorizePaymentActions: IAuthorizePaymentAction[], authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[], eventReservationAcceptedOffers: Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered' | 'priceSpecification'>[], payTransactions: IPayTransaction[], customer: factory.order.ICustomer, options: {
|
|
12
12
|
paymentMethodIdByTransaction?: string;
|
|
13
13
|
}): void;
|
|
14
14
|
/**
|
|
@@ -18,7 +18,7 @@ export declare function validateAcceptedOffers(params: {
|
|
|
18
18
|
result: {
|
|
19
19
|
order: PlaceOrderFactory.IResultOrderParams;
|
|
20
20
|
};
|
|
21
|
-
acceptedOffers: (Pick<factory.
|
|
21
|
+
acceptedOffers: (Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered' | 'offeredThrough' | 'serialNumber'>)[];
|
|
22
22
|
}): void;
|
|
23
23
|
export declare function validateOrderedItem(params: {
|
|
24
24
|
order: Pick<factory.order.IOrder, 'orderedItem'>;
|
|
@@ -297,17 +297,12 @@ function createReservationIdsResult(order, acceptedOffers) {
|
|
|
297
297
|
function createResult(params, options) {
|
|
298
298
|
const transaction = params.transaction;
|
|
299
299
|
const eventReservationAcceptedOffers = [];
|
|
300
|
-
// const productAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IPermit>[] = [];
|
|
301
|
-
// const moneyTransferAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IMoneyTransfer>[] = [];
|
|
302
300
|
params.acceptedOffers.forEach((acceptedOffer) => {
|
|
303
301
|
const itemOfferedTypeOf = acceptedOffer.itemOffered.typeOf;
|
|
304
302
|
switch (itemOfferedTypeOf) {
|
|
305
303
|
case factory_1.factory.reservationType.EventReservation:
|
|
306
304
|
eventReservationAcceptedOffers.push((acceptedOffer));
|
|
307
305
|
break;
|
|
308
|
-
// case factory.permit.PermitType.Permit:
|
|
309
|
-
// productAcceptedOffers.push((acceptedOffer as factory.order.IAcceptedOffer<factory.order.IPermit>));
|
|
310
|
-
// break;
|
|
311
306
|
default:
|
|
312
307
|
throw new factory_1.factory.errors.NotImplemented(`${itemOfferedTypeOf} not implemented`);
|
|
313
308
|
}
|
|
@@ -15,6 +15,6 @@ type ICustomSellerReturnPolicy = Pick<factory.sellerReturnPolicy.ISellerReturnPo
|
|
|
15
15
|
applicablePaymentMethod?: never;
|
|
16
16
|
merchantReturnDays?: never;
|
|
17
17
|
};
|
|
18
|
-
type IFixedAcceptedOffer = Pick<factory.
|
|
18
|
+
type IFixedAcceptedOffer = Pick<factory.acceptedOffer.IAcceptedOffer, 'id' | 'priceSpecification' | 'itemOffered'>;
|
|
19
19
|
type IFixedOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'dateReturned' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'paymentMethods' | 'price' | 'project' | 'seller' | 'typeOf'>;
|
|
20
20
|
export { IAvailableSellerReturnPolicy, ICustomSellerReturnPolicy, IFixedAcceptedOffer, IFixedOrder };
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.1090.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.1090.0",
|
|
14
|
-
"@chevre/factory": "11.1.0-alpha.
|
|
14
|
+
"@chevre/factory": "11.1.0-alpha.1",
|
|
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",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"postversion": "git push origin --tags",
|
|
89
89
|
"prepublishOnly": "npm run clean && npm run build"
|
|
90
90
|
},
|
|
91
|
-
"version": "28.0.0-alpha.
|
|
91
|
+
"version": "28.0.0-alpha.19"
|
|
92
92
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { factory } from '../../factory';
|
|
2
|
-
export type IOwnershipInfo = factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood>;
|
|
3
|
-
/**
|
|
4
|
-
* 注文から所有権を作成する
|
|
5
|
-
*/
|
|
6
|
-
export declare function createOwnershipInfosFromOrder(params: {
|
|
7
|
-
order: Pick<factory.order.IOrder, 'orderDate' | 'project' | 'customer' | 'orderNumber' | 'seller'> & {
|
|
8
|
-
acceptedOffers: (Omit<factory.order.IAcceptedOffer, 'priceSpecification' | 'name'> & {
|
|
9
|
-
/**
|
|
10
|
-
* COA以外では注文ドキュメントにpriceSpecificationが存在しないのでIFを補完
|
|
11
|
-
*/
|
|
12
|
-
priceSpecification?: factory.order.ITicketPriceSpecification;
|
|
13
|
-
})[];
|
|
14
|
-
};
|
|
15
|
-
offerIndexBase: number;
|
|
16
|
-
}): IOwnershipInfo[];
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createOwnershipInfosFromOrder = createOwnershipInfosFromOrder;
|
|
7
|
-
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
8
|
-
const util_1 = require("util");
|
|
9
|
-
const factory_1 = require("../../factory");
|
|
10
|
-
// import { createProductOwnershipInfo } from './product/factory';
|
|
11
|
-
const factory_2 = require("./reservation/factory");
|
|
12
|
-
/**
|
|
13
|
-
* 注文から所有権を作成する
|
|
14
|
-
*/
|
|
15
|
-
function createOwnershipInfosFromOrder(params) {
|
|
16
|
-
const ownershipInfos = [];
|
|
17
|
-
if (!Array.isArray(params.order.acceptedOffers)) {
|
|
18
|
-
throw new factory_1.factory.errors.ArgumentNull('order.acceptedOffers');
|
|
19
|
-
}
|
|
20
|
-
params.order.acceptedOffers.forEach((acceptedOffer, offerIndex) => {
|
|
21
|
-
const itemOffered = acceptedOffer.itemOffered;
|
|
22
|
-
let ownershipInfo;
|
|
23
|
-
const ownedFrom = (0, moment_timezone_1.default)(params.order.orderDate)
|
|
24
|
-
.toDate();
|
|
25
|
-
const identifier = createOwnershipInfoIdentifier({
|
|
26
|
-
order: params.order,
|
|
27
|
-
itemOffered,
|
|
28
|
-
offerIndex,
|
|
29
|
-
offerIndexBase: params.offerIndexBase
|
|
30
|
-
});
|
|
31
|
-
const acquiredFrom = createAcquiredFrom(params);
|
|
32
|
-
const ownedBy = createOwnedby(params);
|
|
33
|
-
// 所有者があれば所有権を作成する
|
|
34
|
-
if (ownedBy.length > 0) {
|
|
35
|
-
const itemOfferedType = itemOffered.typeOf;
|
|
36
|
-
switch (itemOfferedType) {
|
|
37
|
-
case factory_1.factory.reservationType.EventReservation: {
|
|
38
|
-
const excludeCOAReservation = acceptedOffer.offeredThrough?.identifier === factory_1.factory.service.webAPI.Identifier.COA;
|
|
39
|
-
if (excludeCOAReservation) {
|
|
40
|
-
// bookingService:COAでは作成しない(2024-12-31~)
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
ownershipInfo = (0, factory_2.createReservationOwnershipInfo)({
|
|
44
|
-
project: params.order.project,
|
|
45
|
-
ownedBy: ownedBy,
|
|
46
|
-
acceptedOffer,
|
|
47
|
-
ownedFrom: ownedFrom,
|
|
48
|
-
identifier: identifier,
|
|
49
|
-
acquiredFrom: acquiredFrom
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
// case factory.permit.PermitType.Permit:
|
|
55
|
-
// ownershipInfo = createProductOwnershipInfo({
|
|
56
|
-
// project: params.order.project,
|
|
57
|
-
// ownedBy: ownedBy,
|
|
58
|
-
// acceptedOffer: { ...acceptedOffer, itemOffered },
|
|
59
|
-
// ownedFrom: ownedFrom,
|
|
60
|
-
// identifier: identifier,
|
|
61
|
-
// acquiredFrom: acquiredFrom
|
|
62
|
-
// });
|
|
63
|
-
// break;
|
|
64
|
-
// case factory.actionType.MoneyTransfer:
|
|
65
|
-
// // no op
|
|
66
|
-
// // 所有権は発生しない
|
|
67
|
-
// break;
|
|
68
|
-
default:
|
|
69
|
-
throw new factory_1.factory.errors.NotImplemented(`Offered item type ${itemOfferedType} not implemented`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (ownershipInfo !== undefined) {
|
|
73
|
-
ownershipInfos.push(ownershipInfo);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
return ownershipInfos;
|
|
77
|
-
}
|
|
78
|
-
function createOwnershipInfoIdentifier(params) {
|
|
79
|
-
return (0, util_1.format)('%s-%s-%s-%s', params.order.customer.id, params.itemOffered.typeOf, params.order.orderNumber, (params.offerIndexBase + params.offerIndex));
|
|
80
|
-
}
|
|
81
|
-
function createAcquiredFrom(params) {
|
|
82
|
-
// 最低限の情報に絞る
|
|
83
|
-
const seller = params.order.seller;
|
|
84
|
-
return {
|
|
85
|
-
// 最適化(2022-11-15~)
|
|
86
|
-
// project: { typeOf: params.order.project.typeOf, id: params.order.project.id },
|
|
87
|
-
id: seller.id,
|
|
88
|
-
typeOf: seller.typeOf,
|
|
89
|
-
name: (typeof seller.name === 'string')
|
|
90
|
-
? seller.name
|
|
91
|
-
: String(seller.typeOf)
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function createOwnedby(params) {
|
|
95
|
-
const customer = params.order.customer;
|
|
96
|
-
let owner;
|
|
97
|
-
// 顧客組織の場合
|
|
98
|
-
if (customer.typeOf === factory_1.factory.organizationType.Organization) {
|
|
99
|
-
// discontinue(2026-03-15~)
|
|
100
|
-
// const ownerAsOrganization: factory.ownershipInfo.IOwnerAsOrganization = {
|
|
101
|
-
// // 個人情報排除するように
|
|
102
|
-
// typeOf: customer.typeOf,
|
|
103
|
-
// id: customer.id
|
|
104
|
-
// };
|
|
105
|
-
// owner = ownerAsOrganization;
|
|
106
|
-
}
|
|
107
|
-
else if (customer.typeOf === factory_1.factory.personType.Person) {
|
|
108
|
-
const ownerAsPerson = {
|
|
109
|
-
// 個人情報排除するように
|
|
110
|
-
typeOf: customer.typeOf,
|
|
111
|
-
id: customer.id
|
|
112
|
-
};
|
|
113
|
-
owner = ownerAsPerson;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
// discontinue(2026-03-15~)
|
|
117
|
-
// owner = {
|
|
118
|
-
// // 個人情報排除するように
|
|
119
|
-
// typeOf: customer.typeOf,
|
|
120
|
-
// id: customer.id
|
|
121
|
-
// };
|
|
122
|
-
}
|
|
123
|
-
return (owner !== undefined) ? [owner] : [];
|
|
124
|
-
}
|