@chevre/domain 21.18.0-alpha.13 → 21.18.0-alpha.15
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/example/src/chevre/searchOrders.ts +3 -3
- package/lib/chevre/repo/order.d.ts +2 -2
- package/lib/chevre/repo/order.js +5 -2
- package/lib/chevre/repo/place.js +14 -10
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +3 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +10 -5
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -1
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder.d.ts +2 -0
- package/lib/chevre/service/order/sendOrder.js +1 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +2 -0
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -0
- package/lib/chevre/service/task/placeOrder.js +2 -0
- package/package.json +2 -2
|
@@ -14,10 +14,10 @@ async function main() {
|
|
|
14
14
|
orderNumber: 'CIN4-3943271-4221863',
|
|
15
15
|
project: { id: project.id },
|
|
16
16
|
inclusion: [
|
|
17
|
-
'project', 'typeOf', 'orderNumber', 'dateReturned', 'id',
|
|
18
|
-
'customer', 'returner', 'seller', 'price', 'priceCurrency', 'orderDate'
|
|
17
|
+
// 'project', 'typeOf', 'orderNumber', 'dateReturned', 'id',
|
|
18
|
+
// 'customer', 'returner', 'seller', 'price', 'priceCurrency', 'orderDate'
|
|
19
19
|
],
|
|
20
|
-
exclusion: []
|
|
20
|
+
exclusion: ['acceptedOffers']
|
|
21
21
|
});
|
|
22
22
|
console.log(order);
|
|
23
23
|
|
|
@@ -47,7 +47,7 @@ export declare class MongoRepository {
|
|
|
47
47
|
orderNumber: string;
|
|
48
48
|
orderStatus: factory.orderStatus;
|
|
49
49
|
previousOrderStatus: factory.orderStatus;
|
|
50
|
-
}): Promise<factory.order.IOrder
|
|
50
|
+
}): Promise<Omit<factory.order.IOrder, 'acceptedOffers'>>;
|
|
51
51
|
/**
|
|
52
52
|
* 注文を返品する
|
|
53
53
|
*/
|
|
@@ -104,7 +104,7 @@ export declare class MongoRepository {
|
|
|
104
104
|
id?: string;
|
|
105
105
|
};
|
|
106
106
|
inclusion: IKeyOfProjection[];
|
|
107
|
-
exclusion: IKeyOfProjection[];
|
|
107
|
+
exclusion: (IKeyOfProjection | 'acceptedOffers')[];
|
|
108
108
|
}): Promise<factory.order.IOrder>;
|
|
109
109
|
findByOrderNumberAndReservationId(params: {
|
|
110
110
|
project: {
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -697,7 +697,8 @@ class MongoRepository {
|
|
|
697
697
|
projection: {
|
|
698
698
|
__v: 0,
|
|
699
699
|
createdAt: 0,
|
|
700
|
-
updatedAt: 0
|
|
700
|
+
updatedAt: 0,
|
|
701
|
+
acceptedOffers: 0 // 除外(2023-12-08~)
|
|
701
702
|
}
|
|
702
703
|
})
|
|
703
704
|
.exec();
|
|
@@ -707,7 +708,9 @@ class MongoRepository {
|
|
|
707
708
|
orderNumber: params.orderNumber,
|
|
708
709
|
project: { id: params.project.id },
|
|
709
710
|
inclusion: [],
|
|
710
|
-
exclusion: [
|
|
711
|
+
exclusion: [
|
|
712
|
+
'acceptedOffers' // 除外(2023-12-08~)
|
|
713
|
+
]
|
|
711
714
|
});
|
|
712
715
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
713
716
|
/* istanbul ignore next */
|
package/lib/chevre/repo/place.js
CHANGED
|
@@ -625,7 +625,7 @@ class MongoRepository {
|
|
|
625
625
|
}
|
|
626
626
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
627
627
|
searchScreeningRoomSections(searchConditions) {
|
|
628
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
628
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
629
629
|
return __awaiter(this, void 0, void 0, function* () {
|
|
630
630
|
const matchStages = [{ $match: { typeOf: { $eq: factory.placeType.ScreeningRoom } } }];
|
|
631
631
|
const projectIdEq = (_b = (_a = searchConditions.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
@@ -722,17 +722,21 @@ class MongoRepository {
|
|
|
722
722
|
{ $unwind: '$containsPlace' },
|
|
723
723
|
...matchStages,
|
|
724
724
|
{
|
|
725
|
-
$project: Object.assign({ _id: 0, typeOf: '$containsPlace.typeOf', branchCode: '$containsPlace.branchCode', name: '$containsPlace.name',
|
|
726
|
-
|
|
727
|
-
branchCode: '$branchCode',
|
|
728
|
-
name: '$name',
|
|
725
|
+
$project: Object.assign(Object.assign({ _id: 0, typeOf: '$containsPlace.typeOf', branchCode: '$containsPlace.branchCode', name: '$containsPlace.name', additionalProperty: '$containsPlace.additionalProperty' }, (((_p = searchConditions.$projection) === null || _p === void 0 ? void 0 : _p.containedInPlace) === 1)
|
|
726
|
+
? {
|
|
729
727
|
containedInPlace: {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
728
|
+
typeOf: '$typeOf',
|
|
729
|
+
branchCode: '$branchCode',
|
|
730
|
+
name: '$name',
|
|
731
|
+
containedInPlace: {
|
|
732
|
+
id: '$containedInPlace.id',
|
|
733
|
+
typeOf: '$containedInPlace.typeOf',
|
|
734
|
+
branchCode: '$containedInPlace.branchCode',
|
|
735
|
+
name: '$containedInPlace.name'
|
|
736
|
+
}
|
|
734
737
|
}
|
|
735
|
-
}
|
|
738
|
+
}
|
|
739
|
+
: undefined), (((_q = searchConditions.$projection) === null || _q === void 0 ? void 0 : _q.seatCount) === 1)
|
|
736
740
|
? {
|
|
737
741
|
seatCount: {
|
|
738
742
|
$cond: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { MongoRepository as AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
1
2
|
import type { MongoRepository as AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
2
3
|
import type { MongoRepository as OrderRepo } from '../../repo/order';
|
|
3
4
|
import type { MongoRepository as TaskRepo } from '../../repo/task';
|
|
4
5
|
import type { MongoRepository as TransactionRepo } from '../../repo/transaction';
|
|
5
6
|
import * as factory from '../../factory';
|
|
6
7
|
declare function onAssetTransactionStatusChanged(params: factory.task.IData<factory.taskName.OnAssetTransactionStatusChanged>): (repos: {
|
|
8
|
+
acceptedOffer: AcceptedOfferRepo;
|
|
7
9
|
assetTransaction: AssetTransactionRepo;
|
|
8
10
|
order: OrderRepo;
|
|
9
11
|
task: TaskRepo;
|
|
@@ -17,6 +19,7 @@ declare function paymentDue2Processing(params: {
|
|
|
17
19
|
orderNumber: string;
|
|
18
20
|
useOnOrderStatusChanged: boolean;
|
|
19
21
|
}): (repos: {
|
|
22
|
+
acceptedOffer: AcceptedOfferRepo;
|
|
20
23
|
order: OrderRepo;
|
|
21
24
|
task: TaskRepo;
|
|
22
25
|
transaction: TransactionRepo;
|
|
@@ -138,7 +138,7 @@ function paymentDue2Processing(params) {
|
|
|
138
138
|
orderNumber: params.orderNumber,
|
|
139
139
|
project: { id: params.project.id },
|
|
140
140
|
inclusion: [],
|
|
141
|
-
exclusion: []
|
|
141
|
+
exclusion: ['acceptedOffers']
|
|
142
142
|
});
|
|
143
143
|
try {
|
|
144
144
|
order = yield repos.order.changeStatus({
|
|
@@ -151,12 +151,12 @@ function paymentDue2Processing(params) {
|
|
|
151
151
|
catch (error) {
|
|
152
152
|
let throwsError = true;
|
|
153
153
|
// すでにステータスが煤でいた場合、OrderPaymentDue->OrderProcessingの処理自体は成功しているので、後処理を続行する
|
|
154
|
-
order = yield repos.order.findByOrderNumber({
|
|
154
|
+
order = (yield repos.order.findByOrderNumber({
|
|
155
155
|
orderNumber: params.orderNumber,
|
|
156
156
|
project: { id: params.project.id },
|
|
157
157
|
inclusion: [],
|
|
158
|
-
exclusion: []
|
|
159
|
-
});
|
|
158
|
+
exclusion: ['acceptedOffers']
|
|
159
|
+
}));
|
|
160
160
|
if (order.orderStatus === factory.orderStatus.OrderDelivered
|
|
161
161
|
|| order.orderStatus === factory.orderStatus.OrderReturned) {
|
|
162
162
|
throwsError = false;
|
|
@@ -166,8 +166,13 @@ function paymentDue2Processing(params) {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
if (params.useOnOrderStatusChanged) {
|
|
169
|
+
// 全acceptedOffersを検索(2023-12-08~)
|
|
170
|
+
const acceptedOffers = yield repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
171
|
+
orderNumber: { $eq: order.orderNumber },
|
|
172
|
+
project: { id: { $eq: params.project.id } }
|
|
173
|
+
});
|
|
169
174
|
yield (0, onOrderStatusChanged_1.onOrderProcessing)({
|
|
170
|
-
order: Object.assign(Object.assign({}, order), { orderStatus: factory.orderStatus.OrderProcessing // 強制的にOrderProcessingとして処理する
|
|
175
|
+
order: Object.assign(Object.assign({}, order), { acceptedOffers, orderStatus: factory.orderStatus.OrderProcessing // 強制的にOrderProcessingとして処理する
|
|
171
176
|
}),
|
|
172
177
|
placeOrderTransaction
|
|
173
178
|
})({
|
|
@@ -3,8 +3,9 @@ import * as factory from '../../../factory';
|
|
|
3
3
|
import { IExternalOrder } from './onOrderProcessing/factory';
|
|
4
4
|
type IPlaceOrderTransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf' | 'potentialActions'>;
|
|
5
5
|
declare function onOrderProcessing(params: {
|
|
6
|
-
order: Omit<factory.order.IOrder, 'orderStatus'> & {
|
|
6
|
+
order: Omit<factory.order.IOrder, 'acceptedOffers' | 'orderStatus'> & {
|
|
7
7
|
orderStatus: factory.orderStatus.OrderProcessing;
|
|
8
|
+
acceptedOffers: factory.order.IAcceptedOffer<factory.order.IItemOffered>[];
|
|
8
9
|
};
|
|
9
10
|
placeOrderTransaction?: IPlaceOrderTransaction;
|
|
10
11
|
}): (repos: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MongoRepository as AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
1
2
|
import type { MongoRepository as OrderRepo } from '../../repo/order';
|
|
2
3
|
import type { MongoRepository as TaskRepo } from '../../repo/task';
|
|
3
4
|
import type { MongoRepository as TransactionRepo } from '../../repo/transaction';
|
|
@@ -6,6 +7,7 @@ import * as factory from '../../factory';
|
|
|
6
7
|
* 注文を決済する
|
|
7
8
|
*/
|
|
8
9
|
declare function payOrder(params: factory.task.IData<factory.taskName.OnOrderPaymentCompleted>): (repos: {
|
|
10
|
+
acceptedOffer: AcceptedOfferRepo;
|
|
9
11
|
order: OrderRepo;
|
|
10
12
|
task: TaskRepo;
|
|
11
13
|
transaction: TransactionRepo;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MongoRepository as AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
1
2
|
import type { MongoRepository as AccountingReportRepo } from '../../repo/accountingReport';
|
|
2
3
|
import type { MongoRepository as ActionRepo } from '../../repo/action';
|
|
3
4
|
import type { MongoRepository as OrderRepo } from '../../repo/order';
|
|
@@ -34,6 +35,7 @@ declare function placeOrder(params: {
|
|
|
34
35
|
};
|
|
35
36
|
useOnOrderStatusChanged: boolean;
|
|
36
37
|
}): (repos: {
|
|
38
|
+
acceptedOffer: AcceptedOfferRepo;
|
|
37
39
|
accountingReport: AccountingReportRepo;
|
|
38
40
|
action: ActionRepo;
|
|
39
41
|
order: OrderRepo;
|
|
@@ -37,7 +37,7 @@ function sendOrder(params) {
|
|
|
37
37
|
let order = yield repos.order.findByOrderNumber({
|
|
38
38
|
orderNumber,
|
|
39
39
|
project: { id: params.project.id },
|
|
40
|
-
inclusion: [],
|
|
40
|
+
inclusion: ['confirmationNumber', 'project', 'typeOf', 'seller', 'orderNumber', 'price', 'priceCurrency', 'orderDate', 'customer', '_id'],
|
|
41
41
|
exclusion: []
|
|
42
42
|
});
|
|
43
43
|
// プロジェクト条件検証
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.call = void 0;
|
|
13
|
+
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
13
14
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
14
15
|
const order_1 = require("../../repo/order");
|
|
15
16
|
const task_1 = require("../../repo/task");
|
|
@@ -24,6 +25,7 @@ function call(data) {
|
|
|
24
25
|
// throw new factory.errors.Argument('settings', 'redisClient required');
|
|
25
26
|
// }
|
|
26
27
|
yield (0, onAssetTransactionStatusChanged_1.onAssetTransactionStatusChanged)(data)({
|
|
28
|
+
acceptedOffer: new acceptedOffer_1.MongoRepository(settings.connection),
|
|
27
29
|
assetTransaction: new assetTransaction_1.MongoRepository(settings.connection),
|
|
28
30
|
order: new order_1.MongoRepository(settings.connection),
|
|
29
31
|
task: new task_1.MongoRepository(settings.connection),
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.call = void 0;
|
|
13
|
+
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
13
14
|
const order_1 = require("../../repo/order");
|
|
14
15
|
const task_1 = require("../../repo/task");
|
|
15
16
|
const transaction_1 = require("../../repo/transaction");
|
|
@@ -23,6 +24,7 @@ function call(data) {
|
|
|
23
24
|
// throw new factory.errors.Argument('settings', 'redisClient required');
|
|
24
25
|
// }
|
|
25
26
|
yield (0, payOrder_1.payOrder)(data)({
|
|
27
|
+
acceptedOffer: new acceptedOffer_1.MongoRepository(settings.connection),
|
|
26
28
|
order: new order_1.MongoRepository(settings.connection),
|
|
27
29
|
task: new task_1.MongoRepository(settings.connection),
|
|
28
30
|
transaction: new transaction_1.MongoRepository(settings.connection)
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.call = void 0;
|
|
13
|
+
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
13
14
|
const accountingReport_1 = require("../../repo/accountingReport");
|
|
14
15
|
const action_1 = require("../../repo/action");
|
|
15
16
|
const order_1 = require("../../repo/order");
|
|
@@ -25,6 +26,7 @@ function call(data) {
|
|
|
25
26
|
// throw new factory.errors.Argument('settings', 'redisClient required');
|
|
26
27
|
// }
|
|
27
28
|
yield OrderService.placeOrder(Object.assign(Object.assign({}, data), { useOnOrderStatusChanged: true }))({
|
|
29
|
+
acceptedOffer: new acceptedOffer_1.MongoRepository(settings.connection),
|
|
28
30
|
accountingReport: new accountingReport_1.MongoRepository(settings.connection),
|
|
29
31
|
action: new action_1.MongoRepository(settings.connection),
|
|
30
32
|
order: new order_1.MongoRepository(settings.connection),
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.
|
|
13
|
+
"@chevre/factory": "4.345.0",
|
|
14
14
|
"@cinerino/sdk": "5.3.0",
|
|
15
15
|
"@motionpicture/coa-service": "9.2.0",
|
|
16
16
|
"@motionpicture/gmo-service": "5.2.0",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"postversion": "git push origin --tags",
|
|
116
116
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
117
117
|
},
|
|
118
|
-
"version": "21.18.0-alpha.
|
|
118
|
+
"version": "21.18.0-alpha.15"
|
|
119
119
|
}
|