@chevre/domain 20.14.0-alpha.1 → 20.14.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.
@@ -5,7 +5,6 @@ import * as factory from '../../../factory';
5
5
  interface ICheckResult {
6
6
  purchaseNumberAuthIn: factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthIn;
7
7
  purchaseNumberAuthResult: factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult;
8
- movieTickets: factory.action.check.paymentMethod.movieTicket.IMovieTicket[];
9
8
  }
10
9
  /**
11
10
  * MovieTicket認証
@@ -88,96 +88,14 @@ function checkByIdentifier(params) {
88
88
  }, { timeout: credentials_1.credentials.movieticketReserve.timeout });
89
89
  purchaseNumberAuthResult = yield authService.purchaseNumberAuth(purchaseNumberAuthIn);
90
90
  // 決済カード配列に成形
91
- const movieTickets = purchaseNumberAuthResult2movieTickets({
92
- screeningEvent: params.screeningEvent,
93
- paymentMethodType,
94
- knyknrNoInfoIn,
95
- purchaseNumberAuthResult
96
- });
97
- return { purchaseNumberAuthIn, purchaseNumberAuthResult, movieTickets };
91
+ // const movieTickets = purchaseNumberAuthResult2movieTickets({
92
+ // screeningEvent: params.screeningEvent,
93
+ // paymentMethodType,
94
+ // knyknrNoInfoIn,
95
+ // purchaseNumberAuthResult
96
+ // });
97
+ // return { purchaseNumberAuthIn, purchaseNumberAuthResult, movieTickets };
98
+ return { purchaseNumberAuthIn, purchaseNumberAuthResult };
98
99
  });
99
100
  }
100
101
  exports.checkByIdentifier = checkByIdentifier;
101
- function purchaseNumberAuthResult2movieTickets(params) {
102
- const movieTickets = [];
103
- const paymentMethodType = params.paymentMethodType;
104
- const knyknrNoInfoIn = params.knyknrNoInfoIn;
105
- const purchaseNumberAuthResult = params.purchaseNumberAuthResult;
106
- if (Array.isArray(purchaseNumberAuthResult.knyknrNoInfoOut)) {
107
- purchaseNumberAuthResult.knyknrNoInfoOut.forEach((knyknrNoInfoOut) => {
108
- const knyknrNoInfo = knyknrNoInfoIn.find((info) => info.knyknrNo === knyknrNoInfoOut.knyknrNo);
109
- if (knyknrNoInfo !== undefined) {
110
- const movieTicketCategoryCode = (typeof knyknrNoInfoOut.znkkkytsknGkjknTyp === 'string')
111
- ? knyknrNoInfoOut.znkkkytsknGkjknTyp
112
- : '';
113
- if (Array.isArray(knyknrNoInfoOut.ykknInfo)) {
114
- knyknrNoInfoOut.ykknInfo.forEach((ykknInfo) => {
115
- // tslint:disable-next-line:prefer-array-literal
116
- [...Array(Number(ykknInfo.ykknKnshbtsmiNum))].forEach(() => {
117
- movieTickets.push({
118
- // project: { typeOf: factory.organizationType.Project, id: params.screeningEvent.project.id },
119
- typeOf: paymentMethodType,
120
- identifier: knyknrNoInfo.knyknrNo,
121
- accessCode: knyknrNoInfo.pinCd,
122
- category: {
123
- codeValue: movieTicketCategoryCode // 追加(2023-02-08~)
124
- },
125
- serviceType: ykknInfo.ykknshTyp,
126
- serviceOutput: {
127
- reservationFor: {
128
- typeOf: params.screeningEvent.typeOf,
129
- id: params.screeningEvent.id
130
- }
131
- // reservedTicket: {
132
- // ticketedSeat: {
133
- // typeOf: factory.placeType.Seat,
134
- // // seatingType: 'Default', // 情報空でよし
135
- // seatNumber: '', // 情報空でよし
136
- // seatRow: '', // 情報空でよし
137
- // seatSection: '' // 情報空でよし
138
- // }
139
- // }
140
- }
141
- });
142
- });
143
- });
144
- }
145
- if (Array.isArray(knyknrNoInfoOut.mkknInfo)) {
146
- knyknrNoInfoOut.mkknInfo.forEach((mkknInfo) => {
147
- // tslint:disable-next-line:prefer-array-literal
148
- [...Array(Number(mkknInfo.mkknKnshbtsmiNum))].forEach(() => {
149
- movieTickets.push(Object.assign({
150
- // project: { typeOf: factory.organizationType.Project, id: params.screeningEvent.project.id },
151
- typeOf: paymentMethodType, identifier: knyknrNoInfo.knyknrNo, accessCode: knyknrNoInfo.pinCd, category: {
152
- codeValue: movieTicketCategoryCode // 追加(2023-02-08~)
153
- }, amount: {
154
- typeOf: 'MonetaryAmount',
155
- // currency: factory.priceCurrency.JPY,
156
- validThrough: moment(`${mkknInfo.yykDt}+09:00`, 'YYYY/MM/DD HH:mm:ssZ')
157
- .toDate()
158
- }, serviceType: mkknInfo.mkknshTyp, serviceOutput: {
159
- reservationFor: {
160
- typeOf: params.screeningEvent.typeOf,
161
- id: params.screeningEvent.id
162
- }
163
- // reservedTicket: {
164
- // ticketedSeat: {
165
- // typeOf: factory.placeType.Seat,
166
- // // seatingType: 'Default', // 情報空でよし
167
- // seatNumber: '', // 情報空でよし
168
- // seatRow: '', // 情報空でよし
169
- // seatSection: '' // 情報空でよし
170
- // }
171
- // }
172
- } }, {
173
- validThrough: moment(`${mkknInfo.yykDt}+09:00`, 'YYYY/MM/DD HH:mm:ssZ')
174
- .toDate()
175
- }));
176
- });
177
- });
178
- }
179
- }
180
- });
181
- }
182
- return movieTickets;
183
- }
@@ -32,8 +32,23 @@ exports.ISS_PREFIX = 'https://cognito-idp.ap-northeast-1.amazonaws.com/';
32
32
  function orderProgramMembership(params, paymentMethodType) {
33
33
  return (repos) => __awaiter(this, void 0, void 0, function* () {
34
34
  var _a, _b, _c;
35
- // ユーザー存在確認(管理者がマニュアルでユーザーを削除する可能性があるので)
36
- const customer = yield repos.person.findById({ userId: String(params.agent.id) });
35
+ let customer;
36
+ try {
37
+ customer = yield repos.person.findById({ userId: String(params.agent.id) });
38
+ }
39
+ catch (error) {
40
+ // Not Found: User.をハンドル(2023-03-31~)
41
+ if (error instanceof factory.errors.NotFound) {
42
+ // no op
43
+ }
44
+ else {
45
+ throw error;
46
+ }
47
+ }
48
+ if (customer === undefined) {
49
+ // Userが存在しなければリトライは不要
50
+ return;
51
+ }
37
52
  // issに依存するので存在確認
38
53
  const issByCustomer = (_b = (_a = customer.identifier) === null || _a === void 0 ? void 0 : _a.find((p) => p.name === 'iss')) === null || _b === void 0 ? void 0 : _b.value;
39
54
  if (typeof issByCustomer !== 'string' || issByCustomer.length === 0) {
@@ -92,6 +107,10 @@ function orderProgramMembership(params, paymentMethodType) {
92
107
  === OfferService.product.ERROR_MESSAGE_ALREADY_REGISTERED) {
93
108
  return;
94
109
  }
110
+ // Not Found: OwnershipInfos of PaymentCard.をハンドル(2023-03-31~)
111
+ if (error instanceof factory.errors.NotFound && error.entityName === 'OwnershipInfos of PaymentCard') {
112
+ return;
113
+ }
95
114
  throw error;
96
115
  }
97
116
  });
package/package.json CHANGED
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.14.0-alpha.1"
123
+ "version": "20.14.0-alpha.3"
124
124
  }