@chevre/domain 28.0.0-alpha.2 → 28.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/eventEmitter/transaction.d.ts +2 -2
- package/lib/chevre/eventEmitter/transaction.js +1 -1
- package/lib/chevre/repo/adminTransaction.d.ts +35 -29
- package/lib/chevre/repo/adminTransaction.js +0 -98
- package/lib/chevre/repo/aggregateTransaction.d.ts +0 -1
- package/lib/chevre/repo/aggregateTransaction.js +0 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +2 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.js +39 -27
- package/lib/chevre/repo/orderInTransaction.js +0 -6
- package/lib/chevre/repo/transaction/placeOrder.d.ts +6 -11
- package/lib/chevre/repo/transaction/placeOrder.js +38 -110
- package/lib/chevre/repo/transaction/returnOrderInProgress.d.ts +1 -1
- package/lib/chevre/repo/transaction.d.ts +1 -1
- package/lib/chevre/repo/transaction.js +0 -1
- package/lib/chevre/service/aggregation/system.js +1 -3
- 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/event/authorize.js +1 -4
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -5
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -8
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -4
- 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/authorize.js +1 -1
- package/lib/chevre/service/payment/any/factory.d.ts +2 -2
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +1 -4
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -4
- package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -4
- 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
|
@@ -5,12 +5,12 @@ interface IListenArgsOnTransactionStatusChanged {
|
|
|
5
5
|
* 取引ID
|
|
6
6
|
*/
|
|
7
7
|
id: string;
|
|
8
|
-
typeOf: factory.transactionType;
|
|
8
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
9
9
|
status: factory.transactionStatusType;
|
|
10
10
|
}
|
|
11
11
|
type IOnTransactionStatusChangedListener = (listenArgs: IListenArgsOnTransactionStatusChanged) => void;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 注文取引イベントエミッター
|
|
14
14
|
*/
|
|
15
15
|
declare class TransactionEventEmitter extends EventEmitter {
|
|
16
16
|
onTransactionStatusChanged(listner: IOnTransactionStatusChangedListener): void;
|
|
@@ -7,7 +7,7 @@ var EventName;
|
|
|
7
7
|
EventName["OnTransactionStatusChanged"] = "OnTransactionStatusChanged";
|
|
8
8
|
})(EventName || (EventName = {}));
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 注文取引イベントエミッター
|
|
11
11
|
*/
|
|
12
12
|
class TransactionEventEmitter extends events_1.EventEmitter {
|
|
13
13
|
onTransactionStatusChanged(listner) {
|
|
@@ -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
|
}
|
|
@@ -68,51 +68,6 @@ class AdminTransactionRepo {
|
|
|
68
68
|
})
|
|
69
69
|
.exec();
|
|
70
70
|
}
|
|
71
|
-
// /**
|
|
72
|
-
// * タスクエクスポートの遅延している取引について明示的にemitTransactionStatusChangedを実行する
|
|
73
|
-
// */
|
|
74
|
-
// public async exportTasksMany(params: {
|
|
75
|
-
// now: Date;
|
|
76
|
-
// delayInSeconds: number;
|
|
77
|
-
// status: {
|
|
78
|
-
// $in: factory.transactionStatusType[];
|
|
79
|
-
// };
|
|
80
|
-
// limit: number;
|
|
81
|
-
// }) {
|
|
82
|
-
// const delayedTransactions = await this.transactionModel.find({
|
|
83
|
-
// status: { $in: params.status.$in },
|
|
84
|
-
// 'tasksExportAction.actionStatus': {
|
|
85
|
-
// $exists: true,
|
|
86
|
-
// $eq: factory.actionStatusType.PotentialActionStatus
|
|
87
|
-
// },
|
|
88
|
-
// endDate: {
|
|
89
|
-
// $exists: true,
|
|
90
|
-
// $lt: moment(params.now)
|
|
91
|
-
// .add(-params.delayInSeconds, 'seconds')
|
|
92
|
-
// .toDate()
|
|
93
|
-
// }
|
|
94
|
-
// })
|
|
95
|
-
// .select({
|
|
96
|
-
// _id: 0,
|
|
97
|
-
// id: { $toString: '$_id' },
|
|
98
|
-
// typeOf: 1,
|
|
99
|
-
// status: 1
|
|
100
|
-
// })
|
|
101
|
-
// .limit(params.limit)
|
|
102
|
-
// .setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
|
|
103
|
-
// .lean<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'status' | 'typeOf'>[]>()
|
|
104
|
-
// .exec();
|
|
105
|
-
// if (delayedTransactions.length > 0) {
|
|
106
|
-
// delayedTransactions.forEach((delayedTransaction) => {
|
|
107
|
-
// transactionEventEmitter.emitTransactionStatusChanged({
|
|
108
|
-
// id: delayedTransaction.id,
|
|
109
|
-
// typeOf: delayedTransaction.typeOf,
|
|
110
|
-
// status: delayedTransaction.status
|
|
111
|
-
// });
|
|
112
|
-
// });
|
|
113
|
-
// }
|
|
114
|
-
// return delayedTransactions;
|
|
115
|
-
// }
|
|
116
71
|
/**
|
|
117
72
|
* add(2025-03-13~)
|
|
118
73
|
*/
|
|
@@ -167,59 +122,6 @@ class AdminTransactionRepo {
|
|
|
167
122
|
return doc;
|
|
168
123
|
}
|
|
169
124
|
}
|
|
170
|
-
// /**
|
|
171
|
-
// * 取引を期限切れにする
|
|
172
|
-
// */
|
|
173
|
-
// public async makeExpired(params: {
|
|
174
|
-
// expires: { $lt: Date };
|
|
175
|
-
// limit: number; // add limit(2025-02-27~)
|
|
176
|
-
// }): Promise<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'>[]> {
|
|
177
|
-
// if (typeof params.limit !== 'number' || params.limit === 0) {
|
|
178
|
-
// throw new factory.errors.ArgumentNull('limit');
|
|
179
|
-
// }
|
|
180
|
-
// const sort: { [key in keyof factory.transaction.ITransaction<factory.transactionType>]?: factory.sortType } = {
|
|
181
|
-
// expires: factory.sortType.Ascending
|
|
182
|
-
// };
|
|
183
|
-
// // IDをemitしたいのでまずリスト検索(2023-04-27~)
|
|
184
|
-
// const expiringTransactions =
|
|
185
|
-
// await this.transactionModel.find({
|
|
186
|
-
// status: { $eq: factory.transactionStatusType.InProgress },
|
|
187
|
-
// expires: { $lt: params.expires.$lt }
|
|
188
|
-
// })
|
|
189
|
-
// .select({
|
|
190
|
-
// _id: 0,
|
|
191
|
-
// id: { $toString: '$_id' },
|
|
192
|
-
// typeOf: 1
|
|
193
|
-
// })
|
|
194
|
-
// .limit(params.limit)
|
|
195
|
-
// .sort(sort) // sort(2025-03-03~)
|
|
196
|
-
// .setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
|
|
197
|
-
// .lean<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'>[]>()
|
|
198
|
-
// .exec();
|
|
199
|
-
// if (expiringTransactions.length > 0) {
|
|
200
|
-
// // ステータスと期限を見て更新
|
|
201
|
-
// await this.transactionModel.updateMany(
|
|
202
|
-
// {
|
|
203
|
-
// _id: { $in: expiringTransactions.map((t) => t.id) },
|
|
204
|
-
// status: { $eq: factory.transactionStatusType.InProgress },
|
|
205
|
-
// expires: { $lt: params.expires.$lt }
|
|
206
|
-
// },
|
|
207
|
-
// {
|
|
208
|
-
// status: factory.transactionStatusType.Expired,
|
|
209
|
-
// endDate: new Date()
|
|
210
|
-
// }
|
|
211
|
-
// )
|
|
212
|
-
// .exec();
|
|
213
|
-
// expiringTransactions.forEach((expiringTransaction) => {
|
|
214
|
-
// transactionEventEmitter.emitTransactionStatusChanged({
|
|
215
|
-
// id: expiringTransaction.id,
|
|
216
|
-
// typeOf: expiringTransaction.typeOf,
|
|
217
|
-
// status: factory.transactionStatusType.Expired
|
|
218
|
-
// });
|
|
219
|
-
// });
|
|
220
|
-
// }
|
|
221
|
-
// return expiringTransactions;
|
|
222
|
-
// }
|
|
223
125
|
async findByIdAndDelete(params) {
|
|
224
126
|
await this.transactionModel.findByIdAndDelete(params.id)
|
|
225
127
|
.exec();
|
|
@@ -22,7 +22,6 @@ class AggregateTransactionRepo {
|
|
|
22
22
|
$gte: params.startFrom,
|
|
23
23
|
$lte: params.startThrough
|
|
24
24
|
},
|
|
25
|
-
typeOf: { $eq: params.typeOf },
|
|
26
25
|
status: { $eq: transactionStatus },
|
|
27
26
|
...(typeof params.project?.id?.$ne === 'string')
|
|
28
27
|
? { 'project.id': { $ne: params.project.id.$ne } }
|
|
@@ -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>;
|
|
@@ -9,17 +9,17 @@ const settings_1 = require("../../../settings");
|
|
|
9
9
|
const modelName = 'Transaction';
|
|
10
10
|
exports.modelName = modelName;
|
|
11
11
|
const schemaDefinition = {
|
|
12
|
-
project: mongoose_1.SchemaTypes.Mixed,
|
|
13
|
-
status: String,
|
|
14
|
-
typeOf: String,
|
|
12
|
+
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
13
|
+
status: { type: String, required: true },
|
|
14
|
+
typeOf: { type: String, required: true },
|
|
15
15
|
agent: mongoose_1.SchemaTypes.Mixed,
|
|
16
|
-
|
|
16
|
+
expires: { type: Date, required: true },
|
|
17
|
+
startDate: { type: Date, required: true },
|
|
18
|
+
// recipient: SchemaTypes.Mixed, // discontinue(2026-09-09~)
|
|
17
19
|
seller: mongoose_1.SchemaTypes.Mixed,
|
|
18
20
|
error: mongoose_1.SchemaTypes.Mixed,
|
|
19
21
|
result: mongoose_1.SchemaTypes.Mixed,
|
|
20
22
|
object: mongoose_1.SchemaTypes.Mixed,
|
|
21
|
-
expires: Date,
|
|
22
|
-
startDate: Date,
|
|
23
23
|
endDate: Date,
|
|
24
24
|
tasksExportAction: mongoose_1.SchemaTypes.Mixed,
|
|
25
25
|
potentialActions: mongoose_1.SchemaTypes.Mixed,
|
|
@@ -67,31 +67,30 @@ const indexes = [
|
|
|
67
67
|
{ name: 'searchByStartDateDescending' }
|
|
68
68
|
],
|
|
69
69
|
[
|
|
70
|
-
{
|
|
70
|
+
{ 'object.confirmationNumber': 1, startDate: -1 },
|
|
71
71
|
{
|
|
72
|
-
name: '
|
|
72
|
+
name: 'searchByObjectConfirmationNumber',
|
|
73
73
|
partialFilterExpression: {
|
|
74
|
-
|
|
74
|
+
'object.confirmationNumber': { $exists: true }
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
],
|
|
78
78
|
[
|
|
79
|
-
{
|
|
80
|
-
{ name: 'searchByExpiresAndStartDate' }
|
|
81
|
-
],
|
|
82
|
-
[
|
|
83
|
-
{ 'object.confirmationNumber': 1, startDate: -1 },
|
|
79
|
+
{ 'object.orderNumber': 1, startDate: -1 },
|
|
84
80
|
{
|
|
85
|
-
name: '
|
|
81
|
+
name: 'searchByObjectOrderNumber',
|
|
86
82
|
partialFilterExpression: {
|
|
87
|
-
'object.
|
|
83
|
+
'object.orderNumber': { $exists: true }
|
|
88
84
|
}
|
|
89
85
|
}
|
|
90
86
|
],
|
|
91
87
|
[
|
|
92
|
-
|
|
88
|
+
// 注文取引のobject.orderNumberも発行されている場合ユニークなはず(2026-02-21~)
|
|
89
|
+
// 返品取引廃止につきuniquePlacingOrderNumberをreIndex
|
|
90
|
+
{ 'object.orderNumber': 1 },
|
|
93
91
|
{
|
|
94
|
-
name: '
|
|
92
|
+
name: 'uniqueOrderNumber',
|
|
93
|
+
unique: true,
|
|
95
94
|
partialFilterExpression: {
|
|
96
95
|
'object.orderNumber': { $exists: true }
|
|
97
96
|
}
|
|
@@ -180,15 +179,6 @@ const indexes = [
|
|
|
180
179
|
}
|
|
181
180
|
}
|
|
182
181
|
],
|
|
183
|
-
[
|
|
184
|
-
{ 'tasksExportAction.startDate': 1, startDate: -1 },
|
|
185
|
-
{
|
|
186
|
-
name: 'searchByTasksExportActionActionStartDate',
|
|
187
|
-
partialFilterExpression: {
|
|
188
|
-
'tasksExportAction.startDate': { $exists: true }
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
],
|
|
192
182
|
// typeOf: ReturnOrder廃止につき以下廃止(2026-09-08~)
|
|
193
183
|
// [
|
|
194
184
|
// { 'object.order.orderNumber': 1, startDate: -1 },
|
|
@@ -212,6 +202,28 @@ const indexes = [
|
|
|
212
202
|
// }
|
|
213
203
|
// }
|
|
214
204
|
// ],
|
|
205
|
+
// [
|
|
206
|
+
// { endDate: 1, startDate: -1 },
|
|
207
|
+
// {
|
|
208
|
+
// name: 'searchByEndDateAndStartDate',
|
|
209
|
+
// partialFilterExpression: {
|
|
210
|
+
// endDate: { $exists: true }
|
|
211
|
+
// }
|
|
212
|
+
// }
|
|
213
|
+
// ],
|
|
214
|
+
// [
|
|
215
|
+
// { expires: 1, startDate: -1 },
|
|
216
|
+
// { name: 'searchByExpiresAndStartDate' }
|
|
217
|
+
// ],
|
|
218
|
+
// [
|
|
219
|
+
// { 'tasksExportAction.startDate': 1, startDate: -1 },
|
|
220
|
+
// {
|
|
221
|
+
// name: 'searchByTasksExportActionActionStartDate',
|
|
222
|
+
// partialFilterExpression: {
|
|
223
|
+
// 'tasksExportAction.startDate': { $exists: true }
|
|
224
|
+
// }
|
|
225
|
+
// }
|
|
226
|
+
// ],
|
|
215
227
|
];
|
|
216
228
|
exports.indexes = indexes;
|
|
217
229
|
/**
|
|
@@ -5,11 +5,6 @@ exports.OrderInTransactionRepo = void 0;
|
|
|
5
5
|
const errorHandler_1 = require("../errorHandler");
|
|
6
6
|
const factory_1 = require("../factory");
|
|
7
7
|
const order_1 = require("./mongoose/schemas/order");
|
|
8
|
-
// import {
|
|
9
|
-
// createSchema as createTransactionSchema,
|
|
10
|
-
// IModel as ITransactionModel, modelName as transactionModelName,
|
|
11
|
-
// IDocType as ITransactionDocType
|
|
12
|
-
// } from './mongoose/schemas/transaction';
|
|
13
8
|
const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
14
9
|
// const debug = createDebug('chevre-domain:repo:orderInTransaction');
|
|
15
10
|
/**
|
|
@@ -17,7 +12,6 @@ const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
|
17
12
|
*/
|
|
18
13
|
class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveRepo {
|
|
19
14
|
orderModel;
|
|
20
|
-
// private readonly transactionModel: ITransactionModel;
|
|
21
15
|
constructor(connection) {
|
|
22
16
|
super(connection);
|
|
23
17
|
this.orderModel = connection.model(order_1.modelName, (0, order_1.createSchema)());
|
|
@@ -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,14 +34,13 @@ 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
|
/**
|
|
41
41
|
* 取引期限変更
|
|
42
42
|
*/
|
|
43
43
|
updateExpires(params: {
|
|
44
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
45
44
|
id: string;
|
|
46
45
|
expires: Date;
|
|
47
46
|
}): Promise<void>;
|
|
@@ -58,39 +57,35 @@ export declare class PlaceOrderRepo {
|
|
|
58
57
|
* 進行中の注文取引を取得する
|
|
59
58
|
*/
|
|
60
59
|
findPlaceOrderInProgressById(params: {
|
|
61
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
62
60
|
id: string;
|
|
63
61
|
}, inclusion: IKeyOfProjection[]): Promise<ITransactionInProgress>;
|
|
64
62
|
/**
|
|
65
63
|
* 特定注文取引参照
|
|
66
64
|
*/
|
|
67
65
|
findPlaceOrderById(params: {
|
|
68
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
69
66
|
id: string;
|
|
70
67
|
}, inclusion: IKeyOfProjection[]): Promise<IPlaceOrder>;
|
|
71
68
|
/**
|
|
72
69
|
* 取引を開始する
|
|
73
70
|
*/
|
|
74
|
-
startPlaceOrder(params: factory.transaction.IStartParams
|
|
71
|
+
startPlaceOrder(params: factory.transaction.placeOrder.IStartParams): Promise<IStartedPlaceOrder>;
|
|
75
72
|
/**
|
|
76
73
|
* 取引を確定する
|
|
77
74
|
*/
|
|
78
75
|
confirmPlaceOrder(params: {
|
|
79
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
80
76
|
id: string;
|
|
81
77
|
object: {
|
|
82
78
|
orderDate: Date;
|
|
83
79
|
orderNumber: string;
|
|
84
80
|
confirmationNumber: string;
|
|
85
81
|
};
|
|
86
|
-
result: factory.transaction.IResult
|
|
87
|
-
potentialActions?: factory.transaction.IPotentialActions
|
|
82
|
+
result: factory.transaction.placeOrder.IResult;
|
|
83
|
+
potentialActions?: factory.transaction.placeOrder.IPotentialActions;
|
|
88
84
|
}): Promise<void>;
|
|
89
85
|
/**
|
|
90
86
|
* 取引を中止する
|
|
91
87
|
*/
|
|
92
88
|
cancelPlaceOrder(params: {
|
|
93
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
94
89
|
id: string;
|
|
95
90
|
}): Promise<void>;
|
|
96
91
|
}
|