@chevre/domain 24.0.0-alpha.83 → 24.0.0-alpha.85

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 (61) hide show
  1. package/lib/chevre/repo/aggregateOffer.js +0 -16
  2. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +0 -18
  3. package/lib/chevre/repo/offer/unitPriceInCatalog.js +0 -2
  4. package/lib/chevre/repo/product.js +0 -3
  5. package/lib/chevre/repo/transaction.d.ts +4 -4
  6. package/lib/chevre/repository.d.ts +0 -30
  7. package/lib/chevre/repository.js +2 -68
  8. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.d.ts +0 -2
  9. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +3 -102
  10. package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
  11. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +1 -31
  12. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +0 -2
  13. package/lib/chevre/service/offer/event/authorize.d.ts +0 -2
  14. package/lib/chevre/service/offer/factory.js +1 -4
  15. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +1 -5
  16. package/lib/chevre/service/task/deletePerson.js +0 -2
  17. package/lib/chevre/service/task/onResourceDeleted.js +0 -3
  18. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +4 -4
  19. package/lib/chevre/service.d.ts +0 -12
  20. package/lib/chevre/service.js +1 -35
  21. package/package.json +2 -2
  22. package/lib/chevre/factory/availableProductTypes.d.ts +0 -1
  23. package/lib/chevre/factory/availableProductTypes.js +0 -8
  24. package/lib/chevre/repo/account.d.ts +0 -129
  25. package/lib/chevre/repo/account.js +0 -391
  26. package/lib/chevre/repo/accountTransaction.d.ts +0 -65
  27. package/lib/chevre/repo/accountTransaction.js +0 -277
  28. package/lib/chevre/repo/advanceBookingRequirement.d.ts +0 -35
  29. package/lib/chevre/repo/advanceBookingRequirement.js +0 -108
  30. package/lib/chevre/repo/mongoose/schemas/account.d.ts +0 -11
  31. package/lib/chevre/repo/mongoose/schemas/account.js +0 -118
  32. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +0 -11
  33. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +0 -149
  34. package/lib/chevre/repo/mongoose/schemas/advanceBookingRequirement.d.ts +0 -11
  35. package/lib/chevre/repo/mongoose/schemas/advanceBookingRequirement.js +0 -84
  36. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +0 -11
  37. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +0 -144
  38. package/lib/chevre/repo/permit.d.ts +0 -42
  39. package/lib/chevre/repo/permit.js +0 -77
  40. package/lib/chevre/repo/serviceOutput.d.ts +0 -36
  41. package/lib/chevre/repo/serviceOutput.js +0 -167
  42. package/lib/chevre/repo/serviceOutputIdentifier.d.ts +0 -18
  43. package/lib/chevre/repo/serviceOutputIdentifier.js +0 -74
  44. package/lib/chevre/service/account.d.ts +0 -59
  45. package/lib/chevre/service/account.js +0 -108
  46. package/lib/chevre/service/accountTransaction/deposit.d.ts +0 -14
  47. package/lib/chevre/service/accountTransaction/deposit.js +0 -57
  48. package/lib/chevre/service/accountTransaction/factory.d.ts +0 -10
  49. package/lib/chevre/service/accountTransaction/factory.js +0 -101
  50. package/lib/chevre/service/accountTransaction/transfer.d.ts +0 -14
  51. package/lib/chevre/service/accountTransaction/transfer.js +0 -87
  52. package/lib/chevre/service/accountTransaction/withdraw.d.ts +0 -14
  53. package/lib/chevre/service/accountTransaction/withdraw.js +0 -68
  54. package/lib/chevre/service/accountTransaction.d.ts +0 -20
  55. package/lib/chevre/service/accountTransaction.js +0 -81
  56. package/lib/chevre/service/permit.d.ts +0 -45
  57. package/lib/chevre/service/permit.js +0 -158
  58. package/lib/chevre/service/product.d.ts +0 -9
  59. package/lib/chevre/service/product.js +0 -77
  60. package/lib/chevre/service/task/registerService.d.ts +0 -6
  61. package/lib/chevre/service/task/registerService.js +0 -22
@@ -1,149 +0,0 @@
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 = 'AccountTransaction';
9
- exports.modelName = modelName;
10
- const schemaDefinition = {
11
- project: mongoose_1.SchemaTypes.Mixed,
12
- status: {
13
- type: String,
14
- required: true
15
- },
16
- typeOf: {
17
- type: String,
18
- required: true
19
- },
20
- identifier: String,
21
- transactionNumber: {
22
- type: String,
23
- required: true
24
- },
25
- agent: mongoose_1.SchemaTypes.Mixed,
26
- recipient: mongoose_1.SchemaTypes.Mixed,
27
- object: mongoose_1.SchemaTypes.Mixed,
28
- expires: Date,
29
- startDate: Date,
30
- endDate: Date,
31
- potentialActions: mongoose_1.SchemaTypes.Mixed
32
- };
33
- const schemaOptions = {
34
- autoIndex: settings_1.MONGO_AUTO_INDEX,
35
- autoCreate: false,
36
- collection: 'accountTransactions',
37
- id: true,
38
- read: 'primary',
39
- writeConcern: writeConcern_1.writeConcern,
40
- strict: true,
41
- strictQuery: false,
42
- timestamps: false,
43
- versionKey: false,
44
- toJSON: {
45
- getters: false,
46
- virtuals: false,
47
- minimize: false,
48
- versionKey: false
49
- },
50
- toObject: {
51
- getters: false,
52
- virtuals: true,
53
- minimize: false,
54
- versionKey: false
55
- }
56
- };
57
- const indexes = [
58
- [
59
- { transactionNumber: 1 },
60
- {
61
- unique: true,
62
- partialFilterExpression: {
63
- transactionNumber: { $exists: true }
64
- }
65
- }
66
- ],
67
- [
68
- { transactionNumber: 1, startDate: -1 },
69
- { name: 'searchByTransactionNumber' }
70
- ],
71
- [
72
- { identifier: 1, startDate: -1 },
73
- {
74
- name: 'searchByIdentifier',
75
- partialFilterExpression: {
76
- identifier: { $exists: true }
77
- }
78
- }
79
- ],
80
- [
81
- { 'project.id': 1, startDate: -1 },
82
- { name: 'searchByProjectId-v20220721' }
83
- ],
84
- [
85
- { typeOf: 1, startDate: -1 },
86
- { name: 'searchByTypeOfAndStartDate' }
87
- ],
88
- [
89
- { status: 1, startDate: -1 },
90
- { name: 'searchByStatusAndStartDate' }
91
- ],
92
- [
93
- { startDate: -1 },
94
- { name: 'searchByStartDateDescending' }
95
- ],
96
- [
97
- { endDate: 1, startDate: -1 },
98
- {
99
- name: 'searchByEndDateAndStartDate',
100
- partialFilterExpression: {
101
- endDate: { $exists: true }
102
- }
103
- }
104
- ],
105
- [
106
- { expires: 1, startDate: -1 },
107
- { name: 'searchByExpiresAndStartDate' }
108
- ],
109
- [
110
- { 'object.fromLocation.accountNumber': 1, startDate: -1 },
111
- {
112
- name: 'searchByObjectFromLocationAccountNumber',
113
- partialFilterExpression: {
114
- 'object.fromLocation.accountNumber': { $exists: true }
115
- }
116
- }
117
- ],
118
- [
119
- { 'object.toLocation.accountNumber': 1, startDate: -1 },
120
- {
121
- name: 'searchByObjectToLocationAccountNumber',
122
- partialFilterExpression: {
123
- 'object.toLocation.accountNumber': { $exists: true }
124
- }
125
- }
126
- ],
127
- [
128
- { status: 1, expires: 1 },
129
- {
130
- name: 'makeExpired'
131
- }
132
- ]
133
- ];
134
- exports.indexes = indexes;
135
- /**
136
- * 口座取引スキーマ
137
- */
138
- let schema;
139
- function createSchema() {
140
- if (schema === undefined) {
141
- schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
142
- if (settings_1.MONGO_AUTO_INDEX) {
143
- indexes.forEach((indexParams) => {
144
- schema?.index(...indexParams);
145
- });
146
- }
147
- }
148
- return schema;
149
- }
@@ -1,11 +0,0 @@
1
- import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
- import { IVirtuals } from '../virtuals';
3
- import { factory } from '../../../factory';
4
- type IDocType = Omit<factory.advanceBookingRequirement.IAdvanceBookingRequirement, 'id'>;
5
- type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
6
- type ISchemaDefinition = SchemaDefinition<IDocType>;
7
- type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
8
- declare const modelName = "AdvanceBookingRequirement";
9
- declare const indexes: [d: IndexDefinition, o: IndexOptions][];
10
- declare function createSchema(): ISchema;
11
- export { createSchema, IDocType, IModel, indexes, modelName };
@@ -1,84 +0,0 @@
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 = 'AdvanceBookingRequirement';
9
- exports.modelName = modelName;
10
- const schemaDefinition = {
11
- project: {
12
- type: mongoose_1.SchemaTypes.Mixed,
13
- required: true
14
- },
15
- typeOf: {
16
- type: String,
17
- required: true
18
- },
19
- identifier: {
20
- type: String,
21
- required: true
22
- },
23
- unitCode: {
24
- type: String,
25
- required: true
26
- },
27
- maxValue: Number,
28
- minValue: Number,
29
- description: mongoose_1.SchemaTypes.Mixed,
30
- valueReference: mongoose_1.SchemaTypes.Mixed
31
- };
32
- const schemaOptions = {
33
- autoIndex: settings_1.MONGO_AUTO_INDEX,
34
- autoCreate: false,
35
- collection: 'advanceBookingRequirements',
36
- id: true,
37
- read: settings_1.MONGO_READ_PREFERENCE,
38
- writeConcern: writeConcern_1.writeConcern,
39
- strict: true,
40
- strictQuery: false,
41
- timestamps: false,
42
- versionKey: false,
43
- toJSON: {
44
- getters: false,
45
- virtuals: false,
46
- minimize: false,
47
- versionKey: false
48
- },
49
- toObject: {
50
- getters: false,
51
- virtuals: true,
52
- minimize: false,
53
- versionKey: false
54
- }
55
- };
56
- const indexes = [
57
- [
58
- { identifier: 1 },
59
- { name: 'identifier' }
60
- ],
61
- [
62
- { 'project.id': 1, identifier: 1 },
63
- {
64
- name: 'uniqueIdentifier',
65
- unique: true
66
- }
67
- ]
68
- ];
69
- exports.indexes = indexes;
70
- /**
71
- * 事前予約要件スキーマ
72
- */
73
- let schema;
74
- function createSchema() {
75
- if (schema === undefined) {
76
- schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
77
- if (settings_1.MONGO_AUTO_INDEX) {
78
- indexes.forEach((indexParams) => {
79
- schema?.index(...indexParams);
80
- });
81
- }
82
- }
83
- return schema;
84
- }
@@ -1,11 +0,0 @@
1
- import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
- import { IVirtuals } from '../virtuals';
3
- import { factory } from '../../../factory';
4
- type IDocType = Omit<factory.permit.IPermit, 'id'>;
5
- type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
6
- type ISchemaDefinition = SchemaDefinition<IDocType>;
7
- type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
8
- declare const modelName = "ServiceOutput";
9
- declare function createSchema(): ISchema;
10
- declare const indexes: [d: IndexDefinition, o: IndexOptions][];
11
- export { createSchema, IDocType, IModel, indexes, modelName };
@@ -1,144 +0,0 @@
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 = 'ServiceOutput';
9
- exports.modelName = modelName;
10
- const schemaDefinition = {
11
- project: mongoose_1.SchemaTypes.Mixed,
12
- typeOf: {
13
- type: String,
14
- required: true
15
- }
16
- };
17
- const schemaOptions = {
18
- autoIndex: settings_1.MONGO_AUTO_INDEX,
19
- autoCreate: false,
20
- collection: 'serviceOutputs',
21
- id: true,
22
- read: 'primary',
23
- writeConcern: writeConcern_1.writeConcern,
24
- strict: false,
25
- strictQuery: false,
26
- timestamps: false, // 2024-08-07~
27
- versionKey: false, // 2024-08-07~
28
- toJSON: {
29
- getters: false,
30
- virtuals: false,
31
- minimize: false,
32
- versionKey: false
33
- },
34
- toObject: {
35
- getters: false,
36
- virtuals: true,
37
- minimize: false,
38
- versionKey: false
39
- }
40
- };
41
- /**
42
- * 許可証スキーマ
43
- */
44
- let schema;
45
- function createSchema() {
46
- if (schema === undefined) {
47
- schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
48
- }
49
- return schema;
50
- }
51
- const indexes = [
52
- // [ // discontinue(2024-08-07~)
53
- // { createdAt: 1 },
54
- // { name: 'searchByCreatedAt' }
55
- // ],
56
- // [
57
- // { updatedAt: 1 },
58
- // { name: 'searchByUpdatedAt' }
59
- // ],
60
- [
61
- {
62
- typeOf: 1,
63
- identifier: 1
64
- },
65
- {
66
- name: 'uniqueIdentifier',
67
- unique: true,
68
- partialFilterExpression: {
69
- identifier: { $exists: true }
70
- }
71
- }
72
- ],
73
- [
74
- { dateIssued: -1 },
75
- { name: 'searchByDateIssued' }
76
- ],
77
- [
78
- { 'project.id': 1, dateIssued: -1 },
79
- {
80
- name: 'searchByProjectId-v20220721'
81
- }
82
- ],
83
- [
84
- { typeOf: 1, dateIssued: -1 },
85
- {
86
- name: 'searchByTypeOf'
87
- }
88
- ],
89
- [
90
- { identifier: 1, dateIssued: -1 },
91
- {
92
- name: 'searchByIdentifier',
93
- partialFilterExpression: {
94
- identifier: { $exists: true }
95
- }
96
- }
97
- ],
98
- [
99
- { accessCode: 1, dateIssued: -1 },
100
- {
101
- name: 'searchByAccessCode',
102
- partialFilterExpression: {
103
- accessCode: { $exists: true }
104
- }
105
- }
106
- ],
107
- [
108
- { 'issuedBy.id': 1, dateIssued: -1 },
109
- {
110
- name: 'searchByIssuedById',
111
- partialFilterExpression: {
112
- 'issuedBy.id': { $exists: true }
113
- }
114
- }
115
- ],
116
- [
117
- { 'issuedThrough.typeOf': 1, dateIssued: -1 },
118
- {
119
- name: 'searchByIssuedThroughTypeOf',
120
- partialFilterExpression: {
121
- 'issuedThrough.typeOf': { $exists: true }
122
- }
123
- }
124
- ],
125
- [
126
- { 'issuedThrough.id': 1, dateIssued: -1 },
127
- {
128
- name: 'searchByIssuedThroughId',
129
- partialFilterExpression: {
130
- 'issuedThrough.id': { $exists: true }
131
- }
132
- }
133
- ],
134
- [
135
- { 'issuedThrough.serviceType.codeValue': 1, productID: 1 },
136
- {
137
- name: 'searchByIssuedThroughServiceTypeCodeValue',
138
- partialFilterExpression: {
139
- 'issuedThrough.serviceType.codeValue': { $exists: true }
140
- }
141
- }
142
- ]
143
- ];
144
- exports.indexes = indexes;
@@ -1,42 +0,0 @@
1
- import type { Connection } from 'mongoose';
2
- import { factory } from '../factory';
3
- /**
4
- * 許可証リポジトリ
5
- */
6
- export declare class PermitRepo {
7
- private readonly serviceOutputModel;
8
- constructor(connection: Connection);
9
- findByIdentifier(params: {
10
- project: {
11
- id: {
12
- $eq: string;
13
- };
14
- };
15
- identifier: {
16
- $eq: string;
17
- };
18
- issuedThrough: {
19
- typeOf: {
20
- $eq: factory.product.ProductType;
21
- };
22
- };
23
- }, projection?: any): Promise<factory.product.IServiceOutput>;
24
- findByIdentifierAndAccessCode(params: {
25
- project: {
26
- id: {
27
- $eq: string;
28
- };
29
- };
30
- accessCode: {
31
- $eq: string;
32
- };
33
- identifier: {
34
- $eq: string;
35
- };
36
- issuedThrough: {
37
- typeOf: {
38
- $eq: factory.product.ProductType;
39
- };
40
- };
41
- }, projection?: any): Promise<factory.product.IServiceOutput>;
42
- }
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PermitRepo = void 0;
4
- const serviceOutput_1 = require("./mongoose/schemas/serviceOutput");
5
- const factory_1 = require("../factory");
6
- /**
7
- * 許可証リポジトリ
8
- */
9
- class PermitRepo {
10
- serviceOutputModel;
11
- constructor(connection) {
12
- this.serviceOutputModel = connection.model(serviceOutput_1.modelName, (0, serviceOutput_1.createSchema)());
13
- }
14
- async findByIdentifier(params, projection) {
15
- const query = this.serviceOutputModel.findOne({
16
- 'project.id': {
17
- $eq: params.project.id.$eq
18
- },
19
- identifier: {
20
- $exists: true,
21
- $eq: params.identifier.$eq
22
- },
23
- ...(typeof params.issuedThrough?.typeOf?.$eq === 'string')
24
- ? {
25
- 'issuedThrough.typeOf': {
26
- $exists: true,
27
- $eq: params.issuedThrough.typeOf.$eq
28
- }
29
- }
30
- : undefined
31
- }, {
32
- __v: 0,
33
- createdAt: 0,
34
- updatedAt: 0,
35
- ...projection
36
- });
37
- const doc = await query.exec();
38
- if (doc === null) {
39
- throw new factory_1.factory.errors.NotFound(this.serviceOutputModel.modelName);
40
- }
41
- return doc.toObject();
42
- }
43
- async findByIdentifierAndAccessCode(params, projection) {
44
- const query = this.serviceOutputModel.findOne({
45
- 'project.id': {
46
- $eq: params.project.id.$eq
47
- },
48
- accessCode: {
49
- $exists: true,
50
- $eq: params.accessCode.$eq
51
- },
52
- identifier: {
53
- $exists: true,
54
- $eq: params.identifier.$eq
55
- },
56
- ...(typeof params.issuedThrough?.typeOf?.$eq === 'string')
57
- ? {
58
- 'issuedThrough.typeOf': {
59
- $exists: true,
60
- $eq: params.issuedThrough.typeOf.$eq
61
- }
62
- }
63
- : undefined
64
- }, {
65
- __v: 0,
66
- createdAt: 0,
67
- updatedAt: 0,
68
- ...projection
69
- });
70
- const doc = await query.exec();
71
- if (doc === null) {
72
- throw new factory_1.factory.errors.NotFound(this.serviceOutputModel.modelName);
73
- }
74
- return doc.toObject();
75
- }
76
- }
77
- exports.PermitRepo = PermitRepo;
@@ -1,36 +0,0 @@
1
- import type { Connection } from 'mongoose';
2
- import { factory } from '../factory';
3
- /**
4
- * サービスアウトプットリポジトリ
5
- */
6
- export declare class ServiceOutputRepo {
7
- private readonly serviceOutputModel;
8
- constructor(connection: Connection);
9
- static CREATE_MONGO_CONDITIONS(params: factory.product.IServiceOutputSearchConditions): any[];
10
- /**
11
- * 許可証検索
12
- */
13
- search(params: factory.product.IServiceOutputSearchConditions, projection?: any): Promise<factory.permit.IPermit[]>;
14
- /**
15
- * 許可証発行
16
- */
17
- issue(params: factory.permit.IPermit[]): Promise<void>;
18
- /**
19
- * 許可証有効化
20
- */
21
- activate(params: {
22
- typeOf: string;
23
- identifier: string;
24
- validFrom: Date;
25
- validUntil?: Date;
26
- }): Promise<factory.permit.IPermit>;
27
- deleteByProject(params: {
28
- project: {
29
- id: string;
30
- };
31
- }): Promise<void>;
32
- unsetUnnecessaryFields(params: {
33
- filter: any;
34
- $unset: any;
35
- }): Promise<import("mongoose").UpdateWriteOpResult>;
36
- }