@chevre/domain 24.0.0-alpha.31 → 24.0.0-alpha.32

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.
Files changed (26) hide show
  1. package/lib/chevre/repo/aggregateAction.js +1 -1
  2. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +1 -1
  3. package/lib/chevre/repo/order.js +2 -1
  4. package/lib/chevre/repo/reservation.d.ts +6 -24
  5. package/lib/chevre/repo/reservation.js +35 -48
  6. package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +1 -17
  7. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +1 -41
  8. package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +1 -11
  9. package/lib/chevre/service/assetTransaction/reserve/start.js +2 -5
  10. package/lib/chevre/service/delivery/factory.js +0 -1
  11. package/lib/chevre/service/delivery/reservation/factory.js +8 -13
  12. package/lib/chevre/service/offer/event/authorize/factory.js +0 -38
  13. package/lib/chevre/service/offer/event/authorize.js +19 -18
  14. package/lib/chevre/service/order/deleteOrder.js +1 -1
  15. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -2
  16. package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -20
  17. package/lib/chevre/service/order/placeOrder/factory.js +0 -1
  18. package/lib/chevre/service/reserve/cancelReservation.js +4 -11
  19. package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
  20. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -2
  21. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -0
  22. package/lib/chevre/service/reserve/searchByOrder.d.ts +1 -1
  23. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +2 -4
  24. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -3
  25. package/lib/chevre/service/validation/validateOrder.js +1 -3
  26. package/package.json +2 -2
@@ -187,7 +187,7 @@ class AggregateActionRepo {
187
187
  'object.typeOf': {
188
188
  $exists: true,
189
189
  $in: [
190
- factory.reservationType.BusReservation,
190
+ // factory.reservationType.BusReservation,
191
191
  factory.reservationType.EventReservation,
192
192
  factory.reservationType.ReservationPackage
193
193
  ]
@@ -1,7 +1,7 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import * as factory from '../../../factory';
4
- type IDocType = (Omit<factory.reservation.IReservation<factory.reservationType.BusReservation>, 'id'> | Omit<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id'>) & {
4
+ type IDocType = (Omit<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id'>) & {
5
5
  _id: string;
6
6
  bookingAgent?: any;
7
7
  previousReservationStatus?: factory.reservationStatusType;
@@ -949,7 +949,8 @@ class OrderRepo {
949
949
  typeOf: { $eq: factory.order.OrderType.Order },
950
950
  acceptedOffers: {
951
951
  $elemMatch: {
952
- 'itemOffered.typeOf': { $in: [factory.reservationType.BusReservation, factory.reservationType.EventReservation] },
952
+ // 'itemOffered.typeOf': { $in: [factory.reservationType.BusReservation, factory.reservationType.EventReservation] },
953
+ 'itemOffered.typeOf': { $in: [factory.reservationType.EventReservation] },
953
954
  'itemOffered.id': { $eq: params.reservationId }
954
955
  }
955
956
  },
@@ -7,12 +7,10 @@ export interface IUpdatePartiallyParams {
7
7
  }
8
8
  export type ICancelResult = UpdateWriteOpResult;
9
9
  export type ICheckedInResult = UpdateWriteOpResult;
10
- export type ICreatingReservation<T extends factory.reservationType> = T extends factory.reservationType.BusReservation ? (Omit<factory.reservation.busReservation.IReservation, 'id'>) & {
11
- _id: string;
12
- } : T extends factory.reservationType.EventReservation ? (Omit<factory.reservation.eventReservation.IReservation, 'id'>) & {
10
+ export type ICreatingReservation<T extends factory.reservationType> = T extends factory.reservationType.EventReservation ? (Omit<factory.reservation.eventReservation.IReservation, 'id'>) & {
13
11
  _id: string;
14
12
  } : never;
15
- type IKeyOfProjection = keyof factory.reservation.IReservation<factory.reservationType.BusReservation | factory.reservationType.EventReservation> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
13
+ type IKeyOfProjection = keyof factory.reservation.IReservation<factory.reservationType.EventReservation> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
16
14
  export type IAttendedReservation = Pick<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id' | 'typeOf' | 'project' | 'modifiedTime'> & {
17
15
  reservationFor: Pick<factory.reservation.IReservationFor<factory.reservationType.EventReservation>, 'id' | 'typeOf'>;
18
16
  reservedTicket: Pick<factory.reservation.ITicket, 'dateUsed'>;
@@ -23,7 +21,7 @@ export type IAttendedReservation = Pick<factory.reservation.IReservation<factory
23
21
  export declare class ReservationRepo {
24
22
  private readonly reservationModel;
25
23
  constructor(connection: Connection);
26
- static CREATE_MONGO_CONDITIONS(params: factory.reservation.ISearchConditions<factory.reservationType>): FilterQuery<import("@chevre/factory/lib/reservation/busReservation").IReservation | import("@chevre/factory/lib/reservation/event").IReservation | import("@chevre/factory/lib/reservation/reservationPackage").IReservation>[];
24
+ static CREATE_MONGO_CONDITIONS(params: factory.reservation.ISearchConditions<factory.reservationType>): FilterQuery<import("@chevre/factory/lib/reservation/event").IReservation | import("@chevre/factory/lib/reservation/reservationPackage").IReservation>[];
27
25
  /**
28
26
  * 汎用予約カウント
29
27
  */
@@ -126,23 +124,7 @@ export declare class ReservationRepo {
126
124
  $in: string[];
127
125
  };
128
126
  }): Promise<string[]>;
129
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<(Omit<import("@chevre/factory/lib/reservation/busReservation").IReservation, "id"> & {
130
- _id: string;
131
- bookingAgent?: any;
132
- previousReservationStatus?: factory.reservationStatusType;
133
- } & Required<{
134
- _id: string;
135
- }> & {
136
- __v: number;
137
- }) | (Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id"> & {
138
- _id: string;
139
- bookingAgent?: any;
140
- previousReservationStatus?: factory.reservationStatusType;
141
- } & Required<{
142
- _id: string;
143
- }> & {
144
- __v: number;
145
- }), "id"> & import("./mongoose/virtuals").IVirtuals, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, {}, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<(Omit<import("@chevre/factory/lib/reservation/busReservation").IReservation, "id"> & {
127
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id"> & {
146
128
  _id: string;
147
129
  bookingAgent?: any;
148
130
  previousReservationStatus?: factory.reservationStatusType;
@@ -150,7 +132,7 @@ export declare class ReservationRepo {
150
132
  _id: string;
151
133
  }> & {
152
134
  __v: number;
153
- }) | (Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id"> & {
135
+ }, "id"> & import("./mongoose/virtuals").IVirtuals, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, {}, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id"> & {
154
136
  _id: string;
155
137
  bookingAgent?: any;
156
138
  previousReservationStatus?: factory.reservationStatusType;
@@ -158,7 +140,7 @@ export declare class ReservationRepo {
158
140
  _id: string;
159
141
  }> & {
160
142
  __v: number;
161
- }), "id"> & import("./mongoose/virtuals").IVirtuals) | null>;
143
+ }, "id"> & import("./mongoose/virtuals").IVirtuals) | null>;
162
144
  unsetUnnecessaryFields(params: {
163
145
  filter: any;
164
146
  $unset: any;
@@ -221,35 +221,41 @@ class ReservationRepo {
221
221
  });
222
222
  }
223
223
  switch (params.typeOf) {
224
- case factory.reservationType.BusReservation:
225
- const reservationForTypeOfEq = params.reservationFor?.typeOf;
226
- if (typeof reservationForTypeOfEq === 'string') {
227
- andConditions.push({
228
- 'reservationFor.typeOf': {
229
- $exists: true,
230
- $eq: reservationForTypeOfEq
231
- }
232
- });
233
- }
234
- const reservationForIdEq = params.reservationFor?.id?.$eq;
235
- if (typeof reservationForIdEq === 'string') {
236
- andConditions.push({
237
- 'reservationFor.id': {
238
- $exists: true,
239
- $eq: reservationForIdEq
240
- }
241
- });
242
- }
243
- const reservationForIdIn = params.reservationFor?.id?.$in;
244
- if (Array.isArray(reservationForIdIn)) {
245
- andConditions.push({
246
- 'reservationFor.id': {
247
- $exists: true,
248
- $in: reservationForIdIn
249
- }
250
- });
251
- }
252
- break;
224
+ // case factory.reservationType.BusReservation:
225
+ // const reservationForTypeOfEq = params.reservationFor?.typeOf;
226
+ // if (typeof reservationForTypeOfEq === 'string') {
227
+ // andConditions.push(
228
+ // {
229
+ // 'reservationFor.typeOf': {
230
+ // $exists: true,
231
+ // $eq: reservationForTypeOfEq
232
+ // }
233
+ // }
234
+ // );
235
+ // }
236
+ // const reservationForIdEq = params.reservationFor?.id?.$eq;
237
+ // if (typeof reservationForIdEq === 'string') {
238
+ // andConditions.push(
239
+ // {
240
+ // 'reservationFor.id': {
241
+ // $exists: true,
242
+ // $eq: reservationForIdEq
243
+ // }
244
+ // }
245
+ // );
246
+ // }
247
+ // const reservationForIdIn = params.reservationFor?.id?.$in;
248
+ // if (Array.isArray(reservationForIdIn)) {
249
+ // andConditions.push(
250
+ // {
251
+ // 'reservationFor.id': {
252
+ // $exists: true,
253
+ // $in: reservationForIdIn
254
+ // }
255
+ // }
256
+ // );
257
+ // }
258
+ // break;
253
259
  case factory.reservationType.EventReservation:
254
260
  if (typeof params.reservationFor?.id === 'string') {
255
261
  andConditions.push({
@@ -876,25 +882,6 @@ class ReservationRepo {
876
882
  params.subReservation.forEach((subReservation) => {
877
883
  let setOnInsert;
878
884
  switch (subReservation.typeOf) {
879
- case factory.reservationType.BusReservation:
880
- setOnInsert = {
881
- ...subReservation,
882
- _id: subReservation.id,
883
- bookingTime: params.bookingTime,
884
- checkedIn: false,
885
- attended: false,
886
- issuedThrough: params.issuedThrough,
887
- project: { id: params.project.id, typeOf: factory.organizationType.Project },
888
- reservationFor: params.reservationFor,
889
- reservationNumber: params.reservationNumber,
890
- reservationStatus: factory.reservationStatusType.ReservationConfirmed,
891
- modifiedTime,
892
- // providerを追加(2023-07-19~)
893
- provider: params.provider,
894
- ...(params.underName !== undefined) ? { underName: params.underName } : undefined,
895
- ...(typeof params.broker?.typeOf === 'string') ? { broker: params.broker } : undefined
896
- };
897
- break;
898
885
  case factory.reservationType.EventReservation:
899
886
  setOnInsert = {
900
887
  ...subReservation,
@@ -119,23 +119,7 @@ function createPotentialActions(params) {
119
119
  transaction.object.reservations.map((reservation) => {
120
120
  // 最適化(2022-06-06~)
121
121
  let cancelObject;
122
- if (reservation.typeOf === factory.reservationType.BusReservation) {
123
- cancelObject = {
124
- typeOf: reservation.typeOf,
125
- id: reservation.id,
126
- issuedThrough: {
127
- typeOf: reservation.issuedThrough?.typeOf
128
- },
129
- reservationFor: {
130
- typeOf: reservation.reservationFor.typeOf,
131
- id: String(reservation.reservationFor.id)
132
- },
133
- reservationNumber: reservation.reservationNumber,
134
- // ReservationConfirmed->ReservationCancelledのみ処理されるように保証する
135
- reservationStatus: factory.reservationStatusType.ReservationConfirmed
136
- };
137
- }
138
- else if (reservation.typeOf === factory.reservationType.EventReservation) {
122
+ if (reservation.typeOf === factory.reservationType.EventReservation) {
139
123
  cancelObject = {
140
124
  typeOf: reservation.typeOf,
141
125
  id: reservation.id,
@@ -393,46 +393,6 @@ function createReservation(params) {
393
393
  };
394
394
  }
395
395
  else {
396
- return {
397
- // project: params.project,
398
- typeOf: factory.reservationType.BusReservation,
399
- id: params.id,
400
- // reservationPackage保管に移行(2023-06-06~)
401
- // issuedThrough,
402
- additionalProperty: params.additionalProperty,
403
- // bookingTime: params.reserveDate,
404
- // modifiedTime: params.reserveDate,
405
- numSeats: 1,
406
- price: price4reservation,
407
- priceCurrency: factory.priceCurrency.JPY,
408
- // reservationNumber: params.reservationNumber,
409
- // statusは不要なので削除(2023-07-19~)
410
- // reservationStatus: factory.reservationStatusType.ReservationPending,
411
- reservedTicket: params.reservedTicket,
412
- // underName: {
413
- // typeOf: params.agent.typeOf,
414
- // name: params.agent.name
415
- // },
416
- // checkedIn: false,
417
- // attended: false,
418
- ...(typeof params.additionalTicketText === 'string') ? { additionalTicketText: params.additionalTicketText } : undefined,
419
- ...(Array.isArray(params.subReservation))
420
- ? {
421
- subReservation: params.subReservation.map((r) => {
422
- return {
423
- reservedTicket: {
424
- ticketedSeat: r.reservedTicket.ticketedSeat,
425
- typeOf: 'Ticket'
426
- }
427
- };
428
- })
429
- }
430
- : undefined,
431
- // reservationPackage保管に移行(2023-06-06~)
432
- // ...(typeof params.broker?.typeOf === 'string') ? { broker: params.broker } : undefined,
433
- ...(typeof params.programMembershipUsed?.identifier === 'string')
434
- ? { programMembershipUsed: params.programMembershipUsed }
435
- : undefined
436
- };
396
+ throw new factory.errors.NotImplemented(`reservationFor not implemented. typeOf:${params.reservationFor.typeOf}`);
437
397
  }
438
398
  }
@@ -144,16 +144,6 @@ function createIssuedThrough(params) {
144
144
  };
145
145
  }
146
146
  else {
147
- const issuedThrough = {
148
- typeOf: factory.product.ProductType.Transportation,
149
- // 興行IDを追加(2022-09-08~)
150
- id: eventOffers.itemOffered.id,
151
- availableChannel,
152
- // issuedThrough.serviceTypeを連携
153
- ...(typeof serviceTypeOfIssuedThrough?.typeOf === 'string') ? { serviceType: serviceTypeOfIssuedThrough } : undefined
154
- };
155
- return {
156
- issuedThrough
157
- };
147
+ throw new factory.errors.NotImplemented(`reservationFor not implemented. typeOf:${params.reservationFor.typeOf}`);
158
148
  }
159
149
  }
@@ -499,11 +499,8 @@ function processLockOfferRateLimit(params) {
499
499
  }
500
500
  },
501
501
  reservationFor: {
502
- startDate: (params.reservationFor.typeOf === factory.eventType.ScreeningEvent)
503
- ? (0, moment_1.default)(params.reservationFor.startDate)
504
- .toDate()
505
- : (0, moment_1.default)(params.reservationFor.departureTime)
506
- .toDate()
502
+ startDate: (0, moment_1.default)(params.reservationFor.startDate)
503
+ .toDate()
507
504
  },
508
505
  reservationNumber: params.reservationNumber
509
506
  };
@@ -55,7 +55,6 @@ function createOwnershipInfosFromOrder(params) {
55
55
  const ownedBy = createOwnedby(params);
56
56
  const itemOfferedType = itemOffered.typeOf;
57
57
  switch (itemOfferedType) {
58
- case factory.reservationType.BusReservation:
59
58
  case factory.reservationType.EventReservation:
60
59
  const excludeCOAReservation = acceptedOffer.offeredThrough?.identifier === factory.service.webAPI.Identifier.COA;
61
60
  if (excludeCOAReservation) {
@@ -39,10 +39,6 @@ function createReservationOwnershipInfo(params) {
39
39
  ownedThrough = (0, moment_timezone_1.default)(itemOffered.reservationFor.endDate)
40
40
  .toDate();
41
41
  }
42
- else if (itemOffered.typeOf === factory.reservationType.BusReservation) {
43
- ownedThrough = (0, moment_timezone_1.default)(itemOffered.reservationFor.arrivalTime)
44
- .toDate();
45
- }
46
42
  else {
47
43
  throw new factory.errors.NotImplemented(`itemOffered.typeOf '${itemOffered.typeOf}' not implemented`);
48
44
  }
@@ -63,15 +59,14 @@ function createReservationOwnershipInfo(params) {
63
59
  bookingService: bookingService,
64
60
  ...(typeof itemOffered.issuedThrough?.typeOf === 'string') ? { issuedThrough: itemOffered.issuedThrough } : undefined
65
61
  };
66
- }
67
- else if (itemOffered.typeOf === factory.reservationType.BusReservation) {
68
- typeOfGood = {
69
- typeOf: itemOffered.typeOf,
70
- id: itemOffered.id,
71
- reservationNumber: itemOffered.reservationNumber,
72
- bookingService: bookingService,
73
- ...(typeof itemOffered.issuedThrough?.typeOf === 'string') ? { issuedThrough: itemOffered.issuedThrough } : undefined
74
- };
62
+ // } else if (itemOffered.typeOf === factory.reservationType.BusReservation) {
63
+ // typeOfGood = {
64
+ // typeOf: itemOffered.typeOf,
65
+ // id: itemOffered.id,
66
+ // reservationNumber: itemOffered.reservationNumber,
67
+ // bookingService: bookingService,
68
+ // ...(typeof itemOffered.issuedThrough?.typeOf === 'string') ? { issuedThrough: itemOffered.issuedThrough } : undefined
69
+ // };
75
70
  }
76
71
  else {
77
72
  throw new factory.errors.NotImplemented(`itemOffered.typeOf '${itemOffered.typeOf}' not implemented`);
@@ -407,44 +407,6 @@ function createReservation(params) {
407
407
  : undefined
408
408
  };
409
409
  }
410
- else if (itemOffered.typeOf === factory.reservationType.BusReservation
411
- && event.typeOf === factory.tripType.BusTrip) {
412
- // const tripByEvent = event.offers?.itemOffered.serviceOutput?.reservationFor;
413
- // if (typeof tripByEvent?.typeOf !== 'string') {
414
- // throw new factory.errors.NotFound('event.offers.itemOffered.serviceOutput.reservationFor');
415
- // }
416
- const reservationFor = {
417
- typeOf: event.typeOf,
418
- id: event.id,
419
- arrivalBusStop: event.arrivalBusStop,
420
- departureBusStop: event.departureBusStop,
421
- name: event.name,
422
- departureTime: (0, moment_1.default)(event.departureTime)
423
- .toDate(),
424
- arrivalTime: (0, moment_1.default)(event.arrivalTime)
425
- .toDate(),
426
- busName: event.busName,
427
- busNumber: event.busNumber,
428
- identifier: event.identifier
429
- };
430
- if (params.issuedThrough.typeOf !== factory.product.ProductType.Transportation) {
431
- throw new factory.errors.Argument('issuedThrough', `issuedThrough.typeOf must be ${factory.product.ProductType.Transportation}`);
432
- }
433
- reservationItem = {
434
- typeOf: itemOffered.typeOf,
435
- additionalProperty: itemOffered.additionalProperty,
436
- additionalTicketText: itemOffered.additionalTicketText,
437
- id: itemOffered.id,
438
- issuedThrough: params.issuedThrough,
439
- reservationNumber: params.reservationNumber,
440
- reservationFor,
441
- reservedTicket,
442
- // 使用メンバーシップがあれば追加
443
- ...(typeof itemOffered.programMembershipUsed?.typeOf === 'string')
444
- ? { programMembershipUsed: itemOffered.programMembershipUsed }
445
- : undefined
446
- };
447
- }
448
410
  else {
449
411
  throw new factory.errors.Argument('itemOffered');
450
412
  }
@@ -329,24 +329,24 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
329
329
  };
330
330
  }
331
331
  switch (typeOf) {
332
- case factory.reservationType.BusReservation:
333
- const serviceOutputAsBusReservation = {
334
- typeOf,
335
- ...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
336
- ...(typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined,
337
- ...(programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined,
338
- ...(Array.isArray(subReservation)) ? { subReservation } : undefined,
339
- ...(reservedTicket !== undefined) ? {
340
- reservedTicket: {
341
- typeOf: 'Ticket',
342
- // チケット識別子指定拡張(2024-04-15~)
343
- ...(typeof reservedTicket.identifier === 'string') ? { identifier: reservedTicket.identifier } : undefined,
344
- ...(typeof ticketedSeat?.typeOf === 'string') ? { ticketedSeat } : undefined
345
- }
346
- } : undefined
347
- };
348
- itemOfferedServiceOutput = serviceOutputAsBusReservation;
349
- break;
332
+ // case factory.reservationType.BusReservation:
333
+ // const serviceOutputAsBusReservation: factory.assetTransaction.reserve.IBusReservatonAsItemOfferedServiceOutput = {
334
+ // typeOf,
335
+ // ...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
336
+ // ...(typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined,
337
+ // ...(programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined,
338
+ // ...(Array.isArray(subReservation)) ? { subReservation } : undefined,
339
+ // ...(reservedTicket !== undefined) ? {
340
+ // reservedTicket: {
341
+ // typeOf: 'Ticket',
342
+ // // チケット識別子指定拡張(2024-04-15~)
343
+ // ...(typeof reservedTicket.identifier === 'string') ? { identifier: reservedTicket.identifier } : undefined,
344
+ // ...(typeof ticketedSeat?.typeOf === 'string') ? { ticketedSeat } : undefined
345
+ // }
346
+ // } : undefined
347
+ // };
348
+ // itemOfferedServiceOutput = serviceOutputAsBusReservation;
349
+ // break;
350
350
  case factory.reservationType.EventReservation:
351
351
  const serviceOutputAsEventReservation = {
352
352
  typeOf,
@@ -366,6 +366,7 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
366
366
  itemOfferedServiceOutput = serviceOutputAsEventReservation;
367
367
  break;
368
368
  default:
369
+ throw new factory.errors.NotImplemented(`serviceOutput not implemented. typeOf:${typeOf}`);
369
370
  // no op
370
371
  }
371
372
  }
@@ -119,7 +119,7 @@ function deleteReservationsByOrder(order) {
119
119
  orderNumber: { $eq: order.orderNumber },
120
120
  project: { id: { $eq: order.project.id } },
121
121
  acceptedOffers: {
122
- itemOffered: { typeOf: { $in: [factory.reservationType.BusReservation, factory.reservationType.EventReservation] } }
122
+ itemOffered: { typeOf: { $in: [factory.reservationType.EventReservation] } }
123
123
  }
124
124
  });
125
125
  const reservationIds = acceptedOffers.map((o) => String(o.itemOffered.id));
@@ -53,8 +53,7 @@ function processOrder(params) {
53
53
  if (params.order.itemOfferedTypeOf === factory.actionType.MoneyTransfer) {
54
54
  await createConfirmMoneyTransferTasksIfNotExist(params.order, simpleOrder)(repos);
55
55
  }
56
- else if (params.order.itemOfferedTypeOf === factory.reservationType.BusReservation
57
- || params.order.itemOfferedTypeOf === factory.reservationType.EventReservation) {
56
+ else if (params.order.itemOfferedTypeOf === factory.reservationType.EventReservation) {
58
57
  // 冗長なconfirmReserveTransactionタスク作成を回避(2023-08-25~)
59
58
  await createConfirmReserveTransactionTasksIfNotExist(params.order, simpleOrder, params.options)(repos);
60
59
  }
@@ -88,26 +88,6 @@ function reservationOffers2orderedItem(params) {
88
88
  : undefined
89
89
  };
90
90
  }
91
- else if (reservationFor.typeOf === factory.tripType.BusTrip
92
- && issuedThrough.typeOf === factory.product.ProductType.Transportation) {
93
- const reservationFor4orderedItem = {
94
- typeOf: reservationFor.typeOf,
95
- id: reservationFor.id,
96
- departureTime: reservationFor.departureTime,
97
- arrivalTime: reservationFor.arrivalTime
98
- };
99
- return {
100
- typeOf: issuedThrough.typeOf,
101
- id: issuedThrough.id,
102
- ...(typeof issuedThrough.serviceType?.typeOf === 'string')
103
- ? { serviceType: issuedThrough.serviceType }
104
- : undefined,
105
- serviceOutput: {
106
- typeOf: factory.reservationType.ReservationPackage,
107
- reservationFor: reservationFor4orderedItem
108
- }
109
- };
110
- }
111
91
  else {
112
92
  throw new factory.errors.Internal('unexpected params on reservationOffers2orderedItem');
113
93
  }
@@ -110,7 +110,6 @@ function createPlacingOrder(params) {
110
110
  params.acceptedOffers.forEach((acceptedOffer) => {
111
111
  const itemOfferedTypeOf = acceptedOffer.itemOffered.typeOf;
112
112
  switch (itemOfferedTypeOf) {
113
- case factory.reservationType.BusReservation:
114
113
  case factory.reservationType.EventReservation:
115
114
  eventReservationAcceptedOffers.push(acceptedOffer);
116
115
  break;
@@ -115,9 +115,7 @@ function cancelPengindIfNotYet(params) {
115
115
  subReservation: cancelingSubReservation.subReservation,
116
116
  reservationFor: {
117
117
  id: String(reservationFor.id),
118
- startDate: (reservationFor.typeOf === factory.eventType.ScreeningEvent)
119
- ? reservationFor.startDate
120
- : reservationFor.departureTime
118
+ startDate: reservationFor.startDate
121
119
  }
122
120
  },
123
121
  // holder:取引番号に対応(2023-06-05~)
@@ -220,9 +218,7 @@ function cancelReservation(actionAttributesList) {
220
218
  subReservation: cancelingSubReservation.subReservation,
221
219
  reservationFor: {
222
220
  id: String(reservationFor.id),
223
- startDate: (reservationFor.typeOf === factory.eventType.ScreeningEvent)
224
- ? reservationFor.startDate
225
- : reservationFor.departureTime
221
+ startDate: reservationFor.startDate
226
222
  }
227
223
  },
228
224
  // holder:取引番号に対応(2023-06-05~)
@@ -439,11 +435,8 @@ function processUnlockOfferRateLimit(params) {
439
435
  }
440
436
  },
441
437
  reservationFor: {
442
- startDate: (params.reservationFor.typeOf === factory.eventType.ScreeningEvent)
443
- ? (0, moment_1.default)(params.reservationFor.startDate)
444
- .toDate()
445
- : (0, moment_1.default)(params.reservationFor.departureTime)
446
- .toDate()
438
+ startDate: (0, moment_1.default)(params.reservationFor.startDate)
439
+ .toDate()
447
440
  },
448
441
  reservationNumber: reservation.reservationNumber
449
442
  };
@@ -2,7 +2,7 @@ import * as factory from '../../factory';
2
2
  import type { AuthorizationRepo } from '../../repo/authorization';
3
3
  import type { OrderRepo } from '../../repo/order';
4
4
  import type { ReservationRepo } from '../../repo/reservation';
5
- type AvailableReservationType = factory.reservationType.BusReservation | factory.reservationType.EventReservation;
5
+ type AvailableReservationType = factory.reservationType.EventReservation;
6
6
  type IReservationResult = Pick<factory.reservation.IReservation<AvailableReservationType>, 'id' | 'additionalTicketText' | 'checkedIn' | 'reservationStatus'> & {
7
7
  reservedTicket: {
8
8
  ticketType: Pick<factory.reservation.ITicketType<AvailableReservationType>, 'identifier'> & {
@@ -5,12 +5,11 @@ import * as factory from '../../../factory';
5
5
  import type { SettingRepo } from '../../../repo/setting';
6
6
  import type { TaskRepo } from '../../../repo/task';
7
7
  export type ICanceledEventReservation = Pick<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'project' | 'id' | 'typeOf' | 'modifiedTime' | 'reservationNumber'>;
8
- export type ICanceledBusReservation = Pick<factory.reservation.IReservation<factory.reservationType.BusReservation>, 'project' | 'id' | 'typeOf' | 'modifiedTime' | 'reservationNumber'>;
9
8
  export declare function onReservationCanceled(
10
9
  /**
11
10
  * ステータス変更された予約リスト
12
11
  */
13
- canceledReservations: ICanceledEventReservation[] | ICanceledBusReservation[],
12
+ canceledReservations: ICanceledEventReservation[],
14
13
  /**
15
14
  * 集計対象イベント
16
15
  */
@@ -34,6 +34,7 @@ function onReservationCanceled(
34
34
  /**
35
35
  * ステータス変更された予約リスト
36
36
  */
37
+ // canceledReservations: ICanceledEventReservation[] | ICanceledBusReservation[],
37
38
  canceledReservations,
38
39
  // useInformReservation: boolean,
39
40
  /**
@@ -7,7 +7,7 @@ type IReservationResult = Pick<factory.reservation.IReservation<factory.reservat
7
7
  declare function searchByOrder(params: {
8
8
  limit: number;
9
9
  page: number;
10
- typeOf: factory.reservationType.BusReservation | factory.reservationType.EventReservation;
10
+ typeOf: factory.reservationType.EventReservation;
11
11
  project: {
12
12
  id: string;
13
13
  };
@@ -274,8 +274,7 @@ function validateAcceptedOffers(params) {
274
274
  // チケット識別子ユニークネス検証(2024-04-16~)
275
275
  let ticketIdentifiers = [];
276
276
  params.acceptedOffers.forEach(({ itemOffered }) => {
277
- if (itemOffered.typeOf === factory.reservationType.BusReservation
278
- || itemOffered.typeOf === factory.reservationType.EventReservation) {
277
+ if (itemOffered.typeOf === factory.reservationType.EventReservation) {
279
278
  if (typeof itemOffered.reservedTicket.identifier === 'string') {
280
279
  ticketIdentifiers.push(itemOffered.reservedTicket.identifier);
281
280
  }
@@ -292,8 +291,7 @@ function validateAcceptedOffers(params) {
292
291
  // チケット識別子ユニークネス検証(2024-04-15~)
293
292
  let ticketNumbers = [];
294
293
  params.acceptedOffers.forEach(({ itemOffered }) => {
295
- if (itemOffered.typeOf === factory.reservationType.BusReservation
296
- || itemOffered.typeOf === factory.reservationType.EventReservation) {
294
+ if (itemOffered.typeOf === factory.reservationType.EventReservation) {
297
295
  if (typeof itemOffered.reservedTicket.ticketNumber === 'string') {
298
296
  ticketNumbers.push(itemOffered.reservedTicket.ticketNumber);
299
297
  }
@@ -298,8 +298,7 @@ function createReservationIdsResult(order, acceptedOffers) {
298
298
  eventId = eventIdsByOrder[0];
299
299
  if (Array.isArray(acceptedOffers)) {
300
300
  acceptedOffers.forEach((o) => {
301
- if (o.itemOffered.typeOf === factory.reservationType.EventReservation
302
- || o.itemOffered.typeOf === factory.reservationType.BusReservation) {
301
+ if (o.itemOffered.typeOf === factory.reservationType.EventReservation) {
303
302
  reservationIds.push(o.itemOffered.id);
304
303
  }
305
304
  });
@@ -316,7 +315,6 @@ function createResult(params, options) {
316
315
  params.acceptedOffers.forEach((acceptedOffer) => {
317
316
  const itemOfferedTypeOf = acceptedOffer.itemOffered.typeOf;
318
317
  switch (itemOfferedTypeOf) {
319
- case factory.reservationType.BusReservation:
320
318
  case factory.reservationType.EventReservation:
321
319
  eventReservationAcceptedOffers.push(acceptedOffer);
322
320
  break;
@@ -138,8 +138,7 @@ function validateOrder(params) {
138
138
  let reservationReservedTicketIdentifiers = [];
139
139
  acceptedOffers.forEach(({ itemOffered }) => {
140
140
  itemOfferedTypeOfs.push(itemOffered.typeOf);
141
- if (itemOffered.typeOf === factory.reservationType.BusReservation
142
- || itemOffered.typeOf === factory.reservationType.EventReservation) {
141
+ if (itemOffered.typeOf === factory.reservationType.EventReservation) {
143
142
  reservationForIds.push(itemOffered.reservationFor.id);
144
143
  if (typeof itemOffered.reservedTicket.identifier === 'string') {
145
144
  reservationReservedTicketIdentifiers.push(itemOffered.reservedTicket.identifier);
@@ -166,7 +165,6 @@ function validateOrder(params) {
166
165
  let numOrderedItemExpected = 0;
167
166
  const itemOfferedTypeOf = itemOfferedTypeOfs[0];
168
167
  switch (itemOfferedTypeOf) {
169
- case factory.reservationType.BusReservation:
170
168
  case factory.reservationType.EventReservation:
171
169
  numOrderedItemExpected = reservationForIds.length;
172
170
  const reservationAcceptedOffers = acceptedOffers;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cognito-identity-provider": "3.600.0",
13
13
  "@aws-sdk/credential-providers": "3.600.0",
14
- "@chevre/factory": "5.4.0-alpha.32",
14
+ "@chevre/factory": "5.4.0-alpha.33",
15
15
  "@cinerino/sdk": "13.1.0",
16
16
  "@motionpicture/coa-service": "9.6.0",
17
17
  "@motionpicture/gmo-service": "5.4.0-alpha.1",
@@ -99,5 +99,5 @@
99
99
  "postversion": "git push origin --tags",
100
100
  "prepublishOnly": "npm run clean && npm run build"
101
101
  },
102
- "version": "24.0.0-alpha.31"
102
+ "version": "24.0.0-alpha.32"
103
103
  }