@chevre/domain 23.2.0-alpha.6 → 23.2.0-alpha.60

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 (133) hide show
  1. package/example/src/chevre/acceptedPaymentMethodOffer/adminAcceptedPaymentMethodOffers.ts +25 -17
  2. package/example/src/chevre/confirmationNumber/testRandomness.ts +49 -0
  3. package/example/src/chevre/emailMessage/createEmailMessageText.ts +63 -0
  4. package/example/src/chevre/event/importEventsFromCOAByTitle.ts +2 -2
  5. package/example/src/chevre/event/unsetSuperEventVideoFormat.ts +30 -0
  6. package/example/src/chevre/eventSeries/unsetVideoFormat.ts +31 -0
  7. package/example/src/chevre/{upsertScreeningEventSeriesByVersion.ts → eventSeries/upsertScreeningEventSeriesByVersion.ts} +47 -43
  8. package/example/src/chevre/{upsertOfferCatalogItemsByIdentifier.ts → offerCatalog/upsertOfferCatalogItemsByIdentifier.ts} +6 -3
  9. package/example/src/chevre/{upsertOfferCatalogsByIdentifier.ts → offerCatalog/upsertOfferCatalogsByIdentifier.ts} +8 -3
  10. package/example/src/chevre/{upsertOffersByIdentifier.ts → offers/upsertOffersByIdentifier.ts} +5 -3
  11. package/example/src/chevre/orderNumber/decryptOrderNumber.ts +14 -0
  12. package/example/src/chevre/orderNumber/testRandomness.ts +54 -0
  13. package/example/src/chevre/place/adminEntranceGates.ts +69 -0
  14. package/example/src/chevre/place/checkEntranceGatesCount.ts +82 -0
  15. package/example/src/chevre/place/findRooms.ts +24 -0
  16. package/example/src/chevre/place/findSections.ts +28 -0
  17. package/example/src/chevre/place/migrateSectionIdentifier.ts +92 -0
  18. package/example/src/chevre/place/seatsJson2csv.ts +63 -0
  19. package/example/src/chevre/place/upsertMovieTheatersByBranchCode.ts +41 -0
  20. package/example/src/chevre/place/upsertRoomsByBranchCode.ts +40 -0
  21. package/example/src/chevre/place/upsertSeatSectionsByBranchCode.ts +56 -0
  22. package/example/src/chevre/reIndex.ts +1 -1
  23. package/example/src/chevre/roles/addAdminAcceptedPaymentMethodReadPermissionIfNotExists.ts +33 -0
  24. package/example/src/chevre/roles/addAdminAcceptedPaymentMethodWritePermissionIfNotExists.ts +33 -0
  25. package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +49 -0
  26. package/example/src/chevre/roles/addAdminRoomReadPermissionIfNotExists.ts +34 -0
  27. package/example/src/chevre/roles/addAdminRoomWritePermissionIfNotExists.ts +34 -0
  28. package/example/src/chevre/settings/addOrderNumberSetting.ts +44 -0
  29. package/example/src/chevre/settings/addTransactionNumberSetting.ts +40 -0
  30. package/example/src/chevre/transactionNumber/publishByTimestamp.ts +23 -0
  31. package/example/src/chevre/transactionNumber/testRandomness.ts +42 -0
  32. package/example/src/chevre/unsetUnnecessaryFields.ts +8 -4
  33. package/lib/chevre/emailMessageBuilder.js +1 -0
  34. package/lib/chevre/factory/event.d.ts +1 -1
  35. package/lib/chevre/factory/event.js +11 -5
  36. package/lib/chevre/factory/transactionNumber.d.ts +19 -0
  37. package/lib/chevre/factory/transactionNumber.js +54 -0
  38. package/lib/chevre/repo/acceptedPaymentMethod.d.ts +41 -8
  39. package/lib/chevre/repo/acceptedPaymentMethod.js +72 -27
  40. package/lib/chevre/repo/aggregateOffer.d.ts +6 -1
  41. package/lib/chevre/repo/aggregateOffer.js +11 -3
  42. package/lib/chevre/repo/aggregateOrder.js +0 -93
  43. package/lib/chevre/repo/aggregateReservation.d.ts +0 -1
  44. package/lib/chevre/repo/aggregateReservation.js +0 -2
  45. package/lib/chevre/repo/confirmationNumber.d.ts +1 -0
  46. package/lib/chevre/repo/confirmationNumber.js +32 -25
  47. package/lib/chevre/repo/event.d.ts +3 -3
  48. package/lib/chevre/repo/event.js +20 -8
  49. package/lib/chevre/repo/eventOffer.d.ts +8 -0
  50. package/lib/chevre/repo/eventOffer.js +11 -0
  51. package/lib/chevre/repo/eventSeries.d.ts +18 -25
  52. package/lib/chevre/repo/eventSeries.js +155 -101
  53. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -1
  54. package/lib/chevre/repo/mongoose/schemas/eventSeries.js +13 -25
  55. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +2 -8
  56. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +28 -2
  57. package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -2
  58. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +40 -0
  59. package/lib/chevre/repo/mongoose/schemas/setting.js +3 -0
  60. package/lib/chevre/repo/offerCatalog.d.ts +14 -1
  61. package/lib/chevre/repo/offerCatalog.js +41 -19
  62. package/lib/chevre/repo/offerCatalogItem.d.ts +10 -1
  63. package/lib/chevre/repo/offerCatalogItem.js +32 -17
  64. package/lib/chevre/repo/orderNumber.d.ts +7 -0
  65. package/lib/chevre/repo/orderNumber.js +110 -34
  66. package/lib/chevre/repo/place/entranceGate.d.ts +57 -0
  67. package/lib/chevre/repo/place/entranceGate.js +172 -0
  68. package/lib/chevre/repo/place/movieTheater.d.ts +40 -3
  69. package/lib/chevre/repo/place/movieTheater.js +77 -6
  70. package/lib/chevre/repo/place/screeningRoom.d.ts +60 -31
  71. package/lib/chevre/repo/place/screeningRoom.js +227 -135
  72. package/lib/chevre/repo/place/seat.d.ts +47 -45
  73. package/lib/chevre/repo/place/seat.js +175 -45
  74. package/lib/chevre/repo/place/section.d.ts +60 -30
  75. package/lib/chevre/repo/place/section.js +337 -127
  76. package/lib/chevre/repo/serviceOutputIdentifier.d.ts +3 -1
  77. package/lib/chevre/repo/serviceOutputIdentifier.js +42 -27
  78. package/lib/chevre/repo/setting.d.ts +1 -1
  79. package/lib/chevre/repo/setting.js +2 -2
  80. package/lib/chevre/repo/task.d.ts +1 -1
  81. package/lib/chevre/repo/transactionNumber.d.ts +5 -0
  82. package/lib/chevre/repo/transactionNumber.js +63 -27
  83. package/lib/chevre/repository.d.ts +8 -0
  84. package/lib/chevre/repository.js +16 -0
  85. package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +10 -2
  86. package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +1 -1
  87. package/lib/chevre/service/event/processUpdateMovieTheater.js +13 -11
  88. package/lib/chevre/service/event/saveScreeningEventSeries.js +4 -5
  89. package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -2
  90. package/lib/chevre/service/event/saveScreeningEvents.js +16 -12
  91. package/lib/chevre/service/offer/event/authorize/factory.js +9 -1
  92. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +7 -4
  93. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +9 -6
  94. package/lib/chevre/service/offer/event/searchOffersByIds.js +7 -4
  95. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +7 -1
  96. package/lib/chevre/service/offer/onEventChanged.js +10 -6
  97. package/lib/chevre/service/offer/product.js +1 -1
  98. package/lib/chevre/service/offer.d.ts +5 -0
  99. package/lib/chevre/service/offer.js +34 -9
  100. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  101. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  102. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  103. package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +2 -2
  104. package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.js +5 -3
  105. package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +4 -2
  106. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +13 -0
  107. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +53 -0
  108. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +13 -0
  109. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +56 -0
  110. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +15 -0
  111. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +58 -0
  112. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +17 -0
  113. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +75 -0
  114. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +19 -0
  115. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +60 -0
  116. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +20 -0
  117. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +51 -0
  118. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +27 -0
  119. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +100 -0
  120. package/lib/chevre/service/task/onResourceDeleted.d.ts +6 -0
  121. package/lib/chevre/service/task/onResourceDeleted.js +168 -0
  122. package/lib/chevre/service/task/onResourceUpdated.js +205 -42
  123. package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
  124. package/lib/chevre/service/taskHandler.js +1 -0
  125. package/package.json +10 -8
  126. package/example/src/chevre/event/upsertManyScreeningEventByIdentifier.ts +0 -191
  127. package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +0 -93
  128. package/example/src/chevre/offers/createSampleOffers.ts +0 -154
  129. package/example/src/chevre/settings/addSettings.ts +0 -46
  130. package/lib/chevre/service/eventOld.d.ts +0 -60
  131. package/lib/chevre/service/eventOld.js +0 -864
  132. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +0 -45
  133. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +0 -447
@@ -1,93 +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 DEFAULT_PAYMENT_METHOD_TYPE_FOR_MOVIE_TICKET = 'MovieTicket';
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 eventSeriesRepo = await chevre.repository.EventSeries.createInstance(mongoose.connection);
15
-
16
- const cursor = eventSeriesRepo.getCursor(
17
- {
18
- 'project.id': { $eq: 'xxx' },
19
- 'offers.unacceptedPaymentMethod': {
20
- $exists: true,
21
- $ne: DEFAULT_PAYMENT_METHOD_TYPE_FOR_MOVIE_TICKET
22
- },
23
- startDate: {
24
- $lte: moment()
25
- .add(-1, 'year')
26
- .toDate()
27
- }
28
- // _id: { $eq: 'bliy11ffa' }
29
- },
30
- {
31
- // _id: 1,
32
- // offers: 1,
33
- // startDate: 1,
34
- // project: 1,
35
- // typeOf: 1
36
- }
37
- );
38
- console.log('docs found');
39
-
40
- let i = 0;
41
- let updateCount = 0;
42
- await cursor.eachAsync(async (doc) => {
43
- i += 1;
44
- const eventSeries: Pick<
45
- chevre.factory.eventSeries.IEvent,
46
- 'id' | 'offers' | 'startDate' | 'project' | 'typeOf'
47
- > = doc.toObject();
48
-
49
- console.log(
50
- 'alreadyMigrated?', eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
51
- const unacceptedPaymentMethod = eventSeries.offers?.unacceptedPaymentMethod;
52
- const alreadyMigrated = !Array.isArray(unacceptedPaymentMethod)
53
- || (Array.isArray(unacceptedPaymentMethod)
54
- && unacceptedPaymentMethod.every(
55
- (paymentMethodType) => paymentMethodType === DEFAULT_PAYMENT_METHOD_TYPE_FOR_MOVIE_TICKET
56
- ));
57
-
58
- if (alreadyMigrated) {
59
- console.log(
60
- 'already migrated.', eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
61
- } else {
62
- if (Array.isArray(unacceptedPaymentMethod)) {
63
- const newUnacceptedPaymentMethod = unacceptedPaymentMethod.filter(
64
- (paymentMethod) => paymentMethod === DEFAULT_PAYMENT_METHOD_TYPE_FOR_MOVIE_TICKET
65
- );
66
- console.log(
67
- 'updating project...',
68
- newUnacceptedPaymentMethod,
69
- eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
70
- await eventSeriesRepo.saveEventSeries({
71
- id: eventSeries.id,
72
- attributes: <any>{
73
- ...{
74
- typeOf: eventSeries.typeOf,
75
- 'offers.unacceptedPaymentMethod': newUnacceptedPaymentMethod
76
- }
77
- }
78
- });
79
- updateCount += 1;
80
- console.log(
81
- 'updated.',
82
- eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
83
- }
84
- }
85
- });
86
-
87
- console.log(i, 'docs checked');
88
- console.log(updateCount, 'docs updated');
89
- }
90
-
91
- main()
92
- .then()
93
- .catch(console.error);
@@ -1,154 +0,0 @@
1
- // tslint:disable:no-console
2
- import * as mongoose from 'mongoose';
3
-
4
- import { chevre } from '../../../../lib/index';
5
-
6
- const project = { id: String(process.env.PROJECT_ID) };
7
- const NUM_CREATE_OFFERS = 300;
8
- const NUM_CREATE_SUB_CATALOGS = 10;
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 aggregateOfferRepo = await chevre.repository.AggregateOffer.createInstance(mongoose.connection);
15
- const offerCatalogRepo = await chevre.repository.OfferCatalog.createInstance(mongoose.connection);
16
- const productRepo = await chevre.repository.Product.createInstance(mongoose.connection);
17
- const offerCatalogItemRepo = await chevre.repository.OfferCatalogItem.createInstance(mongoose.connection);
18
-
19
- const savingOffers: Omit<chevre.factory.unitPriceOffer.IUnitPriceOffer, 'id'>[] =
20
- // tslint:disable-next-line:prefer-array-literal
21
- [...Array(NUM_CREATE_OFFERS)].map<Omit<chevre.factory.unitPriceOffer.IUnitPriceOffer, 'id'>>((__, i) => {
22
- const identifier = `sampleFreeOffer${i}`;
23
- const priceSpecification: chevre.factory.unitPriceOffer.IUnitPriceOfferPriceSpecification = {
24
- typeOf: chevre.factory.priceSpecificationType.UnitPriceSpecification,
25
- priceCurrency: chevre.factory.priceCurrency.JPY,
26
- valueAddedTaxIncluded: true,
27
- price: 0,
28
- referenceQuantity: {
29
- value: 1,
30
- typeOf: 'QuantitativeValue',
31
- unitCode: chevre.factory.unitCode.C62
32
- },
33
- accounting: {
34
- typeOf: 'Accounting',
35
- accountsReceivable: 0
36
- }
37
- };
38
-
39
- return {
40
- project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
41
- typeOf: chevre.factory.offerType.Offer,
42
- identifier,
43
- description: { en: identifier, ja: identifier },
44
- alternateName: { ja: identifier },
45
- name: { en: identifier, ja: identifier },
46
- availability: chevre.factory.itemAvailability.InStock,
47
- availableAtOrFrom: [
48
- { id: '51qbjcfr72h62m06vtv5kkhgje' }
49
- ],
50
- itemOffered: { typeOf: chevre.factory.product.ProductType.EventService },
51
- priceCurrency: chevre.factory.priceCurrency.JPY,
52
- priceSpecification
53
- };
54
- });
55
- const saveOfferResult = await aggregateOfferRepo.upsertByIdentifier(savingOffers);
56
- console.log('saveOfferResult:', saveOfferResult);
57
-
58
- const offerIds: string[] = (Array.isArray(saveOfferResult?.modifiedOffers)) ? saveOfferResult.modifiedOffers.map(({ id }) => id) : [];
59
- const catalogIdentifier = 'sampleFreeOffersCatalog';
60
- const savingOfferCatalog: chevre.factory.offerCatalog.IOfferCatalog = {
61
- project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
62
- typeOf: 'OfferCatalog',
63
- identifier: catalogIdentifier,
64
- description: { en: catalogIdentifier, ja: catalogIdentifier },
65
- name: { en: catalogIdentifier, ja: catalogIdentifier },
66
- itemListElement: offerIds.map((id) => ({ id, typeOf: chevre.factory.offerType.Offer })),
67
- itemOffered: { typeOf: chevre.factory.product.ProductType.EventService }
68
- };
69
- const saveCatalogResult = await offerCatalogRepo.saveByIdentifier(savingOfferCatalog);
70
- console.log('saveCatalogResult:', saveCatalogResult);
71
-
72
- const productId = 'sampleFreeEventService';
73
- const savingProduct: chevre.factory.product.IProduct & {
74
- offers?: never;
75
- } = {
76
- project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
77
- typeOf: chevre.factory.product.ProductType.EventService,
78
- name: { en: productId, ja: productId },
79
- productID: productId,
80
- hasOfferCatalog: {
81
- typeOf: 'OfferCatalog',
82
- itemListElement: [{ id: saveCatalogResult.id }]
83
- }
84
- };
85
- const saveProductResult = await productRepo.upsertManyByProductId([{
86
- $set: savingProduct
87
- }]);
88
- console.log('saveProductResult:', saveProductResult);
89
-
90
- // 以下サブカタログ
91
- const offerIds4subCatalog: string[] = (Array.isArray(saveOfferResult?.modifiedOffers))
92
- // tslint:disable-next-line:no-magic-numbers
93
- ? saveOfferResult.modifiedOffers.slice(0, 100)
94
- .map(({ id }) => id) :
95
- [];
96
- const savingSubOfferCatalogs: chevre.factory.offerCatalog.IOfferCatalog[] =
97
- // tslint:disable-next-line:prefer-array-literal
98
- [...Array(NUM_CREATE_SUB_CATALOGS)].map<chevre.factory.offerCatalog.IOfferCatalog>((__, i) => {
99
- const subCatalogIdentifier = `sampleFreeOffersSubCatalog${i}`;
100
-
101
- return {
102
- project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
103
- typeOf: 'OfferCatalog',
104
- identifier: subCatalogIdentifier,
105
- description: { en: subCatalogIdentifier, ja: subCatalogIdentifier },
106
- name: { en: subCatalogIdentifier, ja: subCatalogIdentifier },
107
- itemListElement: offerIds4subCatalog.map((id) => ({ id, typeOf: chevre.factory.offerType.Offer })),
108
- itemOffered: { typeOf: chevre.factory.product.ProductType.EventService }
109
- };
110
- });
111
- const saveSubCatalogResult = await offerCatalogItemRepo.upsertManyByIdentifier(savingSubOfferCatalogs.map((savingSubOfferCatalog) => {
112
- return {
113
- $set: savingSubOfferCatalog
114
- };
115
- }));
116
- console.log('saveSubCatalogResult:', saveSubCatalogResult);
117
-
118
- const subCatalogIds: string[] =
119
- (Array.isArray(saveSubCatalogResult?.modifiedCatalogs)) ? saveSubCatalogResult.modifiedCatalogs.map(({ id }) => id) : [];
120
- const catalogBySubCatalogIdentifier = 'sampleFreeOffersCatalogBySub';
121
- const savingOfferCatalogBySubCatalog: chevre.factory.offerCatalog.IOfferCatalog = {
122
- project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
123
- typeOf: 'OfferCatalog',
124
- identifier: catalogBySubCatalogIdentifier,
125
- description: { en: catalogBySubCatalogIdentifier, ja: catalogBySubCatalogIdentifier },
126
- name: { en: catalogBySubCatalogIdentifier, ja: catalogBySubCatalogIdentifier },
127
- itemListElement: subCatalogIds.map((id) => ({ id, typeOf: 'OfferCatalog' })),
128
- itemOffered: { typeOf: chevre.factory.product.ProductType.EventService }
129
- };
130
- const saveCatalogBySubResult = await offerCatalogRepo.saveByIdentifier(savingOfferCatalogBySubCatalog);
131
- console.log('saveCatalogBySubResult:', saveCatalogBySubResult);
132
-
133
- const productIdBySubCatalog = 'sampleFreeEventServiceBySub';
134
- const savingProductBySubCatalog: chevre.factory.product.IProduct & {
135
- offers?: never;
136
- } = {
137
- project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
138
- typeOf: chevre.factory.product.ProductType.EventService,
139
- name: { en: productIdBySubCatalog, ja: productIdBySubCatalog },
140
- productID: productIdBySubCatalog,
141
- hasOfferCatalog: {
142
- typeOf: 'OfferCatalog',
143
- itemListElement: [{ id: saveCatalogBySubResult.id }]
144
- }
145
- };
146
- const saveProductBySubCatalogResult = await productRepo.upsertManyByProductId([{
147
- $set: savingProductBySubCatalog
148
- }]);
149
- console.log('saveProductBySubCatalogResult:', saveProductBySubCatalogResult);
150
- }
151
-
152
- main()
153
- .then()
154
- .catch(console.error);
@@ -1,46 +0,0 @@
1
- // tslint:disable:no-console
2
- import * as mongoose from 'mongoose';
3
-
4
- import { chevre } from '../../../../lib/index';
5
-
6
- const { INFORM_TASK_AGG_URL } = process.env;
7
- if (typeof INFORM_TASK_AGG_URL !== 'string') {
8
- throw new Error('INFORM_TASK_AGG_URL required');
9
- }
10
-
11
- async function main() {
12
- await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
13
-
14
- const settingRepo = await chevre.repository.Setting.createInstance(mongoose.connection);
15
- // const setting = await settingRepo.findOne({ project: { id: { $eq: '*' } } }, ['onTaskStatusChanged']);
16
- // update
17
- await settingRepo.updateByProject(
18
- { project: { id: { $eq: '*' } } },
19
- {
20
- onTaskStatusChanged: {
21
- informTask: [{
22
- recipient: {
23
- name: 'Aggregation Service',
24
- url: INFORM_TASK_AGG_URL
25
- }
26
- }],
27
- informTaskNames: [
28
- chevre.factory.taskName.Pay,
29
- chevre.factory.taskName.InvalidatePaymentUrl,
30
- chevre.factory.taskName.Refund,
31
- chevre.factory.taskName.VoidPayment
32
- // chevre.factory.taskName.ConfirmReserveTransaction
33
- ],
34
- informTaskStatuses: [
35
- chevre.factory.taskStatus.Aborted
36
- // chevre.factory.taskStatus.Running
37
- ]
38
- }
39
- }
40
- );
41
- console.log('updated.');
42
- }
43
-
44
- main()
45
- .then()
46
- .catch(console.error);
@@ -1,60 +0,0 @@
1
- /**
2
- * マスターデータ同期サービス
3
- */
4
- import type * as COA from '@motionpicture/coa-service';
5
- import type { ActionRepo } from '../repo/action';
6
- import type { CategoryCodeRepo } from '../repo/categoryCode';
7
- import type { CreativeWorkRepo } from '../repo/creativeWork';
8
- import type { EventRepo } from '../repo/event';
9
- import type { EventSeriesRepo } from '../repo/eventSeries';
10
- import type { MovieTheaterRepo } from '../repo/place/movieTheater';
11
- import type { ScreeningRoomRepo } from '../repo/place/screeningRoom';
12
- import type { SellerRepo } from '../repo/seller';
13
- import * as factory from '../factory';
14
- interface IImportFromCOAParams {
15
- project: {
16
- id: string;
17
- typeOf: factory.organizationType.Project;
18
- };
19
- /**
20
- * 施設コード
21
- */
22
- locationBranchCode: string;
23
- importFrom: Date;
24
- importThrough: Date;
25
- /**
26
- * 施設を保管するかどうか
27
- */
28
- saveMovieTheater: boolean;
29
- /**
30
- * 施設コンテンツを保管するかどうか
31
- */
32
- saveScreeningEventSeries: boolean;
33
- saveScreeningEventSeriesPeriodInMonth: number;
34
- }
35
- /**
36
- * イベントをインポートする
37
- */
38
- declare function importFromCOA(params: IImportFromCOAParams): (repos: {
39
- action: ActionRepo;
40
- categoryCode: CategoryCodeRepo;
41
- creativeWork: CreativeWorkRepo;
42
- event: EventRepo;
43
- eventSeries: EventSeriesRepo;
44
- movieTheater: MovieTheaterRepo;
45
- screeningRoom: ScreeningRoomRepo;
46
- seller: SellerRepo;
47
- masterService: COA.service.Master;
48
- }) => Promise<void>;
49
- /**
50
- * COA情報からイベントIDを作成する
51
- */
52
- declare function createScreeningEventIdFromCOA(params: {
53
- theaterCode: string;
54
- titleCode: string;
55
- titleBranchNum: string;
56
- dateJouei: string;
57
- screenCode: string;
58
- timeBegin: string;
59
- }): string;
60
- export { importFromCOA, createScreeningEventIdFromCOA };