@chevre/domain 23.0.0-alpha.8 → 23.0.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 (66) hide show
  1. package/example/src/chevre/assetTransaction/processReserve.ts +102 -40
  2. package/example/src/chevre/categoryCode/checkUniqueness.ts +69 -0
  3. package/example/src/chevre/event/checkEventAdditionalPropertyUniqueness.ts +108 -0
  4. package/example/src/chevre/event/migrateEventAdditionalProperty2identifier.ts +121 -0
  5. package/example/src/chevre/event/updateSellerMakesOffersByIdentifier.ts +106 -0
  6. package/example/src/chevre/offerCatalog/updateManyOfferCatalogsByIds.ts +49 -0
  7. package/example/src/chevre/paymentServices/findPaymentServices.ts +37 -0
  8. package/example/src/chevre/product/findHasOfferCatalog.ts +31 -0
  9. package/example/src/chevre/reIndex.ts +2 -3
  10. package/example/src/chevre/roles/addAdminNotePermissionIfNotExists.ts +48 -0
  11. package/example/src/chevre/roles/{addAdminProductOfferPermissionIfNotExists.ts → addAdminPaymentServiceReadPermissionIfNotExists.ts} +20 -19
  12. package/example/src/chevre/roles/addAdminProductHasOfferCatalogReadPermissionIfNotExists.ts +33 -0
  13. package/example/src/chevre/roles/addAdminSellerEventIfNotExists.ts +48 -0
  14. package/example/src/chevre/roles/removeConsolePermissionIfExists.ts +1 -1
  15. package/example/src/chevre/roles/removePermissionIfExists.ts +1 -6
  16. package/example/src/chevre/unsetUnnecessaryFields.ts +5 -7
  17. package/example/src/objectId.ts +12 -0
  18. package/example/src/signPayload.ts +12 -7
  19. package/lib/chevre/errorHandler.d.ts +6 -2
  20. package/lib/chevre/errorHandler.js +18 -2
  21. package/lib/chevre/repo/categoryCode.d.ts +26 -14
  22. package/lib/chevre/repo/categoryCode.js +53 -42
  23. package/lib/chevre/repo/event.d.ts +25 -11
  24. package/lib/chevre/repo/event.js +60 -35
  25. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +24 -39
  26. package/lib/chevre/repo/eventSellerMakesOffer.js +88 -43
  27. package/lib/chevre/repo/issuer.js +9 -5
  28. package/lib/chevre/repo/mongoose/schemas/categoryCode.js +48 -42
  29. package/lib/chevre/repo/mongoose/schemas/movieTicketTypes.d.ts +10 -0
  30. package/lib/chevre/repo/mongoose/schemas/movieTicketTypes.js +107 -0
  31. package/lib/chevre/repo/mongoose/schemas/product.d.ts +4 -4
  32. package/lib/chevre/repo/mongoose/schemas/product.js +2 -2
  33. package/lib/chevre/repo/movieTicketType.d.ts +57 -0
  34. package/lib/chevre/repo/movieTicketType.js +253 -0
  35. package/lib/chevre/repo/noteAboutOrder.d.ts +4 -11
  36. package/lib/chevre/repo/noteAboutOrder.js +16 -4
  37. package/lib/chevre/repo/offerCatalog.d.ts +17 -2
  38. package/lib/chevre/repo/offerCatalog.js +5 -2
  39. package/lib/chevre/repo/productHasOfferCatalog.d.ts +43 -0
  40. package/lib/chevre/repo/productHasOfferCatalog.js +71 -0
  41. package/lib/chevre/repository.d.ts +10 -0
  42. package/lib/chevre/repository.js +28 -2
  43. package/lib/chevre/service/assetTransaction/reserve/start.js +2 -2
  44. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.d.ts +15 -0
  45. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.js +159 -0
  46. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.d.ts +16 -0
  47. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.js +184 -0
  48. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +4 -1
  49. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +25 -139
  50. package/lib/chevre/service/event.js +1 -1
  51. package/lib/chevre/service/offer/event/importFromCOA.js +1 -1
  52. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +3 -3
  53. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +3 -3
  54. package/lib/chevre/service/offer/onEventChanged.js +26 -30
  55. package/lib/chevre/service/project.d.ts +3 -0
  56. package/lib/chevre/service/project.js +2 -1
  57. package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -1
  58. package/lib/chevre/service/task/onResourceUpdated.js +1 -1
  59. package/package.json +4 -4
  60. package/example/src/chevre/aggregateEventSellerMakesOffer.ts +0 -32
  61. package/example/src/chevre/event/migrateEventIdentifier4ttts.ts +0 -96
  62. package/example/src/chevre/searchCategoryCodesByAggregate.ts +0 -31
  63. package/example/src/chevre/searchOfferCatalogItems.ts +0 -59
  64. package/example/src/chevre/searchPaymentServices.ts +0 -32
  65. package/example/src/chevre/unsetUnnecessaryFieldsInAction.ts +0 -50
  66. package/example/src/chevre/unsetUnnecessaryFieldsInTransaction.ts +0 -46
@@ -11,62 +11,107 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.EventSellerMakesOfferRepo = void 0;
13
13
  const factory = require("../factory");
14
- const settings_1 = require("../settings");
14
+ // import { MONGO_MAX_TIME_MS } from '../settings';
15
15
  const event_1 = require("./mongoose/schemas/event");
16
+ // type IMatchStage = PipelineStage.Match;
17
+ // type IAggregateMakesOfferResult = Pick<
18
+ // factory.event.screeningEvent.ISellerMakesOffer,
19
+ // 'availabilityEnds' | 'availabilityStarts' | 'validFrom' | 'validThrough'
20
+ // > & {
21
+ // itemOffered: {
22
+ // serviceOutput: {
23
+ // reservationFor: {
24
+ // /**
25
+ // * イベントID
26
+ // */
27
+ // id: string;
28
+ // };
29
+ // };
30
+ // };
31
+ // };
16
32
  /**
17
- * イベントの販売者makesOfferリポジトリ
33
+ * イベントのアプリケーションオファーリポジトリ
18
34
  */
19
35
  class EventSellerMakesOfferRepo {
20
36
  constructor(connection) {
21
37
  this.eventModel = connection.model(event_1.modelName, (0, event_1.createSchema)());
22
38
  }
23
39
  /**
24
- * 指定クライアントのオファーを集計する(2024-10-09~)
40
+ * 単一イベントのmakesOfferを更新する
25
41
  */
26
- aggregateMakesOffer(conditions) {
42
+ updateOffersByEventId(params) {
27
43
  return __awaiter(this, void 0, void 0, function* () {
28
- var _a;
29
- const { availableAtOrFrom } = conditions;
30
- if (typeof ((_a = availableAtOrFrom === null || availableAtOrFrom === void 0 ? void 0 : availableAtOrFrom.id) === null || _a === void 0 ? void 0 : _a.$eq) !== 'string' || availableAtOrFrom.id.$eq === '') {
31
- throw new factory.errors.ArgumentNull('availableAtOrFrom.id.$eq');
32
- }
33
- const matchStages = [
34
- { $match: { 'project.id': { $eq: conditions.project.id.$eq } } },
35
- { $match: { 'offers.seller.makesOffer.availableAtOrFrom.id': { $exists: true, $eq: availableAtOrFrom.id.$eq } } }
36
- ];
37
- const reservationForIdIn = conditions.itemOffered.serviceOutput.reservationFor.id.$in;
38
- if (Array.isArray(reservationForIdIn)) {
39
- matchStages.push({ $match: { _id: { $in: reservationForIdIn } } });
44
+ const { offers, itemOffered, project } = params;
45
+ const updateQuery = {
46
+ $set: {
47
+ 'offers.seller.makesOffer': offers
48
+ }
49
+ };
50
+ const updateFilter = {
51
+ _id: { $eq: itemOffered.id },
52
+ 'project.id': { $eq: project.id }
53
+ };
54
+ const queryOptions = { upsert: false, new: false, projection: { _id: 1 } };
55
+ const doc = yield this.eventModel.findOneAndUpdate(updateFilter, updateQuery, queryOptions)
56
+ .lean()
57
+ .exec();
58
+ if (doc === null) {
59
+ throw new factory.errors.NotFound(this.eventModel.modelName);
40
60
  }
41
- const aggregate = this.eventModel.aggregate([
42
- { $unwind: '$offers.seller.makesOffer' },
43
- ...matchStages,
44
- { $sort: { _id: factory.sortType.Ascending } },
45
- {
46
- $project: {
47
- _id: 0,
48
- availabilityEnds: '$offers.seller.makesOffer.availabilityEnds',
49
- availabilityStarts: '$offers.seller.makesOffer.availabilityStarts',
50
- validFrom: '$offers.seller.makesOffer.validFrom',
51
- validThrough: '$offers.seller.makesOffer.validThrough',
52
- itemOffered: {
53
- serviceOutput: {
54
- reservationFor: {
55
- id: { $toString: '$_id' }
56
- }
57
- }
58
- }
61
+ });
62
+ }
63
+ /**
64
+ * イベントコードをキーにして複数編集
65
+ * 2025-10-27~
66
+ */
67
+ updateSellerMakesOffersByEventIdentifier(params) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const bulkWriteOps = [];
70
+ const queryFilters = [];
71
+ if (Array.isArray(params)) {
72
+ params.forEach(({ $set }) => {
73
+ const { project, identifier, offers } = $set;
74
+ if (typeof identifier !== 'string' || identifier.length === 0) {
75
+ throw new factory.errors.ArgumentNull('identifier');
59
76
  }
60
- }
61
- ]);
62
- if (typeof conditions.limit === 'number' && conditions.limit > 0) {
63
- const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
64
- aggregate.limit(conditions.limit * page)
65
- .skip(conditions.limit * (page - 1));
77
+ const sellerMakesOffer = offers.seller.makesOffer;
78
+ if (!Array.isArray(sellerMakesOffer)) {
79
+ throw new factory.errors.Argument('offers.seller.makesOffer', 'offers.seller.makesOffer must be an array');
80
+ }
81
+ // リソースのユニークネスを保証するfilter
82
+ const filter = {
83
+ 'project.id': { $eq: project.id },
84
+ identifier: { $exists: true, $eq: identifier }
85
+ };
86
+ queryFilters.push({
87
+ 'project.id': { $eq: project.id },
88
+ identifier: { $exists: true, $eq: identifier }
89
+ });
90
+ const setFields = {
91
+ 'offers.seller.makesOffer': sellerMakesOffer
92
+ };
93
+ const updateQuery = {
94
+ $set: setFields
95
+ };
96
+ const updateOne = {
97
+ filter,
98
+ update: updateQuery,
99
+ upsert: false
100
+ };
101
+ bulkWriteOps.push({ updateOne });
102
+ });
103
+ }
104
+ if (bulkWriteOps.length > 0) {
105
+ const bulkWriteResult = yield this.eventModel.bulkWrite(bulkWriteOps, { ordered: false });
106
+ // modifiedの場合upsertedIdsに含まれないので、idを検索する
107
+ const modifiedEvents = yield this.eventModel.find({ $or: queryFilters }, {
108
+ _id: 0,
109
+ id: { $toString: '$_id' }
110
+ })
111
+ .lean()
112
+ .exec();
113
+ return { bulkWriteResult, modifiedEvents };
66
114
  }
67
- return aggregate
68
- .option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
69
- .exec();
70
115
  });
71
116
  }
72
117
  }
@@ -32,17 +32,21 @@ class IssuerRepo {
32
32
  this.issuerModel = connection.model(issuer_1.modelName, (0, issuer_1.createSchema)());
33
33
  }
34
34
  static CREATE_MONGO_CONDITIONS(params) {
35
- var _a, _b, _c, _d;
35
+ var _a, _b, _c, _d, _e;
36
36
  const andConditions = [];
37
37
  const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
38
38
  if (typeof projectIdEq === 'string') {
39
39
  andConditions.push({ 'project.id': { $eq: projectIdEq } });
40
40
  }
41
- const identifiereEq = (_c = params.identifier) === null || _c === void 0 ? void 0 : _c.$eq;
42
- if (typeof identifiereEq === 'string') {
43
- andConditions.push({ identifier: { $eq: identifiereEq } });
41
+ const identifierEq = (_c = params.identifier) === null || _c === void 0 ? void 0 : _c.$eq;
42
+ if (typeof identifierEq === 'string') {
43
+ andConditions.push({ identifier: { $eq: identifierEq } });
44
44
  }
45
- const idEq = (_d = params.id) === null || _d === void 0 ? void 0 : _d.$eq;
45
+ const identifierIn = (_d = params.identifier) === null || _d === void 0 ? void 0 : _d.$in;
46
+ if (Array.isArray(identifierIn)) {
47
+ andConditions.push({ identifier: { $in: identifierIn } });
48
+ }
49
+ const idEq = (_e = params.id) === null || _e === void 0 ? void 0 : _e.$eq;
46
50
  if (typeof idEq === 'string') {
47
51
  andConditions.push({ _id: { $eq: idEq } });
48
52
  }
@@ -4,26 +4,19 @@ exports.modelName = exports.indexes = void 0;
4
4
  exports.createSchema = createSchema;
5
5
  const mongoose_1 = require("mongoose");
6
6
  const writeConcern_1 = require("../writeConcern");
7
- const factory = require("../../../factory");
8
7
  const settings_1 = require("../../../settings");
9
8
  const modelName = 'CategoryCode';
10
9
  exports.modelName = modelName;
11
10
  const schemaDefinition = {
12
11
  project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
13
- typeOf: {
14
- type: String,
15
- required: true
16
- },
12
+ typeOf: { type: String, required: true },
17
13
  additionalProperty: [mongoose_1.SchemaTypes.Mixed],
18
14
  color: String,
19
15
  image: String,
20
- codeValue: {
21
- type: String,
22
- required: true
23
- },
16
+ codeValue: { type: String, required: true },
24
17
  inCodeSet: { type: mongoose_1.SchemaTypes.Mixed, required: true },
25
- name: mongoose_1.SchemaTypes.Mixed,
26
- paymentMethod: mongoose_1.SchemaTypes.Mixed
18
+ name: mongoose_1.SchemaTypes.Mixed
19
+ // paymentMethod: SchemaTypes.Mixed // discontinue(2025-11-08~)
27
20
  };
28
21
  const schemaOptions = {
29
22
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -76,15 +69,16 @@ const indexes = [
76
69
  }
77
70
  }
78
71
  ],
79
- [
80
- { 'paymentMethod.typeOf': 1, codeValue: 1 },
81
- {
82
- name: 'searchByPaymentMethodTypeOf',
83
- partialFilterExpression: {
84
- 'paymentMethod.typeOf': { $exists: true }
85
- }
86
- }
87
- ],
72
+ // discontinue(2025-11-08~)
73
+ // [
74
+ // { 'paymentMethod.typeOf': 1, codeValue: 1 },
75
+ // {
76
+ // name: 'searchByPaymentMethodTypeOf',
77
+ // partialFilterExpression: {
78
+ // 'paymentMethod.typeOf': { $exists: true }
79
+ // }
80
+ // }
81
+ // ],
88
82
  [
89
83
  { 'project.id': 1, codeValue: 1 },
90
84
  {
@@ -100,37 +94,49 @@ const indexes = [
100
94
  }
101
95
  }
102
96
  ],
103
- // add unique index(2024-11-14~)
97
+ // 決済カード区分をコレクション分離したので、reIndex unique index(2025-11-05~)
104
98
  [
105
99
  {
106
100
  'project.id': 1,
107
- 'inCodeSet.identifier': 1,
101
+ 'inCodeSet.identifier': 1, // ssktsでのみ区分分類をまたいで重複がある
108
102
  codeValue: 1
109
103
  },
110
104
  {
111
105
  unique: true,
112
- name: 'uniqueByCodeValueAndInCodeSet',
113
- partialFilterExpression: {
114
- // tslint:disable-next-line:no-null-keyword
115
- 'paymentMethod.typeOf': null
116
- }
117
- }
118
- ],
119
- [
120
- {
121
- 'project.id': 1,
122
- 'paymentMethod.typeOf': 1,
123
- codeValue: 1
124
- },
125
- {
126
- unique: true,
127
- name: 'uniqueByCodeValueAndPaymentMethod',
128
- partialFilterExpression: {
129
- 'inCodeSet.identifier': { $eq: factory.categoryCode.CategorySetIdentifier.MovieTicketType },
130
- 'paymentMethod.typeOf': { $exists: true }
131
- }
106
+ name: 'uniqueByCodeValue'
132
107
  }
133
108
  ]
109
+ // add unique index(2024-11-14~)
110
+ // [
111
+ // {
112
+ // 'project.id': 1,
113
+ // 'inCodeSet.identifier': 1,
114
+ // codeValue: 1
115
+ // },
116
+ // {
117
+ // unique: true,
118
+ // name: 'uniqueByCodeValueAndInCodeSet',
119
+ // partialFilterExpression: {
120
+ // // tslint:disable-next-line:no-null-keyword
121
+ // 'paymentMethod.typeOf': null
122
+ // }
123
+ // }
124
+ // ],
125
+ // [
126
+ // {
127
+ // 'project.id': 1,
128
+ // 'paymentMethod.typeOf': 1,
129
+ // codeValue: 1
130
+ // },
131
+ // {
132
+ // unique: true,
133
+ // name: 'uniqueByCodeValueAndPaymentMethod',
134
+ // partialFilterExpression: {
135
+ // 'inCodeSet.identifier': { $eq: factory.movieTicketType.CategorySetIdentifier.MovieTicketType },
136
+ // 'paymentMethod.typeOf': { $exists: true }
137
+ // }
138
+ // }
139
+ // ]
134
140
  ];
135
141
  exports.indexes = indexes;
136
142
  /**
@@ -0,0 +1,10 @@
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ type IDocType = factory.movieTicketType.IMovieTicketType;
4
+ type IModel = Model<IDocType>;
5
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
6
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
7
+ declare const modelName = "MovieTicketType";
8
+ declare const indexes: [d: IndexDefinition, o: IndexOptions][];
9
+ declare function createSchema(): ISchema;
10
+ export { createSchema, IModel, IDocType, indexes, modelName };
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modelName = exports.indexes = void 0;
4
+ exports.createSchema = createSchema;
5
+ const mongoose_1 = require("mongoose");
6
+ const writeConcern_1 = require("../writeConcern");
7
+ const settings_1 = require("../../../settings");
8
+ const modelName = 'MovieTicketType';
9
+ exports.modelName = modelName;
10
+ const schemaDefinition = {
11
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
+ typeOf: { type: String, required: true },
13
+ // additionalProperty: [SchemaTypes.Mixed],
14
+ color: String,
15
+ image: String,
16
+ codeValue: { type: String, required: true },
17
+ inCodeSet: { type: mongoose_1.SchemaTypes.Mixed, required: true },
18
+ name: mongoose_1.SchemaTypes.Mixed,
19
+ paymentMethod: { type: mongoose_1.SchemaTypes.Mixed, required: true }
20
+ };
21
+ const schemaOptions = {
22
+ autoIndex: settings_1.MONGO_AUTO_INDEX,
23
+ autoCreate: false,
24
+ collection: 'movieTicketTypes',
25
+ id: true,
26
+ read: settings_1.MONGO_READ_PREFERENCE,
27
+ writeConcern: writeConcern_1.writeConcern,
28
+ strict: true,
29
+ strictQuery: false,
30
+ timestamps: false, // 2024-08-22~
31
+ versionKey: false, // 2024-08-22~
32
+ toJSON: {
33
+ getters: false,
34
+ virtuals: false,
35
+ minimize: false,
36
+ versionKey: false
37
+ },
38
+ toObject: {
39
+ getters: false,
40
+ virtuals: true,
41
+ minimize: false,
42
+ versionKey: false
43
+ }
44
+ };
45
+ const indexes = [
46
+ [
47
+ { codeValue: 1 },
48
+ { name: 'codeValue' }
49
+ ],
50
+ [
51
+ { 'project.id': 1, codeValue: 1 },
52
+ { name: 'projectId' }
53
+ ],
54
+ [
55
+ { 'paymentMethod.typeOf': 1, codeValue: 1 },
56
+ { name: 'paymentMethodTypeOf' }
57
+ ],
58
+ [
59
+ { 'inCodeSet.identifier': 1, codeValue: 1 },
60
+ { name: 'inCodeSetIdentifier' }
61
+ ],
62
+ [
63
+ {
64
+ 'project.id': 1,
65
+ 'paymentMethod.typeOf': 1,
66
+ codeValue: 1
67
+ },
68
+ {
69
+ unique: true,
70
+ name: 'uniqueByCodeValueAndPaymentMethod'
71
+ }
72
+ ],
73
+ [
74
+ { 'name.ja': 1, codeValue: 1 },
75
+ {
76
+ name: 'nameJa',
77
+ partialFilterExpression: {
78
+ 'name.ja': { $exists: true }
79
+ }
80
+ }
81
+ ],
82
+ [
83
+ { 'name.en': 1, codeValue: 1 },
84
+ {
85
+ name: 'nameEn',
86
+ partialFilterExpression: {
87
+ 'name.en': { $exists: true }
88
+ }
89
+ }
90
+ ]
91
+ ];
92
+ exports.indexes = indexes;
93
+ /**
94
+ * 決済カード区分スキーマ
95
+ */
96
+ let schema;
97
+ function createSchema() {
98
+ if (schema === undefined) {
99
+ schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
100
+ if (settings_1.MONGO_AUTO_INDEX) {
101
+ indexes.forEach((indexParams) => {
102
+ schema === null || schema === void 0 ? void 0 : schema.index(...indexParams);
103
+ });
104
+ }
105
+ }
106
+ return schema;
107
+ }
@@ -1,8 +1,8 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import * as factory from '../../../factory';
3
- export type IDocTypeAsProduct = Omit<factory.product.IProduct, 'id'>;
4
- export interface IDocTypeAsProductOffer {
5
- offers?: [];
3
+ type IDocTypeAsProduct = Omit<factory.product.IProduct, 'id'>;
4
+ interface IDocTypeAsProductOffer {
5
+ offers?: never;
6
6
  }
7
7
  type IDocType = IDocTypeAsProduct & IDocTypeAsProductOffer;
8
8
  type IModel = Model<IDocType>;
@@ -11,4 +11,4 @@ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocT
11
11
  declare const modelName = "Product";
12
12
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
13
13
  declare function createSchema(): ISchema;
14
- export { createSchema, IModel, indexes, modelName };
14
+ export { createSchema, IDocTypeAsProduct, IDocTypeAsProductOffer, IModel, indexes, modelName };
@@ -8,14 +8,14 @@ const settings_1 = require("../../../settings");
8
8
  const modelName = 'Product';
9
9
  exports.modelName = modelName;
10
10
  const schemaDefinition = {
11
- project: mongoose_1.SchemaTypes.Mixed,
11
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
12
  typeOf: { type: String, required: true },
13
13
  additionalProperty: [mongoose_1.SchemaTypes.Mixed],
14
14
  availableChannel: mongoose_1.SchemaTypes.Mixed,
15
15
  description: mongoose_1.SchemaTypes.Mixed,
16
16
  hasOfferCatalog: mongoose_1.SchemaTypes.Mixed,
17
17
  name: mongoose_1.SchemaTypes.Mixed,
18
- offers: [mongoose_1.SchemaTypes.Mixed],
18
+ // offers: [SchemaTypes.Mixed], // discontinue(2025-10-15~)
19
19
  productID: { type: String, required: true },
20
20
  // provider: [SchemaTypes.Mixed], // 廃止(2024-04-12~)
21
21
  serviceOutput: mongoose_1.SchemaTypes.Mixed,
@@ -0,0 +1,57 @@
1
+ import { AnyExpression, Connection, FilterQuery } from 'mongoose';
2
+ import { IDocType } from './mongoose/schemas/movieTicketTypes';
3
+ import * as factory from '../factory';
4
+ type IUnset = {
5
+ [key in keyof Pick<IDocType, 'color' | 'image'>]?: 1;
6
+ };
7
+ type IKeyOfProjection = keyof IDocType;
8
+ /**
9
+ * 決済カード区分リポジトリ
10
+ */
11
+ export declare class MovieTicketTypeRepo {
12
+ private readonly categoryCodeModel;
13
+ constructor(connection: Connection);
14
+ static CREATE_MONGO_CONDITIONS(params: factory.movieTicketType.ISearchConditions): FilterQuery<IDocType>[];
15
+ static CREATE_AGGREGATE_PROJECTION(inclusion: IKeyOfProjection[]): {
16
+ [field: string]: AnyExpression;
17
+ };
18
+ /**
19
+ * 決済カード区分検索
20
+ */
21
+ projectMovieTicketTypeFields(params: Omit<factory.movieTicketType.ISearchConditions, 'inCodeSet'> & {
22
+ inCodeSet?: {
23
+ identifier?: {
24
+ $eq?: factory.movieTicketType.CategorySetIdentifier.MovieTicketType;
25
+ };
26
+ };
27
+ },
28
+ /**
29
+ * 空の場合無効
30
+ */
31
+ inclusion: IKeyOfProjection[]): Promise<(IDocType & {
32
+ id: string;
33
+ })[]>;
34
+ saveMovieTicketType(params: {
35
+ id?: string;
36
+ attributes: IDocType & {
37
+ $unset?: IUnset;
38
+ };
39
+ }): Promise<{
40
+ id: string;
41
+ }>;
42
+ /**
43
+ * 削除する
44
+ */
45
+ deleteMovieTicketTypeById(params: {
46
+ id: string;
47
+ }): Promise<void>;
48
+ /**
49
+ * プロジェクト指定で削除する
50
+ */
51
+ deleteMovieTicketTypesByProject(params: {
52
+ project: {
53
+ id: string;
54
+ };
55
+ }): Promise<void>;
56
+ }
57
+ export {};