@chevre/domain 20.4.0-alpha.0 → 20.4.0-alpha.2

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.
@@ -1,177 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.schema = exports.modelName = void 0;
4
- const mongoose = require("mongoose");
5
- const modelName = 'AccountAction';
6
- exports.modelName = modelName;
7
- const writeConcern = { j: true, w: 'majority', wtimeout: 10000 };
8
- /**
9
- * アクションスキーマ
10
- */
11
- const schema = new mongoose.Schema({
12
- project: mongoose.SchemaTypes.Mixed,
13
- actionStatus: String,
14
- typeOf: String,
15
- identifier: String,
16
- description: String,
17
- agent: mongoose.SchemaTypes.Mixed,
18
- recipient: mongoose.SchemaTypes.Mixed,
19
- result: mongoose.SchemaTypes.Mixed,
20
- error: mongoose.SchemaTypes.Mixed,
21
- object: mongoose.SchemaTypes.Mixed,
22
- startDate: Date,
23
- endDate: Date,
24
- purpose: mongoose.SchemaTypes.Mixed,
25
- potentialActions: mongoose.SchemaTypes.Mixed,
26
- amount: mongoose.SchemaTypes.Mixed,
27
- fromLocation: mongoose.SchemaTypes.Mixed,
28
- toLocation: mongoose.SchemaTypes.Mixed,
29
- instrument: mongoose.SchemaTypes.Mixed
30
- }, {
31
- collection: 'accountActions',
32
- id: true,
33
- read: 'primaryPreferred',
34
- writeConcern: writeConcern,
35
- strict: true,
36
- useNestedStrict: true,
37
- timestamps: {
38
- createdAt: 'createdAt',
39
- updatedAt: 'updatedAt'
40
- },
41
- toJSON: {
42
- getters: false,
43
- virtuals: false,
44
- minimize: false,
45
- versionKey: false
46
- },
47
- toObject: {
48
- getters: false,
49
- virtuals: true,
50
- minimize: false,
51
- versionKey: false
52
- }
53
- });
54
- exports.schema = schema;
55
- schema.index({ createdAt: 1 }, { name: 'searchByCreatedAt' });
56
- schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
57
- schema.index({ identifier: 1 }, {
58
- unique: true,
59
- partialFilterExpression: {
60
- identifier: { $exists: true }
61
- }
62
- });
63
- schema.index({ identifier: 1, startDate: -1 }, {
64
- partialFilterExpression: {
65
- identifier: { $exists: true }
66
- }
67
- });
68
- schema.index({ 'project.id': 1, startDate: -1 }, {
69
- name: 'searchByProjectId-v20220721'
70
- });
71
- schema.index({ typeOf: 1, startDate: -1 }, { name: 'searchByTypeOf-v2' });
72
- schema.index({ actionStatus: 1, startDate: -1 }, { name: 'searchByActionStatus-v2' });
73
- schema.index({ startDate: -1 }, { name: 'searchByStartDate-v2' });
74
- schema.index({ endDate: -1, startDate: -1 }, {
75
- name: 'searchByEndDate-v2',
76
- partialFilterExpression: {
77
- endDate: { $exists: true }
78
- }
79
- });
80
- schema.index({ 'amount.currency': 1, startDate: -1 }, {
81
- name: 'searchByAmountCurrency',
82
- partialFilterExpression: {
83
- 'amount.currency': { $exists: true }
84
- }
85
- });
86
- schema.index({ 'purpose.typeOf': 1, startDate: -1 }, {
87
- name: 'searchByPurposeTypeOf-v2',
88
- partialFilterExpression: {
89
- 'purpose.typeOf': { $exists: true }
90
- }
91
- });
92
- schema.index({ 'purpose.id': 1, startDate: -1 }, {
93
- name: 'searchByPurposeId-v2',
94
- partialFilterExpression: {
95
- 'purpose.id': { $exists: true }
96
- }
97
- });
98
- schema.index({ 'purpose.identifier': 1, startDate: -1 }, {
99
- name: 'searchByPurposeIdentifier',
100
- partialFilterExpression: {
101
- 'purpose.identifier': { $exists: true }
102
- }
103
- });
104
- schema.index({ 'purpose.transactionNumber': 1, startDate: -1 }, {
105
- name: 'searchByPurposeTransactionNumber',
106
- partialFilterExpression: {
107
- 'purpose.transactionNumber': { $exists: true }
108
- }
109
- });
110
- schema.index({ 'object.typeOf': 1, startDate: -1 }, {
111
- name: 'searchByObjectTypeOf-v2',
112
- partialFilterExpression: {
113
- 'object.typeOf': { $exists: true }
114
- }
115
- });
116
- schema.index({ 'fromLocation.typeOf': 1, startDate: -1 }, {
117
- name: 'searchByFromLocationTypeOf-v2',
118
- partialFilterExpression: {
119
- 'fromLocation.typeOf': { $exists: true }
120
- }
121
- });
122
- schema.index({ 'fromLocation.accountNumber': 1, startDate: -1 }, {
123
- name: 'searchByFromLocationAccountNumber-v2',
124
- partialFilterExpression: {
125
- 'fromLocation.accountNumber': { $exists: true }
126
- }
127
- });
128
- schema.index({ 'fromLocation.accountType': 1, startDate: -1 }, {
129
- name: 'searchByFromLocationAccountType-v2',
130
- partialFilterExpression: {
131
- 'fromLocation.accountType': { $exists: true }
132
- }
133
- });
134
- schema.index({ 'toLocation.typeOf': 1, startDate: -1 }, {
135
- name: 'searchByToLocationTypeOf-v2',
136
- partialFilterExpression: {
137
- 'toLocation.typeOf': { $exists: true }
138
- }
139
- });
140
- schema.index({ 'toLocation.accountNumber': 1, startDate: -1 }, {
141
- name: 'searchByToLocationAccountNumber-v2',
142
- partialFilterExpression: {
143
- 'toLocation.accountNumber': { $exists: true }
144
- }
145
- });
146
- schema.index({ 'toLocation.accountType': 1, startDate: -1 }, {
147
- name: 'searchByToLocationAccountType-v2',
148
- partialFilterExpression: {
149
- 'toLocation.accountType': { $exists: true }
150
- }
151
- });
152
- schema.index({ 'fromLocation.typeOf': 1, 'fromLocation.accountType': 1, 'fromLocation.accountNumber': 1, endDate: -1 }, {
153
- name: 'searchTransferActionsByFromAccountLocation',
154
- partialFilterExpression: {
155
- 'fromLocation.typeOf': { $exists: true },
156
- 'fromLocation.accountType': { $exists: true },
157
- 'fromLocation.accountNumber': { $exists: true }
158
- }
159
- });
160
- schema.index({ 'toLocation.typeOf': 1, 'toLocation.accountType': 1, 'toLocation.accountNumber': 1, endDate: -1 }, {
161
- name: 'searchTransferActionsByToAccountLocation',
162
- partialFilterExpression: {
163
- 'toLocation.typeOf': { $exists: true },
164
- 'toLocation.accountType': { $exists: true },
165
- 'toLocation.accountNumber': { $exists: true }
166
- }
167
- });
168
- mongoose.model(modelName, schema)
169
- .on('index',
170
- // tslint:disable-next-line:no-single-line-block-comment
171
- /* istanbul ignore next */
172
- (error) => {
173
- if (error !== undefined) {
174
- // tslint:disable-next-line:no-console
175
- console.error(error);
176
- }
177
- });