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

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.
@@ -3,14 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AcceptPayActionRepo = void 0;
4
4
  const factory_1 = require("../../factory");
5
5
  const actionProcess_1 = require("./anyAction/actionProcess");
6
+ const EXPIRE_AFTER_SECONDS = 2592000; // 30 days
6
7
  /**
7
8
  * 決済採用リポジトリ
8
9
  */
9
10
  class AcceptPayActionRepo extends actionProcess_1.ActionProcessRepo {
10
11
  constructor(connection) {
11
12
  super({ connection }, {
12
- expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
13
- recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
13
+ expireAfterSeconds: EXPIRE_AFTER_SECONDS,
14
+ recipeExpireAfterSeconds: EXPIRE_AFTER_SECONDS
14
15
  });
15
16
  }
16
17
  /**
@@ -0,0 +1,48 @@
1
+ import type { Connection } from 'mongoose';
2
+ import { factory } from '../factory';
3
+ import { IModel as IActionModel, IDocType } from './mongoose/schemas/action';
4
+ import { IDocType as IRecipeDocType, IModel as IActionRecipeModel } from './mongoose/schemas/actionRecipe';
5
+ /**
6
+ * アクション移行リポジトリ
7
+ */
8
+ export declare class MigrateActionRepo {
9
+ protected readonly actionModel: IActionModel;
10
+ protected readonly actionRecipeModel: IActionRecipeModel;
11
+ constructor(connection: Connection);
12
+ getActionCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & {
13
+ _id: import("mongoose").Types.ObjectId;
14
+ } & {
15
+ __v: number;
16
+ }, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & {
17
+ _id: import("mongoose").Types.ObjectId;
18
+ } & {
19
+ __v: number;
20
+ }) | null>;
21
+ getActionRecipeCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IRecipeDocType, import("./mongoose/virtuals").IVirtuals, {}> & factory.recipe.IRecipe & {
22
+ recipeFor: {
23
+ id: string;
24
+ };
25
+ dateCreated?: Date;
26
+ dateModified?: Date;
27
+ expires?: Date;
28
+ } & {
29
+ _id: import("mongoose").Types.ObjectId;
30
+ } & {
31
+ __v: number;
32
+ }, import("mongoose").QueryOptions<IRecipeDocType>, (import("mongoose").Document<unknown, Record<string, never>, IRecipeDocType, import("./mongoose/virtuals").IVirtuals, {}> & factory.recipe.IRecipe & {
33
+ recipeFor: {
34
+ id: string;
35
+ };
36
+ dateCreated?: Date;
37
+ dateModified?: Date;
38
+ expires?: Date;
39
+ } & {
40
+ _id: import("mongoose").Types.ObjectId;
41
+ } & {
42
+ __v: number;
43
+ }) | null>;
44
+ migrateActionExpires(params: {
45
+ id: string;
46
+ expires: Date;
47
+ }): Promise<void>;
48
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MigrateActionRepo = void 0;
4
+ const factory_1 = require("../factory");
5
+ const action_1 = require("./mongoose/schemas/action");
6
+ const actionRecipe_1 = require("./mongoose/schemas/actionRecipe");
7
+ /**
8
+ * アクション移行リポジトリ
9
+ */
10
+ class MigrateActionRepo {
11
+ actionModel;
12
+ actionRecipeModel;
13
+ constructor(connection) {
14
+ this.actionModel = connection.model(action_1.modelName, (0, action_1.createSchema)());
15
+ this.actionRecipeModel = connection.model(actionRecipe_1.modelName, (0, actionRecipe_1.createSchema)());
16
+ }
17
+ getActionCursor(conditions, projection) {
18
+ return this.actionModel.find(conditions, projection)
19
+ .sort({ startDate: factory_1.factory.sortType.Ascending })
20
+ .cursor();
21
+ }
22
+ getActionRecipeCursor(conditions, projection) {
23
+ return this.actionRecipeModel.find(conditions, projection)
24
+ .sort({ dateCreated: factory_1.factory.sortType.Ascending })
25
+ .cursor();
26
+ }
27
+ async migrateActionExpires(params) {
28
+ await this.actionModel.updateOne({ _id: { $eq: params.id } }, { $set: { expires: params.expires } })
29
+ .exec();
30
+ }
31
+ }
32
+ exports.MigrateActionRepo = MigrateActionRepo;
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.40"
91
+ "version": "26.0.0-alpha.41"
92
92
  }