@chevre/domain 20.4.0-alpha.8 → 20.4.0

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 (89) hide show
  1. package/example/src/chevre/aggregateEventReservation.ts +2 -1
  2. package/example/src/chevre/deleteMovieTicketCategoryChargePriceSpecs.ts +21 -0
  3. package/example/src/chevre/{deleteReservationTicketUnderNames.ts → deleteTasksByName.ts} +4 -2
  4. package/example/src/chevre/migrateMoneyTransferPendingTransactionIdentifier.ts +96 -0
  5. package/example/src/chevre/reIndex.ts +25 -0
  6. package/example/src/chevre/searchEventTicketOffers.ts +7 -4
  7. package/example/src/chevre/searchOfferCatalogs.ts +14 -16
  8. package/example/src/chevre/searchOffersByCatalog.ts +2 -1
  9. package/example/src/chevre/searchProductOffers.ts +38 -0
  10. package/example/src/chevre/searchTasks.ts +22 -0
  11. package/example/src/chevre/unsetUnnecessaryFields.ts +6 -11
  12. package/lib/chevre/errorHandler.js +1 -0
  13. package/lib/chevre/repo/accountTransaction.d.ts +0 -5
  14. package/lib/chevre/repo/accountTransaction.js +44 -38
  15. package/lib/chevre/repo/assetTransaction.d.ts +1 -0
  16. package/lib/chevre/repo/assetTransaction.js +5 -0
  17. package/lib/chevre/repo/code.d.ts +0 -7
  18. package/lib/chevre/repo/code.js +0 -17
  19. package/lib/chevre/repo/event.d.ts +5 -4
  20. package/lib/chevre/repo/event.js +8 -17
  21. package/lib/chevre/repo/mongoose/model/accountTransaction.js +0 -5
  22. package/lib/chevre/repo/mongoose/model/member.js +5 -2
  23. package/lib/chevre/repo/mongoose/model/offer.js +19 -9
  24. package/lib/chevre/repo/mongoose/model/priceSpecification.js +19 -52
  25. package/lib/chevre/repo/mongoose/model/product.js +15 -2
  26. package/lib/chevre/repo/offer.d.ts +17 -2
  27. package/lib/chevre/repo/offer.js +77 -44
  28. package/lib/chevre/repo/offerCatalog.d.ts +3 -5
  29. package/lib/chevre/repo/offerCatalog.js +78 -37
  30. package/lib/chevre/repo/priceSpecification.d.ts +11 -0
  31. package/lib/chevre/repo/priceSpecification.js +44 -66
  32. package/lib/chevre/repo/task.d.ts +8 -0
  33. package/lib/chevre/repo/task.js +21 -9
  34. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +2 -0
  35. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +93 -96
  36. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +3 -1
  37. package/lib/chevre/service/assetTransaction/moneyTransfer.js +19 -11
  38. package/lib/chevre/service/assetTransaction/pay.js +2 -3
  39. package/lib/chevre/service/assetTransaction/registerService/factory.d.ts +1 -1
  40. package/lib/chevre/service/assetTransaction/registerService/factory.js +6 -3
  41. package/lib/chevre/service/assetTransaction/registerService.js +3 -1
  42. package/lib/chevre/service/assetTransaction/reserve/factory/price.d.ts +1 -1
  43. package/lib/chevre/service/assetTransaction/reserve/factory/price.js +0 -7
  44. package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +2 -2
  45. package/lib/chevre/service/assetTransaction/reserve/factory.js +0 -1
  46. package/lib/chevre/service/assetTransaction/reserve.js +47 -17
  47. package/lib/chevre/service/assetTransaction.d.ts +1 -1
  48. package/lib/chevre/service/code.d.ts +0 -8
  49. package/lib/chevre/service/code.js +1 -38
  50. package/lib/chevre/service/delivery.js +12 -3
  51. package/lib/chevre/service/event.js +0 -3
  52. package/lib/chevre/service/moneyTransfer.d.ts +1 -1
  53. package/lib/chevre/service/moneyTransfer.js +7 -8
  54. package/lib/chevre/service/offer/event/authorize.js +5 -5
  55. package/lib/chevre/service/offer/event/factory.js +1 -1
  56. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +7 -7
  57. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +222 -346
  58. package/lib/chevre/service/offer/factory.d.ts +8 -3
  59. package/lib/chevre/service/offer/factory.js +44 -26
  60. package/lib/chevre/service/offer/moneyTransfer/authorize.js +0 -1
  61. package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +0 -1
  62. package/lib/chevre/service/offer/product/searchProductOffers.d.ts +11 -1
  63. package/lib/chevre/service/offer/product/searchProductOffers.js +15 -7
  64. package/lib/chevre/service/offer/product.d.ts +11 -4
  65. package/lib/chevre/service/offer/product.js +59 -50
  66. package/lib/chevre/service/payment/any/factory.js +30 -21
  67. package/lib/chevre/service/payment/any.js +11 -4
  68. package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +22 -0
  69. package/lib/chevre/service/payment/movieTicket/checkByIdentifier.js +183 -0
  70. package/lib/chevre/service/payment/movieTicket/factory.d.ts +1 -1
  71. package/lib/chevre/service/payment/movieTicket/getCredentials.d.ts +13 -0
  72. package/lib/chevre/service/payment/movieTicket/getCredentials.js +45 -0
  73. package/lib/chevre/service/payment/movieTicket/validation.d.ts +15 -0
  74. package/lib/chevre/service/{assetTransaction/pay → payment}/movieTicket/validation.js +8 -7
  75. package/lib/chevre/service/payment/movieTicket.d.ts +10 -22
  76. package/lib/chevre/service/payment/movieTicket.js +15 -210
  77. package/lib/chevre/service/permit.d.ts +5 -1
  78. package/lib/chevre/service/permit.js +18 -11
  79. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +25 -53
  80. package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -0
  81. package/lib/chevre/service/transaction/moneyTransfer.js +0 -1
  82. package/lib/chevre/service/transaction/orderProgramMembership.js +5 -6
  83. package/lib/chevre/settings.d.ts +4 -0
  84. package/lib/chevre/settings.js +8 -2
  85. package/package.json +3 -3
  86. package/example/src/chevre/migrateAccountTitleAdditionalProperties.ts +0 -157
  87. package/lib/chevre/service/assetTransaction/pay/movieTicket/validation.d.ts +0 -14
  88. package/lib/chevre/service/task/deleteAuthorization.d.ts +0 -6
  89. package/lib/chevre/service/task/deleteAuthorization.js +0 -29
@@ -30,6 +30,9 @@ export declare function activate(params: {
30
30
  }): (repos: {
31
31
  serviceOutput: ServiceOutputRepo;
32
32
  }) => Promise<factory.permit.IPermit>;
33
+ declare type IPermitWithAccountDetail = Omit<factory.permit.IPermit, 'paymentAccount'> & {
34
+ paymentAccount?: factory.permit.IPaymentAccountWithDetail;
35
+ };
33
36
  /**
34
37
  * プロジェクト指定で、許可証を検索する(ペイメントカードプロダクトの場合、口座詳細込み)
35
38
  */
@@ -38,4 +41,5 @@ export declare function search(project: {
38
41
  }, params: factory.product.IServiceOutputSearchConditions, projection?: any): (repos: {
39
42
  account: AccountRepo;
40
43
  serviceOutput: ServiceOutputRepo;
41
- }) => Promise<factory.permit.IPermit[]>;
44
+ }) => Promise<IPermitWithAccountDetail[]>;
45
+ export {};
@@ -78,33 +78,40 @@ exports.activate = activate;
78
78
  function search(project, params, projection) {
79
79
  return (repos) => __awaiter(this, void 0, void 0, function* () {
80
80
  var _a, _b;
81
- let serviceOutputs;
81
+ let permitsWithAccountDetail;
82
82
  // アウトプット検索条件のプロジェクトは強制的に上書き
83
83
  const searchConditions = Object.assign(Object.assign({}, params), { project: { id: { $eq: project.id } } });
84
84
  const productType = (_b = (_a = params.issuedThrough) === null || _a === void 0 ? void 0 : _a.typeOf) === null || _b === void 0 ? void 0 : _b.$eq;
85
85
  switch (productType) {
86
86
  case factory.product.ProductType.PaymentCard:
87
- serviceOutputs = yield repos.serviceOutput.search(searchConditions, projection);
87
+ const permits = yield repos.serviceOutput.search(searchConditions, projection);
88
+ permitsWithAccountDetail = permits;
88
89
  // 口座詳細取得
89
- const accountNumbers = serviceOutputs.map((s) => { var _a; return (_a = s.paymentAccount) === null || _a === void 0 ? void 0 : _a.accountNumber; })
90
- .filter((a) => typeof a === 'string');
90
+ const accountNumbers = permits.map((permit) => { var _a; return (_a = permit.paymentAccount) === null || _a === void 0 ? void 0 : _a.accountNumber; })
91
+ .filter((accountNumber) => typeof accountNumber === 'string');
91
92
  if (accountNumbers.length > 0) {
92
93
  const accounts = yield repos.account.search({
93
94
  project: { id: { $eq: project.id } },
94
95
  accountNumbers: accountNumbers
95
96
  });
96
- serviceOutputs = serviceOutputs.map((s) => {
97
- const account = accounts.find((a) => { var _a; return a.accountNumber === ((_a = s.paymentAccount) === null || _a === void 0 ? void 0 : _a.accountNumber); });
98
- return Object.assign(Object.assign({}, s), (account !== undefined)
99
- ? { paymentAccount: account }
100
- : undefined);
97
+ permitsWithAccountDetail = permits.map((permit) => {
98
+ const account = accounts.find((a) => { var _a; return a.accountNumber === ((_a = permit.paymentAccount) === null || _a === void 0 ? void 0 : _a.accountNumber); });
99
+ const paymentAccount = (typeof (account === null || account === void 0 ? void 0 : account.typeOf) === 'string')
100
+ ? {
101
+ accountNumber: account.accountNumber,
102
+ availableBalance: account.availableBalance,
103
+ balance: account.balance,
104
+ typeOf: account.typeOf
105
+ }
106
+ : undefined;
107
+ return Object.assign(Object.assign({}, permit), { paymentAccount });
101
108
  });
102
109
  }
103
110
  break;
104
111
  default:
105
- serviceOutputs = yield repos.serviceOutput.search(searchConditions, projection);
112
+ permitsWithAccountDetail = (yield repos.serviceOutput.search(searchConditions, projection));
106
113
  }
107
- return serviceOutputs;
114
+ return permitsWithAccountDetail;
108
115
  });
109
116
  }
110
117
  exports.search = search;
@@ -28,37 +28,6 @@ function onReservationUsed(action, attendedReservation) {
28
28
  return (repos) => __awaiter(this, void 0, void 0, function* () {
29
29
  const tasks = [];
30
30
  const now = new Date();
31
- // INFORM_USE_RESERVATION_URL廃止(2023-01-30~)
32
- // アクション通知タスク作成
33
- // if (Array.isArray(informUseReservations)) {
34
- // informUseReservations.filter((informUseReservation) => {
35
- // return typeof informUseReservation.recipient?.url === 'string'
36
- // && informUseReservation.recipient.url.length > 0;
37
- // })
38
- // .forEach((informUseReservation) => {
39
- // const triggerWebhookTask: factory.task.triggerWebhook.IAttributes = {
40
- // project: action.project,
41
- // name: factory.taskName.TriggerWebhook,
42
- // status: factory.taskStatus.Ready,
43
- // runsAt: now,
44
- // remainingNumberOfTries: 3,
45
- // numberOfTried: 0,
46
- // executionResults: [],
47
- // data: {
48
- // project: action.project,
49
- // typeOf: factory.actionType.InformAction,
50
- // agent: action.project,
51
- // recipient: {
52
- // typeOf: factory.personType.Person,
53
- // id: String(informUseReservation.recipient?.url),
54
- // url: String(informUseReservation.recipient?.url)
55
- // },
56
- // object: action
57
- // }
58
- // };
59
- // tasks.push(triggerWebhookTask);
60
- // });
61
- // }
62
31
  // inform galobally
63
32
  if (Array.isArray(informReservations)) {
64
33
  // やや遅延させる(確定通知が未達の可能性を考慮して)
@@ -100,29 +69,32 @@ function onReservationUsed(action, attendedReservation) {
100
69
  };
101
70
  }));
102
71
  }
72
+ // projectを限定する(2023-02-21~)
103
73
  // 使用アクション集計タスクを作成する(冗長な作成を避ける)
104
- const readyAggregateUseActionsTaskDoc = yield repos.task.taskModel.findOne({
105
- 'project.id': { $eq: action.project.id },
106
- name: { $eq: factory.taskName.AggregateUseActionsOnEvent },
107
- status: { $eq: factory.taskStatus.Ready },
108
- 'data.id': { $exists: true, $eq: attendedReservation.reservationFor.id }
109
- }, { _id: 1 })
110
- .exec();
111
- if (readyAggregateUseActionsTaskDoc === null) {
112
- const aggregateUseActionsTask = {
113
- project: attendedReservation.project,
114
- name: factory.taskName.AggregateUseActionsOnEvent,
115
- status: factory.taskStatus.Ready,
116
- runsAt: now,
117
- remainingNumberOfTries: 3,
118
- numberOfTried: 0,
119
- executionResults: [],
120
- data: {
121
- typeOf: attendedReservation.reservationFor.typeOf,
122
- id: attendedReservation.reservationFor.id
123
- }
124
- };
125
- tasks.push(aggregateUseActionsTask);
74
+ if (settings_1.settings.useAggregateEntranceGateProjects.includes(action.project.id)) {
75
+ const readyAggregateUseActionsTaskDoc = yield repos.task.taskModel.findOne({
76
+ 'project.id': { $eq: action.project.id },
77
+ name: { $eq: factory.taskName.AggregateUseActionsOnEvent },
78
+ status: { $eq: factory.taskStatus.Ready },
79
+ 'data.id': { $exists: true, $eq: attendedReservation.reservationFor.id }
80
+ }, { _id: 1 })
81
+ .exec();
82
+ if (readyAggregateUseActionsTaskDoc === null) {
83
+ const aggregateUseActionsTask = {
84
+ project: attendedReservation.project,
85
+ name: factory.taskName.AggregateUseActionsOnEvent,
86
+ status: factory.taskStatus.Ready,
87
+ runsAt: now,
88
+ remainingNumberOfTries: 3,
89
+ numberOfTried: 0,
90
+ executionResults: [],
91
+ data: {
92
+ typeOf: attendedReservation.reservationFor.typeOf,
93
+ id: attendedReservation.reservationFor.id
94
+ }
95
+ };
96
+ tasks.push(aggregateUseActionsTask);
97
+ }
126
98
  }
127
99
  if (tasks.length > 0) {
128
100
  yield repos.task.saveMany(tasks);
@@ -14,6 +14,7 @@ const factory = require("../../factory");
14
14
  const event_1 = require("../../repo/event");
15
15
  const screeningEvent_1 = require("../../repo/itemAvailability/screeningEvent");
16
16
  const offer_1 = require("../../repo/offer");
17
+ const offerCatalog_1 = require("../../repo/offerCatalog");
17
18
  const place_1 = require("../../repo/place");
18
19
  const product_1 = require("../../repo/product");
19
20
  const project_1 = require("../../repo/project");
@@ -33,6 +34,7 @@ function call(data) {
33
34
  event: new event_1.MongoRepository(settings.connection),
34
35
  eventAvailability: new screeningEvent_1.RedisRepository(settings.redisClient),
35
36
  offer: new offer_1.MongoRepository(settings.connection),
37
+ offerCatalog: new offerCatalog_1.MongoRepository(settings.connection),
36
38
  offerRateLimit: new offer_2.RedisRepository(settings.redisClient),
37
39
  place: new place_1.MongoRepository(settings.connection),
38
40
  product: new product_1.MongoRepository(settings.connection),
@@ -328,7 +328,6 @@ function processMoneyTransferTransaction(params) {
328
328
  toLocation,
329
329
  pendingTransaction: {
330
330
  typeOf: factory.account.transactionType.Transfer,
331
- id: '',
332
331
  transactionNumber: params.transactionNumber
333
332
  },
334
333
  force: false
@@ -213,12 +213,12 @@ function processAuthorizeProductOffer(params) {
213
213
  };
214
214
  // オファーにポイント特典設定があるかどうか確認
215
215
  let pointAward;
216
- const offers = yield OfferService.product.search({
216
+ const { offers } = yield OfferService.product.search({
217
217
  project: { id: params.project.id },
218
218
  itemOffered: { id: params.product.id },
219
219
  seller: { id: String(seller.id) },
220
220
  onlyValid: true,
221
- sort: false // ソート不要(2023-01-27~)
221
+ addSortIndex: false
222
222
  })(repos);
223
223
  const acceptedProductOffer = offers.find((o) => o.identifier === acceptedOffer.identifier);
224
224
  if (acceptedProductOffer === undefined) {
@@ -245,18 +245,17 @@ function processAuthorizeProductOffer(params) {
245
245
  }
246
246
  pointAward = {
247
247
  typeOf: factory.actionType.MoneyTransfer,
248
- // Permit識別子を指定する
249
248
  toLocation: {
250
249
  identifier: String(toPermit.identifier),
251
- // 発行サービス指定
252
- issuedThrough: { id: toLocationIssuedThroughId }
250
+ issuedThrough: { id: toLocationIssuedThroughId },
251
+ typeOf: factory.permit.PermitType.Permit
253
252
  },
254
253
  recipient: {
255
254
  id: customer.id,
256
255
  name: `${customer.givenName} ${customer.familyName}`,
257
256
  typeOf: customer.typeOf
258
257
  },
259
- // ポイント特典識別子を指定(ユニークネスを保証するため)
258
+ // 特典識別子を指定(ユニークネスを保証するため)
260
259
  purpose: { identifier }
261
260
  };
262
261
  }
@@ -21,6 +21,10 @@ export declare type ISettings = factory.project.ISettings & {
21
21
  userPoolIdOld: string;
22
22
  userPoolIdNew: string;
23
23
  maxNumCreditCardPaymentMethod?: number;
24
+ useAggregateEntranceGateProjects: string[];
25
+ useAggregateOfferProjects: string[];
26
+ useOfferRateLimitProjects: string[];
27
+ useCheckMovieTicketBeforePay: boolean;
24
28
  };
25
29
  export declare const DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD: string;
26
30
  export declare const USE_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
@@ -54,7 +54,7 @@ exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = process.env.USE_PAY_ASSET_TR
54
54
  /**
55
55
  * グローバル設定
56
56
  */
57
- exports.settings = Object.assign({ transactionWebhookUrls, onOrderStatusChanged: {
57
+ exports.settings = Object.assign(Object.assign({ transactionWebhookUrls, onOrderStatusChanged: {
58
58
  informOrder: informOrderUrls
59
59
  .filter((url) => url.length > 0)
60
60
  .map((url) => {
@@ -94,4 +94,10 @@ exports.settings = Object.assign({ transactionWebhookUrls, onOrderStatusChanged:
94
94
  timeout: triggerWebhookTimeout
95
95
  }, maximumReservationGracePeriodInDays: MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS, userPoolIdOld: String(process.env.USERPOOL_ID_OLD), userPoolIdNew: String(process.env.USERPOOL_ID_NEW) }, (typeof MAX_NUM_CREDIT_CARD_PAYMENT_METHOD === 'number')
96
96
  ? { maxNumCreditCardPaymentMethod: MAX_NUM_CREDIT_CARD_PAYMENT_METHOD }
97
- : undefined);
97
+ : undefined), { useAggregateEntranceGateProjects: (typeof process.env.USE_AGGREGATE_ENTRANCE_GATE_PROJECTS === 'string')
98
+ ? process.env.USE_AGGREGATE_ENTRANCE_GATE_PROJECTS.split(',')
99
+ : [], useAggregateOfferProjects: (typeof process.env.USE_AGGREGATE_OFFER_PROJECTS === 'string')
100
+ ? process.env.USE_AGGREGATE_OFFER_PROJECTS.split(',')
101
+ : [], useOfferRateLimitProjects: (typeof process.env.USE_OFFER_RATE_LIMIT_PROJECTS === 'string')
102
+ ? process.env.USE_OFFER_RATE_LIMIT_PROJECTS.split(',')
103
+ : [], useCheckMovieTicketBeforePay: process.env.USE_CHECK_MOVIE_TICKET_BEFORE_PAY === '1' });
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.289.0-alpha.7",
13
- "@cinerino/sdk": "3.140.0-alpha.9",
12
+ "@chevre/factory": "4.295.0",
13
+ "@cinerino/sdk": "3.144.2",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.4.0-alpha.8"
123
+ "version": "20.4.0"
124
124
  }
@@ -1,157 +0,0 @@
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
- // const project = { id: String(process.env.PROJECT_ID) };
8
- const EXCLUDED_PROJECT_ID = process.env.EXCLUDED_PROJECT_ID;
9
-
10
- // tslint:disable-next-line:max-func-body-length
11
- async function main() {
12
- await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
13
-
14
- const accountTitleRepo = new chevre.repository.AccountTitle(mongoose.connection);
15
-
16
- const cursor = accountTitleRepo.getCursor(
17
- {
18
- // 'project.id': { $eq: project.id },
19
- 'project.id': { $ne: EXCLUDED_PROJECT_ID }
20
- // typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries },
21
- // starDate: { $gte: new Date() }
22
- // _id: { $eq: 'al6aff83w' }
23
- },
24
- {
25
- // _id: 1,
26
- }
27
- );
28
- console.log('accountTitles found');
29
-
30
- const additionalPropertyNamesOnCategories: string[] = [];
31
- const additionalPropertyNames: string[] = [];
32
- const additionalPropertyNamesOnTitles: string[] = [];
33
- const projectIdsOnCategories: string[] = [];
34
- const projectIds: string[] = [];
35
- const projectIdsOnTitles: string[] = [];
36
- const unexpextedprojectIdsOnCategories: string[] = [];
37
- const unexpextedprojectIds: string[] = [];
38
- const unexpextedprojectIdsOnTitles: string[] = [];
39
-
40
- let i = 0;
41
- let updateCount = 0;
42
- // tslint:disable-next-line:max-func-body-length
43
- await cursor.eachAsync(async (doc) => {
44
- i += 1;
45
- const accountTitleCategory: chevre.factory.accountTitle.IAccountTitle = doc.toObject();
46
-
47
- const additionalPropertyNamesOnCategory = accountTitleCategory.additionalProperty?.map((p) => p.name);
48
- console.log(
49
- (Array.isArray(additionalPropertyNamesOnCategory)) ? additionalPropertyNamesOnCategory.length : 0,
50
- 'additionalPropertyNamesOnCategory found',
51
- accountTitleCategory.project.id,
52
- accountTitleCategory.codeValue
53
- );
54
- if (Array.isArray(additionalPropertyNamesOnCategory) && additionalPropertyNamesOnCategory.length > 0) {
55
- console.log(
56
- additionalPropertyNamesOnCategory.length,
57
- 'additionalPropertyNamesOnResource found',
58
- accountTitleCategory.project.id,
59
- accountTitleCategory.codeValue
60
- );
61
- additionalPropertyNamesOnCategories.push(...additionalPropertyNamesOnCategory);
62
- projectIdsOnCategories.push(accountTitleCategory.project.id);
63
- additionalPropertyNamesOnCategory.forEach((name) => {
64
- if (!name.match(/^[a-zA-Z]*$/)) {
65
- // throw new Error(`not matched ${creativeWork.project.id} ${creativeWork.id}`);
66
- unexpextedprojectIdsOnCategories.push(accountTitleCategory.project.id);
67
- }
68
- // tslint:disable-next-line:no-magic-numbers
69
- if (name.length < 5) {
70
- // throw new Error(`length matched ${creativeWork.project.id} ${creativeWork.id} ${name}`);
71
- unexpextedprojectIdsOnCategories.push(accountTitleCategory.project.id);
72
- }
73
- });
74
- }
75
-
76
- if (Array.isArray(accountTitleCategory.hasCategoryCode)) {
77
- accountTitleCategory.hasCategoryCode.forEach((accountTitleSet) => {
78
- const additionalPropertyNamesOnResource = accountTitleSet.additionalProperty?.map((p) => p.name);
79
- console.log(
80
- (Array.isArray(additionalPropertyNamesOnResource)) ? additionalPropertyNamesOnResource.length : 0,
81
- 'additionalPropertyNamesOnResource found',
82
- accountTitleCategory.project.id,
83
- accountTitleCategory.codeValue
84
- );
85
- if (Array.isArray(additionalPropertyNamesOnResource) && additionalPropertyNamesOnResource.length > 0) {
86
- console.log(
87
- additionalPropertyNamesOnResource.length,
88
- 'additionalPropertyNamesOnResource found',
89
- accountTitleCategory.project.id,
90
- accountTitleCategory.codeValue
91
- );
92
- additionalPropertyNames.push(...additionalPropertyNamesOnResource);
93
- projectIds.push(accountTitleCategory.project.id);
94
- additionalPropertyNamesOnResource.forEach((name) => {
95
- if (!name.match(/^[a-zA-Z]*$/)) {
96
- // throw new Error(`not matched ${creativeWork.project.id} ${creativeWork.id}`);
97
- unexpextedprojectIds.push(accountTitleCategory.project.id);
98
- }
99
- // tslint:disable-next-line:no-magic-numbers
100
- if (name.length < 5) {
101
- // throw new Error(`length matched ${creativeWork.project.id} ${creativeWork.id} ${name}`);
102
- unexpextedprojectIds.push(accountTitleCategory.project.id);
103
- }
104
- });
105
- }
106
-
107
- if (Array.isArray(accountTitleSet.hasCategoryCode)) {
108
- accountTitleSet.hasCategoryCode.forEach((accountTitl) => {
109
- const additionalPropertyNamesOnSection = accountTitl.additionalProperty?.map((p) => p.name);
110
- console.log(
111
- (Array.isArray(additionalPropertyNamesOnSection)) ? additionalPropertyNamesOnSection.length : 0,
112
- 'additionalPropertyNamesOnSection found',
113
- accountTitleCategory.project.id,
114
- accountTitleCategory.codeValue
115
- );
116
- if (Array.isArray(additionalPropertyNamesOnSection) && additionalPropertyNamesOnSection.length > 0) {
117
- console.log(
118
- additionalPropertyNamesOnSection.length,
119
- 'additionalPropertyNamesOnSection found',
120
- accountTitleCategory.project.id,
121
- accountTitleCategory.codeValue
122
- );
123
- additionalPropertyNamesOnTitles.push(...additionalPropertyNamesOnSection);
124
- projectIdsOnTitles.push(accountTitleCategory.project.id);
125
- additionalPropertyNamesOnSection.forEach((name) => {
126
- if (!name.match(/^[a-zA-Z]*$/)) {
127
- // throw new Error(`not matched ${creativeWork.project.id} ${creativeWork.id}`);
128
- unexpextedprojectIdsOnTitles.push(accountTitleCategory.project.id);
129
- }
130
- // tslint:disable-next-line:no-magic-numbers
131
- if (name.length < 5) {
132
- // throw new Error(`length matched ${creativeWork.project.id} ${creativeWork.id} ${name}`);
133
- unexpextedprojectIdsOnTitles.push(accountTitleCategory.project.id);
134
- }
135
- });
136
- }
137
- });
138
- }
139
- });
140
- }
141
- });
142
- console.log(i, 'places checked');
143
- console.log(updateCount, 'places updated');
144
- console.log([...new Set(additionalPropertyNamesOnCategories)], 'categories');
145
- console.log([...new Set(projectIdsOnCategories)], 'categories');
146
- console.log([...new Set(unexpextedprojectIdsOnCategories)], 'categories');
147
- console.log([...new Set(additionalPropertyNames)], 'sets');
148
- console.log([...new Set(projectIds)], 'sets');
149
- console.log([...new Set(unexpextedprojectIds)], 'sets');
150
- console.log([...new Set(additionalPropertyNamesOnTitles)], 'titles');
151
- console.log([...new Set(projectIdsOnTitles)], 'titles');
152
- console.log([...new Set(unexpextedprojectIdsOnTitles)], 'titles');
153
- }
154
-
155
- main()
156
- .then()
157
- .catch(console.error);
@@ -1,14 +0,0 @@
1
- /**
2
- * 決済取引サービス
3
- */
4
- import * as factory from '../../../../factory';
5
- import { MongoRepository as EventRepo } from '../../../../repo/event';
6
- import { MongoRepository as ProductRepo } from '../../../../repo/product';
7
- import { MongoRepository as ProjectRepo } from '../../../../repo/project';
8
- import { MongoRepository as SellerRepo } from '../../../../repo/seller';
9
- export declare function validateMovieTicket(params: factory.assetTransaction.pay.IStartParamsWithoutDetail, paymentServiceId: string): (repos: {
10
- event: EventRepo;
11
- product: ProductRepo;
12
- project: ProjectRepo;
13
- seller: SellerRepo;
14
- }) => Promise<import("../../../payment/movieTicket").ICheckResult>;
@@ -1,6 +0,0 @@
1
- import { IOperation } from '../task';
2
- import * as factory from '../../factory';
3
- /**
4
- * タスク実行関数
5
- */
6
- export declare function call(data: factory.task.IData<factory.taskName.DeleteAuthorization>): IOperation<void>;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.call = void 0;
13
- const action_1 = require("../../repo/action");
14
- const code_1 = require("../../repo/code");
15
- const CodeService = require("../code");
16
- /**
17
- * タスク実行関数
18
- */
19
- function call(data) {
20
- return (settings) => __awaiter(this, void 0, void 0, function* () {
21
- const actionRepo = new action_1.MongoRepository(settings.connection);
22
- const authorizationRepoRepo = new code_1.MongoRepository(settings.connection);
23
- yield CodeService.deleteAuthorization(data)({
24
- action: actionRepo,
25
- authorization: authorizationRepoRepo
26
- });
27
- });
28
- }
29
- exports.call = call;