@chevre/domain 23.2.0-alpha.0 → 23.2.0-alpha.10

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 (32) hide show
  1. package/example/src/chevre/actions/checkAuthorizePaymentActions.ts +55 -0
  2. package/example/src/chevre/eventSeries/migrateEventSeriesOffers.ts +75 -0
  3. package/example/src/chevre/place/migrateSectionIdentifier.ts +92 -0
  4. package/example/src/chevre/roles/addAdminEventSeriesReadPermissionIfNotExists.ts +49 -0
  5. package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +49 -0
  6. package/example/src/chevre/roles/addAdminSeatReadPermissionIfNotExists.ts +33 -0
  7. package/example/src/chevre/roles/addAdminSeatWritePermissionIfNotExists.ts +33 -0
  8. package/lib/chevre/repo/acceptedPaymentMethod.js +14 -10
  9. package/lib/chevre/repo/creativeWork.js +9 -5
  10. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +10 -9
  11. package/lib/chevre/repo/place/screeningRoom.d.ts +35 -31
  12. package/lib/chevre/repo/place/screeningRoom.js +20 -20
  13. package/lib/chevre/repo/place/seat.d.ts +16 -45
  14. package/lib/chevre/repo/place/seat.js +25 -47
  15. package/lib/chevre/repo/place/section.d.ts +28 -29
  16. package/lib/chevre/repo/place/section.js +86 -39
  17. package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.d.ts +6 -1
  18. package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.js +26 -4
  19. package/lib/chevre/service/assetTransaction/pay.d.ts +3 -0
  20. package/lib/chevre/service/payment/any/factory.d.ts +5 -0
  21. package/lib/chevre/service/payment/any/factory.js +11 -2
  22. package/lib/chevre/service/payment/any.d.ts +8 -0
  23. package/lib/chevre/service/payment/any.js +3 -2
  24. package/lib/chevre/service/task/authorizePayment.js +3 -1
  25. package/lib/chevre/service/task/publishPaymentUrl.js +3 -1
  26. package/lib/chevre/service/task/syncResourcesFromCOA.d.ts +6 -0
  27. package/lib/chevre/service/task/syncResourcesFromCOA.js +299 -0
  28. package/lib/chevre/service/taskHandler.js +1 -0
  29. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +2 -2
  30. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +3 -1
  31. package/lib/chevre/service/transaction/placeOrder/confirm.js +3 -1
  32. package/package.json +2 -2
@@ -0,0 +1,55 @@
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
+ // 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 actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
12
+
13
+ const cursor = actionRepo.getCursor(
14
+ {
15
+ typeOf: { $eq: chevre.factory.actionType.AuthorizeAction },
16
+ 'object.typeOf': { $exists: true, $eq: chevre.factory.action.authorize.paymentMethod.any.ResultType.Payment },
17
+ startDate: {
18
+ $gte: moment()
19
+ // tslint:disable-next-line:no-magic-numbers
20
+ .add(-7, 'days')
21
+ .toDate()
22
+ }
23
+ },
24
+ {
25
+ }
26
+ );
27
+ console.log('docs found');
28
+
29
+ let i = 0;
30
+ let expectdCount = 0;
31
+ await cursor.eachAsync(async (doc) => {
32
+ i += 1;
33
+ const authorizeAction = <chevre.factory.action.authorize.paymentMethod.any.IAction>doc.toObject();
34
+
35
+ const isExpected = authorizeAction.object.paymentMethodId === authorizeAction.instrument.transactionNumber;
36
+ if (isExpected) {
37
+ console.log(
38
+ authorizeAction.object.paymentMethodId,
39
+ ' expected.',
40
+ authorizeAction.project.id, authorizeAction.typeOf, authorizeAction.object.typeOf,
41
+ authorizeAction.startDate, authorizeAction.identifier, i
42
+ );
43
+ expectdCount += 1;
44
+ } else {
45
+ throw new Error(`not expected ${authorizeAction.object.paymentMethodId} ${authorizeAction.instrument.transactionNumber} ${authorizeAction.project.id}`);
46
+ }
47
+ });
48
+
49
+ console.log(i, 'docs checked');
50
+ console.log(expectdCount, 'expectd');
51
+ }
52
+
53
+ main()
54
+ .then()
55
+ .catch(console.error);
@@ -0,0 +1,75 @@
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
+ // 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 eventSeriesRepo = await chevre.repository.EventSeries.createInstance(mongoose.connection);
12
+
13
+ const cursor = eventSeriesRepo.getCursor(
14
+ {
15
+ // _id: { $eq: 'bmd7x21f2' },
16
+ // 'project.id': { $eq: 'xxx' },
17
+ 'offers.typeOf': {
18
+ $exists: true,
19
+ $eq: chevre.factory.offerType.AggregateOffer
20
+ }
21
+ },
22
+ {
23
+ // _id: 1,
24
+ // offers: 1,
25
+ // startDate: 1,
26
+ // project: 1,
27
+ // typeOf: 1
28
+ }
29
+ );
30
+ console.log('docs found');
31
+
32
+ let i = 0;
33
+ let updateCount = 0;
34
+ await cursor.eachAsync(async (doc) => {
35
+ i += 1;
36
+ const eventSeries: Pick<
37
+ chevre.factory.eventSeries.IEvent,
38
+ 'id' | 'offers' | 'startDate' | 'project' | 'typeOf'
39
+ > = doc.toObject();
40
+
41
+ console.log(
42
+ 'alreadyMigrated?', eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
43
+ const alreadyMigrated = eventSeries.offers?.typeOf === chevre.factory.offerType.Offer;
44
+
45
+ if (alreadyMigrated) {
46
+ console.log(
47
+ 'already migrated.', eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
48
+ } else {
49
+ console.log(
50
+ 'updating...',
51
+ eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
52
+ await eventSeriesRepo.saveEventSeries({
53
+ id: eventSeries.id,
54
+ attributes: <any>{
55
+ ...{
56
+ typeOf: eventSeries.typeOf,
57
+ 'offers.typeOf': chevre.factory.offerType.Offer
58
+ }
59
+ }
60
+ });
61
+ updateCount += 1;
62
+ console.log(
63
+ 'updated.',
64
+ eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
65
+
66
+ }
67
+ });
68
+
69
+ console.log(i, 'docs checked');
70
+ console.log(updateCount, 'docs updated');
71
+ }
72
+
73
+ main()
74
+ .then()
75
+ .catch(console.error);
@@ -0,0 +1,92 @@
1
+ // tslint:disable:no-console
2
+ import * as moment from 'moment-timezone';
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 excludedProject = { id: String(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 roomRepo = await chevre.repository.place.ScreeningRoom.createInstance(mongoose.connection);
15
+ const sectionRepo = await chevre.repository.place.Section.createInstance(mongoose.connection);
16
+
17
+ const cursor = roomRepo.getCursor(
18
+ {
19
+ 'project.id': {
20
+ $ne: 'sskts-development',
21
+ $eq: 'ttts-development'
22
+ }
23
+ // _id: { $eq: '67de46777ec0510590b68922' }
24
+ },
25
+ {
26
+ // _id: 1,
27
+ // about: 1,
28
+ // project: 1,
29
+ // typeOf: 1,
30
+ // issuedBy: 1
31
+ }
32
+ );
33
+ console.log('docs found');
34
+
35
+ const timestamp = moment()
36
+ .tz('Asia/Tokyo')
37
+ .format('YYYYMMDDHHmmss');
38
+
39
+ let i = 0;
40
+ let updateCount = 0;
41
+ await cursor.eachAsync(async (doc) => {
42
+ const room: chevre.factory.place.screeningRoom.IPlace = doc.toObject();
43
+
44
+ const sections = room.containsPlace;
45
+ if (Array.isArray(sections)) {
46
+ for (const section of sections) {
47
+ i += 1;
48
+ const movieTheaterCode = room.containedInPlace?.branchCode;
49
+ if (typeof movieTheaterCode !== 'string') {
50
+ throw new Error('movieTheaterCode undefined');
51
+ }
52
+ const alreadyMigrated = typeof (<any>section).identifier === 'string';
53
+
54
+ if (alreadyMigrated) {
55
+ console.log(
56
+ 'already migrated.', room.project.id, movieTheaterCode, room.branchCode, section.branchCode, i);
57
+ } else {
58
+ // if (typeof identity.id !== 'string') {
59
+ // throw new Error(`id undefined ${identity.id}`);
60
+ // }
61
+ const identifier = `${movieTheaterCode}:${room.branchCode}:${section.branchCode}:${timestamp}`;
62
+
63
+ console.log(
64
+ 'updating...',
65
+ identifier,
66
+ room.project.id, movieTheaterCode, room.branchCode, section.branchCode, i);
67
+ await sectionRepo.migrateSectionIdentifier({
68
+ project: { id: room.project.id },
69
+ identifier,
70
+ branchCode: section.branchCode,
71
+ containedInPlace: {
72
+ branchCode: room.branchCode,
73
+ containedInPlace: {
74
+ branchCode: movieTheaterCode
75
+ }
76
+ }
77
+ });
78
+ updateCount += 1;
79
+ console.log(
80
+ 'updated.', room.project.id, movieTheaterCode, room.branchCode, section.branchCode, i);
81
+ }
82
+ }
83
+ }
84
+ });
85
+
86
+ console.log(i, 'docs checked');
87
+ console.log(updateCount, 'docs updated');
88
+ }
89
+
90
+ main()
91
+ .then()
92
+ .catch(console.error);
@@ -0,0 +1,49 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../../lib/index';
5
+
6
+ async function main() {
7
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
8
+
9
+ const roleRepo = await chevre.repository.Role.createInstance(mongoose.connection);
10
+
11
+ const roleNames = [
12
+ // chevre.factory.role.organizationRole.RoleName.InventoryManager,
13
+ // chevre.factory.role.organizationRole.RoleName.SellersOwner,
14
+ // chevre.factory.role.organizationRole.RoleName.SellersInventoryManager,
15
+ chevre.factory.role.organizationRole.RoleName.TicketClerk
16
+ ];
17
+ const permissions = [
18
+ 'admin.sellers.eventSeries.read'
19
+ ];
20
+ for (const roleName of roleNames) {
21
+ for (const permission of permissions) {
22
+ const result = await roleRepo.addPermissionIfNotExists({
23
+ roleName: { $eq: roleName },
24
+ permission
25
+ });
26
+ console.log('permission added.', result, roleName);
27
+ }
28
+ }
29
+
30
+ // roleNames = [
31
+ // chevre.factory.role.organizationRole.RoleName.TicketClerk
32
+ // ];
33
+ // permissions = [
34
+ // 'admin.sellers.productOffers.read'
35
+ // ];
36
+ // for (const roleName of roleNames) {
37
+ // for (const permission of permissions) {
38
+ // const result = await roleRepo.addPermissionIfNotExists({
39
+ // roleName: { $eq: roleName },
40
+ // permission
41
+ // });
42
+ // console.log('permission added.', result, roleName);
43
+ // }
44
+ // }
45
+ }
46
+
47
+ main()
48
+ .then()
49
+ .catch(console.error);
@@ -0,0 +1,49 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../../lib/index';
5
+
6
+ async function main() {
7
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
8
+
9
+ const roleRepo = await chevre.repository.Role.createInstance(mongoose.connection);
10
+
11
+ const roleNames = [
12
+ // chevre.factory.role.organizationRole.RoleName.InventoryManager,
13
+ chevre.factory.role.organizationRole.RoleName.SellersOwner,
14
+ chevre.factory.role.organizationRole.RoleName.SellersInventoryManager,
15
+ chevre.factory.role.organizationRole.RoleName.TicketClerk
16
+ ];
17
+ const permissions = [
18
+ 'admin.creativeWorks.read'
19
+ ];
20
+ for (const roleName of roleNames) {
21
+ for (const permission of permissions) {
22
+ const result = await roleRepo.addPermissionIfNotExists({
23
+ roleName: { $eq: roleName },
24
+ permission
25
+ });
26
+ console.log('permission added.', result, roleName);
27
+ }
28
+ }
29
+
30
+ // roleNames = [
31
+ // chevre.factory.role.organizationRole.RoleName.TicketClerk
32
+ // ];
33
+ // permissions = [
34
+ // 'admin.sellers.productOffers.read'
35
+ // ];
36
+ // for (const roleName of roleNames) {
37
+ // for (const permission of permissions) {
38
+ // const result = await roleRepo.addPermissionIfNotExists({
39
+ // roleName: { $eq: roleName },
40
+ // permission
41
+ // });
42
+ // console.log('permission added.', result, roleName);
43
+ // }
44
+ // }
45
+ }
46
+
47
+ main()
48
+ .then()
49
+ .catch(console.error);
@@ -0,0 +1,33 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../../lib/index';
5
+
6
+ async function main() {
7
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
8
+
9
+ const roleRepo = await chevre.repository.Role.createInstance(mongoose.connection);
10
+
11
+ const roleNames = [
12
+ // chevre.factory.role.organizationRole.RoleName.InventoryManager,
13
+ // chevre.factory.role.organizationRole.RoleName.SellersOwner,
14
+ // chevre.factory.role.organizationRole.RoleName.SellersInventoryManager,
15
+ chevre.factory.role.organizationRole.RoleName.TicketClerk
16
+ ];
17
+ const permissions = [
18
+ 'admin.sellers.seats.read'
19
+ ];
20
+ for (const roleName of roleNames) {
21
+ for (const permission of permissions) {
22
+ const result = await roleRepo.addPermissionIfNotExists({
23
+ roleName: { $eq: roleName },
24
+ permission
25
+ });
26
+ console.log('permission added.', result, roleName);
27
+ }
28
+ }
29
+ }
30
+
31
+ main()
32
+ .then()
33
+ .catch(console.error);
@@ -0,0 +1,33 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../../lib/index';
5
+
6
+ async function main() {
7
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
8
+
9
+ const roleRepo = await chevre.repository.Role.createInstance(mongoose.connection);
10
+
11
+ const roleNames = [
12
+ chevre.factory.role.organizationRole.RoleName.InventoryManager,
13
+ chevre.factory.role.organizationRole.RoleName.SellersOwner,
14
+ chevre.factory.role.organizationRole.RoleName.SellersInventoryManager
15
+ // chevre.factory.role.organizationRole.RoleName.TicketClerk
16
+ ];
17
+ const permissions = [
18
+ 'admin.sellers.seats.*'
19
+ ];
20
+ for (const roleName of roleNames) {
21
+ for (const permission of permissions) {
22
+ const result = await roleRepo.addPermissionIfNotExists({
23
+ roleName: { $eq: roleName },
24
+ permission
25
+ });
26
+ console.log('permission added.', result, roleName);
27
+ }
28
+ }
29
+ }
30
+
31
+ main()
32
+ .then()
33
+ .catch(console.error);
@@ -31,45 +31,49 @@ class AcceptedPaymentMethodRepo {
31
31
  this.acceptedPaymentMethodModel = connection.model(acceptedPaymentMethod_1.modelName, (0, acceptedPaymentMethod_1.createSchema)());
32
32
  }
33
33
  static CREATE_MONGO_CONDITIONS(params) {
34
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
34
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
35
35
  const andConditions = [];
36
36
  const idEq = (_a = params.id) === null || _a === void 0 ? void 0 : _a.$eq;
37
37
  if (typeof idEq === 'string') {
38
38
  andConditions.push({ _id: { $eq: idEq } });
39
39
  }
40
- const projectIdEq = (_c = (_b = params.project) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.$eq;
40
+ const idIn = (_b = params.id) === null || _b === void 0 ? void 0 : _b.$in;
41
+ if (Array.isArray(idIn)) {
42
+ andConditions.push({ _id: { $in: idIn } });
43
+ }
44
+ const projectIdEq = (_d = (_c = params.project) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$eq;
41
45
  if (typeof projectIdEq === 'string') {
42
46
  andConditions.push({ 'project.id': { $eq: projectIdEq } });
43
47
  }
44
- const identifierEq = (_d = params.identifier) === null || _d === void 0 ? void 0 : _d.$eq;
48
+ const identifierEq = (_e = params.identifier) === null || _e === void 0 ? void 0 : _e.$eq;
45
49
  if (typeof identifierEq === 'string') {
46
50
  andConditions.push({ identifier: { $eq: identifierEq } });
47
51
  }
48
- const identifierIn = (_e = params.identifier) === null || _e === void 0 ? void 0 : _e.$in;
52
+ const identifierIn = (_f = params.identifier) === null || _f === void 0 ? void 0 : _f.$in;
49
53
  if (Array.isArray(identifierIn)) {
50
54
  andConditions.push({ identifier: { $in: identifierIn } });
51
55
  }
52
- const itemOfferedIdEq = (_g = (_f = params.itemOffered) === null || _f === void 0 ? void 0 : _f.id) === null || _g === void 0 ? void 0 : _g.$eq;
56
+ const itemOfferedIdEq = (_h = (_g = params.itemOffered) === null || _g === void 0 ? void 0 : _g.id) === null || _h === void 0 ? void 0 : _h.$eq;
53
57
  if (typeof itemOfferedIdEq === 'string') {
54
58
  andConditions.push({ 'itemOffered.id': { $eq: itemOfferedIdEq } });
55
59
  }
56
- const itemOfferedIdIn = (_j = (_h = params.itemOffered) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.$in;
60
+ const itemOfferedIdIn = (_k = (_j = params.itemOffered) === null || _j === void 0 ? void 0 : _j.id) === null || _k === void 0 ? void 0 : _k.$in;
57
61
  if (Array.isArray(itemOfferedIdIn)) {
58
62
  andConditions.push({ 'itemOffered.id': { $in: itemOfferedIdIn } });
59
63
  }
60
- const acceptedPaymentMethodIdEq = (_l = (_k = params.acceptedPaymentMethod) === null || _k === void 0 ? void 0 : _k.id) === null || _l === void 0 ? void 0 : _l.$eq;
64
+ const acceptedPaymentMethodIdEq = (_m = (_l = params.acceptedPaymentMethod) === null || _l === void 0 ? void 0 : _l.id) === null || _m === void 0 ? void 0 : _m.$eq;
61
65
  if (typeof acceptedPaymentMethodIdEq === 'string') {
62
66
  andConditions.push({ 'acceptedPaymentMethod.id': { $eq: acceptedPaymentMethodIdEq } });
63
67
  }
64
- const sellerByIdEq = (_o = (_m = params.seller) === null || _m === void 0 ? void 0 : _m.id) === null || _o === void 0 ? void 0 : _o.$eq;
68
+ const sellerByIdEq = (_p = (_o = params.seller) === null || _o === void 0 ? void 0 : _o.id) === null || _p === void 0 ? void 0 : _p.$eq;
65
69
  if (typeof sellerByIdEq === 'string') {
66
70
  andConditions.push({ 'seller.id': { $eq: sellerByIdEq } });
67
71
  }
68
- const validFromLte = (_p = params.validFrom) === null || _p === void 0 ? void 0 : _p.$lte;
72
+ const validFromLte = (_q = params.validFrom) === null || _q === void 0 ? void 0 : _q.$lte;
69
73
  if (validFromLte instanceof Date) {
70
74
  andConditions.push({ validFrom: { $lte: validFromLte } });
71
75
  }
72
- const validThroughGte = (_q = params.validThrough) === null || _q === void 0 ? void 0 : _q.$gte;
76
+ const validThroughGte = (_r = params.validThrough) === null || _r === void 0 ? void 0 : _r.$gte;
73
77
  if (validThroughGte instanceof Date) {
74
78
  andConditions.push({ validThrough: { $gte: validThroughGte } });
75
79
  }
@@ -50,7 +50,7 @@ class CreativeWorkRepo {
50
50
  }
51
51
  // tslint:disable-next-line:max-func-body-length
52
52
  static CREATE_MONGO_CONDITIONS(params) {
53
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
53
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
54
54
  const andConditions = [
55
55
  { typeOf: { $eq: factory.creativeWorkType.Movie } }
56
56
  ];
@@ -90,12 +90,16 @@ class CreativeWorkRepo {
90
90
  if (Array.isArray(identifierIn)) {
91
91
  andConditions.push({ identifier: { $in: identifierIn } });
92
92
  }
93
+ const identifierRegex = (_k = params.identifier) === null || _k === void 0 ? void 0 : _k.$regex;
94
+ if (typeof identifierRegex === 'string' && identifierRegex !== '') {
95
+ andConditions.push({ identifier: { $regex: new RegExp(identifierRegex) } });
96
+ }
93
97
  }
94
98
  if (typeof params.name === 'string' && params.name.length > 0) {
95
99
  // 多言語名称対応(2022-07-11~)
96
100
  andConditions.push({
97
101
  $or: [
98
- { name: { $exists: true, $regex: new RegExp(params.name) } },
102
+ // { name: { $exists: true, $regex: new RegExp(params.name) } }, // string型への互換性維持を廃止(2025-12-20~)
99
103
  { 'name.ja': { $exists: true, $regex: new RegExp(params.name) } },
100
104
  { 'name.en': { $exists: true, $regex: new RegExp(params.name) } }
101
105
  ]
@@ -111,15 +115,15 @@ class CreativeWorkRepo {
111
115
  if (params.datePublishedThrough !== undefined) {
112
116
  andConditions.push({ datePublished: { $exists: true, $lte: params.datePublishedThrough } });
113
117
  }
114
- const offersAvailableFrom = (_k = params.offers) === null || _k === void 0 ? void 0 : _k.availableFrom;
118
+ const offersAvailableFrom = (_l = params.offers) === null || _l === void 0 ? void 0 : _l.availableFrom;
115
119
  if (offersAvailableFrom instanceof Date) {
116
120
  andConditions.push({ 'offers.availabilityEnds': { $exists: true, $gte: offersAvailableFrom } });
117
121
  }
118
- const offersAvailableThrough = (_l = params.offers) === null || _l === void 0 ? void 0 : _l.availableThrough;
122
+ const offersAvailableThrough = (_m = params.offers) === null || _m === void 0 ? void 0 : _m.availableThrough;
119
123
  if (offersAvailableThrough instanceof Date) {
120
124
  andConditions.push({ 'offers.availabilityStarts': { $exists: true, $lte: offersAvailableThrough } });
121
125
  }
122
- const additionalPropertyElemMatch = (_m = params.additionalProperty) === null || _m === void 0 ? void 0 : _m.$elemMatch;
126
+ const additionalPropertyElemMatch = (_o = params.additionalProperty) === null || _o === void 0 ? void 0 : _o.$elemMatch;
123
127
  if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
124
128
  andConditions.push({
125
129
  additionalProperty: {
@@ -67,15 +67,16 @@ const indexes = [
67
67
  name: 'searchByProjectId-v20220721'
68
68
  }
69
69
  ],
70
- [
71
- { name: 1, identifier: 1 },
72
- {
73
- name: 'searchByName2',
74
- partialFilterExpression: {
75
- name: { $exists: true }
76
- }
77
- }
78
- ],
70
+ // string型への互換性維持を廃止(2025-12-20~
71
+ // [
72
+ // { name: 1, identifier: 1 },
73
+ // {
74
+ // name: 'searchByName2',
75
+ // partialFilterExpression: {
76
+ // name: { $exists: true }
77
+ // }
78
+ // }
79
+ // ],
79
80
  [
80
81
  { 'name.ja': 1, identifier: 1 },
81
82
  {
@@ -1,6 +1,15 @@
1
- import type { Connection } from 'mongoose';
1
+ import type { Connection, FilterQuery } from 'mongoose';
2
2
  import * as factory from '../../factory';
3
3
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
4
+ interface IUpdateOptions {
5
+ project: {
6
+ id: string;
7
+ };
8
+ parentOrganization?: {
9
+ id?: string;
10
+ };
11
+ movieTheaterCode: string;
12
+ }
4
13
  /**
5
14
  * ルーム編集時レスポンス
6
15
  */
@@ -24,46 +33,20 @@ export declare class ScreeningRoomRepo {
24
33
  private readonly placeModel;
25
34
  constructor(connection: Connection);
26
35
  saveScreeningRooms4coa(params: IMovieTheaterIncludingScreeningRooms): Promise<void>;
27
- createScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containedInPlace' | 'containsPlace' | 'parentOrganization'> & {
28
- containedInPlace: {
29
- branchCode: string;
30
- };
31
- parentOrganization?: {
32
- id?: string;
33
- };
34
- }): Promise<IUpdateScreeningRoomResult>;
35
- updateScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containedInPlace' | 'containsPlace' | 'parentOrganization'> & {
36
- containedInPlace: {
37
- branchCode: string;
38
- };
39
- parentOrganization?: {
40
- id?: string;
41
- };
42
- }, $unset: any): Promise<IUpdateScreeningRoomResult>;
36
+ createRoom(screeningRoom: Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed'>, options: IUpdateOptions): Promise<IUpdateScreeningRoomResult>;
37
+ updateRoomByBranchCode(screeningRoom: Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed'>, $unset: any, options: IUpdateOptions): Promise<IUpdateScreeningRoomResult>;
43
38
  updateScreeningRoomsByContainedInPlaceId(screeningRoom: {
44
39
  project: {
45
40
  id: string;
46
41
  };
47
42
  containedInPlace: Pick<factory.place.screeningRoom.IContainedInPlace, 'id' | 'name'>;
48
43
  }): Promise<void>;
49
- deleteScreeningRoom(screeningRoom: {
50
- project: {
51
- id: string;
52
- };
53
- parentOrganization?: {
54
- id?: string;
55
- };
44
+ deleteRoomByBranchCode(screeningRoom: {
56
45
  /**
57
46
  * ルームコード
58
47
  */
59
48
  branchCode: string;
60
- containedInPlace: {
61
- /**
62
- * 施設コード
63
- */
64
- branchCode: string;
65
- };
66
- }): Promise<IUpdateScreeningRoomResult>;
49
+ }, options: IUpdateOptions): Promise<IUpdateScreeningRoomResult>;
67
50
  deleteScreeningRoomsByMovieTheaterId(params: {
68
51
  project: {
69
52
  id: string;
@@ -114,5 +97,26 @@ export declare class ScreeningRoomRepo {
114
97
  id: string;
115
98
  };
116
99
  }): Promise<void>;
100
+ getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/place/screeningRoom").IPlace & {
101
+ description?: any;
102
+ openingHoursSpecification?: any;
103
+ smokingAllowed?: boolean;
104
+ }> & import("@chevre/factory/lib/place/screeningRoom").IPlace & {
105
+ description?: any;
106
+ openingHoursSpecification?: any;
107
+ smokingAllowed?: boolean;
108
+ } & {
109
+ _id: import("mongoose").Types.ObjectId;
110
+ }, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/place/screeningRoom").IPlace & {
111
+ description?: any;
112
+ openingHoursSpecification?: any;
113
+ smokingAllowed?: boolean;
114
+ }> & import("@chevre/factory/lib/place/screeningRoom").IPlace & {
115
+ description?: any;
116
+ openingHoursSpecification?: any;
117
+ smokingAllowed?: boolean;
118
+ } & {
119
+ _id: import("mongoose").Types.ObjectId;
120
+ }>>;
117
121
  }
118
122
  export {};