@chevre/domain 24.0.0-alpha.82 → 24.0.0-alpha.84

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 (53) hide show
  1. package/lib/chevre/repo/product.js +0 -3
  2. package/lib/chevre/repo/transaction.d.ts +4 -4
  3. package/lib/chevre/repository.d.ts +0 -30
  4. package/lib/chevre/repository.js +2 -68
  5. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +1 -19
  6. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +1 -31
  7. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +1 -5
  8. package/lib/chevre/service/task/deletePerson.js +0 -2
  9. package/lib/chevre/service/task/onResourceDeleted.js +0 -3
  10. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +4 -4
  11. package/lib/chevre/service.d.ts +0 -12
  12. package/lib/chevre/service.js +1 -35
  13. package/package.json +2 -2
  14. package/lib/chevre/factory/availableProductTypes.d.ts +0 -1
  15. package/lib/chevre/factory/availableProductTypes.js +0 -8
  16. package/lib/chevre/repo/account.d.ts +0 -129
  17. package/lib/chevre/repo/account.js +0 -391
  18. package/lib/chevre/repo/accountTransaction.d.ts +0 -65
  19. package/lib/chevre/repo/accountTransaction.js +0 -277
  20. package/lib/chevre/repo/comment.d.ts +0 -42
  21. package/lib/chevre/repo/comment.js +0 -121
  22. package/lib/chevre/repo/mongoose/schemas/account.d.ts +0 -11
  23. package/lib/chevre/repo/mongoose/schemas/account.js +0 -118
  24. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +0 -11
  25. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +0 -149
  26. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +0 -11
  27. package/lib/chevre/repo/mongoose/schemas/comments.js +0 -103
  28. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +0 -11
  29. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +0 -144
  30. package/lib/chevre/repo/permit.d.ts +0 -42
  31. package/lib/chevre/repo/permit.js +0 -77
  32. package/lib/chevre/repo/serviceOutput.d.ts +0 -36
  33. package/lib/chevre/repo/serviceOutput.js +0 -167
  34. package/lib/chevre/repo/serviceOutputIdentifier.d.ts +0 -18
  35. package/lib/chevre/repo/serviceOutputIdentifier.js +0 -74
  36. package/lib/chevre/service/account.d.ts +0 -59
  37. package/lib/chevre/service/account.js +0 -108
  38. package/lib/chevre/service/accountTransaction/deposit.d.ts +0 -14
  39. package/lib/chevre/service/accountTransaction/deposit.js +0 -57
  40. package/lib/chevre/service/accountTransaction/factory.d.ts +0 -10
  41. package/lib/chevre/service/accountTransaction/factory.js +0 -101
  42. package/lib/chevre/service/accountTransaction/transfer.d.ts +0 -14
  43. package/lib/chevre/service/accountTransaction/transfer.js +0 -87
  44. package/lib/chevre/service/accountTransaction/withdraw.d.ts +0 -14
  45. package/lib/chevre/service/accountTransaction/withdraw.js +0 -68
  46. package/lib/chevre/service/accountTransaction.d.ts +0 -20
  47. package/lib/chevre/service/accountTransaction.js +0 -81
  48. package/lib/chevre/service/permit.d.ts +0 -45
  49. package/lib/chevre/service/permit.js +0 -158
  50. package/lib/chevre/service/product.d.ts +0 -9
  51. package/lib/chevre/service/product.js +0 -77
  52. package/lib/chevre/service/task/registerService.d.ts +0 -6
  53. 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 = factory.creativeWork.comment.IComment;
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 = "Comment";
9
- declare function createSchema(): ISchema;
10
- declare const indexes: [d: IndexDefinition, o: IndexOptions][];
11
- export { createSchema, IDocType, IModel, indexes, modelName };
@@ -1,103 +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 = 'Comment';
9
- exports.modelName = modelName;
10
- const schemaDefinition = {
11
- project: mongoose_1.SchemaTypes.Mixed,
12
- typeOf: {
13
- type: String,
14
- required: true
15
- },
16
- about: mongoose_1.SchemaTypes.Mixed,
17
- additionalProperty: [mongoose_1.SchemaTypes.Mixed],
18
- author: mongoose_1.SchemaTypes.Mixed,
19
- // commnet: Comment[]
20
- commentCount: { type: Number, default: 0 },
21
- dateCreated: Date,
22
- dateModified: Date,
23
- mentions: [mongoose_1.SchemaTypes.Mixed],
24
- text: {
25
- type: String,
26
- required: true
27
- }
28
- };
29
- const schemaOptions = {
30
- autoIndex: settings_1.MONGO_AUTO_INDEX,
31
- autoCreate: false,
32
- collection: 'comments',
33
- id: true,
34
- read: 'primary',
35
- writeConcern: writeConcern_1.writeConcern,
36
- strict: true,
37
- strictQuery: false,
38
- timestamps: false, // 2024-08-07~
39
- versionKey: false, // 2024-08-07~
40
- toJSON: {
41
- getters: false,
42
- virtuals: false,
43
- minimize: false,
44
- versionKey: false
45
- },
46
- toObject: {
47
- getters: false,
48
- virtuals: true,
49
- minimize: false,
50
- versionKey: false
51
- }
52
- };
53
- /**
54
- * コメントスキーマ
55
- */
56
- let schema;
57
- function createSchema() {
58
- if (schema === undefined) {
59
- schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
60
- }
61
- return schema;
62
- }
63
- const indexes = [
64
- // [ // discontinue(2024-08-07~)
65
- // { createdAt: 1 },
66
- // { name: 'searchByCreatedAt' }
67
- // ],
68
- // [
69
- // { updatedAt: 1 },
70
- // { name: 'searchByUpdatedAt' }
71
- // ],
72
- [
73
- { dateCreated: 1 },
74
- {
75
- name: 'searchByDateCreated'
76
- }
77
- ],
78
- [
79
- { 'project.id': 1, dateCreated: 1 },
80
- {
81
- name: 'searchByProjectId'
82
- }
83
- ],
84
- [
85
- { 'about.id': 1, dateCreated: 1 },
86
- {
87
- name: 'searchByAboutId',
88
- partialFilterExpression: {
89
- 'about.id': { $exists: true }
90
- }
91
- }
92
- ],
93
- [
94
- { additionalProperty: 1, dateCreated: 1 },
95
- {
96
- name: 'searchByAdditionalProperty',
97
- partialFilterExpression: {
98
- additionalProperty: { $exists: true }
99
- }
100
- }
101
- ]
102
- ];
103
- exports.indexes = indexes;
@@ -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
- }