@chevre/domain 22.3.0-alpha.9 → 22.3.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.
- package/example/src/chevre/importEventsFromCOA.ts +4 -3
- package/example/src/chevre/migrateAccountTitleAdditionalProperties.ts +9 -6
- package/example/src/chevre/migrateCustomerAdditionalProperties.ts +8 -6
- package/example/src/chevre/migrateEventSeries2secondary.ts +70 -0
- package/example/src/chevre/migrateRoomAdditionalProperties.ts +8 -6
- package/example/src/chevre/migrateRoomSectionAdditionalProperties.ts +8 -6
- package/example/src/chevre/projectFields.ts +6 -10
- package/example/src/chevre/unsetUnnecessaryFields.ts +15 -10
- package/example/src/chevre/upsertManyEventsByAdditionalProperty.ts +180 -0
- package/lib/chevre/repo/account.d.ts +25 -1
- package/lib/chevre/repo/accountTitle.d.ts +4 -4
- package/lib/chevre/repo/accountingReport.d.ts +25 -1
- package/lib/chevre/repo/action.d.ts +11 -11
- package/lib/chevre/repo/action.js +4 -7
- package/lib/chevre/repo/additionalProperty.d.ts +33 -8
- package/lib/chevre/repo/additionalProperty.js +52 -106
- package/lib/chevre/repo/aggregateOffer.d.ts +26 -2
- package/lib/chevre/repo/aggregateReservation.d.ts +25 -1
- package/lib/chevre/repo/aggregation.d.ts +26 -2
- package/lib/chevre/repo/assetTransaction.d.ts +5 -5
- package/lib/chevre/repo/authorization.d.ts +25 -1
- package/lib/chevre/repo/categoryCode.d.ts +1 -1
- package/lib/chevre/repo/comment.d.ts +3 -3
- package/lib/chevre/repo/creativeWork.d.ts +12 -10
- package/lib/chevre/repo/creativeWork.js +51 -23
- package/lib/chevre/repo/customer.d.ts +4 -4
- package/lib/chevre/repo/event.d.ts +28 -19
- package/lib/chevre/repo/event.js +61 -162
- package/lib/chevre/repo/eventSeries.d.ts +44 -30
- package/lib/chevre/repo/eventSeries.js +144 -208
- package/lib/chevre/repo/member.d.ts +4 -4
- package/lib/chevre/repo/member.js +0 -15
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +3 -3
- package/lib/chevre/repo/message.d.ts +30 -6
- package/lib/chevre/repo/message.js +25 -22
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +0 -3
- package/lib/chevre/repo/mongoose/schemas/civicStructure.d.ts +12 -0
- package/lib/chevre/repo/mongoose/schemas/civicStructure.js +131 -0
- package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.js +21 -23
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +1 -5
- package/lib/chevre/repo/mongoose/schemas/event.js +11 -78
- package/lib/chevre/repo/mongoose/schemas/eventSeries.d.ts +13 -0
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +219 -0
- package/lib/chevre/repo/mongoose/schemas/message.js +0 -3
- package/lib/chevre/repo/mongoose/schemas/note.js +0 -3
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +21 -23
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +1 -5
- package/lib/chevre/repo/mongoose/schemas/place.js +38 -42
- package/lib/chevre/repo/note.d.ts +27 -6
- package/lib/chevre/repo/note.js +25 -22
- package/lib/chevre/repo/offer.d.ts +8 -8
- package/lib/chevre/repo/offer.js +0 -21
- package/lib/chevre/repo/offerCatalog.d.ts +4 -4
- package/lib/chevre/repo/offerCatalogItem.d.ts +25 -1
- package/lib/chevre/repo/offerItemCondition.d.ts +28 -0
- package/lib/chevre/repo/offerItemCondition.js +8 -1
- package/lib/chevre/repo/order.d.ts +5 -5
- package/lib/chevre/repo/order.js +0 -73
- package/lib/chevre/repo/orderInTransaction.d.ts +27 -3
- package/lib/chevre/repo/ownershipInfo.d.ts +5 -5
- package/lib/chevre/repo/paymentService.d.ts +25 -1
- package/lib/chevre/repo/paymentServiceProvider.d.ts +26 -2
- package/lib/chevre/repo/place/busStop.d.ts +1 -1
- package/lib/chevre/repo/place/busStop.js +11 -11
- package/lib/chevre/repo/place/hasPOS.d.ts +1 -1
- package/lib/chevre/repo/place/hasPOS.js +7 -7
- package/lib/chevre/repo/place/movieTheater.d.ts +24 -53
- package/lib/chevre/repo/place/movieTheater.js +115 -140
- package/lib/chevre/repo/place/screeningRoom.d.ts +5 -0
- package/lib/chevre/repo/place/screeningRoom.js +67 -3
- package/lib/chevre/repo/place/seat.d.ts +1 -0
- package/lib/chevre/repo/place/seat.js +4 -1
- package/lib/chevre/repo/place/section.d.ts +1 -0
- package/lib/chevre/repo/place/section.js +4 -1
- package/lib/chevre/repo/priceSpecification.d.ts +4 -4
- package/lib/chevre/repo/priceSpecification.js +0 -1
- package/lib/chevre/repo/product.d.ts +4 -4
- package/lib/chevre/repo/productModel.d.ts +25 -1
- package/lib/chevre/repo/productOffer.d.ts +25 -1
- package/lib/chevre/repo/project.d.ts +5 -5
- package/lib/chevre/repo/project.js +0 -2
- package/lib/chevre/repo/reservation.d.ts +5 -5
- package/lib/chevre/repo/reservation.js +6 -59
- package/lib/chevre/repo/seller.d.ts +5 -5
- package/lib/chevre/repo/serviceOutput.d.ts +25 -1
- package/lib/chevre/repo/task.d.ts +8 -8
- package/lib/chevre/repo/transaction.d.ts +4 -4
- package/lib/chevre/repo/trip.d.ts +25 -1
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +4 -3
- package/lib/chevre/service/event/createEvent.js +4 -2
- package/lib/chevre/service/event.d.ts +3 -0
- package/lib/chevre/service/event.js +130 -46
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +4 -4
- package/lib/chevre/service/offer/onEventChanged.js +3 -3
- package/lib/chevre/service/payment/movieTicket/factory.js +0 -6
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +0 -6
- package/lib/chevre/service/report/telemetry.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +4 -2
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.js +11 -11
- package/package.json +6 -6
- package/example/src/chevre/migrateAccountTitleCategoryAdditionalProperties.ts +0 -113
- package/example/src/chevre/migrateAccountTitleSetAdditionalProperties.ts +0 -120
- package/example/src/chevre/migrateMembers2.ts +0 -74
- package/example/src/chevre/playAroundMessage.ts +0 -73
- package/example/src/chevre/playAroundNote.ts +0 -34
|
@@ -20,13 +20,13 @@ async function main() {
|
|
|
20
20
|
const sellerRepo = await chevre.repository.Seller.createInstance(mongoose.connection);
|
|
21
21
|
|
|
22
22
|
const coaAuthClient = new (await chevre.loadCOA()).auth.RefreshToken({
|
|
23
|
-
endpoint:
|
|
24
|
-
refreshToken:
|
|
23
|
+
endpoint: String(process.env.COA_ENDPOINT),
|
|
24
|
+
refreshToken: process.env.COA_REFRESH_TOKEN,
|
|
25
25
|
useFetch: true
|
|
26
26
|
});
|
|
27
27
|
const masterService = new (await chevre.loadCOA()).service.Master(
|
|
28
28
|
{
|
|
29
|
-
endpoint:
|
|
29
|
+
endpoint: String(process.env.COA_ENDPOINT),
|
|
30
30
|
auth: coaAuthClient
|
|
31
31
|
},
|
|
32
32
|
{ timeout: 20000 }
|
|
@@ -45,6 +45,7 @@ async function main() {
|
|
|
45
45
|
.toDate(),
|
|
46
46
|
saveMovieTheater: false,
|
|
47
47
|
saveScreeningEventSeries: false,
|
|
48
|
+
// saveScreeningEventSeries: true,
|
|
48
49
|
saveScreeningEventSeriesPeriodInMonth: 3
|
|
49
50
|
})({
|
|
50
51
|
action: actionRepo,
|
|
@@ -74,12 +74,15 @@ async function main() {
|
|
|
74
74
|
|
|
75
75
|
for (const additionalPropertyNameOnResource of additionalPropertyNamesOnResource) {
|
|
76
76
|
checked += 1;
|
|
77
|
-
const existingAdditionalProperties = await additionalPropertyRepo.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
const existingAdditionalProperties = <{ id: string }[]>await additionalPropertyRepo.projectFields(
|
|
78
|
+
{
|
|
79
|
+
limit: 1,
|
|
80
|
+
project: { id: { $eq: accountTitleCategory.project.id } },
|
|
81
|
+
codeValue: { $eq: additionalPropertyNameOnResource },
|
|
82
|
+
inCodeSet: { identifier: { $eq: accountTitle.typeOf } }
|
|
83
|
+
},
|
|
84
|
+
['id']
|
|
85
|
+
);
|
|
83
86
|
if (existingAdditionalProperties.length === 0) {
|
|
84
87
|
const additionalProperty: chevre.factory.additionalProperty.IAdditionalProperty = {
|
|
85
88
|
project: accountTitleCategory.project,
|
|
@@ -64,12 +64,14 @@ async function main() {
|
|
|
64
64
|
|
|
65
65
|
for (const additionalPropertyNameOnResource of additionalPropertyNamesOnResource) {
|
|
66
66
|
checked += 1;
|
|
67
|
-
const existingAdditionalProperties = await additionalPropertyRepo.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
const existingAdditionalProperties = <{ id: string }[]>await additionalPropertyRepo.projectFields(
|
|
68
|
+
{
|
|
69
|
+
limit: 1,
|
|
70
|
+
project: { id: { $eq: customer.project.id } },
|
|
71
|
+
codeValue: { $eq: additionalPropertyNameOnResource },
|
|
72
|
+
inCodeSet: { identifier: { $eq: customer.typeOf } }
|
|
73
|
+
},
|
|
74
|
+
['id']);
|
|
73
75
|
if (existingAdditionalProperties.length === 0) {
|
|
74
76
|
const additionalProperty: chevre.factory.additionalProperty.IAdditionalProperty = {
|
|
75
77
|
project: customer.project,
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
|
|
8
|
+
// tslint:disable-next-line:max-func-body-length
|
|
9
|
+
async function main() {
|
|
10
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
11
|
+
|
|
12
|
+
const eventSeriesRepo = await chevre.repository.EventSeries.createInstance(mongoose.connection);
|
|
13
|
+
|
|
14
|
+
const cursor = eventSeriesRepo.getCursor(
|
|
15
|
+
{
|
|
16
|
+
typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries }
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
_id: 1,
|
|
20
|
+
startDate: 1,
|
|
21
|
+
project: 1,
|
|
22
|
+
typeOf: 1
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
console.log('docs found');
|
|
26
|
+
|
|
27
|
+
let i = 0;
|
|
28
|
+
let updateCount = 0;
|
|
29
|
+
await cursor.eachAsync(async (doc) => {
|
|
30
|
+
i += 1;
|
|
31
|
+
const eventSeries: Pick<chevre.factory.event.screeningEventSeries.IEvent, 'id' | 'startDate' | 'project' | 'typeOf'> =
|
|
32
|
+
doc.toObject();
|
|
33
|
+
const alreadyMigrated = false;
|
|
34
|
+
if (alreadyMigrated) {
|
|
35
|
+
console.log(
|
|
36
|
+
'already exist.',
|
|
37
|
+
eventSeries.project.id,
|
|
38
|
+
eventSeries.typeOf,
|
|
39
|
+
eventSeries.id,
|
|
40
|
+
eventSeries.startDate, i, updateCount
|
|
41
|
+
);
|
|
42
|
+
} else {
|
|
43
|
+
updateCount += 1;
|
|
44
|
+
console.log(
|
|
45
|
+
'updating...',
|
|
46
|
+
eventSeries.project.id,
|
|
47
|
+
eventSeries.typeOf,
|
|
48
|
+
eventSeries.id,
|
|
49
|
+
eventSeries.startDate, i, updateCount
|
|
50
|
+
);
|
|
51
|
+
// await eventSeriesRepo.sync2secondary({
|
|
52
|
+
// id: eventSeries.id
|
|
53
|
+
// });
|
|
54
|
+
console.log(
|
|
55
|
+
'updated.',
|
|
56
|
+
eventSeries.project.id,
|
|
57
|
+
eventSeries.typeOf,
|
|
58
|
+
eventSeries.id,
|
|
59
|
+
eventSeries.startDate, i, updateCount
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
console.log(i, 'docs checked');
|
|
65
|
+
console.log(updateCount, 'docs updated');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
main()
|
|
69
|
+
.then()
|
|
70
|
+
.catch(console.error);
|
|
@@ -66,12 +66,14 @@ async function main() {
|
|
|
66
66
|
|
|
67
67
|
for (const additionalPropertyNameOnResource of additionalPropertyNamesOnResource) {
|
|
68
68
|
checked += 1;
|
|
69
|
-
const existingAdditionalProperties = await additionalPropertyRepo.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
const existingAdditionalProperties = <{ id: string }[]>await additionalPropertyRepo.projectFields(
|
|
70
|
+
{
|
|
71
|
+
limit: 1,
|
|
72
|
+
project: { id: { $eq: screeningRoom.project.id } },
|
|
73
|
+
codeValue: { $eq: additionalPropertyNameOnResource },
|
|
74
|
+
inCodeSet: { identifier: { $eq: screeningRoom.typeOf } }
|
|
75
|
+
},
|
|
76
|
+
['id']);
|
|
75
77
|
if (existingAdditionalProperties.length === 0) {
|
|
76
78
|
const additionalProperty: chevre.factory.additionalProperty.IAdditionalProperty = {
|
|
77
79
|
project: screeningRoom.project,
|
|
@@ -68,12 +68,14 @@ async function main() {
|
|
|
68
68
|
|
|
69
69
|
for (const additionalPropertyNameOnResource of additionalPropertyNamesOnResource) {
|
|
70
70
|
checked += 1;
|
|
71
|
-
const existingAdditionalProperties = await additionalPropertyRepo.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
const existingAdditionalProperties = <{ id: string }[]>await additionalPropertyRepo.projectFields(
|
|
72
|
+
{
|
|
73
|
+
limit: 1,
|
|
74
|
+
project: { id: { $eq: screeningRoom.project.id } },
|
|
75
|
+
codeValue: { $eq: additionalPropertyNameOnResource },
|
|
76
|
+
inCodeSet: { identifier: { $eq: section.typeOf } }
|
|
77
|
+
},
|
|
78
|
+
['id']);
|
|
77
79
|
if (existingAdditionalProperties.length === 0) {
|
|
78
80
|
const additionalProperty: chevre.factory.additionalProperty.IAdditionalProperty = {
|
|
79
81
|
project: screeningRoom.project,
|
|
@@ -3,24 +3,20 @@ import * as mongoose from 'mongoose';
|
|
|
3
3
|
|
|
4
4
|
import { chevre } from '../../../lib/index';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
mongoose.Model.on('index', (...args) => {
|
|
9
|
-
console.error('******** index event emitted. ********\n', args);
|
|
10
|
-
});
|
|
6
|
+
const project = { id: String(process.env.PROJECT_ID) };
|
|
11
7
|
|
|
12
8
|
async function main() {
|
|
13
9
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
14
10
|
|
|
15
|
-
const
|
|
11
|
+
const additionalPropertyRepo = await chevre.repository.AdditionalProperty.createInstance(mongoose.connection);
|
|
16
12
|
|
|
17
|
-
const docs = await
|
|
13
|
+
const docs = await additionalPropertyRepo.projectFields(
|
|
18
14
|
{
|
|
19
15
|
limit: 1,
|
|
20
|
-
page: 1
|
|
16
|
+
page: 1,
|
|
17
|
+
project: { id: { $eq: project.id } }
|
|
21
18
|
},
|
|
22
|
-
['
|
|
23
|
-
['contactPoint', 'additionalProperty']
|
|
19
|
+
['id', 'codeValue', 'name']
|
|
24
20
|
);
|
|
25
21
|
// tslint:disable-next-line:no-null-keyword
|
|
26
22
|
console.dir(docs, { depth: null });
|
|
@@ -6,20 +6,25 @@ import { chevre } from '../../../lib/index';
|
|
|
6
6
|
async function main() {
|
|
7
7
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const creativeWorkRepo = await chevre.repository.CreativeWork.createInstance(mongoose.connection);
|
|
10
|
+
const offerItemConditionRepo = await chevre.repository.OfferItemCondition.createInstance(mongoose.connection);
|
|
10
11
|
|
|
11
12
|
let updateResult: any;
|
|
12
|
-
updateResult = await
|
|
13
|
+
updateResult = await creativeWorkRepo.unsetUnnecessaryFields({
|
|
14
|
+
filter: {
|
|
15
|
+
_id: { $exists: true }
|
|
16
|
+
},
|
|
17
|
+
$unset: <any>{
|
|
18
|
+
createdAt: 1,
|
|
19
|
+
updatedAt: 1,
|
|
20
|
+
__v: 1
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
console.log(updateResult);
|
|
24
|
+
|
|
25
|
+
updateResult = await offerItemConditionRepo.unsetUnnecessaryFields({
|
|
13
26
|
filter: {
|
|
14
27
|
_id: { $exists: true }
|
|
15
|
-
// startDate: {
|
|
16
|
-
// // $gte: moment()
|
|
17
|
-
// // .add(-48, 'months')
|
|
18
|
-
// // .toDate()
|
|
19
|
-
// // $lte: moment()
|
|
20
|
-
// // .add(-1, 'months')
|
|
21
|
-
// // .toDate()
|
|
22
|
-
// }
|
|
23
28
|
},
|
|
24
29
|
$unset: <any>{
|
|
25
30
|
createdAt: 1,
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
import { chevre } from '../../../lib/index';
|
|
4
|
+
|
|
5
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
6
|
+
|
|
7
|
+
// tslint:disable-next-line:max-func-body-length
|
|
8
|
+
async function main() {
|
|
9
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
10
|
+
|
|
11
|
+
const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
|
|
12
|
+
const result = await eventRepo.upsertManyByAdditionalProperty({
|
|
13
|
+
events: [
|
|
14
|
+
{
|
|
15
|
+
additionalProperty: [
|
|
16
|
+
{
|
|
17
|
+
name: 'createId',
|
|
18
|
+
value: 'akeuu512i-10-202409151130-01'
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
project: {
|
|
22
|
+
id: PROJECT_ID,
|
|
23
|
+
typeOf: chevre.factory.organizationType.Project
|
|
24
|
+
},
|
|
25
|
+
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
26
|
+
doorTime: new Date('2024-09-15T02:30:00.000Z'),
|
|
27
|
+
endDate: new Date('2024-09-15T11:45:00.000Z'),
|
|
28
|
+
// eventStatus: chevre.factory.eventStatusType.EventScheduled,
|
|
29
|
+
eventStatus: chevre.factory.eventStatusType.EventCancelled,
|
|
30
|
+
location: {
|
|
31
|
+
typeOf: chevre.factory.placeType.ScreeningRoom,
|
|
32
|
+
branchCode: '10',
|
|
33
|
+
name: {
|
|
34
|
+
ja: 'シネマ1',
|
|
35
|
+
en: 'CINEMA1'
|
|
36
|
+
},
|
|
37
|
+
address: {
|
|
38
|
+
ja: '7階',
|
|
39
|
+
en: '7F'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
name: {
|
|
43
|
+
en: 'Ocean\'s Eight',
|
|
44
|
+
ja: 'オーシャンズ8'
|
|
45
|
+
},
|
|
46
|
+
offers: {
|
|
47
|
+
typeOf: chevre.factory.offerType.Offer,
|
|
48
|
+
availabilityEnds: new Date('2024-09-15T11:45:00.000Z'),
|
|
49
|
+
availabilityStarts: new Date('2024-09-01T15:00:00.000Z'),
|
|
50
|
+
eligibleQuantity: {
|
|
51
|
+
typeOf: 'QuantitativeValue',
|
|
52
|
+
unitCode: chevre.factory.unitCode.C62,
|
|
53
|
+
maxValue: 10
|
|
54
|
+
},
|
|
55
|
+
itemOffered: {
|
|
56
|
+
id: '6603a61f0c914b6c7fd18f99',
|
|
57
|
+
name: {
|
|
58
|
+
ja: 'アップロードテスト用(ムビチケあり)'
|
|
59
|
+
},
|
|
60
|
+
serviceOutput: {
|
|
61
|
+
typeOf: chevre.factory.reservationType.EventReservation,
|
|
62
|
+
reservedTicket: {
|
|
63
|
+
typeOf: 'Ticket',
|
|
64
|
+
ticketedSeat: {
|
|
65
|
+
typeOf: chevre.factory.placeType.Seat
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
typeOf: chevre.factory.product.ProductType.EventService,
|
|
70
|
+
availableChannel: {
|
|
71
|
+
typeOf: 'ServiceChannel',
|
|
72
|
+
serviceLocation: {
|
|
73
|
+
typeOf: chevre.factory.placeType.ScreeningRoom,
|
|
74
|
+
branchCode: '10',
|
|
75
|
+
name: {
|
|
76
|
+
ja: 'シネマ1',
|
|
77
|
+
en: 'CINEMA1'
|
|
78
|
+
},
|
|
79
|
+
containedInPlace: {
|
|
80
|
+
typeOf: chevre.factory.placeType.MovieTheater,
|
|
81
|
+
id: '5bfb841d5a78d7948369979a',
|
|
82
|
+
branchCode: '118',
|
|
83
|
+
name: {
|
|
84
|
+
ja: 'シネモーション赤坂 ',
|
|
85
|
+
en: 'CineMotion Akasaka'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
serviceType: {
|
|
91
|
+
codeValue: '0001',
|
|
92
|
+
id: '64caf203c73a205ccefe80c5',
|
|
93
|
+
inCodeSet: {
|
|
94
|
+
typeOf: 'CategoryCodeSet',
|
|
95
|
+
identifier: chevre.factory.categoryCode.CategorySetIdentifier.ServiceType
|
|
96
|
+
},
|
|
97
|
+
typeOf: 'CategoryCode'
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
validFrom: new Date('2024-09-01T15:00:00.000Z'),
|
|
101
|
+
validThrough: new Date('2024-09-15T11:45:00.000Z'),
|
|
102
|
+
seller: {
|
|
103
|
+
typeOf: chevre.factory.organizationType.Corporation,
|
|
104
|
+
id: '59d20831e53ebc2b4e774466',
|
|
105
|
+
name: {
|
|
106
|
+
ja: 'シネモーション赤坂',
|
|
107
|
+
en: 'CineMotion Akasaka'
|
|
108
|
+
},
|
|
109
|
+
makesOffer: []
|
|
110
|
+
},
|
|
111
|
+
unacceptedPaymentMethod: [
|
|
112
|
+
'MovieTicket'
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
organizer: {
|
|
116
|
+
id: '59d20831e53ebc2b4e774466'
|
|
117
|
+
},
|
|
118
|
+
startDate: new Date('2024-09-15T02:30:00.000Z'),
|
|
119
|
+
superEvent: {
|
|
120
|
+
typeOf: chevre.factory.eventType.ScreeningEventSeries,
|
|
121
|
+
id: 'akeuu512i',
|
|
122
|
+
videoFormat: [
|
|
123
|
+
{
|
|
124
|
+
typeOf: '2D',
|
|
125
|
+
name: '2D'
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
soundFormat: [],
|
|
129
|
+
workPerformed: {
|
|
130
|
+
typeOf: chevre.factory.creativeWorkType.Movie,
|
|
131
|
+
identifier: '00002',
|
|
132
|
+
id: '5bfb841d5a78d79483699803',
|
|
133
|
+
name: {
|
|
134
|
+
en: 'Ocean\'s Eight',
|
|
135
|
+
ja: 'オーシャンズ8'
|
|
136
|
+
},
|
|
137
|
+
duration: 'PT1H50M'
|
|
138
|
+
},
|
|
139
|
+
location: {
|
|
140
|
+
typeOf: chevre.factory.placeType.MovieTheater,
|
|
141
|
+
id: '5bfb841d5a78d7948369979a',
|
|
142
|
+
branchCode: '118',
|
|
143
|
+
name: {
|
|
144
|
+
ja: 'シネモーション赤坂 ',
|
|
145
|
+
en: 'CineMotion Akasaka'
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
kanaName: '',
|
|
149
|
+
name: {
|
|
150
|
+
en: 'Ocean\'s Eight',
|
|
151
|
+
ja: 'オーシャンズ8'
|
|
152
|
+
},
|
|
153
|
+
additionalProperty: [],
|
|
154
|
+
startDate: new Date('2020-08-31T15:00:00.000Z'),
|
|
155
|
+
endDate: new Date('2030-01-01T15:00:00.000Z'),
|
|
156
|
+
description: {
|
|
157
|
+
en: '2018 United States crime movie.',
|
|
158
|
+
ja: '2018年のアメリカ合衆国の犯罪映画。'
|
|
159
|
+
},
|
|
160
|
+
headline: {
|
|
161
|
+
ja: '2018/12/14'
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
additionalPropertyFilter: { name: 'createId' },
|
|
167
|
+
eventSeries: {
|
|
168
|
+
id: 'akeuu512i'
|
|
169
|
+
},
|
|
170
|
+
screeningRoom: {
|
|
171
|
+
branchCode: '10'
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
// tslint:disable-next-line:no-null-keyword
|
|
175
|
+
console.dir(result, { depth: null });
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
main()
|
|
179
|
+
.then(console.log)
|
|
180
|
+
.catch(console.error);
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import type { Connection } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
/**
|
|
@@ -125,5 +149,5 @@ export declare class AccountRepo {
|
|
|
125
149
|
unsetUnnecessaryFields(params: {
|
|
126
150
|
filter: any;
|
|
127
151
|
$unset: any;
|
|
128
|
-
}): Promise<import("
|
|
152
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
129
153
|
}
|
|
@@ -36,13 +36,13 @@ export declare class AccountTitleRepo {
|
|
|
36
36
|
id: string;
|
|
37
37
|
};
|
|
38
38
|
}): Promise<void>;
|
|
39
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.accountTitle.IAccountTitle> &
|
|
39
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.accountTitle.IAccountTitle> & factory.accountTitle.IAccountTitle & {
|
|
40
40
|
_id: import("mongoose").Types.ObjectId;
|
|
41
|
-
},
|
|
41
|
+
}, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.accountTitle.IAccountTitle> & factory.accountTitle.IAccountTitle & {
|
|
42
42
|
_id: import("mongoose").Types.ObjectId;
|
|
43
|
-
}
|
|
43
|
+
}>>;
|
|
44
44
|
unsetUnnecessaryFields(params: {
|
|
45
45
|
filter: any;
|
|
46
46
|
$unset: any;
|
|
47
|
-
}): Promise<import("
|
|
47
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
48
48
|
}
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import type { Connection, PipelineStage } from 'mongoose';
|
|
2
26
|
import { IAccountingReport, IChildReport, IOrder4report } from './mongoose/schemas/accountingReport';
|
|
3
27
|
import * as factory from '../factory';
|
|
@@ -44,5 +68,5 @@ export declare class AccountingReportRepo {
|
|
|
44
68
|
unsetUnnecessaryFields(params: {
|
|
45
69
|
filter: any;
|
|
46
70
|
$unset: any;
|
|
47
|
-
}): Promise<import("
|
|
71
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
48
72
|
}
|
|
@@ -284,8 +284,8 @@ export declare class ActionRepo {
|
|
|
284
284
|
} | null>;
|
|
285
285
|
saveRecipeWithDateCreated(savingRecipe: IRecipeAsDocument & {
|
|
286
286
|
dateModified: Date;
|
|
287
|
-
}): Promise<import("
|
|
288
|
-
saveActionWithEndDate(savingAction: Omit<factory.action.authorize.invoice.IAction, 'id'>): Promise<import("
|
|
287
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
288
|
+
saveActionWithEndDate(savingAction: Omit<factory.action.authorize.invoice.IAction, 'id'>): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
289
289
|
findRecipeByAction<T extends factory.recipe.RecipeCategory>(params: {
|
|
290
290
|
project: {
|
|
291
291
|
id: string;
|
|
@@ -381,6 +381,7 @@ export declare class ActionRepo {
|
|
|
381
381
|
location?: any;
|
|
382
382
|
description?: string | undefined;
|
|
383
383
|
result?: any;
|
|
384
|
+
toLocation?: any;
|
|
384
385
|
actionStatus: factory.actionStatusType;
|
|
385
386
|
endDate?: Date | undefined;
|
|
386
387
|
purpose?: import("@chevre/factory/lib/action").IPurpose | undefined;
|
|
@@ -391,11 +392,10 @@ export declare class ActionRepo {
|
|
|
391
392
|
recipient?: import("@chevre/factory/lib/action").IParticipant | undefined;
|
|
392
393
|
sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
|
|
393
394
|
fromLocation?: any;
|
|
394
|
-
toLocation?: any;
|
|
395
395
|
replacer?: any;
|
|
396
396
|
targetCollection?: any;
|
|
397
397
|
cancelAction?: any;
|
|
398
|
-
}> &
|
|
398
|
+
}> & {
|
|
399
399
|
object: any;
|
|
400
400
|
error?: any;
|
|
401
401
|
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
@@ -404,6 +404,7 @@ export declare class ActionRepo {
|
|
|
404
404
|
location?: any;
|
|
405
405
|
description?: string | undefined;
|
|
406
406
|
result?: any;
|
|
407
|
+
toLocation?: any;
|
|
407
408
|
actionStatus: factory.actionStatusType;
|
|
408
409
|
endDate?: Date | undefined;
|
|
409
410
|
purpose?: import("@chevre/factory/lib/action").IPurpose | undefined;
|
|
@@ -414,13 +415,12 @@ export declare class ActionRepo {
|
|
|
414
415
|
recipient?: import("@chevre/factory/lib/action").IParticipant | undefined;
|
|
415
416
|
sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
|
|
416
417
|
fromLocation?: any;
|
|
417
|
-
toLocation?: any;
|
|
418
418
|
replacer?: any;
|
|
419
419
|
targetCollection?: any;
|
|
420
420
|
cancelAction?: any;
|
|
421
421
|
} & {
|
|
422
422
|
_id: import("mongoose").Types.ObjectId;
|
|
423
|
-
},
|
|
423
|
+
}, QueryOptions<import("mongoose").Document<unknown, {}, {
|
|
424
424
|
object: any;
|
|
425
425
|
error?: any;
|
|
426
426
|
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
@@ -429,6 +429,7 @@ export declare class ActionRepo {
|
|
|
429
429
|
location?: any;
|
|
430
430
|
description?: string | undefined;
|
|
431
431
|
result?: any;
|
|
432
|
+
toLocation?: any;
|
|
432
433
|
actionStatus: factory.actionStatusType;
|
|
433
434
|
endDate?: Date | undefined;
|
|
434
435
|
purpose?: import("@chevre/factory/lib/action").IPurpose | undefined;
|
|
@@ -439,11 +440,10 @@ export declare class ActionRepo {
|
|
|
439
440
|
recipient?: import("@chevre/factory/lib/action").IParticipant | undefined;
|
|
440
441
|
sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
|
|
441
442
|
fromLocation?: any;
|
|
442
|
-
toLocation?: any;
|
|
443
443
|
replacer?: any;
|
|
444
444
|
targetCollection?: any;
|
|
445
445
|
cancelAction?: any;
|
|
446
|
-
}> &
|
|
446
|
+
}> & {
|
|
447
447
|
object: any;
|
|
448
448
|
error?: any;
|
|
449
449
|
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
@@ -452,6 +452,7 @@ export declare class ActionRepo {
|
|
|
452
452
|
location?: any;
|
|
453
453
|
description?: string | undefined;
|
|
454
454
|
result?: any;
|
|
455
|
+
toLocation?: any;
|
|
455
456
|
actionStatus: factory.actionStatusType;
|
|
456
457
|
endDate?: Date | undefined;
|
|
457
458
|
purpose?: import("@chevre/factory/lib/action").IPurpose | undefined;
|
|
@@ -462,17 +463,16 @@ export declare class ActionRepo {
|
|
|
462
463
|
recipient?: import("@chevre/factory/lib/action").IParticipant | undefined;
|
|
463
464
|
sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
|
|
464
465
|
fromLocation?: any;
|
|
465
|
-
toLocation?: any;
|
|
466
466
|
replacer?: any;
|
|
467
467
|
targetCollection?: any;
|
|
468
468
|
cancelAction?: any;
|
|
469
469
|
} & {
|
|
470
470
|
_id: import("mongoose").Types.ObjectId;
|
|
471
|
-
}
|
|
471
|
+
}>>;
|
|
472
472
|
unsetUnnecessaryFields(params: {
|
|
473
473
|
filter: FilterQuery<factory.action.IAction<factory.action.IAttributes<factory.actionType, any, any>>>;
|
|
474
474
|
$unset: any;
|
|
475
|
-
}): Promise<import("
|
|
475
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
476
476
|
private agggregateByStatus;
|
|
477
477
|
private upsertRecipe;
|
|
478
478
|
}
|
|
@@ -508,12 +508,6 @@ class ActionRepo {
|
|
|
508
508
|
var _a, _b;
|
|
509
509
|
return __awaiter(this, void 0, void 0, function* () {
|
|
510
510
|
const startDate = new Date();
|
|
511
|
-
// const startedAction: IAction<T> = await this.actionModel.create<AnyKeys<IAction<T>>>({
|
|
512
|
-
// ...attributes,
|
|
513
|
-
// actionStatus: factory.actionStatusType.ActiveActionStatus,
|
|
514
|
-
// startDate
|
|
515
|
-
// })
|
|
516
|
-
// .then((doc) => doc.toObject());
|
|
517
511
|
const creatingAction = Object.assign(Object.assign({}, attributes), { actionStatus: factory.actionStatusType.ActiveActionStatus, startDate });
|
|
518
512
|
// reimplemnt with insertMany(2024-08-29~)
|
|
519
513
|
const result = yield this.actionModel.insertMany(creatingAction, { rawResult: true });
|
|
@@ -1221,7 +1215,10 @@ class ActionRepo {
|
|
|
1221
1215
|
return this.actionRecipeModel.findOne({
|
|
1222
1216
|
'project.id': { $eq: params.project.id },
|
|
1223
1217
|
'recipeFor.id': { $eq: params.recipeFor.id }
|
|
1224
|
-
}, { step: 1, recipeCategory: 1 }
|
|
1218
|
+
}, { step: 1, recipeCategory: 1 }
|
|
1219
|
+
// { lean: true }
|
|
1220
|
+
)
|
|
1221
|
+
.lean()
|
|
1225
1222
|
.exec();
|
|
1226
1223
|
// if (result === null) {
|
|
1227
1224
|
// throw new factory.errors.NotFound(this.actionRecipeModel.modelName);
|