@chevre/domain 21.4.0-alpha.16 → 21.4.0-alpha.18
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/order.d.ts +20 -2
- package/lib/chevre/repo/order.js +50 -58
- package/lib/chevre/repo/reservation.d.ts +0 -1
- package/lib/chevre/service/order/returnOrder.js +8 -1
- package/lib/chevre/service/order/sendOrder.js +8 -1
- package/lib/chevre/service/reserve/verifyToken4reservation.js +1 -0
- package/lib/chevre/service/task/onAuthorizationCreated.js +1 -0
- package/lib/chevre/service/task/returnPayTransaction.js +1 -0
- package/package.json +2 -2
- package/example/src/chevre/findByOrderNumberAndReservationId.ts +0 -20
|
@@ -39,6 +39,9 @@ export declare class MongoRepository {
|
|
|
39
39
|
* 注文ステータスを変更する
|
|
40
40
|
*/
|
|
41
41
|
changeStatus(params: {
|
|
42
|
+
project: {
|
|
43
|
+
id: string;
|
|
44
|
+
};
|
|
42
45
|
orderNumber: string;
|
|
43
46
|
orderStatus: factory.orderStatus;
|
|
44
47
|
previousOrderStatus: factory.orderStatus;
|
|
@@ -47,6 +50,9 @@ export declare class MongoRepository {
|
|
|
47
50
|
* 注文を返品する
|
|
48
51
|
*/
|
|
49
52
|
returnOrder(params: {
|
|
53
|
+
project: {
|
|
54
|
+
id: string;
|
|
55
|
+
};
|
|
50
56
|
orderNumber: string;
|
|
51
57
|
dateReturned: Date;
|
|
52
58
|
returner: factory.order.IReturner;
|
|
@@ -55,6 +61,9 @@ export declare class MongoRepository {
|
|
|
55
61
|
* 変更可能な属性を更新する
|
|
56
62
|
*/
|
|
57
63
|
updateChangeableAttributes(params: {
|
|
64
|
+
project: {
|
|
65
|
+
id: string;
|
|
66
|
+
};
|
|
58
67
|
additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
|
|
59
68
|
name?: string;
|
|
60
69
|
orderNumber: string;
|
|
@@ -71,15 +80,24 @@ export declare class MongoRepository {
|
|
|
71
80
|
*/
|
|
72
81
|
findByOrderNumber(params: {
|
|
73
82
|
orderNumber: string;
|
|
83
|
+
project: {
|
|
84
|
+
id: string;
|
|
85
|
+
};
|
|
86
|
+
seller?: {
|
|
87
|
+
id?: string;
|
|
88
|
+
};
|
|
74
89
|
inclusion: string[];
|
|
75
90
|
exclusion: string[];
|
|
76
91
|
}): Promise<factory.order.IOrder>;
|
|
77
92
|
findByOrderNumberAndReservationId(params: {
|
|
78
|
-
|
|
79
|
-
|
|
93
|
+
project: {
|
|
94
|
+
id: string;
|
|
95
|
+
};
|
|
80
96
|
seller?: {
|
|
81
97
|
id?: string;
|
|
82
98
|
};
|
|
99
|
+
orderNumber: string;
|
|
100
|
+
reservationId: string;
|
|
83
101
|
}): Promise<Pick<factory.order.IOrder, 'orderNumber' | 'orderStatus' | 'typeOf'>>;
|
|
84
102
|
/**
|
|
85
103
|
* 注文番号で削除する
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -24,34 +24,25 @@ class MongoRepository {
|
|
|
24
24
|
}
|
|
25
25
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
26
26
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
27
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19;
|
|
28
28
|
const andConditions = [];
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (params.project.id !== undefined && params.project.id !== null) {
|
|
33
|
-
if (typeof params.project.id.$eq === 'string') {
|
|
34
|
-
andConditions.push({
|
|
35
|
-
'project.id': {
|
|
36
|
-
$eq: params.project.id.$eq
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
29
|
+
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
30
|
+
if (typeof projectIdEq === 'string') {
|
|
31
|
+
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
41
32
|
}
|
|
42
|
-
const additionalPropertyAll = (
|
|
33
|
+
const additionalPropertyAll = (_c = params.additionalProperty) === null || _c === void 0 ? void 0 : _c.$all;
|
|
43
34
|
if (Array.isArray(additionalPropertyAll)) {
|
|
44
35
|
andConditions.push({ additionalProperty: { $exists: true, $all: additionalPropertyAll } });
|
|
45
36
|
}
|
|
46
|
-
const additionalPropertyIn = (
|
|
37
|
+
const additionalPropertyIn = (_d = params.additionalProperty) === null || _d === void 0 ? void 0 : _d.$in;
|
|
47
38
|
if (Array.isArray(additionalPropertyIn)) {
|
|
48
39
|
andConditions.push({ additionalProperty: { $exists: true, $in: additionalPropertyIn } });
|
|
49
40
|
}
|
|
50
|
-
const additionalPropertyNin = (
|
|
41
|
+
const additionalPropertyNin = (_e = params.additionalProperty) === null || _e === void 0 ? void 0 : _e.$nin;
|
|
51
42
|
if (Array.isArray(additionalPropertyNin)) {
|
|
52
43
|
andConditions.push({ additionalProperty: { $nin: additionalPropertyNin } });
|
|
53
44
|
}
|
|
54
|
-
const additionalPropertyElemMatch = (
|
|
45
|
+
const additionalPropertyElemMatch = (_f = params.additionalProperty) === null || _f === void 0 ? void 0 : _f.$elemMatch;
|
|
55
46
|
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
56
47
|
andConditions.push({ additionalProperty: { $exists: true, $elemMatch: additionalPropertyElemMatch } });
|
|
57
48
|
}
|
|
@@ -79,31 +70,22 @@ class MongoRepository {
|
|
|
79
70
|
});
|
|
80
71
|
}
|
|
81
72
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
96
|
-
/* istanbul ignore else */
|
|
97
|
-
if (Array.isArray(params.seller.ids)) {
|
|
98
|
-
andConditions.push({
|
|
99
|
-
'seller.id': {
|
|
100
|
-
$exists: true,
|
|
101
|
-
$in: params.seller.ids
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
73
|
+
const providerIdEq = (_h = (_g = params.provider) === null || _g === void 0 ? void 0 : _g.id) === null || _h === void 0 ? void 0 : _h.$eq;
|
|
74
|
+
if (typeof providerIdEq === 'string') {
|
|
75
|
+
andConditions.push({ 'seller.id': { $exists: true, $eq: providerIdEq } });
|
|
76
|
+
}
|
|
77
|
+
const sellerIdEq = (_k = (_j = params.seller) === null || _j === void 0 ? void 0 : _j.id) === null || _k === void 0 ? void 0 : _k.$eq;
|
|
78
|
+
if (typeof sellerIdEq === 'string') {
|
|
79
|
+
andConditions.push({ 'seller.id': { $exists: true, $eq: sellerIdEq } });
|
|
80
|
+
}
|
|
81
|
+
const sellerIds = (_l = params.seller) === null || _l === void 0 ? void 0 : _l.ids;
|
|
82
|
+
if (Array.isArray(sellerIds)) {
|
|
83
|
+
andConditions.push({ 'seller.id': { $exists: true, $in: sellerIds } });
|
|
105
84
|
}
|
|
106
|
-
|
|
85
|
+
if (typeof ((_m = params.seller) === null || _m === void 0 ? void 0 : _m.typeOf) === 'string') {
|
|
86
|
+
andConditions.push({ 'seller.typeOf': { $exists: true, $eq: params.seller.typeOf } });
|
|
87
|
+
}
|
|
88
|
+
const brokerIdEq = (_p = (_o = params.broker) === null || _o === void 0 ? void 0 : _o.id) === null || _p === void 0 ? void 0 : _p.$eq;
|
|
107
89
|
if (typeof brokerIdEq === 'string') {
|
|
108
90
|
andConditions.push({
|
|
109
91
|
'broker.id': {
|
|
@@ -320,7 +302,7 @@ class MongoRepository {
|
|
|
320
302
|
}
|
|
321
303
|
}
|
|
322
304
|
}
|
|
323
|
-
const nameEq = (
|
|
305
|
+
const nameEq = (_q = params.name) === null || _q === void 0 ? void 0 : _q.$eq;
|
|
324
306
|
if (typeof nameEq === 'string') {
|
|
325
307
|
andConditions.push({
|
|
326
308
|
name: {
|
|
@@ -329,7 +311,7 @@ class MongoRepository {
|
|
|
329
311
|
}
|
|
330
312
|
});
|
|
331
313
|
}
|
|
332
|
-
const nameRegex = (
|
|
314
|
+
const nameRegex = (_r = params.name) === null || _r === void 0 ? void 0 : _r.$regex;
|
|
333
315
|
if (typeof nameRegex === 'string' && nameRegex.length > 0) {
|
|
334
316
|
andConditions.push({
|
|
335
317
|
name: {
|
|
@@ -362,7 +344,7 @@ class MongoRepository {
|
|
|
362
344
|
}
|
|
363
345
|
});
|
|
364
346
|
}
|
|
365
|
-
const itemOfferedIdentifierIn = (
|
|
347
|
+
const itemOfferedIdentifierIn = (_u = (_t = (_s = params.acceptedOffers) === null || _s === void 0 ? void 0 : _s.itemOffered) === null || _t === void 0 ? void 0 : _t.identifier) === null || _u === void 0 ? void 0 : _u.$in;
|
|
366
348
|
if (Array.isArray(itemOfferedIdentifierIn)) {
|
|
367
349
|
andConditions.push({
|
|
368
350
|
'acceptedOffers.itemOffered.identifier': {
|
|
@@ -371,7 +353,7 @@ class MongoRepository {
|
|
|
371
353
|
}
|
|
372
354
|
});
|
|
373
355
|
}
|
|
374
|
-
const itemOfferedTypeOfIn = (
|
|
356
|
+
const itemOfferedTypeOfIn = (_x = (_w = (_v = params.acceptedOffers) === null || _v === void 0 ? void 0 : _v.itemOffered) === null || _w === void 0 ? void 0 : _w.typeOf) === null || _x === void 0 ? void 0 : _x.$in;
|
|
375
357
|
if (Array.isArray(itemOfferedTypeOfIn)) {
|
|
376
358
|
andConditions.push({
|
|
377
359
|
'acceptedOffers.itemOffered.typeOf': {
|
|
@@ -380,7 +362,7 @@ class MongoRepository {
|
|
|
380
362
|
}
|
|
381
363
|
});
|
|
382
364
|
}
|
|
383
|
-
const itemOfferedIssuedThroughTypeOfEq = (
|
|
365
|
+
const itemOfferedIssuedThroughTypeOfEq = (_1 = (_0 = (_z = (_y = params.acceptedOffers) === null || _y === void 0 ? void 0 : _y.itemOffered) === null || _z === void 0 ? void 0 : _z.issuedThrough) === null || _0 === void 0 ? void 0 : _0.typeOf) === null || _1 === void 0 ? void 0 : _1.$eq;
|
|
384
366
|
if (typeof itemOfferedIssuedThroughTypeOfEq === 'string') {
|
|
385
367
|
andConditions.push({
|
|
386
368
|
'acceptedOffers.itemOffered.issuedThrough.typeOf': {
|
|
@@ -389,7 +371,7 @@ class MongoRepository {
|
|
|
389
371
|
}
|
|
390
372
|
});
|
|
391
373
|
}
|
|
392
|
-
const itemOfferedIssuedThroughIdIn = (
|
|
374
|
+
const itemOfferedIssuedThroughIdIn = (_5 = (_4 = (_3 = (_2 = params.acceptedOffers) === null || _2 === void 0 ? void 0 : _2.itemOffered) === null || _3 === void 0 ? void 0 : _3.issuedThrough) === null || _4 === void 0 ? void 0 : _4.id) === null || _5 === void 0 ? void 0 : _5.$in;
|
|
393
375
|
if (Array.isArray(itemOfferedIssuedThroughIdIn)) {
|
|
394
376
|
andConditions.push({
|
|
395
377
|
'acceptedOffers.itemOffered.issuedThrough.id': {
|
|
@@ -398,7 +380,7 @@ class MongoRepository {
|
|
|
398
380
|
}
|
|
399
381
|
});
|
|
400
382
|
}
|
|
401
|
-
const itemOfferedProgramMembershipUsedIdentifierEq = (
|
|
383
|
+
const itemOfferedProgramMembershipUsedIdentifierEq = (_9 = (_8 = (_7 = (_6 = params.acceptedOffers) === null || _6 === void 0 ? void 0 : _6.itemOffered) === null || _7 === void 0 ? void 0 : _7.programMembershipUsed) === null || _8 === void 0 ? void 0 : _8.identifier) === null || _9 === void 0 ? void 0 : _9.$eq;
|
|
402
384
|
if (typeof itemOfferedProgramMembershipUsedIdentifierEq === 'string') {
|
|
403
385
|
andConditions.push({
|
|
404
386
|
'acceptedOffers.itemOffered.programMembershipUsed.identifier': {
|
|
@@ -407,7 +389,7 @@ class MongoRepository {
|
|
|
407
389
|
}
|
|
408
390
|
});
|
|
409
391
|
}
|
|
410
|
-
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (
|
|
392
|
+
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_15 = (_14 = (_13 = (_12 = (_11 = (_10 = params.acceptedOffers) === null || _10 === void 0 ? void 0 : _10.itemOffered) === null || _11 === void 0 ? void 0 : _11.programMembershipUsed) === null || _12 === void 0 ? void 0 : _12.issuedThrough) === null || _13 === void 0 ? void 0 : _13.serviceType) === null || _14 === void 0 ? void 0 : _14.codeValue) === null || _15 === void 0 ? void 0 : _15.$eq;
|
|
411
393
|
if (typeof itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
|
|
412
394
|
andConditions.push({
|
|
413
395
|
'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': {
|
|
@@ -603,7 +585,7 @@ class MongoRepository {
|
|
|
603
585
|
});
|
|
604
586
|
}
|
|
605
587
|
}
|
|
606
|
-
const paymentMethodAdditionalPropertyAll = (
|
|
588
|
+
const paymentMethodAdditionalPropertyAll = (_17 = (_16 = params.paymentMethods) === null || _16 === void 0 ? void 0 : _16.additionalProperty) === null || _17 === void 0 ? void 0 : _17.$all;
|
|
607
589
|
if (Array.isArray(paymentMethodAdditionalPropertyAll)) {
|
|
608
590
|
andConditions.push({
|
|
609
591
|
'paymentMethods.additionalProperty': {
|
|
@@ -612,7 +594,7 @@ class MongoRepository {
|
|
|
612
594
|
}
|
|
613
595
|
});
|
|
614
596
|
}
|
|
615
|
-
const paymentMethodAdditionalPropertyIn = (
|
|
597
|
+
const paymentMethodAdditionalPropertyIn = (_19 = (_18 = params.paymentMethods) === null || _18 === void 0 ? void 0 : _18.additionalProperty) === null || _19 === void 0 ? void 0 : _19.$in;
|
|
616
598
|
if (Array.isArray(paymentMethodAdditionalPropertyIn)) {
|
|
617
599
|
andConditions.push({
|
|
618
600
|
'paymentMethods.additionalProperty': {
|
|
@@ -696,8 +678,9 @@ class MongoRepository {
|
|
|
696
678
|
changeStatus(params) {
|
|
697
679
|
return __awaiter(this, void 0, void 0, function* () {
|
|
698
680
|
const doc = yield this.orderModel.findOneAndUpdate({
|
|
699
|
-
orderNumber: params.orderNumber,
|
|
700
|
-
orderStatus: params.previousOrderStatus
|
|
681
|
+
orderNumber: { $eq: params.orderNumber },
|
|
682
|
+
orderStatus: { $eq: params.previousOrderStatus },
|
|
683
|
+
'project.id': { $eq: params.project.id }
|
|
701
684
|
}, { orderStatus: params.orderStatus }, {
|
|
702
685
|
new: true,
|
|
703
686
|
projection: {
|
|
@@ -711,6 +694,7 @@ class MongoRepository {
|
|
|
711
694
|
if (doc === null) {
|
|
712
695
|
const order = yield this.findByOrderNumber({
|
|
713
696
|
orderNumber: params.orderNumber,
|
|
697
|
+
project: { id: params.project.id },
|
|
714
698
|
inclusion: [],
|
|
715
699
|
exclusion: []
|
|
716
700
|
});
|
|
@@ -735,8 +719,9 @@ class MongoRepository {
|
|
|
735
719
|
returnOrder(params) {
|
|
736
720
|
return __awaiter(this, void 0, void 0, function* () {
|
|
737
721
|
const doc = yield this.orderModel.findOneAndUpdate({
|
|
738
|
-
orderNumber: params.orderNumber,
|
|
739
|
-
orderStatus: factory.orderStatus.OrderDelivered
|
|
722
|
+
orderNumber: { $eq: params.orderNumber },
|
|
723
|
+
orderStatus: { $eq: factory.orderStatus.OrderDelivered },
|
|
724
|
+
'project.id': { $eq: params.project.id }
|
|
740
725
|
}, {
|
|
741
726
|
orderStatus: factory.orderStatus.OrderReturned,
|
|
742
727
|
dateReturned: params.dateReturned,
|
|
@@ -754,6 +739,7 @@ class MongoRepository {
|
|
|
754
739
|
if (doc === null) {
|
|
755
740
|
const order = yield this.findByOrderNumber({
|
|
756
741
|
orderNumber: params.orderNumber,
|
|
742
|
+
project: { id: params.project.id },
|
|
757
743
|
inclusion: [],
|
|
758
744
|
exclusion: []
|
|
759
745
|
});
|
|
@@ -777,7 +763,10 @@ class MongoRepository {
|
|
|
777
763
|
*/
|
|
778
764
|
updateChangeableAttributes(params) {
|
|
779
765
|
return __awaiter(this, void 0, void 0, function* () {
|
|
780
|
-
const doc = yield this.orderModel.findOneAndUpdate({
|
|
766
|
+
const doc = yield this.orderModel.findOneAndUpdate({
|
|
767
|
+
orderNumber: { $eq: params.orderNumber },
|
|
768
|
+
'project.id': { $eq: params.project.id }
|
|
769
|
+
}, {
|
|
781
770
|
$set: Object.assign(Object.assign({}, (Array.isArray(params.additionalProperty)) ? { additionalProperty: params.additionalProperty } : undefined), (typeof params.name === 'string') ? { name: params.name } : undefined)
|
|
782
771
|
}, {
|
|
783
772
|
new: true,
|
|
@@ -844,7 +833,10 @@ class MongoRepository {
|
|
|
844
833
|
});
|
|
845
834
|
}
|
|
846
835
|
}
|
|
847
|
-
const doc = yield this.orderModel.findOne({
|
|
836
|
+
const doc = yield this.orderModel.findOne({
|
|
837
|
+
orderNumber: { $eq: params.orderNumber },
|
|
838
|
+
'project.id': { $eq: params.project.id }
|
|
839
|
+
}, projection)
|
|
848
840
|
.exec();
|
|
849
841
|
if (doc === null) {
|
|
850
842
|
throw new factory.errors.NotFound(this.orderModel.modelName);
|
|
@@ -861,7 +853,7 @@ class MongoRepository {
|
|
|
861
853
|
orderNumber: 1,
|
|
862
854
|
_id: 0
|
|
863
855
|
};
|
|
864
|
-
const doc = yield this.orderModel.findOne(Object.assign({ orderNumber: { $eq: params.orderNumber }, acceptedOffers: {
|
|
856
|
+
const doc = yield this.orderModel.findOne(Object.assign({ orderNumber: { $eq: params.orderNumber }, 'project.id': { $eq: params.project.id }, acceptedOffers: {
|
|
865
857
|
$elemMatch: {
|
|
866
858
|
'itemOffered.typeOf': { $in: [factory.reservationType.BusReservation, factory.reservationType.EventReservation] },
|
|
867
859
|
'itemOffered.id': { $eq: params.reservationId }
|
|
@@ -27,7 +27,6 @@ import { Connection, UpdateWriteOpResult } from 'mongoose';
|
|
|
27
27
|
import * as factory from '../factory';
|
|
28
28
|
export interface IUpdatePartiallyParams {
|
|
29
29
|
additionalTicketText?: string;
|
|
30
|
-
'reservedTicket.dateUsed'?: Date;
|
|
31
30
|
}
|
|
32
31
|
export type ICancelResult = UpdateWriteOpResult;
|
|
33
32
|
export type ICreatingReservation<T extends factory.reservationType> = T extends factory.reservationType.BusReservation ? (factory.reservation.busReservation.IReservation) & {
|
|
@@ -14,6 +14,7 @@ const order_1 = require("../../factory/order");
|
|
|
14
14
|
const factory_1 = require("../delivery/factory");
|
|
15
15
|
const onOrderStatusChanged_1 = require("./onOrderStatusChanged");
|
|
16
16
|
const factory = require("../../factory");
|
|
17
|
+
// tslint:disable-next-line:max-func-body-length
|
|
17
18
|
function returnOrder(params) {
|
|
18
19
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
19
20
|
const orderNumber = params.object.orderNumber;
|
|
@@ -21,7 +22,12 @@ function returnOrder(params) {
|
|
|
21
22
|
? params.object.dateReturned
|
|
22
23
|
: new Date();
|
|
23
24
|
const returner = params.agent;
|
|
24
|
-
let order = yield repos.order.findByOrderNumber({
|
|
25
|
+
let order = yield repos.order.findByOrderNumber({
|
|
26
|
+
orderNumber,
|
|
27
|
+
project: { id: params.project.id },
|
|
28
|
+
inclusion: [],
|
|
29
|
+
exclusion: []
|
|
30
|
+
});
|
|
25
31
|
// プロジェクト条件検証
|
|
26
32
|
if (order.project.id !== params.project.id) {
|
|
27
33
|
throw new factory.errors.NotFound('Order');
|
|
@@ -59,6 +65,7 @@ function returnOrder(params) {
|
|
|
59
65
|
returnedOwnershipInfos = yield processReturnOrder(order, dateReturned)({ ownershipInfo: repos.ownershipInfo });
|
|
60
66
|
// 注文ステータス変更
|
|
61
67
|
order = yield repos.order.returnOrder({
|
|
68
|
+
project: { id: order.project.id },
|
|
62
69
|
orderNumber,
|
|
63
70
|
dateReturned,
|
|
64
71
|
returner
|
|
@@ -31,7 +31,12 @@ function sendOrder(params) {
|
|
|
31
31
|
orderNumber
|
|
32
32
|
})({ transaction: repos.transaction });
|
|
33
33
|
// 注文取得
|
|
34
|
-
let order = yield repos.order.findByOrderNumber({
|
|
34
|
+
let order = yield repos.order.findByOrderNumber({
|
|
35
|
+
orderNumber,
|
|
36
|
+
project: { id: params.project.id },
|
|
37
|
+
inclusion: [],
|
|
38
|
+
exclusion: []
|
|
39
|
+
});
|
|
35
40
|
// プロジェクト条件検証
|
|
36
41
|
if (order.project.id !== params.project.id) {
|
|
37
42
|
throw new factory.errors.NotFound('Order');
|
|
@@ -69,6 +74,7 @@ function sendOrder(params) {
|
|
|
69
74
|
return repos.ownershipInfo.createIfNotExistByIdentifier(ownershipInfo);
|
|
70
75
|
})));
|
|
71
76
|
order = yield repos.order.changeStatus({
|
|
77
|
+
project: { id: order.project.id },
|
|
72
78
|
orderNumber,
|
|
73
79
|
orderStatus: factory.orderStatus.OrderDelivered,
|
|
74
80
|
previousOrderStatus: factory.orderStatus.OrderProcessing
|
|
@@ -98,6 +104,7 @@ function sendOrder(params) {
|
|
|
98
104
|
// すでにOrderReturnedだった場合、OrderDelivered->OrderReturnedの処理自体は成功しているので、後処理を続行する
|
|
99
105
|
const currentOrder = yield repos.order.findByOrderNumber({
|
|
100
106
|
orderNumber: params.object.orderNumber,
|
|
107
|
+
project: { id: params.project.id },
|
|
101
108
|
inclusion: ['orderStatus'],
|
|
102
109
|
exclusion: []
|
|
103
110
|
});
|
|
@@ -26,6 +26,7 @@ function verifyToken4reservation(params) {
|
|
|
26
26
|
case factory.order.OrderType.Order:
|
|
27
27
|
// reservationIdを含む注文の存在を確認するだけでよい(2023-01-31~)
|
|
28
28
|
const order = yield repos.order.findByOrderNumberAndReservationId({
|
|
29
|
+
project: { id: params.project.id },
|
|
29
30
|
orderNumber: payload.orderNumber,
|
|
30
31
|
reservationId: params.reservationId,
|
|
31
32
|
seller: params.seller
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.316.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.316.0-alpha.1",
|
|
13
13
|
"@cinerino/sdk": "3.160.0-alpha.5",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"postversion": "git push origin --tags",
|
|
118
118
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
119
119
|
},
|
|
120
|
-
"version": "21.4.0-alpha.
|
|
120
|
+
"version": "21.4.0-alpha.18"
|
|
121
121
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as mongoose from 'mongoose';
|
|
3
|
-
|
|
4
|
-
import { chevre } from '../../../lib/index';
|
|
5
|
-
|
|
6
|
-
async function main() {
|
|
7
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
8
|
-
|
|
9
|
-
const orderRepo = new chevre.repository.Order(mongoose.connection);
|
|
10
|
-
|
|
11
|
-
const order = await orderRepo.findByOrderNumberAndReservationId({
|
|
12
|
-
orderNumber: 'CIN9-4783801-1618274',
|
|
13
|
-
reservationId: '139787058570943-0'
|
|
14
|
-
});
|
|
15
|
-
console.log('order found', order);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
main()
|
|
19
|
-
.then()
|
|
20
|
-
.catch(console.error);
|