@chevre/domain 24.0.0-alpha.16 → 24.0.0-alpha.17

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.
@@ -219,7 +219,7 @@ function aggregateAuthorizeEventServiceOfferAction(params) {
219
219
  .add(-i, params.aggregateDurationUnit)
220
220
  .endOf(params.aggregateDurationUnit)
221
221
  .toDate();
222
- const aggregateResult = await repos.action.aggregateAuthorizeEventServiceOfferAction({
222
+ const aggregateResult = await repos.aggregateAction.aggregateAuthorizeEventServiceOfferAction({
223
223
  project: { id: { $ne: params.excludedProjectId } },
224
224
  startFrom,
225
225
  startThrough,
@@ -264,7 +264,7 @@ function aggregateAuthorizePaymentAction(params) {
264
264
  .add(-i, params.aggregateDurationUnit)
265
265
  .endOf(params.aggregateDurationUnit)
266
266
  .toDate();
267
- const aggregateResult = await repos.action.aggregateAuthorizePaymentAction({
267
+ const aggregateResult = await repos.aggregateAction.aggregateAuthorizePaymentAction({
268
268
  project: { id: { $ne: params.excludedProjectId } },
269
269
  startFrom,
270
270
  startThrough,
@@ -306,7 +306,7 @@ function aggregateAuthorizeOrderAction(params) {
306
306
  .add(-i, params.aggregateDurationUnit)
307
307
  .endOf(params.aggregateDurationUnit)
308
308
  .toDate();
309
- const aggregateResult = await repos.action.aggregateAuthorizeOrderAction({
309
+ const aggregateResult = await repos.aggregateAction.aggregateAuthorizeOrderAction({
310
310
  project: { id: { $ne: params.excludedProjectId } },
311
311
  startFrom,
312
312
  startThrough,
@@ -351,7 +351,7 @@ function aggregateUseAction(params) {
351
351
  .add(-i, params.aggregateDurationUnit)
352
352
  .endOf(params.aggregateDurationUnit)
353
353
  .toDate();
354
- const aggregateResult = await repos.action.aggregateByTypeOf({
354
+ const aggregateResult = await repos.aggregateAction.aggregateByTypeOf({
355
355
  project: { id: { $ne: params.excludedProjectId } },
356
356
  startFrom,
357
357
  startThrough,
@@ -396,7 +396,7 @@ function aggregateReserveAction(params) {
396
396
  .add(-i, params.aggregateDurationUnit)
397
397
  .endOf(params.aggregateDurationUnit)
398
398
  .toDate();
399
- const aggregateResult = await repos.action.aggregateByTypeOf({
399
+ const aggregateResult = await repos.aggregateAction.aggregateByTypeOf({
400
400
  project: { id: { $ne: params.excludedProjectId } },
401
401
  startFrom,
402
402
  startThrough,
@@ -441,7 +441,7 @@ function aggregateOrderAction(params) {
441
441
  .add(-i, params.aggregateDurationUnit)
442
442
  .endOf(params.aggregateDurationUnit)
443
443
  .toDate();
444
- const aggregateResult = await repos.action.aggregateByTypeOf({
444
+ const aggregateResult = await repos.aggregateAction.aggregateByTypeOf({
445
445
  project: { id: { $ne: params.excludedProjectId } },
446
446
  startFrom,
447
447
  startThrough,
@@ -486,7 +486,7 @@ function aggregateCancelReservationAction(params) {
486
486
  .add(-i, params.aggregateDurationUnit)
487
487
  .endOf(params.aggregateDurationUnit)
488
488
  .toDate();
489
- const aggregateResult = await repos.action.aggregateCancelReservationAction({
489
+ const aggregateResult = await repos.aggregateAction.aggregateCancelReservationAction({
490
490
  project: { id: { $ne: params.excludedProjectId } },
491
491
  startFrom,
492
492
  startThrough
@@ -527,7 +527,7 @@ function aggregateCheckMovieTicketAction(params) {
527
527
  .add(-i, params.aggregateDurationUnit)
528
528
  .endOf(params.aggregateDurationUnit)
529
529
  .toDate();
530
- const aggregateResult = await repos.action.aggregateCheckMovieTicketAction({
530
+ const aggregateResult = await repos.aggregateAction.aggregateCheckMovieTicketAction({
531
531
  project: { id: { $ne: params.excludedProjectId } },
532
532
  startFrom,
533
533
  startThrough
@@ -568,7 +568,7 @@ function aggregatePayMovieTicketAction(params) {
568
568
  .add(-i, params.aggregateDurationUnit)
569
569
  .endOf(params.aggregateDurationUnit)
570
570
  .toDate();
571
- const aggregateResult = await repos.action.aggregatePayMovieTicketAction({
571
+ const aggregateResult = await repos.aggregateAction.aggregatePayMovieTicketAction({
572
572
  project: { id: { $ne: params.excludedProjectId } },
573
573
  startFrom,
574
574
  startThrough
@@ -1,4 +1,5 @@
1
- import type { ActionRepo } from '../../../repo/action';
1
+ import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
2
+ import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
2
3
  import type { CategoryCodeRepo } from '../../../repo/categoryCode';
3
4
  import type { EventRepo } from '../../../repo/event';
4
5
  import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
@@ -10,7 +11,8 @@ import * as factory from '../../../factory';
10
11
  export { IRequestBody, IResponseBody };
11
12
  export type IAuthorizeActionResult = factory.action.authorize.offer.eventService.IResult;
12
13
  export interface IAuthorizeRepos {
13
- action: ActionRepo;
14
+ action: AuthorizeOfferActionRepo;
15
+ accpetCOAOfferAction: AcceptCOAOfferActionRepo;
14
16
  categoryCode: CategoryCodeRepo;
15
17
  event: EventRepo;
16
18
  offer: OfferRepo;
@@ -32,18 +32,26 @@ const factory = __importStar(require("../../../factory"));
32
32
  */
33
33
  function authorizeByAcceptAction(params) {
34
34
  return async (repos) => {
35
- const acceptAction = (await repos.action.search({
36
- limit: 1,
37
- page: 1,
38
- project: { id: { $eq: params.project.id } },
39
- id: { $in: [params.object.id] },
40
- typeOf: { $eq: factory.actionType.AcceptAction },
41
- purpose: { id: { $in: [params.purpose.id] } },
42
- actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] }
43
- }, ['result', 'object', 'potentialActions'])).shift();
44
- if (acceptAction === undefined) {
45
- throw new factory.errors.NotFound(factory.actionType.AcceptAction);
46
- }
35
+ // const acceptAction = (<IAcceptAction[]>await repos.action.search(
36
+ // {
37
+ // limit: 1,
38
+ // page: 1,
39
+ // project: { id: { $eq: params.project.id } },
40
+ // id: { $in: [params.object.id] },
41
+ // typeOf: { $eq: factory.actionType.AcceptAction },
42
+ // purpose: { id: { $in: [params.purpose.id] } },
43
+ // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] }
44
+ // },
45
+ // ['result', 'object', 'potentialActions']
46
+ // )).shift();
47
+ // if (acceptAction === undefined) {
48
+ // throw new factory.errors.NotFound(factory.actionType.AcceptAction);
49
+ // }
50
+ const acceptAction = await repos.accpetCOAOfferAction.findCompletedById({
51
+ project: { id: params.project.id },
52
+ id: params.object.id,
53
+ purpose: { id: params.purpose.id },
54
+ }, ['result', 'object', 'potentialActions']);
47
55
  const acceptResult = acceptAction.result;
48
56
  if (acceptResult === undefined) {
49
57
  throw new factory.errors.NotFound(`${factory.actionType.AcceptAction}.result`);
@@ -32,6 +32,7 @@ const any_1 = require("../any");
32
32
  const factory_1 = require("./authorize/factory");
33
33
  const validateAcceptedOffers_1 = require("./authorize/validateAcceptedOffers");
34
34
  const factory = __importStar(require("../../../factory"));
35
+ // type IAcceptAction = Pick<factory.action.accept.coaOffer.IAction, 'result'>;
35
36
  /**
36
37
  * COA興行オファー承認のオファーを変更
37
38
  */
@@ -61,13 +62,21 @@ function changeOffers(params) {
61
62
  if (typeof originalAcceptActionId !== 'string' || originalAcceptActionId === '') {
62
63
  throw new factory.errors.NotFound('authorizeAction.object.id');
63
64
  }
64
- const originalAcceptResult = (await repos.action.search({
65
- limit: 1,
66
- page: 1,
67
- project: { id: { $eq: authorizeAction.project.id } },
68
- id: { $in: [originalAcceptActionId] },
69
- typeOf: { $eq: factory.actionType.AcceptAction }
70
- }, ['result'])).shift()?.result;
65
+ // const originalAcceptResult = (<IAcceptAction[]>await repos.action.search(
66
+ // {
67
+ // limit: 1,
68
+ // page: 1,
69
+ // project: { id: { $eq: authorizeAction.project.id } },
70
+ // id: { $in: [originalAcceptActionId] },
71
+ // typeOf: { $eq: factory.actionType.AcceptAction }
72
+ // },
73
+ // ['result']
74
+ // )).shift()?.result;
75
+ const originalAcceptResult = (await repos.accpetCOAOfferAction.findCompletedById({
76
+ project: { id: authorizeAction.project.id },
77
+ id: originalAcceptActionId,
78
+ purpose: { id: authorizeAction.purpose.id },
79
+ }, ['result'])).result;
71
80
  if (originalAcceptResult === undefined) {
72
81
  throw new factory.errors.NotFound(`${factory.actionType.AcceptAction}.result`);
73
82
  }
package/package.json CHANGED
@@ -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.16"
102
+ "version": "24.0.0-alpha.17"
103
103
  }