@chevre/domain 24.0.0-alpha.34 → 24.0.0-alpha.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/repo/action/acceptCOAOffer.d.ts +9 -0
- package/lib/chevre/repo/action/acceptCOAOffer.js +11 -0
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/action/authorizeOffer.d.ts +15 -0
- package/lib/chevre/repo/action/authorizeOffer.js +11 -0
- package/lib/chevre/repo/action/authorizeProductOffer.js +7 -4
- package/lib/chevre/repo/action.d.ts +3 -11
- package/lib/chevre/repo/action.js +27 -14
- package/lib/chevre/repo/mongoose/schemas/task.js +1 -0
- package/lib/chevre/repo/order.js +1 -0
- package/lib/chevre/service/offer/event/authorize/factory.js +0 -2
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +4 -1
- package/lib/chevre/service/offer/event/voidTransaction.js +11 -11
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +0 -2
- package/lib/chevre/service/offer/product/factory.d.ts +5 -5
- package/lib/chevre/service/offer/product/factory.js +13 -5
- package/lib/chevre/service/offer/product.d.ts +1 -1
- package/lib/chevre/service/offer/product.js +9 -5
- package/lib/chevre/service/payment/any/factory.js +1 -0
- package/lib/chevre/service/task/syncResourcesFromCOA.js +2 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +1 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrder/confirm.js +15 -14
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +1 -0
- package/package.json +2 -2
|
@@ -20,4 +20,13 @@ export declare class AcceptCOAOfferActionRepo extends ActionProcessRepo<IAcceptC
|
|
|
20
20
|
id: string;
|
|
21
21
|
};
|
|
22
22
|
}, inclusion: IKeyOfProjection[]): Promise<IAcceptCOAOfferAction>;
|
|
23
|
+
findAcceptCOAOfferActionsByPurpose(params: {
|
|
24
|
+
/**
|
|
25
|
+
* 注文取引でフィルター
|
|
26
|
+
*/
|
|
27
|
+
purpose: {
|
|
28
|
+
typeOf: factory.transactionType;
|
|
29
|
+
id: string;
|
|
30
|
+
};
|
|
31
|
+
}): Promise<IAcceptCOAOfferAction[]>;
|
|
23
32
|
}
|
|
@@ -58,5 +58,16 @@ class AcceptCOAOfferActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
58
58
|
}
|
|
59
59
|
return doc;
|
|
60
60
|
}
|
|
61
|
+
async findAcceptCOAOfferActionsByPurpose(params) {
|
|
62
|
+
return this.findAnyActionsByPurpose({
|
|
63
|
+
...params,
|
|
64
|
+
typeOf: factory.actionType.AcceptAction,
|
|
65
|
+
purpose: {
|
|
66
|
+
typeOf: params.purpose.typeOf,
|
|
67
|
+
id: params.purpose.id
|
|
68
|
+
},
|
|
69
|
+
object: { typeOf: { $eq: factory.offerType.AggregateOffer } }
|
|
70
|
+
});
|
|
71
|
+
}
|
|
61
72
|
}
|
|
62
73
|
exports.AcceptCOAOfferActionRepo = AcceptCOAOfferActionRepo;
|
|
@@ -56,7 +56,7 @@ export declare class ActionProcessRepo<TAction extends IAction<factory.actionTyp
|
|
|
56
56
|
* アクション取消
|
|
57
57
|
*/
|
|
58
58
|
cancelWithVoid(params: {
|
|
59
|
-
typeOf:
|
|
59
|
+
typeOf: TAction['typeOf'];
|
|
60
60
|
id: string;
|
|
61
61
|
cancelAction?: Pick<ICancelActionAction, 'agent' | 'sameAs' | 'startTime'>;
|
|
62
62
|
}): Promise<void>;
|
|
@@ -20,6 +20,21 @@ export declare class AuthorizeOfferActionRepo extends ActionProcessRepo<IAuthori
|
|
|
20
20
|
*/
|
|
21
21
|
ids: string[];
|
|
22
22
|
}): Promise<IAuthorizeOfferActionWithInstrument[]>;
|
|
23
|
+
findAuthorizeOfferActionsByPurpose(params: {
|
|
24
|
+
/**
|
|
25
|
+
* 注文取引でフィルター
|
|
26
|
+
*/
|
|
27
|
+
purpose: {
|
|
28
|
+
typeOf: factory.transactionType;
|
|
29
|
+
id: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* アクションステータスでフィルター
|
|
33
|
+
*/
|
|
34
|
+
actionStatus?: {
|
|
35
|
+
$eq?: factory.actionStatusType.CompletedActionStatus;
|
|
36
|
+
};
|
|
37
|
+
}): Promise<IAuthorizeEventServiceOfferAction[]>;
|
|
23
38
|
/**
|
|
24
39
|
* アクション再開
|
|
25
40
|
*/
|
|
@@ -52,6 +52,17 @@ class AuthorizeOfferActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
52
52
|
id: { $in: params.ids }
|
|
53
53
|
}, ['instrument']);
|
|
54
54
|
}
|
|
55
|
+
async findAuthorizeOfferActionsByPurpose(params) {
|
|
56
|
+
return this.findAnyActionsByPurpose({
|
|
57
|
+
...params,
|
|
58
|
+
typeOf: factory.actionType.AuthorizeAction,
|
|
59
|
+
purpose: {
|
|
60
|
+
typeOf: params.purpose.typeOf,
|
|
61
|
+
id: params.purpose.id
|
|
62
|
+
},
|
|
63
|
+
object: { typeOf: { $eq: factory.action.authorize.offer.eventService.ObjectType.SeatReservation } }
|
|
64
|
+
});
|
|
65
|
+
}
|
|
55
66
|
/**
|
|
56
67
|
* アクション再開
|
|
57
68
|
*/
|
|
@@ -43,10 +43,13 @@ class AuthorizeProductOfferActionRepo extends actionProcess_1.ActionProcessRepo
|
|
|
43
43
|
typeOf: { $eq: factory.offerType.Offer }
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
return authorizeActions.filter((a) =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
return authorizeActions.filter((a) =>
|
|
47
|
+
// Array.isArray(a.object)
|
|
48
|
+
// && a.object.length > 0
|
|
49
|
+
// // && a.object[0].typeOf === factory.offerType.Offer
|
|
50
|
+
// && availableProductTypes.indexOf(a.object[0].itemOffered.typeOf) >= 0
|
|
51
|
+
a.object.typeOf === factory.offerType.AggregateOffer
|
|
52
|
+
&& availableProductTypes_1.availableProductTypes.indexOf(a.object.itemOffered.typeOf) >= 0);
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
exports.AuthorizeProductOfferActionRepo = AuthorizeProductOfferActionRepo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FilterQuery
|
|
1
|
+
import { FilterQuery } from 'mongoose';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
3
|
import type { IDocType } from './mongoose/schemas/action';
|
|
4
4
|
import { IAction, IKeyOfProjection, ActionProcessRepo, ICancelActionAction, IActionRecipe } from './action/actionProcess';
|
|
@@ -16,7 +16,7 @@ export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActio
|
|
|
16
16
|
/**
|
|
17
17
|
* アクション検索
|
|
18
18
|
*/
|
|
19
|
-
search<T extends StartableActionType>(params: factory.action.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<IAction<T>[]>;
|
|
19
|
+
search<T extends StartableActionType>(params: factory.action.ISearchConditions & {}, inclusion: IKeyOfProjection[]): Promise<IAction<T>[]>;
|
|
20
20
|
findPayAction(params: {
|
|
21
21
|
project: {
|
|
22
22
|
id: string;
|
|
@@ -29,7 +29,7 @@ export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActio
|
|
|
29
29
|
/**
|
|
30
30
|
* 取引に対するアクションを検索する
|
|
31
31
|
*/
|
|
32
|
-
searchByPurpose<T extends factory.actionType.
|
|
32
|
+
searchByPurpose<T extends factory.actionType.AuthorizeAction>(params: {
|
|
33
33
|
typeOf?: T;
|
|
34
34
|
purpose: {
|
|
35
35
|
typeOf: factory.transactionType;
|
|
@@ -60,14 +60,6 @@ export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActio
|
|
|
60
60
|
id: string;
|
|
61
61
|
};
|
|
62
62
|
}): Promise<void>;
|
|
63
|
-
updateById(params: {
|
|
64
|
-
id: string;
|
|
65
|
-
update: any;
|
|
66
|
-
}): Promise<void>;
|
|
67
|
-
findByIdAndUpdate(params: {
|
|
68
|
-
id: string;
|
|
69
|
-
update: UpdateQuery<IAction<factory.actionType>>;
|
|
70
|
-
}): Promise<void>;
|
|
71
63
|
/**
|
|
72
64
|
* イベントと入場ゲート指定で予約使用アクションを集計する
|
|
73
65
|
* discontinue(2024-12-26~)
|
|
@@ -365,20 +365,33 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
365
365
|
// }
|
|
366
366
|
// });
|
|
367
367
|
// }
|
|
368
|
-
async updateById(params
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}
|
|
368
|
+
// public async updateById(params: {
|
|
369
|
+
// id: string;
|
|
370
|
+
// update: any;
|
|
371
|
+
// }): Promise<void> {
|
|
372
|
+
// await this.actionModel.updateOne(
|
|
373
|
+
// { _id: { $eq: params.id } },
|
|
374
|
+
// params.update
|
|
375
|
+
// )
|
|
376
|
+
// .exec();
|
|
377
|
+
// }
|
|
378
|
+
// public async findByIdAndUpdate(params: {
|
|
379
|
+
// id: string;
|
|
380
|
+
// update: UpdateQuery<IAction<factory.actionType>>;
|
|
381
|
+
// }): Promise<void> {
|
|
382
|
+
// await this.actionModel.findOneAndUpdate(
|
|
383
|
+
// { _id: { $eq: params.id } },
|
|
384
|
+
// params.update,
|
|
385
|
+
// { projection: { _id: 1 } }
|
|
386
|
+
// )
|
|
387
|
+
// .lean<{ _id: ObjectId }>()
|
|
388
|
+
// .exec()
|
|
389
|
+
// .then((doc) => {
|
|
390
|
+
// if (doc === null) {
|
|
391
|
+
// throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
392
|
+
// }
|
|
393
|
+
// });
|
|
394
|
+
// }
|
|
382
395
|
/**
|
|
383
396
|
* イベントと入場ゲート指定で予約使用アクションを集計する
|
|
384
397
|
* discontinue(2024-12-26~)
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -853,6 +853,7 @@ class OrderRepo {
|
|
|
853
853
|
}, {
|
|
854
854
|
$set: {
|
|
855
855
|
'paymentMethods.$[invoice].paymentMethod.identifier': params.invoice.paymentMethod.identifier,
|
|
856
|
+
// eslint-disable-next-line no-warning-comments
|
|
856
857
|
// TODO 互換性維持対応としてtypeOfも変更しているが、そのうち廃止(2023-08-30)
|
|
857
858
|
'paymentMethods.$[invoice].typeOf': params.invoice.paymentMethod.identifier
|
|
858
859
|
}
|
|
@@ -121,8 +121,6 @@ function createAuthorizeSeatReservationActionAttributes(params) {
|
|
|
121
121
|
event: authorizeObjectEvent
|
|
122
122
|
// pendingTransaction: params.pendingTransaction, // discontinue(2024-06-22~)
|
|
123
123
|
// ...(params.broker !== undefined) ? { broker: params.broker } : undefined // discontinue(2024-06-24~)
|
|
124
|
-
// useResultAcceptedOffers: false // discontinue(2024-06-24~)
|
|
125
|
-
// acceptedOffer: acceptedOffers // discontinue(2024-06-19~)
|
|
126
124
|
};
|
|
127
125
|
const instrument = {
|
|
128
126
|
// typeOf: 'WebAPI',
|
|
@@ -13,6 +13,9 @@ import type { StockHolderRepo } from '../../../repo/stockHolder';
|
|
|
13
13
|
import type { TaskRepo } from '../../../repo/task';
|
|
14
14
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
15
15
|
interface IVoidTransactionRepos {
|
|
16
|
+
/**
|
|
17
|
+
* CancelAction開始で使用される
|
|
18
|
+
*/
|
|
16
19
|
action: ActionRepo;
|
|
17
20
|
acceptCOAOfferAction: AcceptCOAOfferActionRepo;
|
|
18
21
|
authorizeOfferAction: AuthorizeOfferActionRepo;
|
|
@@ -44,4 +47,4 @@ declare function voidTransaction(params: factory.task.IData<factory.taskName.Voi
|
|
|
44
47
|
id: string;
|
|
45
48
|
};
|
|
46
49
|
}): (repos: IVoidTransactionRepos, settings: Settings) => Promise<void>;
|
|
47
|
-
export { voidTransaction };
|
|
50
|
+
export { IVoidTransactionRepos, voidTransaction };
|
|
@@ -47,13 +47,13 @@ function voidTransaction(params) {
|
|
|
47
47
|
};
|
|
48
48
|
const transaction = await repos.placeOrder.findPlaceOrderById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'object']);
|
|
49
49
|
// 興行オファー承認アクション検索
|
|
50
|
-
let authorizeActions = await repos.
|
|
51
|
-
typeOf: factory.actionType.AuthorizeAction,
|
|
50
|
+
let authorizeActions = await repos.authorizeOfferAction.findAuthorizeOfferActionsByPurpose({
|
|
51
|
+
// typeOf: factory.actionType.AuthorizeAction,
|
|
52
52
|
purpose: {
|
|
53
53
|
typeOf: params.purpose.typeOf,
|
|
54
54
|
id: params.purpose.id
|
|
55
55
|
},
|
|
56
|
-
object: { typeOf: { $eq: factory.action.authorize.offer.eventService.ObjectType.SeatReservation } }
|
|
56
|
+
// object: { typeOf: { $eq: factory.action.authorize.offer.eventService.ObjectType.SeatReservation } }
|
|
57
57
|
});
|
|
58
58
|
switch (transaction.status) {
|
|
59
59
|
case factory.transactionStatusType.InProgress:
|
|
@@ -89,7 +89,7 @@ function voidTransaction(params) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
await Promise.all(authorizeActions.map(async (action) => {
|
|
92
|
-
await repos.
|
|
92
|
+
await repos.authorizeOfferAction.cancelWithVoid({ typeOf: action.typeOf, id: action.id, cancelAction });
|
|
93
93
|
switch (action.instrument.typeOf) {
|
|
94
94
|
// case WebAPIIdentifier.COA:
|
|
95
95
|
case factory.assetTransactionType.COAReserveTransaction:
|
|
@@ -129,23 +129,23 @@ function cancelAcceptActions(params) {
|
|
|
129
129
|
id: params.purpose.id
|
|
130
130
|
}, ['typeOf', 'status']);
|
|
131
131
|
// 興行オファー承認アクション検索
|
|
132
|
-
const completedAuthorizeActions = await repos.
|
|
133
|
-
typeOf: factory.actionType.AuthorizeAction,
|
|
132
|
+
const completedAuthorizeActions = await repos.authorizeOfferAction.findAuthorizeOfferActionsByPurpose({
|
|
133
|
+
// typeOf: factory.actionType.AuthorizeAction,
|
|
134
134
|
purpose: {
|
|
135
135
|
typeOf: params.purpose.typeOf,
|
|
136
136
|
id: params.purpose.id
|
|
137
137
|
},
|
|
138
|
-
object: { typeOf: { $eq: factory.action.authorize.offer.eventService.ObjectType.SeatReservation } },
|
|
138
|
+
// object: { typeOf: { $eq: factory.action.authorize.offer.eventService.ObjectType.SeatReservation } },
|
|
139
139
|
actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
|
|
140
140
|
});
|
|
141
141
|
// 興行オファー採用アクション検索
|
|
142
|
-
let acceptActions = await repos.
|
|
143
|
-
typeOf: factory.actionType.AcceptAction,
|
|
142
|
+
let acceptActions = await repos.acceptCOAOfferAction.findAcceptCOAOfferActionsByPurpose({
|
|
143
|
+
// typeOf: factory.actionType.AcceptAction,
|
|
144
144
|
purpose: {
|
|
145
145
|
typeOf: params.purpose.typeOf,
|
|
146
146
|
id: params.purpose.id
|
|
147
147
|
},
|
|
148
|
-
object: { typeOf: { $eq: factory.offerType.AggregateOffer } }
|
|
148
|
+
// object: { typeOf: { $eq: factory.offerType.AggregateOffer } }
|
|
149
149
|
});
|
|
150
150
|
switch (transaction.status) {
|
|
151
151
|
case factory.transactionStatusType.InProgress:
|
|
@@ -173,7 +173,7 @@ function cancelAcceptActions(params) {
|
|
|
173
173
|
}
|
|
174
174
|
const { reserveService } = repos;
|
|
175
175
|
await Promise.all(acceptActions.map(async (action) => {
|
|
176
|
-
await repos.
|
|
176
|
+
await repos.acceptCOAOfferAction.cancelWithVoid({ typeOf: action.typeOf, id: action.id, cancelAction });
|
|
177
177
|
if (reserveService === undefined) {
|
|
178
178
|
throw new factory.errors.Internal('repos.reserveService required');
|
|
179
179
|
}
|
|
@@ -49,10 +49,8 @@ function createAuthorizeSeatReservationActionAttributes(params) {
|
|
|
49
49
|
const authorizeObject = {
|
|
50
50
|
typeOf: factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
|
|
51
51
|
id: params.acceptAction.id,
|
|
52
|
-
// acceptedOffer: params.acceptedOffers, // discontinue acceptedOffers(2024-06-21~)
|
|
53
52
|
event: authorizeObjectEvent,
|
|
54
53
|
pendingTransaction: params.pendingTransaction
|
|
55
|
-
// useResultAcceptedOffers: false // discontinue(2024-06-24~)
|
|
56
54
|
};
|
|
57
55
|
const instrument = {
|
|
58
56
|
// typeOf: 'WebAPI',
|
|
@@ -4,26 +4,26 @@ export declare function createRegisterServiceStartParams(params: {
|
|
|
4
4
|
id: string;
|
|
5
5
|
typeOf: factory.organizationType.Project;
|
|
6
6
|
};
|
|
7
|
-
object: factory.action.authorize.offer.product.
|
|
7
|
+
object: factory.action.authorize.offer.product.IAcceptedOffer[];
|
|
8
8
|
transaction: Pick<factory.transaction.ITransaction<factory.transactionType>, 'seller' | 'expires'>;
|
|
9
9
|
transactionNumber: string;
|
|
10
10
|
}): factory.assetTransaction.registerService.IStartParamsWithoutDetail;
|
|
11
11
|
export declare function createActionAttributes(params: {
|
|
12
|
-
acceptedOffer: factory.action.authorize.offer.product.
|
|
12
|
+
acceptedOffer: factory.action.authorize.offer.product.IAcceptedOffer[];
|
|
13
13
|
transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
14
14
|
transactionNumber: string;
|
|
15
15
|
}): factory.action.authorize.offer.product.IAttributes;
|
|
16
16
|
export declare function acceptedOffers2amount(params: {
|
|
17
17
|
acceptedOffers: IResultAcceptedOffer;
|
|
18
18
|
}): number;
|
|
19
|
-
type IResultAcceptedOffer = factory.
|
|
19
|
+
type IResultAcceptedOffer = factory.order.IAcceptedOffer<factory.order.IPermit>[];
|
|
20
20
|
export declare function responseBody2resultAcceptedOffer(params: {
|
|
21
21
|
project: {
|
|
22
22
|
id: string;
|
|
23
23
|
typeOf: factory.organizationType.Project;
|
|
24
24
|
};
|
|
25
25
|
responseBody: factory.assetTransaction.registerService.ITransaction;
|
|
26
|
-
acceptedOffer: factory.action.authorize.offer.product.
|
|
26
|
+
acceptedOffer: factory.action.authorize.offer.product.IAcceptedOffer[];
|
|
27
27
|
}): IResultAcceptedOffer;
|
|
28
28
|
export declare function createResult(params: {
|
|
29
29
|
project: {
|
|
@@ -32,6 +32,6 @@ export declare function createResult(params: {
|
|
|
32
32
|
};
|
|
33
33
|
requestBody: factory.assetTransaction.registerService.IStartParamsWithoutDetail;
|
|
34
34
|
responseBody: factory.assetTransaction.registerService.ITransaction;
|
|
35
|
-
acceptedOffer: factory.action.authorize.offer.product.
|
|
35
|
+
acceptedOffer: factory.action.authorize.offer.product.IAcceptedOffer[];
|
|
36
36
|
}): factory.action.authorize.offer.product.IResult;
|
|
37
37
|
export {};
|
|
@@ -79,6 +79,13 @@ function createRegisterServiceStartParams(params) {
|
|
|
79
79
|
}
|
|
80
80
|
function createActionAttributes(params) {
|
|
81
81
|
const transaction = params.transaction;
|
|
82
|
+
const actionObject = {
|
|
83
|
+
typeOf: factory.offerType.AggregateOffer,
|
|
84
|
+
itemOffered: {
|
|
85
|
+
id: params.acceptedOffer[0].itemOffered.id,
|
|
86
|
+
typeOf: params.acceptedOffer[0].itemOffered.typeOf
|
|
87
|
+
}
|
|
88
|
+
};
|
|
82
89
|
return {
|
|
83
90
|
project: transaction.project,
|
|
84
91
|
typeOf: factory.actionType.AuthorizeAction,
|
|
@@ -86,7 +93,8 @@ function createActionAttributes(params) {
|
|
|
86
93
|
typeOf: factory.assetTransactionType.RegisterService,
|
|
87
94
|
transactionNumber: params.transactionNumber
|
|
88
95
|
},
|
|
89
|
-
object: params.acceptedOffer,
|
|
96
|
+
// object: params.acceptedOffer,
|
|
97
|
+
object: actionObject, // optimize(2026-03-13~)
|
|
90
98
|
agent: {
|
|
91
99
|
id: transaction.seller.id,
|
|
92
100
|
typeOf: transaction.seller.typeOf,
|
|
@@ -199,7 +207,7 @@ function responseBody2resultAcceptedOffer(params) {
|
|
|
199
207
|
const permitAcceptedOffer = {
|
|
200
208
|
typeOf: responseBodyObject.typeOf,
|
|
201
209
|
id: offer.id,
|
|
202
|
-
name: offer.name,
|
|
210
|
+
// name: offer.name,
|
|
203
211
|
itemOffered,
|
|
204
212
|
priceSpecification,
|
|
205
213
|
serialNumber: params.responseBody.transactionNumber
|
|
@@ -214,10 +222,10 @@ function createResult(params) {
|
|
|
214
222
|
// 金額計算
|
|
215
223
|
const amount = acceptedOffers2amount({ acceptedOffers: acceptedOffers4result });
|
|
216
224
|
return {
|
|
225
|
+
typeOf: factory.offerType.AggregateOffer,
|
|
217
226
|
price: amount,
|
|
218
227
|
priceCurrency: factory.priceCurrency.JPY,
|
|
219
|
-
//
|
|
220
|
-
|
|
221
|
-
responseBody: params.responseBody
|
|
228
|
+
// requestBody: params.requestBody, // discontinue(2026-03-13~)
|
|
229
|
+
// responseBody: params.responseBody // discontinue(2026-03-13~)
|
|
222
230
|
};
|
|
223
231
|
}
|
|
@@ -77,7 +77,7 @@ export declare function authorize(params: {
|
|
|
77
77
|
id: string;
|
|
78
78
|
typeOf: factory.organizationType.Project;
|
|
79
79
|
};
|
|
80
|
-
object: factory.action.authorize.offer.product.
|
|
80
|
+
object: factory.action.authorize.offer.product.IAcceptedOffer[];
|
|
81
81
|
agent: {
|
|
82
82
|
id: string;
|
|
83
83
|
typeOf: factory.personType.Person | factory.creativeWorkType.WebApplication;
|
|
@@ -245,13 +245,17 @@ function voidTransaction(params) {
|
|
|
245
245
|
}
|
|
246
246
|
})
|
|
247
247
|
.then((actions) => actions
|
|
248
|
-
.filter((a) =>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
.filter((a) =>
|
|
249
|
+
// Array.isArray(a.object)
|
|
250
|
+
// && a.object.length > 0
|
|
251
|
+
// && a.object[0].typeOf === factory.offerType.Offer
|
|
252
|
+
// && availableProductTypes.indexOf(a.object[0].itemOffered.typeOf) >= 0
|
|
253
|
+
a.object.typeOf === factory.offerType.AggregateOffer
|
|
254
|
+
&& availableProductTypes_1.availableProductTypes.indexOf(a.object.itemOffered.typeOf) >= 0));
|
|
252
255
|
}
|
|
253
256
|
await Promise.all(authorizeActions.map(async (action) => {
|
|
254
|
-
const productId = action.object[0]?.itemOffered?.id;
|
|
257
|
+
// const productId = action.object[0]?.itemOffered?.id;
|
|
258
|
+
const productId = action.object?.itemOffered?.id;
|
|
255
259
|
if (typeof productId === 'string') {
|
|
256
260
|
// 廃止(2023-12-07~)
|
|
257
261
|
// await processUnlockRegisterMembershipService({
|
|
@@ -276,6 +276,7 @@ function createAuthorizeResult(params) {
|
|
|
276
276
|
typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment,
|
|
277
277
|
referencesOrder // add(2025-11-23~)
|
|
278
278
|
};
|
|
279
|
+
// eslint-disable-next-line no-warning-comments
|
|
279
280
|
// TODO 保留 resultにメンバーシップを追加(2024-08-13~)
|
|
280
281
|
// let resultAsPermit: factory.action.authorize.paymentMethod.any.IResultAsPermit | undefined;
|
|
281
282
|
// if (typeof params.permit?.identifier === 'string') {
|
|
@@ -144,6 +144,7 @@ function syncEventSeries(params) {
|
|
|
144
144
|
project: { typeOf: factory.organizationType.Project, id: params.project.id },
|
|
145
145
|
typeOf: factory.actionType.ReplaceAction,
|
|
146
146
|
agent: params.agent,
|
|
147
|
+
// eslint-disable-next-line no-warning-comments
|
|
147
148
|
// TODO define object
|
|
148
149
|
object: {
|
|
149
150
|
...params.object,
|
|
@@ -212,6 +213,7 @@ function syncEvents(params) {
|
|
|
212
213
|
project: { typeOf: factory.organizationType.Project, id: params.project.id },
|
|
213
214
|
typeOf: factory.actionType.ReplaceAction,
|
|
214
215
|
agent: params.agent,
|
|
216
|
+
// eslint-disable-next-line no-warning-comments
|
|
215
217
|
// TODO define object
|
|
216
218
|
object: {
|
|
217
219
|
...params.object,
|
|
@@ -221,6 +221,7 @@ function deleteTransactionById(params) {
|
|
|
221
221
|
default:
|
|
222
222
|
throw new factory.errors.NotImplemented(`${transaction.status} not implemented`);
|
|
223
223
|
}
|
|
224
|
+
// eslint-disable-next-line no-warning-comments
|
|
224
225
|
// TODO サービス登録取引を削除
|
|
225
226
|
// 決済取引を削除
|
|
226
227
|
const deletePayTransactionsByPlaceOrderResult = await deletePayTransactionsByPlaceOrder({ authorizeActions, transaction })(repos);
|
|
@@ -4,5 +4,6 @@ export type IAuthorizeEventServiceOffer = factory.action.authorize.offer.eventSe
|
|
|
4
4
|
export type IAuthorizeProductOffer = factory.action.authorize.offer.product.IAction;
|
|
5
5
|
export type IAuthorizePaymentAction = Pick<factory.action.authorize.paymentMethod.any.IAction, 'id' | 'result' | 'endDate'> & {
|
|
6
6
|
object: Pick<factory.action.authorize.paymentMethod.any.IObject, 'typeOf' | 'paymentMethodId'>;
|
|
7
|
+
instrument?: never;
|
|
7
8
|
};
|
|
8
9
|
export type IPayTransaction = Pick<factory.assetTransaction.pay.ITransaction, 'object'>;
|
|
@@ -31,7 +31,6 @@ const debug_1 = __importDefault(require("debug"));
|
|
|
31
31
|
const moment_1 = __importDefault(require("moment"));
|
|
32
32
|
const errorHandler_1 = require("../../../errorHandler");
|
|
33
33
|
const factory = __importStar(require("../../../factory"));
|
|
34
|
-
const availableProductTypes_1 = require("../../../factory/availableProductTypes");
|
|
35
34
|
// import { Settings } from '../../../settings';
|
|
36
35
|
const factory_1 = require("../../order/placeOrder/factory");
|
|
37
36
|
const orderedItem_1 = require("../../order/placeOrder/factory/orderedItem");
|
|
@@ -245,27 +244,29 @@ function dissolveAuthorizeActions(completedAuthorizeActions) {
|
|
|
245
244
|
completedAuthorizeActions.forEach((a) => {
|
|
246
245
|
let serialNumber;
|
|
247
246
|
if (Array.isArray(a.object)) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
247
|
+
throw new factory.errors.NotImplemented('authorizeAction object as an array discontinued.'); // discontinue(2026-03-13~)
|
|
248
|
+
// if (
|
|
249
|
+
// a.object.length > 0
|
|
250
|
+
// && a.object.every(({ typeOf }) => typeOf === factory.offerType.Offer)
|
|
251
|
+
// && a.object.every(({ itemOffered }) => availableProductTypes.indexOf(itemOffered.typeOf) >= 0)
|
|
252
|
+
// ) {
|
|
253
|
+
// authorizeProductOfferActions.push(<IAuthorizeProductOffer>a);
|
|
254
|
+
// serialNumber = (<IAuthorizeProductOffer>a).instrument.transactionNumber;
|
|
255
|
+
// }
|
|
254
256
|
}
|
|
255
257
|
else {
|
|
256
258
|
if (a.object.typeOf === factory.action.authorize.offer.eventService.ObjectType.SeatReservation) {
|
|
257
259
|
authorizeEventServiceOfferActions.push(a);
|
|
258
|
-
const assetTransactionNumber = a.instrument
|
|
260
|
+
const assetTransactionNumber = a.instrument?.transactionNumber;
|
|
259
261
|
if (typeof assetTransactionNumber !== 'string') {
|
|
260
262
|
throw new factory.errors.NotFound('instrument.transactionNumber', `action.instrument.transactionNumber not found. [${a.id}]`);
|
|
261
263
|
}
|
|
262
264
|
serialNumber = assetTransactionNumber;
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
// serialNumber = (<IAuthorizeMoneyTransferOffer>a).instrument.transactionNumber;
|
|
265
|
+
}
|
|
266
|
+
else if (a.object.typeOf === factory.offerType.AggregateOffer
|
|
267
|
+
&& a.instrument?.typeOf === factory.assetTransactionType.RegisterService) {
|
|
268
|
+
authorizeProductOfferActions.push(a);
|
|
269
|
+
serialNumber = a.instrument.transactionNumber;
|
|
269
270
|
}
|
|
270
271
|
else if (a.object.typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment) {
|
|
271
272
|
authorizePaymentActions.push(a);
|
|
@@ -214,6 +214,7 @@ function createTasks(params, setting
|
|
|
214
214
|
else {
|
|
215
215
|
taskAttributes.push(voidReserveTaskAttributes, voidPaymentTaskAttributes);
|
|
216
216
|
}
|
|
217
|
+
// eslint-disable-next-line no-warning-comments
|
|
217
218
|
// TODO reimplement
|
|
218
219
|
// temporarily discontinue VoidRegisterServiceTransaction VoidMoneyTransferTransaction(2025-02-25~)
|
|
219
220
|
// const voidRegisterServiceTaskAttributes: factory.task.IAttributes<factory.taskName.VoidRegisterServiceTransaction> = {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "6.0.0-alpha.
|
|
14
|
+
"@chevre/factory": "6.0.0-alpha.1",
|
|
15
15
|
"@cinerino/sdk": "13.2.0",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"postversion": "git push origin --tags",
|
|
100
100
|
"prepublishOnly": "npm run clean && npm run build"
|
|
101
101
|
},
|
|
102
|
-
"version": "24.0.0-alpha.
|
|
102
|
+
"version": "24.0.0-alpha.36"
|
|
103
103
|
}
|