@chevre/domain 21.4.0-alpha.3 → 21.4.0-alpha.4

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.
@@ -0,0 +1,23 @@
1
+ // tslint:disable:no-console
2
+ import * as moment from 'moment';
3
+ import * as mongoose from 'mongoose';
4
+
5
+ import { chevre } from '../../../lib/index';
6
+
7
+ async function main() {
8
+ await mongoose.connect(<string>process.env.MONGOLAB_URI);
9
+
10
+ const actionRepo = new chevre.repository.Action(mongoose.connection);
11
+
12
+ const result = await actionRepo.deleteStartDatePassedCertainPeriod({
13
+ $lt: moment()
14
+ // tslint:disable-next-line:no-magic-numbers
15
+ .add(-548, 'days')
16
+ .toDate()
17
+ });
18
+ console.log(result);
19
+ }
20
+
21
+ main()
22
+ .then()
23
+ .catch(console.error);
@@ -163,6 +163,12 @@ export declare class MongoRepository {
163
163
  };
164
164
  entranceGateIdentifier: string;
165
165
  }): Promise<IUseActionCountByOffer[]>;
166
+ /**
167
+ * 開始日時を一定期間過ぎたアクションを削除する
168
+ */
169
+ deleteStartDatePassedCertainPeriod(params: {
170
+ $lt: Date;
171
+ }): Promise<any>;
166
172
  /**
167
173
  * 終了日時を一定期間過ぎたアクションを削除する
168
174
  */
@@ -713,6 +713,19 @@ class MongoRepository {
713
713
  .exec();
714
714
  });
715
715
  }
716
+ /**
717
+ * 開始日時を一定期間過ぎたアクションを削除する
718
+ */
719
+ deleteStartDatePassedCertainPeriod(params) {
720
+ return __awaiter(this, void 0, void 0, function* () {
721
+ return this.actionModel.deleteMany({
722
+ startDate: {
723
+ $lt: params.$lt
724
+ }
725
+ })
726
+ .exec();
727
+ });
728
+ }
716
729
  /**
717
730
  * 終了日時を一定期間過ぎたアクションを削除する
718
731
  */
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@chevre/factory": "4.314.0",
13
- "@cinerino/sdk": "3.157.1",
13
+ "@cinerino/sdk": "3.160.0-alpha.2",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -117,5 +117,5 @@
117
117
  "postversion": "git push origin --tags",
118
118
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
119
119
  },
120
- "version": "21.4.0-alpha.3"
120
+ "version": "21.4.0-alpha.4"
121
121
  }