@chevre/domain 28.0.0-alpha.2 → 28.0.0-alpha.3
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/adminTransaction.d.ts +35 -29
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +2 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.js +1 -1
- package/lib/chevre/repo/transaction/placeOrder.d.ts +6 -6
- package/lib/chevre/repo/transaction/placeOrder.js +22 -34
- package/lib/chevre/repo/transaction/returnOrderInProgress.d.ts +1 -1
- package/lib/chevre/repo/transaction.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -1
- package/lib/chevre/service/payment/any/factory.d.ts +2 -2
- package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -3
- package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +13 -1
- package/lib/chevre/service/transaction/returnOrder.d.ts +14 -3
- package/lib/chevre/service/transaction/returnOrder.js +1 -6
- package/lib/chevre/service/transaction.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Connection } from 'mongoose';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
|
-
import { IDocType } from './mongoose/schemas/transaction';
|
|
4
3
|
/**
|
|
5
4
|
* 取引管理リポジトリ
|
|
6
5
|
*/
|
|
@@ -43,7 +42,7 @@ export declare class AdminTransactionRepo {
|
|
|
43
42
|
expires: {
|
|
44
43
|
$lt: Date;
|
|
45
44
|
};
|
|
46
|
-
}): Promise<Pick<factory.transaction.ITransaction
|
|
45
|
+
}): Promise<Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf'> | undefined>;
|
|
47
46
|
findByIdAndDelete(params: {
|
|
48
47
|
id: string;
|
|
49
48
|
}): Promise<void>;
|
|
@@ -51,7 +50,7 @@ export declare class AdminTransactionRepo {
|
|
|
51
50
|
filter: any;
|
|
52
51
|
$unset: any;
|
|
53
52
|
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
54
|
-
getCursor(conditions: any, projection: any, sort?: factory.sortType): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>,
|
|
53
|
+
getCursor(conditions: any, projection: any, sort?: factory.sortType): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, {
|
|
55
54
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
56
55
|
error?: any;
|
|
57
56
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
@@ -66,30 +65,26 @@ export declare class AdminTransactionRepo {
|
|
|
66
65
|
status: factory.transactionStatusType;
|
|
67
66
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
68
67
|
potentialActions?: undefined;
|
|
69
|
-
} & {
|
|
70
|
-
|
|
71
|
-
} & {
|
|
72
|
-
__v: number;
|
|
73
|
-
}) | ({
|
|
74
|
-
object: import("@chevre/factory/lib/chevre/transaction/returnOrder").IObject;
|
|
68
|
+
}, import("./mongoose/virtuals").IVirtuals, {}> & {
|
|
69
|
+
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
75
70
|
error?: any;
|
|
76
71
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
77
|
-
seller: import("@chevre/factory/lib/chevre/transaction").ISeller;
|
|
78
|
-
typeOf: factory.transactionType.
|
|
72
|
+
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
73
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
79
74
|
expires: Date;
|
|
80
|
-
result?: undefined;
|
|
75
|
+
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
81
76
|
startDate: Date;
|
|
82
77
|
endDate?: Date | undefined;
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
79
|
+
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
85
80
|
status: factory.transactionStatusType;
|
|
86
81
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
87
|
-
potentialActions?:
|
|
82
|
+
potentialActions?: undefined;
|
|
88
83
|
} & {
|
|
89
84
|
_id: import("mongoose").Types.ObjectId;
|
|
90
85
|
} & {
|
|
91
86
|
__v: number;
|
|
92
|
-
}
|
|
87
|
+
}, import("mongoose").QueryOptions<{
|
|
93
88
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
94
89
|
error?: any;
|
|
95
90
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
@@ -104,28 +99,39 @@ export declare class AdminTransactionRepo {
|
|
|
104
99
|
status: factory.transactionStatusType;
|
|
105
100
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
106
101
|
potentialActions?: undefined;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
}>, (import("mongoose").Document<unknown, Record<string, never>, {
|
|
103
|
+
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
104
|
+
error?: any;
|
|
105
|
+
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
106
|
+
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
107
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
108
|
+
expires: Date;
|
|
109
|
+
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
110
|
+
startDate: Date;
|
|
111
|
+
endDate?: Date | undefined;
|
|
112
|
+
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
113
|
+
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
114
|
+
status: factory.transactionStatusType;
|
|
115
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
116
|
+
potentialActions?: undefined;
|
|
117
|
+
}, import("./mongoose/virtuals").IVirtuals, {}> & {
|
|
118
|
+
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
113
119
|
error?: any;
|
|
114
120
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
115
|
-
seller: import("@chevre/factory/lib/chevre/transaction").ISeller;
|
|
116
|
-
typeOf: factory.transactionType.
|
|
121
|
+
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
122
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
117
123
|
expires: Date;
|
|
118
|
-
result?: undefined;
|
|
124
|
+
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
119
125
|
startDate: Date;
|
|
120
126
|
endDate?: Date | undefined;
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
128
|
+
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
123
129
|
status: factory.transactionStatusType;
|
|
124
130
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
125
|
-
potentialActions?:
|
|
131
|
+
potentialActions?: undefined;
|
|
126
132
|
} & {
|
|
127
133
|
_id: import("mongoose").Types.ObjectId;
|
|
128
134
|
} & {
|
|
129
135
|
__v: number;
|
|
130
|
-
})
|
|
136
|
+
}) | null>;
|
|
131
137
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
type IPlaceOrder =
|
|
5
|
-
type
|
|
6
|
-
type IDocType = IPlaceOrder | IReturnOrder;
|
|
4
|
+
type IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'endDate' | 'error' | 'expires' | 'instrument' | 'object' | 'potentialActions' | 'project' | 'result' | 'seller' | 'startDate' | 'status' | 'tasksExportAction' | 'typeOf'>;
|
|
5
|
+
type IDocType = IPlaceOrder;
|
|
7
6
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
8
7
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
9
8
|
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
@@ -13,7 +13,7 @@ const schemaDefinition = {
|
|
|
13
13
|
status: String,
|
|
14
14
|
typeOf: String,
|
|
15
15
|
agent: mongoose_1.SchemaTypes.Mixed,
|
|
16
|
-
recipient:
|
|
16
|
+
// recipient: SchemaTypes.Mixed, // discontinue(2026-09-09~)
|
|
17
17
|
seller: mongoose_1.SchemaTypes.Mixed,
|
|
18
18
|
error: mongoose_1.SchemaTypes.Mixed,
|
|
19
19
|
result: mongoose_1.SchemaTypes.Mixed,
|
|
@@ -16,8 +16,8 @@ export type IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, IKey
|
|
|
16
16
|
id: string;
|
|
17
17
|
};
|
|
18
18
|
type IStartedPlaceOrderFields = 'expires' | 'id' | 'startDate' | 'status';
|
|
19
|
-
export type IStartedPlaceOrder = Pick<factory.transaction.ITransaction
|
|
20
|
-
type IFindParams = factory.transaction.ISearchConditions
|
|
19
|
+
export type IStartedPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, IStartedPlaceOrderFields>;
|
|
20
|
+
type IFindParams = Pick<factory.transaction.placeOrder.ISearchConditions, 'agent' | 'ids' | 'limit' | 'object' | 'page' | 'project' | 'seller' | 'sort' | 'startFrom' | 'startThrough' | 'status' | 'statuses' | 'tasksExportAction'> & {};
|
|
21
21
|
/**
|
|
22
22
|
* 注文取引リポジトリ
|
|
23
23
|
*/
|
|
@@ -34,7 +34,7 @@ export declare class PlaceOrderRepo {
|
|
|
34
34
|
findPlaceOrderTransactions(params: Omit<IFindParams, 'result'> & {
|
|
35
35
|
result?: never;
|
|
36
36
|
inclusion: IKeyOfProjection[];
|
|
37
|
-
}): Promise<(Pick<factory.transaction.ITransaction
|
|
37
|
+
}): Promise<(Pick<factory.transaction.placeOrder.ITransaction, IKeyOfProjection> & {
|
|
38
38
|
id: string;
|
|
39
39
|
})[]>;
|
|
40
40
|
/**
|
|
@@ -71,7 +71,7 @@ export declare class PlaceOrderRepo {
|
|
|
71
71
|
/**
|
|
72
72
|
* 取引を開始する
|
|
73
73
|
*/
|
|
74
|
-
startPlaceOrder(params: factory.transaction.IStartParams
|
|
74
|
+
startPlaceOrder(params: factory.transaction.placeOrder.IStartParams): Promise<IStartedPlaceOrder>;
|
|
75
75
|
/**
|
|
76
76
|
* 取引を確定する
|
|
77
77
|
*/
|
|
@@ -83,8 +83,8 @@ export declare class PlaceOrderRepo {
|
|
|
83
83
|
orderNumber: string;
|
|
84
84
|
confirmationNumber: string;
|
|
85
85
|
};
|
|
86
|
-
result: factory.transaction.IResult
|
|
87
|
-
potentialActions?: factory.transaction.IPotentialActions
|
|
86
|
+
result: factory.transaction.placeOrder.IResult;
|
|
87
|
+
potentialActions?: factory.transaction.placeOrder.IPotentialActions;
|
|
88
88
|
}): Promise<void>;
|
|
89
89
|
/**
|
|
90
90
|
* 取引を中止する
|
|
@@ -35,17 +35,17 @@ class PlaceOrderRepo {
|
|
|
35
35
|
this.transactionModel = connection.model(transaction_2.modelName, (0, transaction_2.createSchema)());
|
|
36
36
|
}
|
|
37
37
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
38
|
-
if (params.typeOf !==
|
|
39
|
-
|
|
40
|
-
}
|
|
38
|
+
// if (params.typeOf !== factory.transactionType.PlaceOrder) {
|
|
39
|
+
// throw new factory.errors.Argument('typeOf', `must be ${factory.transactionType.PlaceOrder}`);
|
|
40
|
+
// }
|
|
41
41
|
const andConditions = [];
|
|
42
42
|
const projectIdEq = params.project?.id?.$eq;
|
|
43
43
|
if (typeof projectIdEq === 'string') {
|
|
44
44
|
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
45
45
|
}
|
|
46
|
-
if (typeof params.typeOf === 'string') {
|
|
47
|
-
|
|
48
|
-
}
|
|
46
|
+
// if (typeof params.typeOf === 'string') {
|
|
47
|
+
// andConditions.push({ typeOf: { $eq: params.typeOf } });
|
|
48
|
+
// }
|
|
49
49
|
if (params.startFrom !== undefined) {
|
|
50
50
|
andConditions.push({
|
|
51
51
|
startDate: { $gte: params.startFrom }
|
|
@@ -56,22 +56,22 @@ class PlaceOrderRepo {
|
|
|
56
56
|
startDate: { $lte: params.startThrough }
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
if (params.endFrom !== undefined) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
if (params.endThrough !== undefined) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
59
|
+
// if (params.endFrom !== undefined) {
|
|
60
|
+
// andConditions.push({
|
|
61
|
+
// endDate: {
|
|
62
|
+
// $exists: true,
|
|
63
|
+
// $gte: params.endFrom
|
|
64
|
+
// }
|
|
65
|
+
// });
|
|
66
|
+
// }
|
|
67
|
+
// if (params.endThrough !== undefined) {
|
|
68
|
+
// andConditions.push({
|
|
69
|
+
// endDate: {
|
|
70
|
+
// $exists: true,
|
|
71
|
+
// $lt: params.endThrough
|
|
72
|
+
// }
|
|
73
|
+
// });
|
|
74
|
+
// }
|
|
75
75
|
if (Array.isArray(params.ids)) {
|
|
76
76
|
andConditions.push({
|
|
77
77
|
_id: { $in: params.ids }
|
|
@@ -122,18 +122,6 @@ class PlaceOrderRepo {
|
|
|
122
122
|
if (Array.isArray(sellerIdIn)) {
|
|
123
123
|
andConditions.push({ 'seller.id': { $exists: true, $in: sellerIdIn } });
|
|
124
124
|
}
|
|
125
|
-
// result.orderは完全に廃止したので検索条件としても廃止(2026-06-26~)
|
|
126
|
-
// const resultOrderNumberIn = params.result?.order?.orderNumbers;
|
|
127
|
-
// if (Array.isArray(resultOrderNumberIn)) {
|
|
128
|
-
// andConditions.push({ 'result.order.orderNumber': { $exists: true, $in: resultOrderNumberIn } });
|
|
129
|
-
// }
|
|
130
|
-
// result.orderは完全に廃止したので検索条件としても廃止(2026-06-26~)
|
|
131
|
-
// const resultOrderConfirmationNumberEq = params.result?.order?.confirmationNumber?.$eq;
|
|
132
|
-
// if (typeof resultOrderConfirmationNumberEq === 'string') {
|
|
133
|
-
// andConditions.push({
|
|
134
|
-
// 'result.order.confirmationNumber': { $exists: true, $eq: resultOrderConfirmationNumberEq }
|
|
135
|
-
// });
|
|
136
|
-
// }
|
|
137
125
|
const objectOrderNumberEq = params.object?.orderNumber?.$eq;
|
|
138
126
|
if (typeof objectOrderNumberEq === 'string') {
|
|
139
127
|
andConditions.push({ 'object.orderNumber': { $exists: true, $eq: objectOrderNumberEq } });
|
|
@@ -15,7 +15,7 @@ export declare class ReturnOrderInProgressRepo {
|
|
|
15
15
|
/**
|
|
16
16
|
* 取引を開始する
|
|
17
17
|
*/
|
|
18
|
-
startReturnOrder(params: factory.transaction.returnOrder.IStartParams): Promise<IStartedTransaction>;
|
|
18
|
+
startReturnOrder(params: Pick<factory.transaction.returnOrder.IStartParams, 'agent' | 'expiresInSeconds' | 'object' | 'project' | 'typeOf'>): Promise<IStartedTransaction>;
|
|
19
19
|
findReturnOrderById(params: {
|
|
20
20
|
id: string;
|
|
21
21
|
}): Promise<IReturnOrderAsFindResult>;
|
|
@@ -26,7 +26,7 @@ export declare class TransactionRepo {
|
|
|
26
26
|
endDate?: factory.sortType;
|
|
27
27
|
startDate?: factory.sortType;
|
|
28
28
|
};
|
|
29
|
-
}): Promise<Pick<factory.transaction.ITransaction
|
|
29
|
+
}): Promise<Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf'> | null>;
|
|
30
30
|
/**
|
|
31
31
|
* set task status exported by transaction id
|
|
32
32
|
* IDでタスクをエクスポート済に変更する
|
|
@@ -8,7 +8,7 @@ declare function createReserveTransactionStartParams(params: {
|
|
|
8
8
|
id: string;
|
|
9
9
|
};
|
|
10
10
|
broker?: factory.reservation.IBroker;
|
|
11
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
11
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'expires' | 'seller'>;
|
|
12
12
|
transactionNumber: string;
|
|
13
13
|
}): factory.assetTransaction.reserve.IStartParamsWithoutDetail;
|
|
14
14
|
declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
@@ -18,7 +18,7 @@ declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
18
18
|
*/
|
|
19
19
|
transactionNumber: string;
|
|
20
20
|
};
|
|
21
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
21
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
22
22
|
}): factory.action.authorize.offer.eventService.IAttributes;
|
|
23
23
|
declare function acceptedOffers2amount(params: {
|
|
24
24
|
acceptedOffers: Pick<IResultAcceptedOffer, 'priceSpecification' | 'id'>[];
|
|
@@ -31,7 +31,7 @@ declare function processStartReserve4chevre(params: {
|
|
|
31
31
|
};
|
|
32
32
|
broker?: factory.reservation.IBroker;
|
|
33
33
|
transactionNumber: string;
|
|
34
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
34
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'expires' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
35
35
|
availableAtOrFrom: {
|
|
36
36
|
id: string;
|
|
37
37
|
};
|
|
@@ -8,7 +8,7 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
8
8
|
acceptAction: {
|
|
9
9
|
id: string;
|
|
10
10
|
};
|
|
11
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
11
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
12
12
|
/**
|
|
13
13
|
* 仮予約済のCOA予約取引
|
|
14
14
|
*/
|
package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js
CHANGED
|
@@ -36,7 +36,7 @@ function cancelOrderIfExist(params) {
|
|
|
36
36
|
limit: 1,
|
|
37
37
|
page: 1,
|
|
38
38
|
project: { id: { $eq: params.project.id } },
|
|
39
|
-
typeOf:
|
|
39
|
+
// typeOf: factory.transactionType.PlaceOrder,
|
|
40
40
|
statuses: [factory_1.factory.transactionStatusType.Confirmed],
|
|
41
41
|
// resultではなくobjectで参照するように変更(2026-06-16~)
|
|
42
42
|
object: {
|
|
@@ -83,7 +83,7 @@ function createOnAuthorizationCreatedTask(order) {
|
|
|
83
83
|
const placeOrderTransaction = (await repos.placeOrder.findPlaceOrderTransactions({
|
|
84
84
|
limit: 1,
|
|
85
85
|
page: 1,
|
|
86
|
-
typeOf:
|
|
86
|
+
// typeOf: factory.transactionType.PlaceOrder,
|
|
87
87
|
object: { orderNumber: { $eq: order.orderNumber } },
|
|
88
88
|
inclusion: ['result']
|
|
89
89
|
})).shift();
|
|
@@ -11,7 +11,7 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
11
11
|
limit: 1,
|
|
12
12
|
page: 1,
|
|
13
13
|
project: { id: { $eq: params.project.id } },
|
|
14
|
-
typeOf:
|
|
14
|
+
// typeOf: factory.transactionType.PlaceOrder,
|
|
15
15
|
statuses: [factory_1.factory.transactionStatusType.Confirmed],
|
|
16
16
|
// resultではなくobjectで参照するように変更(2026-06-16~)
|
|
17
17
|
object: {
|
|
@@ -8,7 +8,7 @@ export declare function creatPublishPaymentUrlParams(params: {
|
|
|
8
8
|
accountId?: string;
|
|
9
9
|
object: Pick<factory.action.authorize.paymentMethod.any.IObjectIncludingPaymentMethodDetails, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod' | 'referencesOrder'>;
|
|
10
10
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
11
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
11
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'expires' | 'seller' | 'project'>;
|
|
12
12
|
transactionNumber: string;
|
|
13
13
|
location?: factory.action.trade.pay.ILocation;
|
|
14
14
|
identifier?: string;
|
|
@@ -26,7 +26,7 @@ export declare function creatPayTransactionStartParams(params: {
|
|
|
26
26
|
accountId?: string;
|
|
27
27
|
object: factory.action.authorize.paymentMethod.any.IObjectIncludingPaymentMethodDetails;
|
|
28
28
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
29
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
29
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'expires' | 'seller' | 'project'>;
|
|
30
30
|
transactionNumber: string;
|
|
31
31
|
location?: factory.action.trade.pay.ILocation;
|
|
32
32
|
order: {
|
|
@@ -36,7 +36,7 @@ function deleteTransactionById(params) {
|
|
|
36
36
|
if (params.object.typeOf === factory_1.factory.transactionType.PlaceOrder) {
|
|
37
37
|
transaction = (await repos.placeOrder.findPlaceOrderTransactions({
|
|
38
38
|
ids: [deletingTransactionId],
|
|
39
|
-
typeOf: params.object.typeOf,
|
|
39
|
+
// typeOf: params.object.typeOf,
|
|
40
40
|
inclusion: ['typeOf', 'project', 'status']
|
|
41
41
|
})).shift();
|
|
42
42
|
}
|
|
@@ -6,10 +6,10 @@ type IPlaceOrderPotentialTask = factory.task.IAttributes<factory.taskName.PlaceO
|
|
|
6
6
|
* 取引削除タスクを分離(2026-08-02~)
|
|
7
7
|
*/
|
|
8
8
|
export declare function createImmediateTasks(params: {
|
|
9
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
9
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'endDate' | 'id' | 'object' | 'project' | 'seller' | 'startDate' | 'status' | 'typeOf'>;
|
|
10
10
|
taskRunsAt: Date;
|
|
11
11
|
}): IPlaceOrderPotentialTask[];
|
|
12
12
|
export declare function createScheduledTasks(params: {
|
|
13
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
13
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'endDate' | 'id' | 'object' | 'project' | 'status' | 'typeOf'>;
|
|
14
14
|
}, setting: Pick<ISetting, 'storage'> | null): factory.task.deleteTransaction.IAttributes;
|
|
15
15
|
export {};
|
|
@@ -34,7 +34,7 @@ function start(params, options) {
|
|
|
34
34
|
// in case already locked
|
|
35
35
|
const alreadyStartedTransaction = (await repos.placeOrder.findPlaceOrderTransactions({
|
|
36
36
|
limit: 1, page: 1,
|
|
37
|
-
typeOf:
|
|
37
|
+
// typeOf: factory.transactionType.PlaceOrder,
|
|
38
38
|
project: { id: { $eq: startParams.project.id } },
|
|
39
39
|
status: { $in: [factory_1.factory.transactionStatusType.InProgress] },
|
|
40
40
|
agent: { identifiers: [{ name: factory_2.AGENT_IDENTIFIER_NAME_PASSPORT, value: passport.identifier }] },
|
|
@@ -4,9 +4,7 @@ exports.createPotentialActions = createPotentialActions;
|
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
5
|
const returnPaymentMethod_1 = require("./potentialActions/returnPaymentMethod");
|
|
6
6
|
const sendEmailMessage_1 = require("./potentialActions/sendEmailMessage");
|
|
7
|
-
async function createPotentialActions(params,
|
|
8
|
-
// settings: Settings
|
|
9
|
-
setting) {
|
|
7
|
+
async function createPotentialActions(params, setting) {
|
|
10
8
|
const emailMessages = [];
|
|
11
9
|
const returnOrderActions = await Promise.all(params.orders.map(async (order) => {
|
|
12
10
|
let returnOrderParams = params.potentialActions?.returnOrder;
|
|
@@ -23,10 +23,22 @@ interface IPreStartOperationRepos {
|
|
|
23
23
|
}
|
|
24
24
|
type IPreStartOperation<T> = (repos: IPreStartOperationRepos) => Promise<T>;
|
|
25
25
|
type IFixedSeller = Pick<ISellerWithId, 'id' | 'name' | 'project' | 'hasMerchantReturnPolicy' | 'typeOf'>;
|
|
26
|
+
/**
|
|
27
|
+
* 注文返品開始パラメータ
|
|
28
|
+
*/
|
|
29
|
+
export interface IStartParamsWithoutDetail {
|
|
30
|
+
project: Pick<factory.project.IProject, 'id' | 'typeOf'>;
|
|
31
|
+
expiresInSeconds: number;
|
|
32
|
+
agent: factory.transaction.returnOrder.IAgent;
|
|
33
|
+
object: {
|
|
34
|
+
order: [factory.transaction.returnOrder.IReturnableOrder];
|
|
35
|
+
reason: factory.transaction.returnOrder.Reason;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
26
38
|
/**
|
|
27
39
|
* 返品取引開始前処理
|
|
28
40
|
*/
|
|
29
|
-
declare function preStart(params:
|
|
41
|
+
declare function preStart(params: IStartParamsWithoutDetail): IPreStartOperation<{
|
|
30
42
|
transactionObject: factory.transaction.returnOrder.IObject;
|
|
31
43
|
seller: IFixedSeller;
|
|
32
44
|
expiresInSeconds: number;
|
|
@@ -13,7 +13,7 @@ import type { SellerReturnPolicyRepo } from '../../repo/sellerReturnPolicy';
|
|
|
13
13
|
import type { SettingRepo } from '../../repo/setting';
|
|
14
14
|
import type { TaskRepo } from '../../repo/task';
|
|
15
15
|
import type { IStartedTransaction, ReturnOrderInProgressRepo } from '../../repo/transaction/returnOrderInProgress';
|
|
16
|
-
import { preStart } from './returnOrder/preStart';
|
|
16
|
+
import { preStart, IStartParamsWithoutDetail } from './returnOrder/preStart';
|
|
17
17
|
interface IStartOperationRepos {
|
|
18
18
|
acceptedOffer: AcceptedOfferRepo;
|
|
19
19
|
event: EventRepo;
|
|
@@ -31,7 +31,7 @@ type IStartOperation<T> = (repos: IStartOperationRepos) => Promise<T>;
|
|
|
31
31
|
/**
|
|
32
32
|
* 返品取引開始
|
|
33
33
|
*/
|
|
34
|
-
declare function start(params:
|
|
34
|
+
declare function start(params: IStartParamsWithoutDetail): IStartOperation<IStartedTransaction>;
|
|
35
35
|
interface IConfirmRepos {
|
|
36
36
|
acceptedOffer: AcceptedOfferRepo;
|
|
37
37
|
message: MessageRepo;
|
|
@@ -43,7 +43,18 @@ interface IConfirmRepos {
|
|
|
43
43
|
/**
|
|
44
44
|
* 取引確定
|
|
45
45
|
*/
|
|
46
|
-
declare function confirm(params:
|
|
46
|
+
declare function confirm(params: {
|
|
47
|
+
/**
|
|
48
|
+
* 取引ID
|
|
49
|
+
*/
|
|
50
|
+
id: string;
|
|
51
|
+
agent: {
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 取引確定後アクション
|
|
56
|
+
*/
|
|
57
|
+
potentialActions?: factory.transaction.returnOrder.IPotentialActionsParams;
|
|
47
58
|
object: {
|
|
48
59
|
order: {
|
|
49
60
|
dateReturned: Date;
|
|
@@ -16,16 +16,11 @@ Object.defineProperty(exports, "preStart", { enumerable: true, get: function ()
|
|
|
16
16
|
*/
|
|
17
17
|
function start(params) {
|
|
18
18
|
return async (repos) => {
|
|
19
|
-
const { transactionObject, expiresInSeconds, seller } = await (0, preStart_1.preStart)(params)(repos);
|
|
19
|
+
const { transactionObject, expiresInSeconds, seller: _seller } = await (0, preStart_1.preStart)(params)(repos);
|
|
20
20
|
const returnOrderAttributes = {
|
|
21
21
|
project: params.project,
|
|
22
22
|
typeOf: factory_1.factory.transactionType.ReturnOrder,
|
|
23
23
|
agent: params.agent,
|
|
24
|
-
seller: {
|
|
25
|
-
id: String(seller.id),
|
|
26
|
-
typeOf: seller.typeOf,
|
|
27
|
-
name: seller.name
|
|
28
|
-
},
|
|
29
24
|
object: transactionObject,
|
|
30
25
|
expiresInSeconds
|
|
31
26
|
};
|
|
@@ -44,4 +44,4 @@ export declare function exportOneTransactionTasksIfExists(params: {
|
|
|
44
44
|
endDate?: factory.sortType;
|
|
45
45
|
startDate?: factory.sortType;
|
|
46
46
|
};
|
|
47
|
-
}): IExportTasksOperation<Pick<factory.transaction.ITransaction
|
|
47
|
+
}): IExportTasksOperation<Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf'> | undefined>;
|
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": "
|
|
14
|
+
"@chevre/factory": "11.0.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.3"
|
|
92
92
|
}
|