@chevre/domain 25.0.0-alpha.15 → 25.0.0-alpha.17
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/mongoose/schemas/order.js +1 -1
- package/lib/chevre/repo/orderInTransaction.d.ts +5 -2
- package/lib/chevre/repo/orderInTransaction.js +4 -23
- package/lib/chevre/repo/transaction.d.ts +1 -1
- package/lib/chevre/repo/transaction.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
- package/lib/chevre/service/offer/any.d.ts +0 -1
- package/lib/chevre/service/offer/any.js +1 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +5 -7
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.d.ts +0 -8
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +5 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +4 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -26
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory.js +5 -5
- package/lib/chevre/service/order/placeOrder.js +3 -3
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.d.ts +0 -4
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +4 -6
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -6
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +5 -7
- package/lib/chevre/service/task/acceptCOAOffer.js +8 -8
- package/lib/chevre/service/task/publishPaymentUrl.js +6 -6
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm.js +0 -6
- package/lib/chevre/service/transaction/placeOrder/issueOrderNumberIfNotExist.d.ts +0 -2
- package/lib/chevre/service/transaction/placeOrder/issueOrderNumberIfNotExist.js +11 -11
- package/lib/chevre/service/transaction/placeOrder/start/factory.d.ts +3 -1
- package/lib/chevre/service/transaction/placeOrder/start/factory.js +15 -8
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/start.js +21 -22
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -4
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +4 -5
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ const schemaDefinition = {
|
|
|
12
12
|
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
13
13
|
typeOf: { type: String, required: true },
|
|
14
14
|
name: String,
|
|
15
|
-
seller: mongoose_1.SchemaTypes.Mixed,
|
|
15
|
+
seller: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
16
|
customer: mongoose_1.SchemaTypes.Mixed,
|
|
17
17
|
returner: mongoose_1.SchemaTypes.Mixed,
|
|
18
18
|
confirmationNumber: String,
|
|
@@ -15,7 +15,7 @@ type IOrderInTransaction = Pick<factory.order.IOrder, 'orderNumber' | 'project'
|
|
|
15
15
|
/**
|
|
16
16
|
* typeOf: Orderへドキュメント変換時の編集フィールド
|
|
17
17
|
*/
|
|
18
|
-
export type IPlacingOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | '
|
|
18
|
+
export type IPlacingOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'typeOf'> & {
|
|
19
19
|
url?: never;
|
|
20
20
|
identifier?: never;
|
|
21
21
|
name?: never;
|
|
@@ -31,6 +31,10 @@ export type IPlacingOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'o
|
|
|
31
31
|
* 上書きしてはいけない
|
|
32
32
|
*/
|
|
33
33
|
broker?: never;
|
|
34
|
+
/**
|
|
35
|
+
* 上書きしてはいけない
|
|
36
|
+
*/
|
|
37
|
+
seller?: never;
|
|
34
38
|
};
|
|
35
39
|
export type IMinimizedReservationFor = Pick<factory.order.IEventAsReservationFor, 'endDate' | 'id' | 'startDate' | 'typeOf'> & {
|
|
36
40
|
location: Pick<factory.order.IEventAsReservationFor['location'], 'branchCode' | 'typeOf'>;
|
|
@@ -102,7 +106,6 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
|
102
106
|
*/
|
|
103
107
|
acceptOffer(params: Pick<IOrderInTransaction, 'orderNumber' | 'project' | 'identifier'> & {
|
|
104
108
|
acceptedOffers: IMinimizedAcceptedOffer[] | factory.order.ICOAAcceptedOffer[];
|
|
105
|
-
broker?: factory.order.IBroker;
|
|
106
109
|
}): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
|
|
107
110
|
/**
|
|
108
111
|
* serialNumberからオファーを除外する
|
|
@@ -157,15 +157,8 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
157
157
|
if (!Array.isArray(params.acceptedOffers) || params.acceptedOffers.length === 0) {
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
const { orderNumber, project, identifier } = params;
|
|
161
|
-
await this.createPlaceOrderIfNotExists({ orderNumber, project, identifier });
|
|
162
|
-
// const setOnInsert: IInitalOrderInTransaction = {
|
|
163
|
-
// typeOf: factory.transactionType.PlaceOrder,
|
|
164
|
-
// orderDate: new Date(), // orderDate required(2024-12-09~)
|
|
165
|
-
// orderNumber: params.orderNumber,
|
|
166
|
-
// project: params.project,
|
|
167
|
-
// identifier: params.identifier // 取引ID(2026-06-22~)
|
|
168
|
-
// };
|
|
160
|
+
// const { orderNumber, project, identifier } = params;
|
|
161
|
+
// await this.createPlaceOrderIfNotExists({ orderNumber, project, identifier }); // 取引開始時に完全移行(2026-06-25~)
|
|
169
162
|
const result = await this.orderModel.updateOne({
|
|
170
163
|
typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder },
|
|
171
164
|
orderNumber: { $eq: params.orderNumber },
|
|
@@ -178,11 +171,6 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
178
171
|
acceptedOffers: {
|
|
179
172
|
$each: params.acceptedOffers
|
|
180
173
|
}
|
|
181
|
-
},
|
|
182
|
-
$set: {
|
|
183
|
-
...((params.broker !== undefined) && {
|
|
184
|
-
broker: { id: params.broker.id, typeOf: params.broker.typeOf }
|
|
185
|
-
}) // set broker(2026-06-21~)
|
|
186
174
|
}
|
|
187
175
|
}, {
|
|
188
176
|
// upsert: true // createPlaceOrderIfNotExistsへ移行(2026-06-24~)
|
|
@@ -232,7 +220,7 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
232
220
|
}
|
|
233
221
|
}
|
|
234
222
|
async setCustomer(params) {
|
|
235
|
-
const { customer, orderNumber, project
|
|
223
|
+
const { customer, orderNumber, project } = params;
|
|
236
224
|
const filter = {
|
|
237
225
|
typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder },
|
|
238
226
|
orderNumber: { $eq: orderNumber },
|
|
@@ -240,14 +228,7 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
240
228
|
// 万が一異なるプロジェクトで同じ注文番号でオファーを受け入れようとしても、DBにインデックスによってDuplicateKey
|
|
241
229
|
'project.id': { $eq: project.id }
|
|
242
230
|
};
|
|
243
|
-
await this.createPlaceOrderIfNotExists({ orderNumber, project, identifier });
|
|
244
|
-
// const setOnInsert: IInitalOrderInTransaction = {
|
|
245
|
-
// typeOf: factory.transactionType.PlaceOrder,
|
|
246
|
-
// orderDate: new Date(), // orderDate required(2024-12-09~)
|
|
247
|
-
// orderNumber,
|
|
248
|
-
// project,
|
|
249
|
-
// identifier: params.identifier // 取引ID(2026-06-22~)
|
|
250
|
-
// };
|
|
231
|
+
// await this.createPlaceOrderIfNotExists({ orderNumber, project, identifier }); // 取引開始時に完全移行(2026-06-25~)
|
|
251
232
|
const setKeys = { customer };
|
|
252
233
|
const result = await this.orderModel.updateOne(filter, {
|
|
253
234
|
// $setOnInsert: setOnInsert, // createPlaceOrderIfNotExistsへ移行(2026-06-24~)
|
|
@@ -130,7 +130,7 @@ export declare class TransactionRepo {
|
|
|
130
130
|
$lt: Date;
|
|
131
131
|
};
|
|
132
132
|
}): Promise<import("mongodb").DeleteResult>;
|
|
133
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
133
|
+
getCursor(conditions: any, projection: any, sort?: factory.sortType): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
134
134
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
135
135
|
error?: any;
|
|
136
136
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
@@ -316,9 +316,9 @@ class TransactionRepo {
|
|
|
316
316
|
})
|
|
317
317
|
.exec();
|
|
318
318
|
}
|
|
319
|
-
getCursor(conditions, projection) {
|
|
319
|
+
getCursor(conditions, projection, sort) {
|
|
320
320
|
return this.transactionModel.find(conditions, projection)
|
|
321
|
-
.sort({ startDate: factory_1.factory.sortType.Descending })
|
|
321
|
+
.sort({ startDate: (sort === factory_1.factory.sortType.Ascending) ? sort : factory_1.factory.sortType.Descending })
|
|
322
322
|
.cursor();
|
|
323
323
|
}
|
|
324
324
|
async aggregatePlaceOrder(params) {
|
|
@@ -15,7 +15,6 @@ import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
|
15
15
|
import { SeatRepo } from '../../../repo/place/seat';
|
|
16
16
|
import type { PriceSpecificationRepo } from '../../../repo/priceSpecification';
|
|
17
17
|
import type { ProductRepo } from '../../../repo/product';
|
|
18
|
-
import type { ProjectRepo } from '../../../repo/project';
|
|
19
18
|
import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
20
19
|
import type { SettingRepo } from '../../../repo/setting';
|
|
21
20
|
import type { StockHolderRepo } from '../../../repo/stockHolder';
|
|
@@ -37,7 +36,6 @@ interface IStartOperationRepos {
|
|
|
37
36
|
paymentService: PaymentServiceRepo;
|
|
38
37
|
product: ProductRepo;
|
|
39
38
|
priceSpecification: PriceSpecificationRepo;
|
|
40
|
-
project: ProjectRepo;
|
|
41
39
|
seat: SeatRepo;
|
|
42
40
|
setting: SettingRepo;
|
|
43
41
|
task: TaskRepo;
|
|
@@ -12,7 +12,6 @@ export declare function acceptOffer(params: {
|
|
|
12
12
|
};
|
|
13
13
|
placeOrderId: string;
|
|
14
14
|
acceptedOffers: IMinimizedAcceptedOffer[] | factory.order.ICOAAcceptedOffer[];
|
|
15
|
-
broker?: factory.order.IBroker;
|
|
16
15
|
}): IAcceptOfferOperation<void>;
|
|
17
16
|
export declare function voidAcceptedOffer(params: {
|
|
18
17
|
/**
|
|
@@ -14,8 +14,7 @@ function acceptOffer(params) {
|
|
|
14
14
|
orderNumber: params.orderNumber,
|
|
15
15
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
16
16
|
identifier: params.placeOrderId,
|
|
17
|
-
acceptedOffers: params.acceptedOffers
|
|
18
|
-
...((params.broker !== undefined) && { broker: params.broker })
|
|
17
|
+
acceptedOffers: params.acceptedOffers
|
|
19
18
|
});
|
|
20
19
|
};
|
|
21
20
|
}
|
|
@@ -15,7 +15,6 @@ import type { PaymentServiceRepo } from '../../../../repo/paymentService';
|
|
|
15
15
|
import type { SeatRepo } from '../../../../repo/place/seat';
|
|
16
16
|
import type { PriceSpecificationRepo } from '../../../../repo/priceSpecification';
|
|
17
17
|
import type { ProductRepo } from '../../../../repo/product';
|
|
18
|
-
import type { ProjectRepo } from '../../../../repo/project';
|
|
19
18
|
import type { OfferRateLimitRepo } from '../../../../repo/rateLimit/offer';
|
|
20
19
|
import type { SettingRepo } from '../../../../repo/setting';
|
|
21
20
|
import type { StockHolderRepo } from '../../../../repo/stockHolder';
|
|
@@ -63,7 +62,6 @@ declare function processStartReserve4chevre(params: {
|
|
|
63
62
|
paymentService: PaymentServiceRepo;
|
|
64
63
|
product: ProductRepo;
|
|
65
64
|
priceSpecification: PriceSpecificationRepo;
|
|
66
|
-
project: ProjectRepo;
|
|
67
65
|
seat: SeatRepo;
|
|
68
66
|
setting: SettingRepo;
|
|
69
67
|
task: TaskRepo;
|
|
@@ -13,12 +13,10 @@ import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
|
|
|
13
13
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
14
14
|
import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
15
15
|
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
16
|
-
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
17
16
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
18
17
|
import type { SeatRepo } from '../../../repo/place/seat';
|
|
19
18
|
import type { PriceSpecificationRepo } from '../../../repo/priceSpecification';
|
|
20
19
|
import type { ProductRepo } from '../../../repo/product';
|
|
21
|
-
import type { ProjectRepo } from '../../../repo/project';
|
|
22
20
|
import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
23
21
|
import type { SettingRepo } from '../../../repo/setting';
|
|
24
22
|
import type { StockHolderRepo } from '../../../repo/stockHolder';
|
|
@@ -43,11 +41,9 @@ interface IAuthorizeRepos {
|
|
|
43
41
|
offerCatalogItem: OfferCatalogItemRepo;
|
|
44
42
|
offerRateLimit: OfferRateLimitRepo;
|
|
45
43
|
orderInTransaction: OrderInTransactionRepo;
|
|
46
|
-
orderNumber: OrderNumberRepo;
|
|
47
44
|
paymentService: PaymentServiceRepo;
|
|
48
45
|
priceSpecification: PriceSpecificationRepo;
|
|
49
46
|
product: ProductRepo;
|
|
50
|
-
project: ProjectRepo;
|
|
51
47
|
seat: SeatRepo;
|
|
52
48
|
setting: SettingRepo;
|
|
53
49
|
task: TaskRepo;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.authorize = authorize;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
|
|
6
5
|
const any_1 = require("../any");
|
|
7
6
|
const defaultOffer_1 = require("./authorize/defaultOffer");
|
|
8
7
|
const factory_2 = require("./authorize/factory");
|
|
@@ -25,11 +24,11 @@ function authorize(params, options) {
|
|
|
25
24
|
})(repos);
|
|
26
25
|
let acceptedOffers4result;
|
|
27
26
|
const now = new Date();
|
|
28
|
-
|
|
27
|
+
// 注文ドキュメントを参照(2026-06-24~)
|
|
28
|
+
const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
29
|
+
identifier: transaction.id,
|
|
29
30
|
project: { id: params.project.id },
|
|
30
|
-
|
|
31
|
-
object: { orderDate: now }
|
|
32
|
-
}, { issueForce: false })(repos);
|
|
31
|
+
});
|
|
33
32
|
// まず取引番号発行
|
|
34
33
|
const { transactionNumber } = await repos.transactionNumber.publishByTimestamp({ startDate: now });
|
|
35
34
|
const actionAttributes = (0, factory_2.createAuthorizeSeatReservationActionAttributes)({
|
|
@@ -67,8 +66,7 @@ function authorize(params, options) {
|
|
|
67
66
|
orderNumber,
|
|
68
67
|
project: transaction.project,
|
|
69
68
|
placeOrderId: transaction.id,
|
|
70
|
-
acceptedOffers: minimizedAcceptedOffers
|
|
71
|
-
...((typeof params.object.broker?.typeOf === 'string') && { broker: params.object.broker })
|
|
69
|
+
acceptedOffers: minimizedAcceptedOffers
|
|
72
70
|
})(repos);
|
|
73
71
|
}
|
|
74
72
|
}
|
|
@@ -2,17 +2,11 @@ import type { COA } from '@motionpicture/coa-service';
|
|
|
2
2
|
import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
3
3
|
import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
|
|
4
4
|
import type { EventRepo } from '../../../repo/event';
|
|
5
|
-
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
6
|
-
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
7
|
-
import type { ProjectRepo } from '../../../repo/project';
|
|
8
5
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
9
6
|
import { factory } from '../../../factory';
|
|
10
7
|
interface IAcceptRepos {
|
|
11
8
|
action: AcceptCOAOfferActionRepo;
|
|
12
9
|
event: EventRepo;
|
|
13
|
-
orderInTransaction: OrderInTransactionRepo;
|
|
14
|
-
orderNumber: OrderNumberRepo;
|
|
15
|
-
project: ProjectRepo;
|
|
16
10
|
placeOrder: PlaceOrderRepo;
|
|
17
11
|
reserveService: COA.service.Reserve;
|
|
18
12
|
masterService: COA.service.Master;
|
|
@@ -21,8 +15,6 @@ interface IReAcceptRepos {
|
|
|
21
15
|
action: AcceptCOAOfferActionRepo;
|
|
22
16
|
authorizeOfferAction: AuthorizeOfferActionRepo;
|
|
23
17
|
event: EventRepo;
|
|
24
|
-
orderNumber: OrderNumberRepo;
|
|
25
|
-
project: ProjectRepo;
|
|
26
18
|
placeOrder: PlaceOrderRepo;
|
|
27
19
|
reserveService: COA.service.Reserve;
|
|
28
20
|
masterService: COA.service.Master;
|
|
@@ -4,7 +4,6 @@ exports.acceptOffer = acceptOffer;
|
|
|
4
4
|
exports.reAcceptOffer = reAcceptOffer;
|
|
5
5
|
const errorHandler_1 = require("../../../errorHandler");
|
|
6
6
|
const factory_1 = require("../../../factory");
|
|
7
|
-
const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
|
|
8
7
|
const authorize_1 = require("./acceptOffer/authorize");
|
|
9
8
|
const factory_2 = require("./acceptOffer/factory");
|
|
10
9
|
function findCOAInfo(params) {
|
|
@@ -39,12 +38,11 @@ function acceptOffer(params) {
|
|
|
39
38
|
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
40
39
|
id: params.purpose.id
|
|
41
40
|
}, ['project', 'agent', 'typeOf']);
|
|
42
|
-
//
|
|
43
|
-
await
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, { issueForce: false })(repos);
|
|
41
|
+
// // 注文ドキュメントを参照(2026-06-24~)
|
|
42
|
+
// const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
43
|
+
// identifier: transaction.id,
|
|
44
|
+
// project: { id: transaction.project.id },
|
|
45
|
+
// });
|
|
48
46
|
const coaInfo = await findCOAInfo({ id: params.object.event.id, project: { id: transaction.project.id } })(repos);
|
|
49
47
|
const updTmpReserveSeatArgs = (0, factory_2.createUpdTmpReserveSeatArgs)({ object: params.object, coaInfo });
|
|
50
48
|
let updTmpReserveSeatResult;
|
|
@@ -32,7 +32,7 @@ export declare function responseBody2acceptedOffers4result(params: {
|
|
|
32
32
|
responseBody: IResponseBody;
|
|
33
33
|
acceptedOffer: IAcceptedOffer4COA[];
|
|
34
34
|
event: Pick<IMinimizedIndividualEvent, 'coaInfo' | 'doorTime' | 'endDate' | 'id' | 'location' | 'startDate' | 'superEvent' | 'typeOf' | 'identifier' | 'name'>;
|
|
35
|
-
seller
|
|
35
|
+
seller?: never;
|
|
36
36
|
bookingTime: Date;
|
|
37
37
|
totalPrice: number;
|
|
38
38
|
}): IResultAcceptedOffer[];
|
|
@@ -103,7 +103,7 @@ function authorize(params) {
|
|
|
103
103
|
responseBody: params.result.responseBody,
|
|
104
104
|
acceptedOffer: acceptedOffers,
|
|
105
105
|
event: screeningEvent,
|
|
106
|
-
seller: transaction.seller,
|
|
106
|
+
// seller: transaction.seller,
|
|
107
107
|
bookingTime: (0, moment_1.default)(action.startDate)
|
|
108
108
|
.toDate(),
|
|
109
109
|
totalPrice: price
|
|
@@ -126,7 +126,7 @@ function changeOffers(params) {
|
|
|
126
126
|
responseBody: updTmpReserveSeatResult,
|
|
127
127
|
acceptedOffer: acceptedOffers,
|
|
128
128
|
event: screeningEvent,
|
|
129
|
-
seller: transaction.seller,
|
|
129
|
+
// seller: transaction.seller,
|
|
130
130
|
bookingTime: (0, moment_1.default)(authorizeAction.startDate)
|
|
131
131
|
.toDate(),
|
|
132
132
|
totalPrice: price
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 注文決済時処理
|
|
3
|
+
*/
|
|
1
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
2
5
|
import { factory } from '../../../factory';
|
|
3
6
|
declare function onOrderPaymentDue(params: {
|
|
4
|
-
order: Pick<factory.order.IOrder, 'paymentMethods' | 'project' | 'orderNumber' | 'confirmationNumber' | 'orderDate' | '
|
|
7
|
+
order: Pick<factory.order.IOrder, 'paymentMethods' | 'project' | 'orderNumber' | 'confirmationNumber' | 'orderDate' | 'typeOf'> & {
|
|
5
8
|
orderStatus: factory.orderStatus.OrderPaymentDue;
|
|
6
9
|
};
|
|
7
10
|
}): (repos: {
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.onOrderPaymentDue = onOrderPaymentDue;
|
|
7
|
-
/**
|
|
8
|
-
* 注文決済時処理
|
|
9
|
-
*/
|
|
10
|
-
const debug_1 = __importDefault(require("debug"));
|
|
11
4
|
const factory_1 = require("../../../factory");
|
|
12
|
-
// import { createMaskedCustomer } from '../../../factory/order';
|
|
13
|
-
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
14
5
|
function onOrderPaymentDue(params) {
|
|
15
6
|
return async (repos) => {
|
|
16
|
-
debug('onOrderStatusChanged called.', params.order.orderNumber, params.order.orderStatus, params.order.orderDate);
|
|
17
7
|
let tasks;
|
|
18
|
-
// const maskedCustomer = createMaskedCustomer(params.order, { noProfile: true });
|
|
19
8
|
const simpleOrder = {
|
|
20
9
|
typeOf: params.order.typeOf,
|
|
21
|
-
// seller: {
|
|
22
|
-
// id: params.order.seller.id,
|
|
23
|
-
// typeOf: params.order.seller.typeOf,
|
|
24
|
-
// name: params.order.seller.name
|
|
25
|
-
// }, // 廃止(2024-03-06~)
|
|
26
|
-
// customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id }, // 廃止(2024-03-06~)
|
|
27
10
|
orderNumber: params.order.orderNumber,
|
|
28
|
-
// price: params.order.price,
|
|
29
|
-
// priceCurrency: params.order.priceCurrency,
|
|
30
11
|
orderDate: params.order.orderDate
|
|
31
12
|
};
|
|
32
13
|
switch (params.order.orderStatus) {
|
|
@@ -62,12 +43,7 @@ function createConfirmPayTransactionTasks(order, simpleOrder) {
|
|
|
62
43
|
object: { transactionNumber: { $eq: invoice.paymentMethodId } },
|
|
63
44
|
purpose: { orderNumber: { $eq: order.orderNumber } }
|
|
64
45
|
}
|
|
65
|
-
}, ['id']
|
|
66
|
-
// {
|
|
67
|
-
// data: 0, executionResults: 0, name: 0, numberOfTried: 0,
|
|
68
|
-
// remainingNumberOfTries: 0, runsAt: 0, status: 0
|
|
69
|
-
// }
|
|
70
|
-
);
|
|
46
|
+
}, ['id']);
|
|
71
47
|
if (existingTasks.length === 0) {
|
|
72
48
|
const data = {
|
|
73
49
|
project: order.project,
|
|
@@ -114,7 +90,6 @@ function createCreateAccountingReportTask(order) {
|
|
|
114
90
|
executionResults: [],
|
|
115
91
|
data: {
|
|
116
92
|
object: { mainEntity: { orderNumber: order.orderNumber } }
|
|
117
|
-
// project: { id: order.project.id }
|
|
118
93
|
}
|
|
119
94
|
};
|
|
120
95
|
return [task];
|
|
@@ -10,7 +10,7 @@ declare function createPaymentMethods(params: {
|
|
|
10
10
|
};
|
|
11
11
|
declare function createSeller(params: {
|
|
12
12
|
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'seller'>;
|
|
13
|
-
}): factory.order.ISeller
|
|
13
|
+
}): Pick<factory.order.ISeller, 'id' | 'name' | 'typeOf'>;
|
|
14
14
|
declare function createPlacingOrder(params: {
|
|
15
15
|
transaction: IPlaceOrderTransaction;
|
|
16
16
|
authorizePaymentActions: Pick<factory.action.authorize.paymentMethod.any.IAction, 'result'>[];
|
|
@@ -61,9 +61,9 @@ function createSeller(params) {
|
|
|
61
61
|
return {
|
|
62
62
|
id: seller.id,
|
|
63
63
|
name: (typeof seller.name === 'string') ? seller.name : String(seller.name?.ja),
|
|
64
|
-
typeOf: seller.typeOf
|
|
65
|
-
// 追加特性を追加(2023-08-08~)
|
|
66
|
-
additionalProperty: (Array.isArray(seller.additionalProperty)) ? seller.additionalProperty : []
|
|
64
|
+
typeOf: seller.typeOf
|
|
65
|
+
// // 追加特性を追加(2023-08-08~)
|
|
66
|
+
// additionalProperty: (Array.isArray(seller.additionalProperty)) ? seller.additionalProperty : []
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
function createPlacingOrder(params) {
|
|
@@ -91,7 +91,7 @@ function createPlacingOrder(params) {
|
|
|
91
91
|
// if (orderByTransaction === undefined) {
|
|
92
92
|
// throw new factory.errors.NotFound('transaction.result.order');
|
|
93
93
|
// }
|
|
94
|
-
const seller = createSeller({ transaction });
|
|
94
|
+
// const seller = createSeller({ transaction });
|
|
95
95
|
// discontinue(2026-06-11~)
|
|
96
96
|
// const name: string | undefined =
|
|
97
97
|
// (typeof transaction.object.name === 'string') ? transaction.object.name : undefined;
|
|
@@ -119,7 +119,7 @@ function createPlacingOrder(params) {
|
|
|
119
119
|
orderNumber,
|
|
120
120
|
typeOf: factory_1.factory.order.OrderType.Order, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
121
121
|
orderStatus: factory_1.factory.orderStatus.OrderPaymentDue, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
122
|
-
seller, //
|
|
122
|
+
// seller, // 取引開始時の注文ドキュメント作成へ移行(2026-06-25~)
|
|
123
123
|
paymentMethods, // 2024-06-17~
|
|
124
124
|
price, // 2024-06-17~
|
|
125
125
|
priceCurrency: factory_1.factory.priceCurrency.JPY, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
@@ -89,10 +89,10 @@ function placeOrder(params) {
|
|
|
89
89
|
orderNumber: order.orderNumber,
|
|
90
90
|
confirmationNumber: order.confirmationNumber,
|
|
91
91
|
orderDate: order.orderDate,
|
|
92
|
-
seller: order.seller,
|
|
92
|
+
// seller: order.seller,
|
|
93
93
|
typeOf: order.typeOf,
|
|
94
|
-
price: order.price,
|
|
95
|
-
priceCurrency: order.priceCurrency,
|
|
94
|
+
// price: order.price,
|
|
95
|
+
// priceCurrency: order.priceCurrency,
|
|
96
96
|
orderStatus: order.orderStatus
|
|
97
97
|
}
|
|
98
98
|
})({
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../../factory';
|
|
2
2
|
import type { ConfirmationNumberRepo } from '../../../../repo/confirmationNumber';
|
|
3
3
|
import type { OrderInTransactionRepo } from '../../../../repo/orderInTransaction';
|
|
4
|
-
import type { OrderNumberRepo } from '../../../../repo/orderNumber';
|
|
5
|
-
import type { ProjectRepo } from '../../../../repo/project';
|
|
6
4
|
import type { PlaceOrderRepo } from '../../../../repo/transaction/placeOrder';
|
|
7
5
|
declare function fixOrderAsNeeded(params: {
|
|
8
6
|
project: {
|
|
@@ -10,11 +8,9 @@ declare function fixOrderAsNeeded(params: {
|
|
|
10
8
|
};
|
|
11
9
|
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
12
10
|
}): (repos: {
|
|
13
|
-
project: ProjectRepo;
|
|
14
11
|
placeOrder: PlaceOrderRepo;
|
|
15
12
|
confirmationNumber: ConfirmationNumberRepo;
|
|
16
13
|
orderInTransaction: OrderInTransactionRepo;
|
|
17
|
-
orderNumber: OrderNumberRepo;
|
|
18
14
|
}) => Promise<{
|
|
19
15
|
confirmationNumber: string;
|
|
20
16
|
orderNumber: string;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fixOrderAsNeeded = fixOrderAsNeeded;
|
|
4
4
|
const factory_1 = require("../../../../factory");
|
|
5
5
|
const publishConfirmationNumberIfNotExist_1 = require("../../../transaction/placeOrder/publishConfirmationNumberIfNotExist");
|
|
6
|
-
const issueOrderNumberIfNotExist_1 = require("../../../transaction/placeOrder/issueOrderNumberIfNotExist");
|
|
7
6
|
function fixOrderAsNeeded(params) {
|
|
8
7
|
return async (repos) => {
|
|
9
8
|
const orderDate = new Date();
|
|
@@ -17,12 +16,11 @@ function fixOrderAsNeeded(params) {
|
|
|
17
16
|
object: { orderDate }
|
|
18
17
|
})(repos);
|
|
19
18
|
// }
|
|
20
|
-
//
|
|
21
|
-
const orderNumber = await
|
|
19
|
+
// 注文ドキュメントを参照(2026-06-24~)
|
|
20
|
+
const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
21
|
+
identifier: params.purpose.id,
|
|
22
22
|
project: { id: params.project.id },
|
|
23
|
-
|
|
24
|
-
object: { orderDate }
|
|
25
|
-
}, { issueForce: false })(repos);
|
|
23
|
+
});
|
|
26
24
|
return { confirmationNumber, orderNumber };
|
|
27
25
|
};
|
|
28
26
|
}
|
|
@@ -7,11 +7,8 @@ import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
|
7
7
|
import type { EventRepo } from '../../../repo/event';
|
|
8
8
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
9
9
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
10
|
-
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
11
|
-
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
12
10
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
13
11
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
14
|
-
import type { ProjectRepo } from '../../../repo/project';
|
|
15
12
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
16
13
|
import type { TicketRepo } from '../../../repo/ticket';
|
|
17
14
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
@@ -25,12 +22,9 @@ interface IPublishPaymentUrlRepos {
|
|
|
25
22
|
event: EventRepo;
|
|
26
23
|
eventSeries: EventSeriesRepo;
|
|
27
24
|
issuer: IssuerRepo;
|
|
28
|
-
orderInTransaction: OrderInTransactionRepo;
|
|
29
|
-
orderNumber: OrderNumberRepo;
|
|
30
25
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
31
26
|
paymentService: PaymentServiceRepo;
|
|
32
27
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
33
|
-
project: ProjectRepo;
|
|
34
28
|
ticket: TicketRepo;
|
|
35
29
|
placeOrder: PlaceOrderRepo;
|
|
36
30
|
transactionNumber: TransactionNumberRepo;
|
|
@@ -36,7 +36,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.publishPaymentUrl = publishPaymentUrl;
|
|
37
37
|
const factory_1 = require("../../../factory");
|
|
38
38
|
const PayTransactionService = __importStar(require("../../assetTransaction/pay"));
|
|
39
|
-
const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
|
|
40
39
|
const fixTransactionNumberOnPublishPaymentUrl_1 = require("./publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl");
|
|
41
40
|
const factory_2 = require("./factory");
|
|
42
41
|
/**
|
|
@@ -53,12 +52,11 @@ function publishPaymentUrl(params) {
|
|
|
53
52
|
if (project.id !== transaction.project.id) {
|
|
54
53
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
|
|
55
54
|
}
|
|
56
|
-
//
|
|
57
|
-
await
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, { issueForce: false })(repos);
|
|
55
|
+
// // 注文ドキュメントを参照(2026-06-24~)
|
|
56
|
+
// const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
57
|
+
// identifier: transaction.id,
|
|
58
|
+
// project: { id: transaction.project.id },
|
|
59
|
+
// });
|
|
62
60
|
// 取引番号生成
|
|
63
61
|
const { transactionNumber, ticketToken } = await (0, fixTransactionNumberOnPublishPaymentUrl_1.fixTransactionNumberOnPublishPaymentUrl)({
|
|
64
62
|
object: params.object,
|
|
@@ -7,9 +7,9 @@ const acceptCOAOffer_1 = require("../../repo/action/acceptCOAOffer");
|
|
|
7
7
|
const authorizeOffer_1 = require("../../repo/action/authorizeOffer");
|
|
8
8
|
const credentials_1 = require("../../repo/credentials");
|
|
9
9
|
const event_1 = require("../../repo/event");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
// import { OrderInTransactionRepo } from '../../repo/orderInTransaction';
|
|
11
|
+
// import { OrderNumberRepo } from '../../repo/orderNumber';
|
|
12
|
+
// import { ProjectRepo } from '../../repo/project';
|
|
13
13
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
14
14
|
const integration_1 = require("../../repo/setting/integration");
|
|
15
15
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
@@ -86,8 +86,8 @@ function call(params) {
|
|
|
86
86
|
action: actionRepo,
|
|
87
87
|
authorizeOfferAction: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
|
|
88
88
|
event: new event_1.EventRepo(connection),
|
|
89
|
-
orderNumber: new
|
|
90
|
-
project: new
|
|
89
|
+
// orderNumber: new OrderNumberRepo({ connection }),
|
|
90
|
+
// project: new ProjectRepo(connection),
|
|
91
91
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
92
92
|
reserveService,
|
|
93
93
|
masterService
|
|
@@ -104,9 +104,9 @@ function call(params) {
|
|
|
104
104
|
})({
|
|
105
105
|
action: actionRepo,
|
|
106
106
|
event: new event_1.EventRepo(connection),
|
|
107
|
-
orderInTransaction: new
|
|
108
|
-
orderNumber: new
|
|
109
|
-
project: new
|
|
107
|
+
// orderInTransaction: new OrderInTransactionRepo(connection),
|
|
108
|
+
// orderNumber: new OrderNumberRepo({ connection }),
|
|
109
|
+
// project: new ProjectRepo(connection),
|
|
110
110
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
111
111
|
reserveService,
|
|
112
112
|
masterService
|
|
@@ -9,11 +9,11 @@ const authorization_1 = require("../../repo/authorization");
|
|
|
9
9
|
const event_1 = require("../../repo/event");
|
|
10
10
|
const eventSeries_1 = require("../../repo/eventSeries");
|
|
11
11
|
const issuer_1 = require("../../repo/issuer");
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// import { OrderInTransactionRepo } from '../../repo/orderInTransaction';
|
|
13
|
+
// import { OrderNumberRepo } from '../../repo/orderNumber';
|
|
14
14
|
const paymentService_1 = require("../../repo/paymentService");
|
|
15
15
|
const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
16
|
-
|
|
16
|
+
// import { ProjectRepo } from '../../repo/project';
|
|
17
17
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
18
18
|
const integration_1 = require("../../repo/setting/integration");
|
|
19
19
|
const ticket_1 = require("../../repo/ticket");
|
|
@@ -48,12 +48,12 @@ function call(params) {
|
|
|
48
48
|
event: new event_1.EventRepo(connection),
|
|
49
49
|
eventSeries: new eventSeries_1.EventSeriesRepo(connection),
|
|
50
50
|
issuer: new issuer_1.IssuerRepo(connection),
|
|
51
|
-
orderInTransaction: new
|
|
52
|
-
orderNumber: new
|
|
51
|
+
// orderInTransaction: new OrderInTransactionRepo(connection),
|
|
52
|
+
// orderNumber: new OrderNumberRepo({ connection }),
|
|
53
53
|
paymentAccepted: new sellerPaymentAccepted_1.SellerPaymentAcceptedRepo(connection),
|
|
54
54
|
paymentService: new paymentService_1.PaymentServiceRepo(connection),
|
|
55
55
|
paymentServiceProvider: new paymentServiceProvider_1.PaymentServiceProviderRepo(connection),
|
|
56
|
-
project: new
|
|
56
|
+
// project: new ProjectRepo(connection),
|
|
57
57
|
ticket: new ticket_1.TicketRepo(connection),
|
|
58
58
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
59
59
|
transactionNumber: new transactionNumber_1.TransactionNumberRepo({ connection })
|
package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare function createSendEmailMessageActions(params: {
|
|
|
9
9
|
typeOf: factory.order.OrderType;
|
|
10
10
|
};
|
|
11
11
|
customer: factory.order.ICustomer;
|
|
12
|
-
seller: factory.order.ISeller
|
|
12
|
+
seller: Pick<factory.order.ISeller, 'name' | 'typeOf'>;
|
|
13
13
|
paymentMethods: factory.order.IReferencedInvoice[];
|
|
14
14
|
potentialActions?: factory.transaction.placeOrder.IPotentialActionsParams;
|
|
15
15
|
}, setting: Pick<ISetting, 'defaultSenderEmail'>): Promise<{
|
|
@@ -12,7 +12,7 @@ export declare function createPotentialActions(params: {
|
|
|
12
12
|
typeOf: factory.order.OrderType;
|
|
13
13
|
};
|
|
14
14
|
customer: factory.order.ICustomer;
|
|
15
|
-
seller: factory.order.ISeller
|
|
15
|
+
seller: Pick<factory.order.ISeller, 'name' | 'typeOf'>;
|
|
16
16
|
paymentMethods: factory.order.IReferencedInvoice[];
|
|
17
17
|
potentialActions?: factory.transaction.placeOrder.IPotentialActionsParams;
|
|
18
18
|
}, setting: Pick<ISetting, 'defaultSenderEmail'>): Promise<{
|
|
@@ -80,12 +80,6 @@ function confirm(params, options) {
|
|
|
80
80
|
if (typeof transaction.object.paymentMethods?.paymentMethodId === 'string') {
|
|
81
81
|
acceptPayActions = await searchAcceptPayActions(params)(repos);
|
|
82
82
|
}
|
|
83
|
-
// 注文番号は興行オファー承認時に発行済のはずなので、ここは不要(承認オファーなしの注文は存在しえない)(2026-06-16~)
|
|
84
|
-
// const orderNumber = await issueOrderNumberIfNotExist({
|
|
85
|
-
// project: { id: transaction.project.id },
|
|
86
|
-
// id: transaction.id,
|
|
87
|
-
// object: { orderDate: params.result.order.orderDate }
|
|
88
|
-
// })(repos);
|
|
89
83
|
// 必要あらば注文コード発行(2024-02-05~)
|
|
90
84
|
let code;
|
|
91
85
|
const publishCodeExpiresInSeconds = options.publishCodeExpiresInSeconds;
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.issueOrderNumberIfNotExist = issueOrderNumberIfNotExist;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
const USE_LEGACY_ISSUE_ORDER_NUMBER = process.env.USE_LEGACY_ISSUE_ORDER_NUMBER === '1';
|
|
5
|
+
// const USE_LEGACY_ISSUE_ORDER_NUMBER = process.env.USE_LEGACY_ISSUE_ORDER_NUMBER === '1';
|
|
6
6
|
/**
|
|
7
7
|
* 未発行であれば、注文番号を発行して取引に保管する
|
|
8
8
|
*/
|
|
9
|
-
function issueOrderNumberIfNotExist(params
|
|
9
|
+
function issueOrderNumberIfNotExist(params) {
|
|
10
10
|
return async (repos) => {
|
|
11
|
-
// issueForceオプションあるいは、廃止予定の発行オプションの場合、注文番号を新たに発行する
|
|
12
|
-
const issueOrderNumber = options?.issueForce === true || USE_LEGACY_ISSUE_ORDER_NUMBER;
|
|
13
|
-
if (!issueOrderNumber) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
11
|
+
// // issueForceオプションあるいは、廃止予定の発行オプションの場合、注文番号を新たに発行する
|
|
12
|
+
// const issueOrderNumber = options?.issueForce === true || USE_LEGACY_ISSUE_ORDER_NUMBER;
|
|
13
|
+
// if (!issueOrderNumber) {
|
|
14
|
+
// // 注文ドキュメントを参照(2026-06-24~)
|
|
15
|
+
// return repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
16
|
+
// identifier: params.id,
|
|
17
|
+
// project: { id: params.project.id }
|
|
18
|
+
// })
|
|
19
|
+
// }
|
|
20
20
|
// 1. 最初のチェック
|
|
21
21
|
let orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: params.id });
|
|
22
22
|
// すでに発行済であれば何もしない
|
|
@@ -18,5 +18,7 @@ type IStartPlaceOrderParams = factory.transaction.placeOrder.IStartParamsWithout
|
|
|
18
18
|
*/
|
|
19
19
|
broker?: factory.order.IBroker;
|
|
20
20
|
};
|
|
21
|
-
declare function createStartParams(params: IStartPlaceOrderParams, expiresInSeconds: number, passport: IVerifiedPassport | undefined, seller: Pick<factory.seller.ISeller, 'id' | 'name' | 'typeOf' | 'project' | 'additionalProperty'>,
|
|
21
|
+
declare function createStartParams(params: IStartPlaceOrderParams, expiresInSeconds: number, passport: IVerifiedPassport | undefined, seller: Pick<factory.seller.ISeller, 'id' | 'name' | 'typeOf' | 'project' | 'additionalProperty'>, options: {
|
|
22
|
+
minimizeStartPlaceOrderParams: boolean;
|
|
23
|
+
}, customerType?: string): factory.transaction.placeOrder.IStartParams;
|
|
22
24
|
export { AGENT_IDENTIFIER_NAME_PASSPORT, createStartParams, IStartPlaceOrderParams };
|
|
@@ -5,7 +5,8 @@ exports.createStartParams = createStartParams;
|
|
|
5
5
|
const factory_1 = require("../../../../factory");
|
|
6
6
|
const AGENT_IDENTIFIER_NAME_PASSPORT = 'passport';
|
|
7
7
|
exports.AGENT_IDENTIFIER_NAME_PASSPORT = AGENT_IDENTIFIER_NAME_PASSPORT;
|
|
8
|
-
function createStartParams(params, expiresInSeconds, passport, seller, customerType) {
|
|
8
|
+
function createStartParams(params, expiresInSeconds, passport, seller, options, customerType) {
|
|
9
|
+
const { minimizeStartPlaceOrderParams } = options;
|
|
9
10
|
// const { broker } = params;
|
|
10
11
|
// let clientUser: Omit<factory.clientUser.IClientUser, 'scope' | 'scopes'> | undefined;
|
|
11
12
|
let instrument;
|
|
@@ -20,7 +21,7 @@ function createStartParams(params, expiresInSeconds, passport, seller, customerT
|
|
|
20
21
|
// ...(typeof clientUser?.client_id === 'string') ? { clientUser } : undefined, // discontinue(2026-06-10~)
|
|
21
22
|
// ...(typeof params.object?.name === 'string') ? { name: params.object?.name } : undefined, // discontinue(2026-06-11~)
|
|
22
23
|
// ...(typeof broker?.typeOf === 'string') ? { broker: broker } : undefined, // discontinue(2026-06-22~)
|
|
23
|
-
...(typeof params.object.customer?.typeOf === 'string') ? { customer: params.object.customer } : undefined,
|
|
24
|
+
...(!minimizeStartPlaceOrderParams && typeof params.object.customer?.typeOf === 'string') ? { customer: params.object.customer } : undefined,
|
|
24
25
|
...(typeof customerType === 'string') ? { customerType } : undefined
|
|
25
26
|
};
|
|
26
27
|
if (typeof seller.id !== 'string') {
|
|
@@ -43,12 +44,18 @@ function createStartParams(params, expiresInSeconds, passport, seller, customerT
|
|
|
43
44
|
project: { typeOf: seller.project.typeOf, id: seller.project.id },
|
|
44
45
|
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
45
46
|
agent,
|
|
46
|
-
seller:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
seller: (minimizeStartPlaceOrderParams)
|
|
48
|
+
? {
|
|
49
|
+
id: seller.id,
|
|
50
|
+
name: { ja: String(seller.name.ja) },
|
|
51
|
+
typeOf: seller.typeOf
|
|
52
|
+
}
|
|
53
|
+
: {
|
|
54
|
+
id: seller.id,
|
|
55
|
+
name: seller.name,
|
|
56
|
+
typeOf: seller.typeOf,
|
|
57
|
+
additionalProperty: (Array.isArray(seller.additionalProperty)) ? seller.additionalProperty : [] // 追加特性を追加(2023-08-08~)
|
|
58
|
+
},
|
|
52
59
|
object: transactionObject,
|
|
53
60
|
expiresInSeconds,
|
|
54
61
|
...(typeof instrument?.id === 'string') ? { instrument } : undefined
|
|
@@ -23,7 +23,8 @@ function start(params, options) {
|
|
|
23
23
|
throw new factory_1.factory.errors.NotFound('eligibleTransactionDuration.maxValue');
|
|
24
24
|
}
|
|
25
25
|
// 取引ファクトリーで新しい進行中取引オブジェクトを作成
|
|
26
|
-
const
|
|
26
|
+
const { minimizeStartPlaceOrderParams } = options;
|
|
27
|
+
const startParams = (0, factory_2.createStartParams)(params, expiresInSeconds, passport, seller, { minimizeStartPlaceOrderParams }, customerType);
|
|
27
28
|
let transaction;
|
|
28
29
|
// lock passport(2024-07-05~)
|
|
29
30
|
if (passport !== undefined) {
|
|
@@ -53,27 +54,25 @@ function start(params, options) {
|
|
|
53
54
|
transaction = await repos.placeOrder.startPlaceOrder(startParams);
|
|
54
55
|
}
|
|
55
56
|
// support createOrderDocument(2026-06-23~)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// console.log('createPlaceOrderResult:', createPlaceOrderResult);
|
|
76
|
-
}
|
|
57
|
+
const orderNumber = await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
|
|
58
|
+
project: { id: params.project.id },
|
|
59
|
+
id: transaction.id,
|
|
60
|
+
object: { orderDate: new Date() }
|
|
61
|
+
})(repos);
|
|
62
|
+
await repos.orderInTransaction.createPlaceOrderIfNotExists({
|
|
63
|
+
orderNumber,
|
|
64
|
+
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
65
|
+
identifier: transaction.id,
|
|
66
|
+
seller: {
|
|
67
|
+
id: seller.id,
|
|
68
|
+
name: (typeof seller.name === 'string') ? seller.name : String(seller.name?.ja),
|
|
69
|
+
typeOf: seller.typeOf,
|
|
70
|
+
additionalProperty: (Array.isArray(seller.additionalProperty)) ? seller.additionalProperty : [] // 追加特性を追加(2023-08-08~)
|
|
71
|
+
},
|
|
72
|
+
...((typeof params.object.customer?.typeOf === 'string') && { customer: params.object.customer }),
|
|
73
|
+
...((typeof params.broker?.typeOf === 'string') && { broker: params.broker })
|
|
74
|
+
});
|
|
75
|
+
// console.log('createPlaceOrderResult:', createPlaceOrderResult);
|
|
77
76
|
return transaction;
|
|
78
77
|
};
|
|
79
78
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
3
|
-
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
4
|
-
import type { ProjectRepo } from '../../../repo/project';
|
|
5
3
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
6
4
|
/**
|
|
7
5
|
* 取引人プロフィール更新
|
|
@@ -17,7 +15,5 @@ export declare function updateAgent(params: {
|
|
|
17
15
|
};
|
|
18
16
|
}): (repos: {
|
|
19
17
|
orderInTransaction: OrderInTransactionRepo;
|
|
20
|
-
orderNumber: OrderNumberRepo;
|
|
21
|
-
project: ProjectRepo;
|
|
22
18
|
placeOrder: PlaceOrderRepo;
|
|
23
19
|
}) => Promise<void>;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateAgent = updateAgent;
|
|
4
4
|
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
5
5
|
const factory_1 = require("../../../factory");
|
|
6
|
-
const issueOrderNumberIfNotExist_1 = require("./issueOrderNumberIfNotExist");
|
|
7
6
|
function fixCustomer(params) {
|
|
8
7
|
return async (repos) => {
|
|
9
8
|
let formattedTelephone;
|
|
@@ -74,11 +73,11 @@ function updateAgent(params) {
|
|
|
74
73
|
const { customer, transaction } = await fixCustomer(params)(repos);
|
|
75
74
|
// also save in orderInTransaction(2024-06-20~)
|
|
76
75
|
if (customer !== undefined) {
|
|
77
|
-
|
|
76
|
+
// 注文ドキュメントを参照(2026-06-24~)
|
|
77
|
+
const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
78
|
+
identifier: params.id,
|
|
78
79
|
project: { id: transaction.project.id },
|
|
79
|
-
|
|
80
|
-
object: { orderDate: new Date() }
|
|
81
|
-
}, { issueForce: false })(repos);
|
|
80
|
+
});
|
|
82
81
|
const customerName = (typeof customer.name === 'string' && customer.name !== '')
|
|
83
82
|
? customer.name
|
|
84
83
|
: (typeof customer.givenName === 'string' && typeof customer.familyName === 'string'
|
package/package.json
CHANGED