@chevre/domain 26.0.0-alpha.39 → 26.0.0-alpha.40

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 (39) hide show
  1. package/lib/chevre/repo/action/acceptCOAOffer.d.ts +3 -1
  2. package/lib/chevre/repo/action/acceptCOAOffer.js +8 -1
  3. package/lib/chevre/repo/action/acceptPay.d.ts +3 -1
  4. package/lib/chevre/repo/action/acceptPay.js +7 -1
  5. package/lib/chevre/repo/action/{actionProcess.d.ts → anyAction/actionProcess.d.ts} +14 -8
  6. package/lib/chevre/repo/action/{actionProcess.js → anyAction/actionProcess.js} +18 -23
  7. package/lib/chevre/repo/action/{actionRecipe.d.ts → anyAction/actionRecipe.d.ts} +11 -6
  8. package/lib/chevre/repo/action/{actionRecipe.js → anyAction/actionRecipe.js} +7 -4
  9. package/lib/chevre/repo/action/authorizeInvoice.d.ts +5 -8
  10. package/lib/chevre/repo/action/authorizeInvoice.js +7 -1
  11. package/lib/chevre/repo/action/authorizeOffer.d.ts +3 -1
  12. package/lib/chevre/repo/action/authorizeOffer.js +7 -1
  13. package/lib/chevre/repo/action/authorizePaymentMethod.d.ts +3 -1
  14. package/lib/chevre/repo/action/authorizePaymentMethod.js +7 -1
  15. package/lib/chevre/repo/action/authorizeTicketedObject.d.ts +3 -1
  16. package/lib/chevre/repo/action/authorizeTicketedObject.js +7 -1
  17. package/lib/chevre/repo/action/checkMovieTicket.d.ts +3 -1
  18. package/lib/chevre/repo/action/checkMovieTicket.js +8 -1
  19. package/lib/chevre/repo/action/create.d.ts +3 -1
  20. package/lib/chevre/repo/action/create.js +8 -1
  21. package/lib/chevre/repo/action/pay.d.ts +3 -1
  22. package/lib/chevre/repo/action/pay.js +7 -1
  23. package/lib/chevre/repo/action/refund.d.ts +3 -1
  24. package/lib/chevre/repo/action/refund.js +7 -1
  25. package/lib/chevre/repo/action/sendEmailMessage.d.ts +10 -0
  26. package/lib/chevre/repo/action/sendEmailMessage.js +17 -0
  27. package/lib/chevre/repo/action/sendOrder.d.ts +10 -0
  28. package/lib/chevre/repo/action/sendOrder.js +16 -0
  29. package/lib/chevre/repo/action.d.ts +4 -2
  30. package/lib/chevre/repo/action.js +7 -1
  31. package/lib/chevre/repo/adminAction.d.ts +3 -2
  32. package/lib/chevre/repo/adminAction.js +7 -1
  33. package/lib/chevre/service/notification/sendEmailMessage.d.ts +4 -2
  34. package/lib/chevre/service/notification/sendEmailMessage.js +3 -3
  35. package/lib/chevre/service/order/sendOrder.d.ts +4 -2
  36. package/lib/chevre/service/order/sendOrder.js +3 -3
  37. package/lib/chevre/service/task/sendEmailMessage.js +2 -2
  38. package/lib/chevre/service/task/sendOrder.js +4 -4
  39. package/package.json +1 -1
@@ -1,10 +1,12 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../../factory';
2
- import { IActionRecipe, IKeyOfProjection, ActionProcessRepo } from './actionProcess';
3
+ import { IActionRecipe, IKeyOfProjection, ActionProcessRepo } from './anyAction/actionProcess';
3
4
  export type IAcceptCOAOfferAction = factory.action.accept.coaOffer.IAction;
4
5
  /**
5
6
  * COAオファー採用リポジトリ
6
7
  */
7
8
  export declare class AcceptCOAOfferActionRepo extends ActionProcessRepo<IAcceptCOAOfferAction, IActionRecipe<factory.recipe.RecipeCategory.acceptCOAOffer>> {
9
+ constructor(connection: Connection);
8
10
  /**
9
11
  * 完了済の採用アクションを参照する
10
12
  */
@@ -2,11 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AcceptCOAOfferActionRepo = void 0;
4
4
  const factory_1 = require("../../factory");
5
- const actionProcess_1 = require("./actionProcess");
5
+ const actionProcess_1 = require("./anyAction/actionProcess");
6
+ const EXPIRE_AFTER_SECONDS = 2592000; // 30 days
6
7
  /**
7
8
  * COAオファー採用リポジトリ
8
9
  */
9
10
  class AcceptCOAOfferActionRepo extends actionProcess_1.ActionProcessRepo {
11
+ constructor(connection) {
12
+ super({ connection }, {
13
+ expireAfterSeconds: EXPIRE_AFTER_SECONDS,
14
+ recipeExpireAfterSeconds: EXPIRE_AFTER_SECONDS
15
+ });
16
+ }
10
17
  /**
11
18
  * 完了済の採用アクションを参照する
12
19
  */
@@ -1,10 +1,12 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../../factory';
2
- import { IKeyOfProjection, IActionRecipe, ActionProcessRepo } from './actionProcess';
3
+ import { IKeyOfProjection, IActionRecipe, ActionProcessRepo } from './anyAction/actionProcess';
3
4
  export type IAcceptPayAction = factory.action.accept.pay.IAction;
4
5
  /**
5
6
  * 決済採用リポジトリ
6
7
  */
7
8
  export declare class AcceptPayActionRepo extends ActionProcessRepo<IAcceptPayAction, IActionRecipe<factory.recipe.RecipeCategory.publishPaymentUrl>> {
9
+ constructor(connection: Connection);
8
10
  /**
9
11
  * 注文取引から検索する
10
12
  * 件数はlimitされない
@@ -2,11 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AcceptPayActionRepo = void 0;
4
4
  const factory_1 = require("../../factory");
5
- const actionProcess_1 = require("./actionProcess");
5
+ const actionProcess_1 = require("./anyAction/actionProcess");
6
6
  /**
7
7
  * 決済採用リポジトリ
8
8
  */
9
9
  class AcceptPayActionRepo extends actionProcess_1.ActionProcessRepo {
10
+ constructor(connection) {
11
+ super({ connection }, {
12
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
13
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
14
+ });
15
+ }
10
16
  /**
11
17
  * 注文取引から検索する
12
18
  * 件数はlimitされない
@@ -1,6 +1,6 @@
1
1
  import { Connection } from 'mongoose';
2
- import { factory } from '../../factory';
3
- import { IModel as IActionModel, IDocType } from '../mongoose/schemas/action';
2
+ import { factory } from '../../../factory';
3
+ import { IModel as IActionModel, IDocType } from '../../mongoose/schemas/action';
4
4
  import { ActionRecipeRepo, IActionRecipe, IRecipeAsActionAttributes } from './actionRecipe';
5
5
  export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
6
6
  type IAuthorizeAction = factory.action.authorize.invoice.IAction | factory.action.authorize.offer.eventService.IAction | factory.action.authorize.paymentMethod.any.IAction | factory.action.authorize.ticketedObject.IAction;
@@ -18,26 +18,33 @@ export interface ICancelActionAction {
18
18
  export { IActionRecipe };
19
19
  export type IKeyOfProjection = keyof IDocType | 'id';
20
20
  export declare const AVAILABLE_PROJECT_FIELDS: IKeyOfProjection[];
21
+ interface IOptions {
22
+ expireAfterSeconds: number;
23
+ recipeExpireAfterSeconds: number;
24
+ }
25
+ export declare const DEFAULT_EXPIRE_AFTER_SECONDS = 17280000;
26
+ export declare const RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS = 17280000;
21
27
  /**
22
28
  * アクション状態管理リポジトリ
23
29
  */
24
30
  export declare class ActionProcessRepo<TAction extends IAction<factory.actionType>, TActionRecipe extends IActionRecipe<factory.recipe.RecipeCategory>> extends ActionRecipeRepo<TActionRecipe> {
25
31
  protected readonly actionModel: IActionModel;
26
- constructor(connection: Connection);
32
+ private options;
33
+ protected constructor(params: {
34
+ connection: Connection;
35
+ }, options: IOptions);
27
36
  static CREATE_MONGO_CONDITIONS(params: factory.action.ISearchConditions): any[];
28
37
  /**
29
38
  * アクション開始
30
39
  */
31
- start<T extends TAction['typeOf']>(attributes: factory.action.IAttributes<T, any, any> & {
32
- expires?: Date;
33
- }, options?: {
40
+ start<T extends TAction['typeOf']>(attributes: factory.action.IAttributes<T, any, any>, // eslint-disable-line @typescript-eslint/no-explicit-any
41
+ options?: {
34
42
  recipe?: IRecipeAsActionAttributes<TActionRecipe['recipeCategory']>;
35
43
  }): Promise<Pick<IAction<T>, 'id' | 'typeOf' | 'startDate'>>;
36
44
  completeWithVoid(params: {
37
45
  typeOf: TAction['typeOf'];
38
46
  id: string;
39
47
  result: any;
40
- expires?: Date;
41
48
  recipe?: IRecipeAsActionAttributes<TActionRecipe['recipeCategory']>;
42
49
  }): Promise<void>;
43
50
  /**
@@ -55,7 +62,6 @@ export declare class ActionProcessRepo<TAction extends IAction<factory.actionTyp
55
62
  typeOf: TAction['typeOf'];
56
63
  id: string;
57
64
  error: Error | Error[] | unknown;
58
- expires?: Date;
59
65
  recipe?: IRecipeAsActionAttributes<TActionRecipe['recipeCategory']>;
60
66
  }): Promise<void>;
61
67
  findById(params: {
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionProcessRepo = exports.AVAILABLE_PROJECT_FIELDS = void 0;
4
- const factory_1 = require("../../factory");
5
- const settings_1 = require("../../settings");
6
- const action_1 = require("../mongoose/schemas/action");
7
- const unknown2actionError_1 = require("./unknown2actionError");
3
+ exports.ActionProcessRepo = exports.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS = exports.DEFAULT_EXPIRE_AFTER_SECONDS = exports.AVAILABLE_PROJECT_FIELDS = void 0;
4
+ const factory_1 = require("../../../factory");
5
+ const settings_1 = require("../../../settings");
6
+ const action_1 = require("../../mongoose/schemas/action");
7
+ const unknown2actionError_1 = require("../unknown2actionError");
8
8
  const actionRecipe_1 = require("./actionRecipe");
9
9
  exports.AVAILABLE_PROJECT_FIELDS = [
10
10
  'project',
@@ -28,16 +28,18 @@ exports.AVAILABLE_PROJECT_FIELDS = [
28
28
  'identifier',
29
29
  'expires'
30
30
  ];
31
- const DEFAULT_EXPIRE_AFTER_SECONDS = 17280000; // 200 days
32
- const RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS = 17280000; // 200 days
31
+ exports.DEFAULT_EXPIRE_AFTER_SECONDS = 17280000; // 200 days
32
+ exports.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS = 17280000; // 200 days
33
33
  /**
34
34
  * アクション状態管理リポジトリ
35
35
  */
36
36
  class ActionProcessRepo extends actionRecipe_1.ActionRecipeRepo {
37
37
  actionModel;
38
- constructor(connection) {
39
- super(connection);
40
- this.actionModel = connection.model(action_1.modelName, (0, action_1.createSchema)());
38
+ options;
39
+ constructor(params, options) {
40
+ super(params, options);
41
+ this.actionModel = params.connection.model(action_1.modelName, (0, action_1.createSchema)());
42
+ this.options = options;
41
43
  }
42
44
  static CREATE_MONGO_CONDITIONS(params) {
43
45
  const andConditions = []; // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -438,11 +440,10 @@ class ActionProcessRepo extends actionRecipe_1.ActionRecipeRepo {
438
440
  /**
439
441
  * アクション開始
440
442
  */
441
- async start(attributes, options) {
443
+ async start(attributes, // eslint-disable-line @typescript-eslint/no-explicit-any
444
+ options) {
442
445
  const startDate = new Date();
443
- const expires = (attributes.expires instanceof Date)
444
- ? attributes.expires
445
- : new Date(startDate.getTime() + DEFAULT_EXPIRE_AFTER_SECONDS * 1000);
446
+ const expires = new Date(startDate.getTime() + this.options.expireAfterSeconds * 1000);
446
447
  const creatingAction = {
447
448
  ...attributes,
448
449
  actionStatus: factory_1.factory.actionStatusType.ActiveActionStatus,
@@ -458,17 +459,14 @@ class ActionProcessRepo extends actionRecipe_1.ActionRecipeRepo {
458
459
  // add recipe(2024-06-09~)
459
460
  const savingRecipe = options?.recipe;
460
461
  if (savingRecipe?.typeOf === 'Recipe') {
461
- await this.upsertRecipe({ ...savingRecipe, recipeFor: { id, typeOf: creatingAction.typeOf }, expires });
462
+ await this.upsertRecipe({ ...savingRecipe, recipeFor: { id, typeOf: creatingAction.typeOf } });
462
463
  }
463
464
  return { id, startDate, typeOf: creatingAction.typeOf };
464
465
  }
465
466
  async completeWithVoid(params) {
466
467
  const endDate = new Date();
467
- const recipeExpires = (params.expires instanceof Date)
468
- ? params.expires
469
- : new Date(endDate.getTime() + RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS * 1000);
470
468
  if (params.recipe?.typeOf === 'Recipe') {
471
- await this.upsertRecipe({ ...params.recipe, recipeFor: { id: params.id, typeOf: params.typeOf }, expires: recipeExpires });
469
+ await this.upsertRecipe({ ...params.recipe, recipeFor: { id: params.id, typeOf: params.typeOf } });
472
470
  }
473
471
  const doc = await this.actionModel.findOneAndUpdate({
474
472
  _id: { $eq: params.id },
@@ -529,14 +527,11 @@ class ActionProcessRepo extends actionRecipe_1.ActionRecipeRepo {
529
527
  */
530
528
  async giveUp(params) {
531
529
  const endDate = new Date();
532
- const recipeExpires = (params.expires instanceof Date)
533
- ? params.expires
534
- : new Date(endDate.getTime() + RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS * 1000);
535
530
  const actionError = Array.isArray(params.error)
536
531
  ? params.error.map(unknown2actionError_1.unknown2actionError)
537
532
  : (0, unknown2actionError_1.unknown2actionError)(params.error);
538
533
  if (params.recipe?.typeOf === 'Recipe') {
539
- await this.upsertRecipe({ ...params.recipe, recipeFor: { id: params.id, typeOf: params.typeOf }, expires: recipeExpires });
534
+ await this.upsertRecipe({ ...params.recipe, recipeFor: { id: params.id, typeOf: params.typeOf } });
540
535
  }
541
536
  const doc = await this.actionModel.findOneAndUpdate({
542
537
  typeOf: { $eq: params.typeOf },
@@ -1,6 +1,6 @@
1
1
  import { Connection } from 'mongoose';
2
- import { factory } from '../../factory';
3
- import { IModel as IActionRecipeModel } from '../mongoose/schemas/actionRecipe';
2
+ import { factory } from '../../../factory';
3
+ import { IModel as IActionRecipeModel } from '../../mongoose/schemas/actionRecipe';
4
4
  export type IActionRecipe<T extends factory.recipe.RecipeCategory> = T extends factory.recipe.RecipeCategory.checkMovieTicket ? factory.action.check.paymentMethod.movieTicket.IRecipe : T extends factory.recipe.RecipeCategory.payCreditCard ? factory.action.trade.pay.IPayCreditCardRecipe : T extends factory.recipe.RecipeCategory.payMovieTicket ? factory.action.trade.pay.IPayMovieTicketRecipe : T extends factory.recipe.RecipeCategory.publishPaymentUrl ? factory.action.accept.pay.IRecipe : T extends factory.recipe.RecipeCategory.refundCreditCard ? factory.action.trade.refund.IRefundCreditCardRecipe : T extends factory.recipe.RecipeCategory.refundMovieTicket ? factory.action.trade.refund.IRefundMovieTicketRecipe : T extends factory.recipe.RecipeCategory.authorizeInvoice ? factory.action.authorize.invoice.IAuthorizeInvoiceRecipe : T extends factory.recipe.RecipeCategory.authorizeInvoice3ds ? factory.action.authorize.invoice.IAuthorizeInvoice3dsRecipe : T extends factory.recipe.RecipeCategory.acceptCOAOffer ? factory.action.accept.coaOffer.IRecipe : T extends factory.recipe.RecipeCategory.confirmCOAReserve ? factory.action.interact.confirm.reservation.IConfirmCOAReserveRecipe : T extends factory.recipe.RecipeCategory.cancelPendingCOAReserve ? factory.action.cancel.coaReserve.ICancelPendingCOAReserveRecipe : T extends factory.recipe.RecipeCategory.returnCOAReserve ? factory.action.transfer.returnAction.reserveTransaction.IReturnCOAReserveRecipe : T extends factory.recipe.RecipeCategory.sendEmailMessage ? factory.action.transfer.send.message.email.IRecipe : never;
5
5
  export type IRecipeAsDocument = factory.recipe.IRecipe & {
6
6
  recipeFor: {
@@ -12,12 +12,18 @@ export type IRecipeAsDocument = factory.recipe.IRecipe & {
12
12
  expires: Date;
13
13
  };
14
14
  export type IRecipeAsActionAttributes<T extends factory.recipe.RecipeCategory> = Pick<IActionRecipe<T>, 'project' | 'recipeCategory' | 'step' | 'typeOf'>;
15
+ interface IOptions {
16
+ recipeExpireAfterSeconds: number;
17
+ }
15
18
  /**
16
19
  * アクションレシピリポジトリ
17
20
  */
18
21
  export declare class ActionRecipeRepo<TActionRecipe extends IActionRecipe<factory.recipe.RecipeCategory>> {
19
22
  protected readonly actionRecipeModel: IActionRecipeModel;
20
- protected constructor(connection: Connection);
23
+ private recipeOptions;
24
+ protected constructor(params: {
25
+ connection: Connection;
26
+ }, options: IOptions);
21
27
  findRecipeByAction<T extends TActionRecipe['recipeCategory']>(params: {
22
28
  project: {
23
29
  id: string;
@@ -26,7 +32,6 @@ export declare class ActionRecipeRepo<TActionRecipe extends IActionRecipe<factor
26
32
  id: string;
27
33
  };
28
34
  }): Promise<Pick<IActionRecipe<T>, 'step' | 'recipeCategory'> | null>;
29
- upsertRecipe(savingRecipe: Pick<IRecipeAsDocument, 'project' | 'recipeCategory' | 'recipeFor' | 'step' | 'typeOf'> & {
30
- expires: Date;
31
- }): Promise<void>;
35
+ upsertRecipe(savingRecipe: Pick<IRecipeAsDocument, 'project' | 'recipeCategory' | 'recipeFor' | 'step' | 'typeOf'>): Promise<void>;
32
36
  }
37
+ export {};
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionRecipeRepo = void 0;
4
- const actionRecipe_1 = require("../mongoose/schemas/actionRecipe");
4
+ const actionRecipe_1 = require("../../mongoose/schemas/actionRecipe");
5
5
  /**
6
6
  * アクションレシピリポジトリ
7
7
  */
8
8
  class ActionRecipeRepo {
9
9
  actionRecipeModel;
10
- constructor(connection) {
11
- this.actionRecipeModel = connection.model(actionRecipe_1.modelName, (0, actionRecipe_1.createSchema)());
10
+ recipeOptions;
11
+ constructor(params, options) {
12
+ this.actionRecipeModel = params.connection.model(actionRecipe_1.modelName, (0, actionRecipe_1.createSchema)());
13
+ this.recipeOptions = options;
12
14
  }
13
15
  async findRecipeByAction(params) {
14
16
  return this.actionRecipeModel.findOne({
@@ -26,7 +28,8 @@ class ActionRecipeRepo {
26
28
  }
27
29
  async upsertRecipe(savingRecipe) {
28
30
  const dateModified = new Date();
29
- const { typeOf, project, recipeCategory, recipeFor, step, expires } = savingRecipe;
31
+ const expires = new Date(dateModified.getTime() + this.recipeOptions.recipeExpireAfterSeconds * 1000);
32
+ const { typeOf, project, recipeCategory, recipeFor, step } = savingRecipe;
30
33
  const filter = {
31
34
  'recipeFor.id': { $eq: recipeFor.id }
32
35
  };
@@ -1,15 +1,12 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../../factory';
2
- import { IKeyOfProjection, IActionRecipe, ActionProcessRepo } from './actionProcess';
3
- export type IAuthorizeInvoiceAction = factory.action.authorize.invoice.IAction & {
4
- /**
5
- * 実際存在しない属性だが、ActionProcessRepoのTActionに適合させるために補完
6
- */
7
- recipient: any;
8
- };
3
+ import { IKeyOfProjection, IActionRecipe, ActionProcessRepo } from './anyAction/actionProcess';
4
+ export type IAuthorizeInvoiceAction = factory.action.authorize.invoice.IAction;
9
5
  /**
10
6
  * インボイス承認リポジトリ
11
7
  */
12
8
  export declare class AuthorizeInvoiceActionRepo extends ActionProcessRepo<IAuthorizeInvoiceAction, IActionRecipe<factory.recipe.RecipeCategory.authorizeInvoice | factory.recipe.RecipeCategory.authorizeInvoice3ds>> {
9
+ constructor(connection: Connection);
13
10
  /**
14
11
  * 決済取引からインボイス承認アクションをひとつ参照する
15
12
  */
@@ -22,5 +19,5 @@ export declare class AuthorizeInvoiceActionRepo extends ActionProcessRepo<IAutho
22
19
  * 決済取引ID
23
20
  */
24
21
  payTransactionId: string;
25
- }, inclusion: IKeyOfProjection[]): Promise<IAuthorizeInvoiceAction[]>;
22
+ }, inclusion: IKeyOfProjection[]): Promise<import("@chevre/factory/lib/chevre/action/authorize/invoice").IAction[]>;
26
23
  }
@@ -2,11 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthorizeInvoiceActionRepo = void 0;
4
4
  const factory_1 = require("../../factory");
5
- const actionProcess_1 = require("./actionProcess");
5
+ const actionProcess_1 = require("./anyAction/actionProcess");
6
6
  /**
7
7
  * インボイス承認リポジトリ
8
8
  */
9
9
  class AuthorizeInvoiceActionRepo extends actionProcess_1.ActionProcessRepo {
10
+ constructor(connection) {
11
+ super({ connection }, {
12
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
13
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
14
+ });
15
+ }
10
16
  /**
11
17
  * 決済取引からインボイス承認アクションをひとつ参照する
12
18
  */
@@ -1,5 +1,6 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../../factory';
2
- import { ActionProcessRepo } from './actionProcess';
3
+ import { ActionProcessRepo } from './anyAction/actionProcess';
3
4
  export type IAuthorizeEventServiceOfferAction = factory.action.authorize.offer.eventService.IAction;
4
5
  export type IAuthorizeOfferAction = IAuthorizeEventServiceOfferAction;
5
6
  export type IAuthorizeOfferActionWithInstrument = Pick<IAuthorizeEventServiceOfferAction, 'instrument'>;
@@ -7,6 +8,7 @@ export type IAuthorizeOfferActionWithInstrument = Pick<IAuthorizeEventServiceOff
7
8
  * オファー承認リポジトリ
8
9
  */
9
10
  export declare class AuthorizeOfferActionRepo extends ActionProcessRepo<IAuthorizeOfferAction, never> {
11
+ constructor(connection: Connection);
10
12
  findAuthorizeOfferInstrumentsByIds(params: {
11
13
  /**
12
14
  * 注文取引
@@ -2,11 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthorizeOfferActionRepo = void 0;
4
4
  const factory_1 = require("../../factory");
5
- const actionProcess_1 = require("./actionProcess");
5
+ const actionProcess_1 = require("./anyAction/actionProcess");
6
6
  /**
7
7
  * オファー承認リポジトリ
8
8
  */
9
9
  class AuthorizeOfferActionRepo extends actionProcess_1.ActionProcessRepo {
10
+ constructor(connection) {
11
+ super({ connection }, {
12
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
13
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
14
+ });
15
+ }
10
16
  async findAuthorizeOfferInstrumentsByIds(params) {
11
17
  if (!Array.isArray(params.ids)) {
12
18
  throw new factory_1.factory.errors.Argument('ids', 'must be Array');
@@ -1,11 +1,13 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../../factory';
2
- import { ActionProcessRepo } from './actionProcess';
3
+ import { ActionProcessRepo } from './anyAction/actionProcess';
3
4
  export type IAuthorizePaymentMethodAction = factory.action.authorize.paymentMethod.any.IAction;
4
5
  export type IActionRecipe = never;
5
6
  /**
6
7
  * 決済承認リポジトリ
7
8
  */
8
9
  export declare class AuthorizePaymentMethodActionRepo extends ActionProcessRepo<IAuthorizePaymentMethodAction, IActionRecipe> {
10
+ constructor(connection: Connection);
9
11
  /**
10
12
  * 取引に対する決済承認アクションを検索する
11
13
  */
@@ -2,11 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthorizePaymentMethodActionRepo = void 0;
4
4
  const factory_1 = require("../../factory");
5
- const actionProcess_1 = require("./actionProcess");
5
+ const actionProcess_1 = require("./anyAction/actionProcess");
6
6
  /**
7
7
  * 決済承認リポジトリ
8
8
  */
9
9
  class AuthorizePaymentMethodActionRepo extends actionProcess_1.ActionProcessRepo {
10
+ constructor(connection) {
11
+ super({ connection }, {
12
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
13
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
14
+ });
15
+ }
10
16
  /**
11
17
  * 取引に対する決済承認アクションを検索する
12
18
  */
@@ -1,8 +1,10 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../../factory';
2
- import { ActionProcessRepo } from './actionProcess';
3
+ import { ActionProcessRepo } from './anyAction/actionProcess';
3
4
  export type IAuthorizeTicketedObjectAction = factory.action.authorize.ticketedObject.IAction;
4
5
  /**
5
6
  * 決済とオファー以外に対する汎用承認リポジトリ
6
7
  */
7
8
  export declare class AuthorizeTicketedObjectActionRepo extends ActionProcessRepo<IAuthorizeTicketedObjectAction, never> {
9
+ constructor(connection: Connection);
8
10
  }
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthorizeTicketedObjectActionRepo = void 0;
4
- const actionProcess_1 = require("./actionProcess");
4
+ const actionProcess_1 = require("./anyAction/actionProcess");
5
5
  /**
6
6
  * 決済とオファー以外に対する汎用承認リポジトリ
7
7
  */
8
8
  class AuthorizeTicketedObjectActionRepo extends actionProcess_1.ActionProcessRepo {
9
+ constructor(connection) {
10
+ super({ connection }, {
11
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
12
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
13
+ });
14
+ }
9
15
  }
10
16
  exports.AuthorizeTicketedObjectActionRepo = AuthorizeTicketedObjectActionRepo;
@@ -1,6 +1,7 @@
1
1
  import { Surfrock } from '@surfrock/sdk';
2
+ import type { Connection } from 'mongoose';
2
3
  import { factory } from '../../factory';
3
- import { ActionProcessRepo, IActionRecipe } from './actionProcess';
4
+ import { ActionProcessRepo, IActionRecipe } from './anyAction/actionProcess';
4
5
  export type IMinimizedPurchaseNumberAuthResult = Pick<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult, 'mkknmiNumSum' | 'resultInfo' | 'ykknmiNumSum'> & {
5
6
  knyknrNoInfoOut: Omit<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberInfo, 'ykknInfo' | 'mkknInfo'>[] | null;
6
7
  };
@@ -60,6 +61,7 @@ export type ICheckMovieTicketAction = factory.action.check.paymentMethod.movieTi
60
61
  * 決済カード認証アクションリポジトリ
61
62
  */
62
63
  export declare class CheckMovieTicketActionRepo extends ActionProcessRepo<ICheckMovieTicketAction, IActionRecipe<factory.recipe.RecipeCategory.checkMovieTicket>> {
64
+ constructor(connection: Connection);
63
65
  /**
64
66
  * アクションIDからレシピのafterMediaを参照する
65
67
  */
@@ -3,11 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CheckMovieTicketActionRepo = void 0;
4
4
  const factory_1 = require("../../factory");
5
5
  const settings_1 = require("../../settings");
6
- const actionProcess_1 = require("./actionProcess");
6
+ const actionProcess_1 = require("./anyAction/actionProcess");
7
+ const EXPIRE_AFTER_SECONDS = 2592000; // 30 days
7
8
  /**
8
9
  * 決済カード認証アクションリポジトリ
9
10
  */
10
11
  class CheckMovieTicketActionRepo extends actionProcess_1.ActionProcessRepo {
12
+ constructor(connection) {
13
+ super({ connection }, {
14
+ expireAfterSeconds: EXPIRE_AFTER_SECONDS,
15
+ recipeExpireAfterSeconds: EXPIRE_AFTER_SECONDS
16
+ });
17
+ }
11
18
  /**
12
19
  * アクションIDからレシピのafterMediaを参照する
13
20
  */
@@ -1,8 +1,10 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../../factory';
2
- import { ActionProcessRepo } from './actionProcess';
3
+ import { ActionProcessRepo } from './anyAction/actionProcess';
3
4
  export type ICreateAction = factory.action.create.IAction;
4
5
  /**
5
6
  * レポート作成アクションリポジトリ
6
7
  */
7
8
  export declare class CreateActionRepo extends ActionProcessRepo<ICreateAction, never> {
9
+ constructor(connection: Connection);
8
10
  }
@@ -1,10 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateActionRepo = void 0;
4
- const actionProcess_1 = require("./actionProcess");
4
+ const actionProcess_1 = require("./anyAction/actionProcess");
5
+ const EXPIRE_AFTER_SECONDS = 2592000; // 30 days
5
6
  /**
6
7
  * レポート作成アクションリポジトリ
7
8
  */
8
9
  class CreateActionRepo extends actionProcess_1.ActionProcessRepo {
10
+ constructor(connection) {
11
+ super({ connection }, {
12
+ expireAfterSeconds: EXPIRE_AFTER_SECONDS,
13
+ recipeExpireAfterSeconds: EXPIRE_AFTER_SECONDS
14
+ });
15
+ }
9
16
  }
10
17
  exports.CreateActionRepo = CreateActionRepo;
@@ -1,11 +1,13 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../../factory';
2
- import { ActionProcessRepo } from './actionProcess';
3
+ import { ActionProcessRepo } from './anyAction/actionProcess';
3
4
  export type IPayAction = factory.action.trade.pay.IAction;
4
5
  export type IActionRecipe = factory.action.trade.pay.IPayCreditCardRecipe | factory.action.trade.pay.IPayMovieTicketRecipe;
5
6
  /**
6
7
  * 決済アクションリポジトリ
7
8
  */
8
9
  export declare class PayActionRepo extends ActionProcessRepo<IPayAction, IActionRecipe> {
10
+ constructor(connection: Connection);
9
11
  /**
10
12
  * 決済方法IDから決済アクションをひとつ参照する
11
13
  * デフォルトでCompletedActionStatusのみ参照
@@ -2,11 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PayActionRepo = void 0;
4
4
  const factory_1 = require("../../factory");
5
- const actionProcess_1 = require("./actionProcess");
5
+ const actionProcess_1 = require("./anyAction/actionProcess");
6
6
  /**
7
7
  * 決済アクションリポジトリ
8
8
  */
9
9
  class PayActionRepo extends actionProcess_1.ActionProcessRepo {
10
+ constructor(connection) {
11
+ super({ connection }, {
12
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
13
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
14
+ });
15
+ }
10
16
  /**
11
17
  * 決済方法IDから決済アクションをひとつ参照する
12
18
  * デフォルトでCompletedActionStatusのみ参照
@@ -1,9 +1,11 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../../factory';
2
- import { ActionProcessRepo } from './actionProcess';
3
+ import { ActionProcessRepo } from './anyAction/actionProcess';
3
4
  export type IRefundAction = factory.action.trade.refund.IAction;
4
5
  export type IActionRecipe = factory.action.trade.refund.IRefundCreditCardRecipe | factory.action.trade.refund.IRefundMovieTicketRecipe;
5
6
  /**
6
7
  * 返金アクションリポジトリ
7
8
  */
8
9
  export declare class RefundActionRepo extends ActionProcessRepo<IRefundAction, IActionRecipe> {
10
+ constructor(connection: Connection);
9
11
  }
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RefundActionRepo = void 0;
4
- const actionProcess_1 = require("./actionProcess");
4
+ const actionProcess_1 = require("./anyAction/actionProcess");
5
5
  /**
6
6
  * 返金アクションリポジトリ
7
7
  */
8
8
  class RefundActionRepo extends actionProcess_1.ActionProcessRepo {
9
+ constructor(connection) {
10
+ super({ connection }, {
11
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
12
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
13
+ });
14
+ }
9
15
  }
10
16
  exports.RefundActionRepo = RefundActionRepo;
@@ -0,0 +1,10 @@
1
+ import type { Connection } from 'mongoose';
2
+ import { factory } from '../../factory';
3
+ import { ActionProcessRepo, IActionRecipe } from './anyAction/actionProcess';
4
+ export type ISendAction = factory.action.transfer.send.message.email.IAction;
5
+ /**
6
+ * メッセージ送信アクションリポジトリ
7
+ */
8
+ export declare class SendEmailMessageActionRepo extends ActionProcessRepo<ISendAction, IActionRecipe<factory.recipe.RecipeCategory.sendEmailMessage>> {
9
+ constructor(connection: Connection);
10
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SendEmailMessageActionRepo = void 0;
4
+ const actionProcess_1 = require("./anyAction/actionProcess");
5
+ const EXPIRE_AFTER_SECONDS = 2592000; // 30 days
6
+ /**
7
+ * メッセージ送信アクションリポジトリ
8
+ */
9
+ class SendEmailMessageActionRepo extends actionProcess_1.ActionProcessRepo {
10
+ constructor(connection) {
11
+ super({ connection }, {
12
+ expireAfterSeconds: EXPIRE_AFTER_SECONDS,
13
+ recipeExpireAfterSeconds: EXPIRE_AFTER_SECONDS
14
+ });
15
+ }
16
+ }
17
+ exports.SendEmailMessageActionRepo = SendEmailMessageActionRepo;
@@ -0,0 +1,10 @@
1
+ import type { Connection } from 'mongoose';
2
+ import { factory } from '../../factory';
3
+ import { ActionProcessRepo } from './anyAction/actionProcess';
4
+ export type ISendAction = factory.action.transfer.send.order.IAction;
5
+ /**
6
+ * 注文配送アクションリポジトリ
7
+ */
8
+ export declare class SendOrderActionRepo extends ActionProcessRepo<ISendAction, never> {
9
+ constructor(connection: Connection);
10
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SendOrderActionRepo = void 0;
4
+ const actionProcess_1 = require("./anyAction/actionProcess");
5
+ /**
6
+ * 注文配送アクションリポジトリ
7
+ */
8
+ class SendOrderActionRepo extends actionProcess_1.ActionProcessRepo {
9
+ constructor(connection) {
10
+ super({ connection }, {
11
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
12
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
13
+ });
14
+ }
15
+ }
16
+ exports.SendOrderActionRepo = SendOrderActionRepo;
@@ -1,15 +1,17 @@
1
+ import type { Connection } from 'mongoose';
1
2
  import { factory } from '../factory';
2
- import { IAction, IKeyOfProjection, ActionProcessRepo, ICancelActionAction, IActionRecipe } from './action/actionProcess';
3
+ import { IAction, IKeyOfProjection, ActionProcessRepo, ICancelActionAction, IActionRecipe } from './action/anyAction/actionProcess';
3
4
  export { ICancelActionAction };
4
5
  /**
5
6
  * 汎用アクションリポジトリで開始可能なアクションタイプ
6
7
  */
7
- export type StartableActionType = Exclude<factory.actionType, factory.actionType.AcceptAction | factory.actionType.CheckAction | factory.actionType.AuthorizeAction | factory.actionType.PayAction | factory.actionType.RefundAction | factory.actionType.AddAction | factory.actionType.UpdateAction | factory.actionType.ReplaceAction | factory.actionType.DeleteAction | factory.actionType.InformAction | factory.actionType.UseAction | factory.actionType.CreateAction>;
8
+ export type StartableActionType = factory.actionType.AuthorizeAction | factory.actionType.CancelAction | factory.actionType.ConfirmAction | factory.actionType.OrderAction | factory.actionType.ReserveAction | factory.actionType.ReturnAction;
8
9
  export type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl | factory.recipe.RecipeCategory.checkMovieTicket | factory.recipe.RecipeCategory.acceptCOAOffer | factory.recipe.RecipeCategory.authorizeInvoice | factory.recipe.RecipeCategory.authorizeInvoice3ds | factory.recipe.RecipeCategory.payCreditCard | factory.recipe.RecipeCategory.payMovieTicket | factory.recipe.RecipeCategory.refundCreditCard | factory.recipe.RecipeCategory.refundMovieTicket>>;
9
10
  /**
10
11
  * アクションリポジトリ
11
12
  */
12
13
  export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActionType>, IAvailableActionRecipe> {
14
+ constructor(connection: Connection);
13
15
  /**
14
16
  * 汎用アクション検索
15
17
  */
@@ -1,11 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionRepo = void 0;
4
- const actionProcess_1 = require("./action/actionProcess");
4
+ const actionProcess_1 = require("./action/anyAction/actionProcess");
5
5
  /**
6
6
  * アクションリポジトリ
7
7
  */
8
8
  class ActionRepo extends actionProcess_1.ActionProcessRepo {
9
+ constructor(connection) {
10
+ super({ connection }, {
11
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
12
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
13
+ });
14
+ }
9
15
  /**
10
16
  * 汎用アクション検索
11
17
  */
@@ -1,7 +1,7 @@
1
- import { FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery } from 'mongoose';
2
2
  import { factory } from '../factory';
3
3
  import type { IDocType } from './mongoose/schemas/action';
4
- import { IAction, ActionProcessRepo } from './action/actionProcess';
4
+ import { IAction, ActionProcessRepo } from './action/anyAction/actionProcess';
5
5
  import { StartableActionType, IAvailableActionRecipe } from './action';
6
6
  export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
7
7
  export interface IDeleteActionResult {
@@ -12,6 +12,7 @@ export interface IDeleteActionResult {
12
12
  * アクション管理リポジトリ
13
13
  */
14
14
  export declare class AdminActionRepo extends ActionProcessRepo<IAction<StartableActionType>, IAvailableActionRecipe> {
15
+ constructor(connection: Connection);
15
16
  /**
16
17
  * 取引に対するアクションを検索する
17
18
  */
@@ -2,11 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdminActionRepo = void 0;
4
4
  const factory_1 = require("../factory");
5
- const actionProcess_1 = require("./action/actionProcess");
5
+ const actionProcess_1 = require("./action/anyAction/actionProcess");
6
6
  /**
7
7
  * アクション管理リポジトリ
8
8
  */
9
9
  class AdminActionRepo extends actionProcess_1.ActionProcessRepo {
10
+ constructor(connection) {
11
+ super({ connection }, {
12
+ expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
13
+ recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
14
+ });
15
+ }
10
16
  /**
11
17
  * 取引に対するアクションを検索する
12
18
  */
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../factory';
2
- import type { ActionRepo } from '../../repo/action';
2
+ import type { SendEmailMessageActionRepo } from '../../repo/action/sendEmailMessage';
3
3
  import type { MessageRepo } from '../../repo/message';
4
4
  import type { ProjectRepo } from '../../repo/project';
5
5
  import type { IntegrationSettingRepo } from '../../repo/setting/integration';
@@ -11,7 +11,9 @@ declare function sendEmailMessage(params: factory.task.sendEmailMessage.IActionA
11
11
  id: string;
12
12
  };
13
13
  }): (repos: {
14
- action: ActionRepo;
14
+ actions: {
15
+ sendEmailMessage: SendEmailMessageActionRepo;
16
+ };
15
17
  message: MessageRepo;
16
18
  project: ProjectRepo;
17
19
  integrationSetting: IntegrationSettingRepo;
@@ -80,7 +80,7 @@ function sendEmailMessage(params) {
80
80
  project: { id: params.project.id }
81
81
  });
82
82
  const startingAction = createSendEmailMessageActionAttributes(params);
83
- const action = await repos.action.start(startingAction, { recipe });
83
+ const action = await repos.actions.sendEmailMessage.start(startingAction, { recipe });
84
84
  let result;
85
85
  try {
86
86
  mailData.customArgs = {
@@ -121,13 +121,13 @@ function sendEmailMessage(params) {
121
121
  mailData,
122
122
  project: { id: params.project.id }
123
123
  });
124
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error, recipe });
124
+ await repos.actions.sendEmailMessage.giveUp({ typeOf: action.typeOf, id: action.id, error, recipe });
125
125
  }
126
126
  catch (__) {
127
127
  // 失敗したら仕方ない
128
128
  }
129
129
  throw error;
130
130
  }
131
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result, recipe });
131
+ await repos.actions.sendEmailMessage.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result, recipe });
132
132
  };
133
133
  }
@@ -1,12 +1,14 @@
1
1
  import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
2
- import type { ActionRepo } from '../../repo/action';
2
+ import type { SendOrderActionRepo } from '../../repo/action/sendOrder';
3
3
  import type { OrderRepo } from '../../repo/order';
4
4
  import type { SettingRepo } from '../../repo/setting';
5
5
  import type { TaskRepo } from '../../repo/task';
6
6
  import { factory } from '../../factory';
7
7
  interface ISendOrderRepos {
8
8
  acceptedOffer: AcceptedOfferRepo;
9
- action: ActionRepo;
9
+ actions: {
10
+ sendOrder: SendOrderActionRepo;
11
+ };
10
12
  order: OrderRepo;
11
13
  setting: SettingRepo;
12
14
  task: TaskRepo;
@@ -58,7 +58,7 @@ function sendOrder(params) {
58
58
  project: order.project,
59
59
  typeOf: factory_1.factory.actionType.SendAction
60
60
  };
61
- const action = await repos.action.start(sendOrderActionAttributes);
61
+ const action = await repos.actions.sendOrder.start(sendOrderActionAttributes);
62
62
  let allOffersDelivered = false;
63
63
  let acceptedOffers;
64
64
  // 所有権管理はひとまず廃止(2026-08-10~)
@@ -93,7 +93,7 @@ function sendOrder(params) {
93
93
  }
94
94
  catch (error) {
95
95
  try {
96
- await repos.action.giveUp({ typeOf: sendOrderActionAttributes.typeOf, id: action.id, error });
96
+ await repos.actions.sendOrder.giveUp({ typeOf: sendOrderActionAttributes.typeOf, id: action.id, error });
97
97
  }
98
98
  catch (_) {
99
99
  // no op
@@ -101,7 +101,7 @@ function sendOrder(params) {
101
101
  throw error;
102
102
  }
103
103
  const result = [];
104
- await repos.action.completeWithVoid({ typeOf: sendOrderActionAttributes.typeOf, id: action.id, result: result });
104
+ await repos.actions.sendOrder.completeWithVoid({ typeOf: sendOrderActionAttributes.typeOf, id: action.id, result: result });
105
105
  if (params.useOnOrderStatusChanged) {
106
106
  if (allOffersDelivered) {
107
107
  await (0, onOrderStatusChanged_1.onOrderDelivered)({
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
- const action_1 = require("../../repo/action");
4
+ const sendEmailMessage_1 = require("../../repo/action/sendEmailMessage");
5
5
  const message_1 = require("../../repo/message");
6
6
  const project_1 = require("../../repo/project");
7
7
  const integration_1 = require("../../repo/setting/integration");
@@ -15,7 +15,7 @@ function call(params) {
15
15
  ...params.data.actionAttributes,
16
16
  sameAs: { id: params.id } // タスクIDを関連付け(2024-06-25~)
17
17
  })({
18
- action: new action_1.ActionRepo(connection),
18
+ actions: { sendEmailMessage: new sendEmailMessage_1.SendEmailMessageActionRepo(connection) },
19
19
  message: new message_1.MessageRepo(connection),
20
20
  project: new project_1.ProjectRepo(connection),
21
21
  integrationSetting: new integration_1.IntegrationSettingRepo({ connection })
@@ -3,18 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
4
  const factory_1 = require("../../factory");
5
5
  const acceptedOffer_1 = require("../../repo/acceptedOffer");
6
- const action_1 = require("../../repo/action");
6
+ const sendOrder_1 = require("../../repo/action/sendOrder");
7
7
  const order_1 = require("../../repo/order");
8
8
  const setting_1 = require("../../repo/setting");
9
9
  const task_1 = require("../../repo/task");
10
- const sendOrder_1 = require("../order/sendOrder");
10
+ const sendOrder_2 = require("../order/sendOrder");
11
11
  /**
12
12
  * タスク実行関数
13
13
  */
14
14
  function call(params) {
15
15
  return async ({ connection }) => {
16
16
  const { data } = params;
17
- await (0, sendOrder_1.sendOrder)({
17
+ await (0, sendOrder_2.sendOrder)({
18
18
  ...data,
19
19
  object: {
20
20
  ...data.object,
@@ -28,7 +28,7 @@ function call(params) {
28
28
  useOnOrderStatusChanged: true
29
29
  })({
30
30
  acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
31
- action: new action_1.ActionRepo(connection),
31
+ actions: { sendOrder: new sendOrder_1.SendOrderActionRepo(connection) },
32
32
  order: new order_1.OrderRepo(connection),
33
33
  setting: new setting_1.SettingRepo(connection),
34
34
  task: new task_1.TaskRepo(connection),
package/package.json CHANGED
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "26.0.0-alpha.39"
91
+ "version": "26.0.0-alpha.40"
92
92
  }