@chevre/domain 21.26.0-alpha.8 → 21.26.0
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.
|
@@ -22,12 +22,12 @@ async function main() {
|
|
|
22
22
|
orderDate: {
|
|
23
23
|
$gte: moment()
|
|
24
24
|
// tslint:disable-next-line:no-magic-numbers
|
|
25
|
-
.add(-
|
|
26
|
-
.toDate(),
|
|
27
|
-
$lte: moment()
|
|
28
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
29
|
-
.add(-280, 'days')
|
|
25
|
+
.add(-1, 'days')
|
|
30
26
|
.toDate()
|
|
27
|
+
// $lte: moment()
|
|
28
|
+
// // tslint:disable-next-line:no-magic-numbers
|
|
29
|
+
// .add(-360, 'days')
|
|
30
|
+
// .toDate()
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
{
|
|
@@ -89,8 +89,17 @@ function validateOrder(params) {
|
|
|
89
89
|
reservationForIds = [...new Set(reservationForIds)];
|
|
90
90
|
itemOfferedTypeOfs = [...new Set(itemOfferedTypeOfs)];
|
|
91
91
|
// itemOffered.typeOf検証
|
|
92
|
-
if (
|
|
93
|
-
|
|
92
|
+
if (moment(order.orderDate)
|
|
93
|
+
.isAfter(moment('2024-02-01T15:00:00Z'))) {
|
|
94
|
+
if (itemOfferedTypeOfs.length !== 1) {
|
|
95
|
+
throw new Error(`itemOfferedTypeOfs.length must be 1 [${itemOfferedTypeOfs.length}]`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// 0対応(~2024-02-02)
|
|
100
|
+
if (itemOfferedTypeOfs.length > 1) {
|
|
101
|
+
throw new Error(`itemOfferedTypeOfs.length must be 0 or 1 [${itemOfferedTypeOfs.length}]`);
|
|
102
|
+
}
|
|
94
103
|
}
|
|
95
104
|
// price検証
|
|
96
105
|
let priceExpected = 0;
|
|
@@ -109,16 +118,17 @@ function validateOrder(params) {
|
|
|
109
118
|
if (coaTicketInfo === undefined) {
|
|
110
119
|
throw new Error(`itemOffered.reservedTicket.coaTicketInfo not found`);
|
|
111
120
|
}
|
|
112
|
-
if (typeof coaTicketInfo.
|
|
121
|
+
if (typeof coaTicketInfo.salePrice !== 'number'
|
|
113
122
|
|| typeof coaTicketInfo.addGlasses !== 'number'
|
|
114
123
|
|| typeof coaTicketInfo.spseatAdd1 !== 'number'
|
|
115
124
|
|| typeof coaTicketInfo.spseatAdd2 !== 'number') {
|
|
116
125
|
throw new Error(`invalid itemOffered.reservedTicket.coaTicketInfo`);
|
|
117
126
|
}
|
|
118
127
|
return a + [
|
|
119
|
-
coaTicketInfo.salesTicketSalePrice,
|
|
120
|
-
coaTicketInfo.addGlasses,
|
|
121
|
-
coaTicketInfo.spseatAdd1,
|
|
128
|
+
// <number>(<any>coaTicketInfo).salesTicketSalePrice,
|
|
129
|
+
// coaTicketInfo.addGlasses,
|
|
130
|
+
// coaTicketInfo.spseatAdd1,
|
|
131
|
+
coaTicketInfo.salePrice,
|
|
122
132
|
coaTicketInfo.spseatAdd2
|
|
123
133
|
].reduce((a2, b2) => a2 + b2, 0);
|
|
124
134
|
}, 0);
|
|
@@ -139,7 +149,10 @@ function validateOrder(params) {
|
|
|
139
149
|
case factory.actionType.MoneyTransfer:
|
|
140
150
|
break;
|
|
141
151
|
default:
|
|
142
|
-
|
|
152
|
+
if (moment(order.orderDate)
|
|
153
|
+
.isAfter(moment('2024-02-01T15:00:00Z'))) {
|
|
154
|
+
throw new Error(`invalid itemOfferedTypeOf [${itemOfferedTypeOf}]`);
|
|
155
|
+
}
|
|
143
156
|
}
|
|
144
157
|
// orderedItem検証
|
|
145
158
|
if (order.orderedItem.length !== numOrderedItemExpected) {
|
package/package.json
CHANGED