master_data_tool 0.22.0 → 0.24.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.
- checksums.yaml +4 -4
- data/exe/master_data_tool +3 -65
- data/lib/master_data_tool/act_as_master_data.rb +13 -0
- data/lib/master_data_tool/command/dump.rb +43 -0
- data/lib/master_data_tool/command/import.rb +86 -0
- data/lib/master_data_tool/command/verify.rb +64 -0
- data/lib/master_data_tool/command.rb +5 -0
- data/lib/master_data_tool/config.rb +3 -7
- data/lib/master_data_tool/dump/config.rb +42 -0
- data/lib/master_data_tool/dump/executor.rb +9 -15
- data/lib/master_data_tool/dump.rb +1 -0
- data/lib/master_data_tool/import/config.rb +35 -0
- data/lib/master_data_tool/import/executor.rb +49 -76
- data/lib/master_data_tool/import.rb +1 -0
- data/lib/master_data_tool/master_data.rb +48 -36
- data/lib/master_data_tool/master_data_collection.rb +1 -1
- data/lib/master_data_tool/master_data_file.rb +4 -4
- data/lib/master_data_tool/master_data_file_collection.rb +10 -8
- data/lib/master_data_tool/master_data_status.rb +18 -9
- data/lib/master_data_tool/report/core.rb +2 -2
- data/lib/master_data_tool/report/default_printer.rb +1 -1
- data/lib/master_data_tool/report/import_report.rb +13 -15
- data/lib/master_data_tool/report/print_affected_table_report.rb +2 -2
- data/lib/master_data_tool/report/printer.rb +2 -2
- data/lib/master_data_tool/report/verify_report.rb +8 -8
- data/lib/master_data_tool/spec_config.rb +8 -10
- data/lib/master_data_tool/verify/config.rb +39 -0
- data/lib/master_data_tool/verify/executor.rb +39 -0
- data/lib/master_data_tool/verify.rb +4 -0
- data/lib/master_data_tool/version.rb +1 -1
- data/lib/master_data_tool.rb +23 -3
- data/sig/master_data_tool.rbs +321 -171
- metadata +54 -17
- data/LICENSE +0 -21
- data/README.md +0 -242
data/sig/master_data_tool.rbs
CHANGED
|
@@ -1,25 +1,196 @@
|
|
|
1
|
-
# TypeProf 0.21.3
|
|
2
|
-
|
|
3
|
-
# Classes
|
|
4
1
|
module MasterDataTool
|
|
5
2
|
VERSION: String
|
|
6
|
-
self.@config: Config
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
module ActAsMasterData
|
|
5
|
+
extend ActiveSupport::Concern
|
|
6
|
+
|
|
7
|
+
def master_data?: () -> true
|
|
8
|
+
end
|
|
11
9
|
|
|
12
10
|
class Config
|
|
13
|
-
def initialize: -> void
|
|
11
|
+
def initialize: () -> void
|
|
12
|
+
|
|
13
|
+
def spec_config: (String spec_name) -> untyped
|
|
14
|
+
|
|
15
|
+
def csv_dir_for: (spec_name: String, override_identifier: String?) -> Pathname
|
|
14
16
|
end
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
module Dump
|
|
19
|
+
class Config
|
|
20
|
+
DEFAULT_IGNORE_TABLES: [String]
|
|
21
|
+
DEFAULT_IGNORE_COLUMNS: [String]
|
|
22
|
+
DEFAULT_VALUES: { ignore_empty_table: bool, ignore_tables: Array[String], ignore_column_names: Array[String], only_tables: Array[String] }
|
|
23
|
+
|
|
24
|
+
attr_accessor ignore_empty_table: bool
|
|
25
|
+
attr_accessor ignore_tables: Array[String]
|
|
26
|
+
attr_accessor ignore_column_names: Array[String]
|
|
27
|
+
attr_accessor only_tables: Array[String]
|
|
28
|
+
|
|
29
|
+
def initialize: (ignore_empty_table: bool, ignore_tables: Array[String], ignore_column_names: Array[String], only_tables: Array[String]) -> void
|
|
30
|
+
|
|
31
|
+
def configure: () -> Config
|
|
32
|
+
|
|
33
|
+
def self.default_config: () -> Config
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
class Executor
|
|
37
|
+
class Error < Struct[untyped]
|
|
38
|
+
attr_accessor table: String
|
|
39
|
+
attr_accessor exception: StandardError
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def initialize: (spec_config: SpecConfig, dump_config: Dump::Config, verbose: bool) -> void
|
|
43
|
+
|
|
44
|
+
def execute: () -> Array[Error]
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
attr_reader spec_config: SpecConfig
|
|
49
|
+
attr_reader dump_config: Dump::Config
|
|
50
|
+
attr_reader verbose: bool
|
|
51
|
+
|
|
52
|
+
def print_message: (String message) -> nil
|
|
53
|
+
|
|
54
|
+
def dump_to_csv: (String table) -> nil
|
|
55
|
+
|
|
56
|
+
def ignore?: (Class model_klass) -> bool
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
module Import
|
|
61
|
+
class Config
|
|
62
|
+
DEFAULT_VALUES: { only_tables: Array[String], except_tables: Array[String], skip_no_change: bool, ignore_foreign_key_when_delete: bool }
|
|
63
|
+
|
|
64
|
+
attr_accessor only_tables: Array[String]
|
|
65
|
+
attr_accessor except_tables: Array[String]
|
|
66
|
+
attr_accessor skip_no_change: bool
|
|
67
|
+
attr_accessor ignore_foreign_key_when_delete: bool
|
|
68
|
+
|
|
69
|
+
def initialize: (only_tables: Array[String], except_tables: Array[String], skip_no_change: bool, ignore_foreign_key_when_delete: bool) -> void
|
|
70
|
+
|
|
71
|
+
def skip_table?: (String table_name) -> bool
|
|
72
|
+
|
|
73
|
+
def configure: () -> Config
|
|
74
|
+
|
|
75
|
+
def self.default_config: () -> Config
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
class Executor
|
|
79
|
+
def initialize: (spec_config: SpecConfig, import_config: Import::Config?, verify_config: Verify::Config?, dry_run: bool, verify: bool, silent: bool, override_identifier: String?, report_printer: Report::Printer?) -> void
|
|
80
|
+
|
|
81
|
+
def execute: () -> nil
|
|
82
|
+
|
|
83
|
+
private
|
|
84
|
+
|
|
85
|
+
attr_reader spec_config: SpecConfig
|
|
86
|
+
attr_reader import_config: Import::Config
|
|
87
|
+
attr_reader verify_config: Verify::Config
|
|
88
|
+
attr_reader dry_run: bool
|
|
89
|
+
attr_reader verify: bool
|
|
90
|
+
attr_reader silent: bool
|
|
91
|
+
attr_reader override_identifier: String?
|
|
92
|
+
attr_reader report_printer: Report::DefaultPrinter
|
|
93
|
+
attr_reader master_data_statuses_by_name: Hash[String, MasterDataStatus]
|
|
94
|
+
|
|
95
|
+
def load_master_data_statuses: () -> Hash[String, MasterDataStatus]
|
|
96
|
+
|
|
97
|
+
def print_execute_options: () -> nil
|
|
98
|
+
|
|
99
|
+
def build_master_data_collection: () -> MasterDataCollection
|
|
100
|
+
|
|
101
|
+
def import_all!: (MasterDataCollection master_data_collection) -> untyped
|
|
102
|
+
|
|
103
|
+
def transaction: -> untyped
|
|
104
|
+
|
|
105
|
+
def verify_all!: (MasterDataCollection master_data_collection) -> untyped
|
|
106
|
+
|
|
107
|
+
def save_master_data_statuses!: (MasterDataCollection master_data_collection) -> untyped
|
|
108
|
+
|
|
109
|
+
def print_affected_tables: (MasterDataCollection master_data_collection) -> untyped
|
|
110
|
+
|
|
111
|
+
def load_skip_table?: (MasterDataFile master_data_file) -> bool
|
|
112
|
+
|
|
113
|
+
def extract_master_data_csv_paths: () -> Array[Pathname]
|
|
114
|
+
|
|
115
|
+
def overridden_master_data_csv_paths: () -> Array[Pathname]
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
class MasterData
|
|
120
|
+
@affected: bool
|
|
121
|
+
@before_count: Integer
|
|
122
|
+
@after_count: Integer
|
|
123
|
+
|
|
124
|
+
attr_reader master_data_file: MasterDataFile
|
|
125
|
+
attr_reader model_klass: Class
|
|
126
|
+
attr_accessor columns: Array[String]
|
|
127
|
+
attr_reader spec_config: SpecConfig
|
|
128
|
+
attr_writer loaded: bool
|
|
129
|
+
attr_writer new_records: Array[ActiveRecord::Base]
|
|
130
|
+
attr_writer updated_records: Array[ActiveRecord::Base]
|
|
131
|
+
attr_writer no_change_records: Array[ActiveRecord::Base]
|
|
132
|
+
attr_writer deleted_records: Array[ActiveRecord::Base]
|
|
133
|
+
|
|
134
|
+
def decide_preload_associations: (Verify::Config verify_config) -> Array[String]
|
|
135
|
+
|
|
136
|
+
def decide_eager_load_associations: (Verify::Config verify_config) -> Array[String]
|
|
137
|
+
|
|
138
|
+
def initialize: (spec_config: SpecConfig, master_data_file: MasterDataFile, model_klass: Class) -> void
|
|
139
|
+
|
|
140
|
+
def self.build: (spec_config: SpecConfig, master_data_file: MasterDataFile, load: bool) -> MasterData
|
|
141
|
+
|
|
142
|
+
def basename: () -> Pathname
|
|
143
|
+
|
|
144
|
+
def load: () -> true
|
|
145
|
+
|
|
146
|
+
def import_records: () -> Array[ActiveRecord::Base]
|
|
147
|
+
|
|
148
|
+
def affected_records: () -> Array[ActiveRecord::Base]
|
|
149
|
+
|
|
150
|
+
def new_records: () -> Array[ActiveRecord::Base]
|
|
151
|
+
|
|
152
|
+
def updated_records: () -> Array[ActiveRecord::Base]
|
|
153
|
+
|
|
154
|
+
def no_change_records: () -> Array[ActiveRecord::Base]
|
|
155
|
+
|
|
156
|
+
def deleted_records: () -> Array[ActiveRecord::Base]
|
|
157
|
+
|
|
158
|
+
def loaded?: () -> bool
|
|
159
|
+
|
|
160
|
+
def affected?: () -> bool
|
|
161
|
+
|
|
162
|
+
def before_count: () -> Integer
|
|
163
|
+
|
|
164
|
+
def after_count: () -> Integer
|
|
165
|
+
|
|
166
|
+
def table_name: () -> String
|
|
167
|
+
|
|
168
|
+
def import!: (import_config: Import::Config, ?dry_run: bool) -> Report::ImportReport
|
|
169
|
+
|
|
170
|
+
def verify!: (verify_config: Verify::Config, ?ignore_fail: bool) -> Report::VerifyReport
|
|
171
|
+
|
|
172
|
+
def print_affected_table: () -> Report::PrintAffectedTableReport
|
|
173
|
+
|
|
174
|
+
private
|
|
175
|
+
|
|
176
|
+
def build_records_from_csv: (untyped csv, Hash[Integer, ActiveRecord::Base] old_records_by_id) -> Hash[Integer, ActiveRecord::Base]
|
|
177
|
+
|
|
178
|
+
def enable_foreign_key_checks: () -> void
|
|
179
|
+
|
|
180
|
+
def disable_foreign_key_checks: () -> void
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
class MasterDataCollection
|
|
184
|
+
@collection: Array[MasterData]
|
|
185
|
+
|
|
186
|
+
def initialize: () -> void
|
|
187
|
+
|
|
188
|
+
def append: (master_data: MasterData) -> Array[MasterData]
|
|
189
|
+
|
|
190
|
+
def each: () { (MasterData) -> void } -> void
|
|
191
|
+
| () -> Enumerator[void, MasterData]
|
|
192
|
+
|
|
193
|
+
def to_a: () -> Array[MasterData]
|
|
23
194
|
end
|
|
24
195
|
|
|
25
196
|
class MasterDataFile
|
|
@@ -27,224 +198,203 @@ module MasterDataTool
|
|
|
27
198
|
attr_reader table_name: String
|
|
28
199
|
attr_reader path: Pathname
|
|
29
200
|
attr_reader override_identifier: String?
|
|
30
|
-
|
|
31
|
-
def
|
|
32
|
-
|
|
33
|
-
def
|
|
201
|
+
|
|
202
|
+
def initialize: (spec_name: String, table_name: String, path: Pathname, override_identifier: String?) -> void
|
|
203
|
+
|
|
204
|
+
def self.build: (spec_name: String, path: Pathname, override_identifier: String?) -> MasterDataFile
|
|
205
|
+
|
|
206
|
+
def basename: () -> Pathname
|
|
207
|
+
|
|
208
|
+
def ==: (Integer | Object other) -> bool
|
|
209
|
+
|
|
34
210
|
alias eql? ==
|
|
35
|
-
|
|
211
|
+
|
|
212
|
+
def hash: () -> Integer
|
|
36
213
|
end
|
|
37
214
|
|
|
38
215
|
class MasterDataFileCollection
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
216
|
+
attr_reader collection: [MasterDataFile]
|
|
217
|
+
attr_reader spec_name: String
|
|
218
|
+
attr_reader override_identifier: String?
|
|
219
|
+
|
|
220
|
+
def initialize: (spec_name: String, override_identifier: String?) -> void
|
|
221
|
+
|
|
222
|
+
def to_a: () -> Array[MasterDataFile]
|
|
42
223
|
|
|
43
|
-
def
|
|
44
|
-
|
|
45
|
-
def to_a: -> Array[MasterDataFile]
|
|
224
|
+
def each: () { (MasterDataFile) -> void } -> void
|
|
225
|
+
| () -> Enumerator[void, MasterDataFile]
|
|
46
226
|
|
|
47
227
|
private
|
|
48
|
-
def build: -> Array[MasterDataFile]
|
|
49
|
-
def extract_master_data_csv_paths: -> Array[MasterDataFile]
|
|
50
|
-
def overridden_master_data_csv_paths: -> Array[MasterDataFile]
|
|
51
|
-
end
|
|
52
228
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
attr_reader default_import_options: Hash[String,Class]
|
|
59
|
-
attr_reader logger: Logger
|
|
60
|
-
attr_reader preload_associations: Hash[Class, Array[Symbol]]
|
|
61
|
-
attr_reader eager_load_associations: Hash[Class, Array[Symbol]]
|
|
62
|
-
|
|
63
|
-
def initialize: (spec_name: String, application_record_class: Class, dump_ignore_tables: Array[String], dump_ignore_columns: Array[String],
|
|
64
|
-
default_import_options: Hash[String,Class], logger: Logger, preload_associations: Hash[Class, Array[Symbol]], eager_load_associations: Hash[Class, Array[Symbol]]) -> void
|
|
229
|
+
def build: () -> untyped
|
|
230
|
+
|
|
231
|
+
def extract_master_data_csv_paths: () -> untyped
|
|
232
|
+
|
|
233
|
+
def overridden_master_data_csv_paths: () -> Array[untyped]
|
|
65
234
|
end
|
|
66
235
|
|
|
67
|
-
class
|
|
68
|
-
|
|
69
|
-
@affected: bool
|
|
70
|
-
@preload_associations: Array[untyped]
|
|
71
|
-
@eager_load_associations: Array[untyped]
|
|
236
|
+
class MasterDataStatus
|
|
237
|
+
def will_change?: (MasterData master_data_file) -> bool
|
|
72
238
|
|
|
73
|
-
|
|
74
|
-
attr_reader master_data_file: MasterDataFile
|
|
75
|
-
attr_reader model_klass: untyped
|
|
76
|
-
attr_reader columns: Array[String]
|
|
77
|
-
attr_reader new_records: Array[untyped]
|
|
78
|
-
def new_records: -> Array[untyped]
|
|
79
|
-
attr_reader updated_records: Array[untyped]
|
|
80
|
-
def updated_records: -> Array[untyped]
|
|
81
|
-
attr_reader no_change_records: Array[untyped]
|
|
82
|
-
def no_change_records: -> Array[untyped]
|
|
83
|
-
attr_reader deleted_records: Array[untyped]
|
|
84
|
-
def deleted_records: -> Array[untyped]
|
|
85
|
-
attr_reader before_count: Integer
|
|
86
|
-
def before_count: -> Integer
|
|
87
|
-
attr_reader after_count: Integer
|
|
88
|
-
def after_count: -> Integer
|
|
89
|
-
def initialize: (SpecConfig spec_config, MasterDataFile master_data_file, untyped model_klass) -> void
|
|
90
|
-
def self.build: (SpecConfig spec_config, MasterDataFile master_data_file, ?load: bool) -> MasterData
|
|
91
|
-
def basename: -> Pathname
|
|
92
|
-
def load: -> true
|
|
93
|
-
def import_records: -> Array[untyped]
|
|
94
|
-
def affected_records: -> Array[untyped]
|
|
95
|
-
def loaded?: -> bool
|
|
96
|
-
def affected?: -> bool?
|
|
97
|
-
def table_name: -> String
|
|
98
|
-
def import!: (?dry_run: true, ?delete_all_ignore_foreign_key: false) -> Report::ImportReport
|
|
99
|
-
def verify!: (?ignore_fail: bool) -> Report::VerifyReport
|
|
100
|
-
def print_affected_table: -> Report::PrintAffectedTableReport?
|
|
239
|
+
def model_klass: () -> Class
|
|
101
240
|
|
|
102
|
-
|
|
103
|
-
def preload_associations: -> Array[untyped]
|
|
104
|
-
def eager_load_associations: -> Array[untyped]
|
|
105
|
-
def build_records_from_csv: (Array[Array[String?]] csv, Hash[Integer, untyped] old_records_by_id) -> Hash[Integer, untyped]
|
|
106
|
-
def enable_foreign_key_checks: -> untyped
|
|
107
|
-
def disable_foreign_key_checks: -> untyped
|
|
108
|
-
end
|
|
241
|
+
def self.build: (spec_name: String, master_data_file: MasterDataFile) -> MasterDataStatus
|
|
109
242
|
|
|
110
|
-
|
|
111
|
-
|
|
243
|
+
def self.import_records!: (records: [MasterDataStatus], dry_run: bool) -> nil
|
|
244
|
+
|
|
245
|
+
def self.decide_version: (Pathname csv_path) -> String
|
|
112
246
|
|
|
113
|
-
def
|
|
114
|
-
def append: (MasterData master_data) -> Array[MasterData]
|
|
115
|
-
def each: ?{ (MasterData) -> (Array[MasterDataStatus | {operation: :verify, table_name: untyped, valid: untyped, id: untyped}]?) } -> (Array[MasterData] | Enumerator[MasterData, untyped] | Enumerator[untyped, untyped])
|
|
116
|
-
def to_a: -> Array[MasterData]
|
|
247
|
+
def self.import_columns: () -> Array[String]
|
|
117
248
|
end
|
|
118
249
|
|
|
119
250
|
module Report
|
|
120
251
|
module Printer
|
|
121
252
|
attr_reader spec_config: SpecConfig
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
253
|
+
|
|
254
|
+
attr_accessor silent: bool
|
|
255
|
+
|
|
256
|
+
def initialize: (spec_config: SpecConfig, silent: bool) -> void
|
|
257
|
+
|
|
258
|
+
def print: (message: String) -> nil
|
|
125
259
|
end
|
|
126
260
|
|
|
127
261
|
class DefaultPrinter
|
|
128
262
|
include Printer
|
|
129
263
|
|
|
130
|
-
def print: (String
|
|
264
|
+
def print: (message: String) -> nil
|
|
131
265
|
end
|
|
132
266
|
|
|
133
267
|
module Core
|
|
134
|
-
|
|
135
|
-
|
|
268
|
+
attr_reader master_data: MasterData
|
|
269
|
+
|
|
270
|
+
def initialize: (master_data: MasterData) -> void
|
|
271
|
+
|
|
272
|
+
def print: (printer: Printer) -> untyped
|
|
136
273
|
|
|
137
274
|
private
|
|
138
|
-
|
|
275
|
+
|
|
276
|
+
def convert_to_ltsv: ({ operation: :affected_table, table_name: String } items) -> String
|
|
139
277
|
end
|
|
140
278
|
|
|
141
279
|
class ImportReport
|
|
142
280
|
include Core
|
|
143
|
-
@master_data: MasterData
|
|
144
281
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
def print: (Printer
|
|
282
|
+
def reports: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
|
283
|
+
|
|
284
|
+
def print: (printer: Printer) -> untyped
|
|
148
285
|
|
|
149
286
|
private
|
|
150
|
-
|
|
151
|
-
def
|
|
152
|
-
|
|
153
|
-
def
|
|
154
|
-
|
|
287
|
+
|
|
288
|
+
def count_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
|
289
|
+
|
|
290
|
+
def new_records_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
|
291
|
+
|
|
292
|
+
def updated_records_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
|
293
|
+
|
|
294
|
+
def no_change_records_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
|
295
|
+
|
|
296
|
+
def deleted_records_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
|
155
297
|
end
|
|
156
298
|
|
|
157
299
|
class VerifyReport
|
|
158
300
|
include Core
|
|
159
|
-
@master_data: MasterData
|
|
160
301
|
|
|
161
|
-
attr_reader reports: Array[{operation: :verify, table_name:
|
|
162
|
-
|
|
163
|
-
def
|
|
164
|
-
|
|
165
|
-
def
|
|
302
|
+
attr_reader reports: Array[{ operation: :verify, table_name: String, valid: bool, id: Integer }]
|
|
303
|
+
|
|
304
|
+
def initialize: (master_data: MasterData) -> void
|
|
305
|
+
|
|
306
|
+
def append: (report: { operation: :verify, table_name: String, valid: bool, id: Integer }) -> Array[{ operation: :verify, table_name: String, valid: bool, id: Integer }]
|
|
307
|
+
|
|
308
|
+
def print: (printer: Printer) -> untyped
|
|
309
|
+
|
|
310
|
+
def self.build_verify_record_report: (master_data: MasterData, record: ActiveRecord::Base, valid: bool) -> { operation: :verify, table_name: String, valid: bool, id: Integer }
|
|
166
311
|
end
|
|
167
312
|
|
|
168
313
|
class PrintAffectedTableReport
|
|
169
314
|
include Core
|
|
170
|
-
@master_data: MasterData
|
|
171
315
|
|
|
172
|
-
def print: (Printer
|
|
316
|
+
def print: (printer: Printer) -> untyped
|
|
173
317
|
end
|
|
174
318
|
end
|
|
175
319
|
|
|
176
|
-
|
|
320
|
+
class SpecConfig
|
|
321
|
+
attr_accessor spec_name: String
|
|
322
|
+
attr_accessor application_record_class: Class
|
|
323
|
+
attr_accessor import_config: Import::Config?
|
|
324
|
+
attr_accessor verify_config: Verify::Config?
|
|
325
|
+
attr_accessor dump_config: Dump::Config?
|
|
326
|
+
attr_accessor logger: Logger
|
|
327
|
+
|
|
328
|
+
def initialize: (spec_name: String, application_record_class: Class, import_config: Import::Config?, verify_config: Verify::Config?, dump_config: Dump::Config?, logger: Logger) -> void
|
|
329
|
+
|
|
330
|
+
def configure: () -> SpecConfig
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
module Verify
|
|
334
|
+
class Config
|
|
335
|
+
DEFAULT_VALUES: { only_tables: Array[String], except_tables: Array[String], preload_belongs_to_associations: bool, preload_associations: Hash[Class, Array[Symbol]], eager_load_associations: Hash[Class, Array[Symbol]] }
|
|
336
|
+
|
|
337
|
+
attr_accessor only_tables: Array[String]
|
|
338
|
+
attr_accessor except_tables: Array[String]
|
|
339
|
+
attr_accessor preload_belongs_to_associations: bool
|
|
340
|
+
attr_accessor preload_associations: Hash[Class, Array[Symbol]]
|
|
341
|
+
attr_accessor eager_load_associations: Hash[Class, Array[Symbol]]
|
|
342
|
+
|
|
343
|
+
def initialize: (only_tables: Array[String], except_tables: Array[String], preload_belongs_to_associations: bool, preload_associations: Hash[Class, Array[Symbol]], eager_load_associations: Hash[Class, Array[Symbol]]) -> void
|
|
344
|
+
|
|
345
|
+
def skip_table?: (String table_name) -> bool
|
|
346
|
+
|
|
347
|
+
def configure: () -> Config
|
|
348
|
+
|
|
349
|
+
def self.default_config: () -> Config
|
|
350
|
+
end
|
|
351
|
+
|
|
177
352
|
class Executor
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
@ignore_empty_table: bool
|
|
182
|
-
@ignore_tables: Array[String]
|
|
183
|
-
@ignore_column_names: Array[String]
|
|
184
|
-
@only_tables: Array[String]
|
|
185
|
-
@verbose: bool
|
|
186
|
-
|
|
187
|
-
def initialize: (spec_config: SpecConfig, ignore_empty_table: bool, ignore_tables: Array[String], ignore_column_names: Array[String], only_tables: Array[String], verbose: bool) -> void
|
|
188
|
-
def execute: -> Array[untyped]
|
|
353
|
+
def initialize: (spec_config: SpecConfig, verify_config: Verify::Config?, silent: bool, override_identifier: String?, report_printer: Report::Printer?) -> void
|
|
354
|
+
|
|
355
|
+
def execute: () -> untyped
|
|
189
356
|
|
|
190
357
|
private
|
|
191
|
-
def print_message: (String message) -> nil
|
|
192
|
-
def dump_to_csv: (untyped table) -> nil
|
|
193
|
-
def ignore?: (untyped model_klass) -> false
|
|
194
358
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
359
|
+
attr_reader spec_config: SpecConfig
|
|
360
|
+
attr_reader verify_config: Verify::Config
|
|
361
|
+
attr_reader silent: bool
|
|
362
|
+
attr_reader override_identifier: String?
|
|
363
|
+
attr_reader report_printer: Report::DefaultPrinter
|
|
364
|
+
|
|
365
|
+
def build_master_data_collection: () -> MasterDataCollection
|
|
199
366
|
end
|
|
200
367
|
end
|
|
201
368
|
|
|
202
|
-
module
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
@only_verify_tables: Array[String]
|
|
210
|
-
@except_verify_tables: Array[String]
|
|
211
|
-
@skip_no_change: bool
|
|
212
|
-
@silent: bool
|
|
213
|
-
@delete_all_ignore_foreign_key: bool
|
|
214
|
-
@override_identifier: String?
|
|
215
|
-
@report_printer: Report::DefaultPrinter
|
|
216
|
-
@master_data_statuses: [MasterDataStatus]
|
|
217
|
-
|
|
218
|
-
def initialize: (spec_config: SpecConfig, dry_run: bool, verify: bool, only_import_tables: Array[String], except_import_tables: Array[String], only_verify_tables: Array[String], except_verify_tables: Array[String], skip_no_change: bool, silent: bool, delete_all_ignore_foreign_key: bool, override_identifier: String?, report_printer: Report::Printer) -> void
|
|
219
|
-
def execute: -> nil
|
|
369
|
+
module Command
|
|
370
|
+
module Import
|
|
371
|
+
extend ActiveSupport::Concern
|
|
372
|
+
|
|
373
|
+
def import: () -> untyped
|
|
374
|
+
|
|
375
|
+
def import_all: () -> untyped
|
|
220
376
|
|
|
221
377
|
private
|
|
222
|
-
|
|
223
|
-
def
|
|
224
|
-
def import_all!: (MasterDataCollection master_data_collection) -> (Array[MasterData] | Enumerator[MasterData, untyped] | Enumerator[untyped, untyped])
|
|
225
|
-
def verify_all!: (MasterDataCollection master_data_collection) -> (Array[MasterData] | Enumerator[MasterData, untyped] | Enumerator[untyped, untyped])
|
|
226
|
-
def save_master_data_statuses!: (MasterDataCollection master_data_collection) -> Array[MasterDataStatus]
|
|
227
|
-
def print_affected_tables: (MasterDataCollection master_data_collection) -> (Array[MasterData] | Enumerator[MasterData, untyped] | Enumerator[untyped, untyped])
|
|
228
|
-
def load_skip_table?: (untyped master_data_file) -> bool
|
|
229
|
-
def import_skip_table?: (untyped table_name) -> bool
|
|
230
|
-
def verify_skip_table?: (untyped table_name) -> bool
|
|
231
|
-
def need_skip_table?: (untyped table_name, Array[untyped] only, Array[untyped] except) -> bool
|
|
232
|
-
def extract_master_data_csv_paths: -> Array[Pathname]
|
|
233
|
-
def overridden_master_data_csv_paths: -> Array[Pathname]
|
|
234
|
-
def master_data_statuses: -> untyped
|
|
378
|
+
|
|
379
|
+
def build_import_executor: (SpecConfig spec_config) -> untyped
|
|
235
380
|
end
|
|
236
|
-
end
|
|
237
381
|
|
|
238
|
-
|
|
239
|
-
|
|
382
|
+
module Verify
|
|
383
|
+
extend ActiveSupport::Concern
|
|
240
384
|
|
|
241
|
-
|
|
242
|
-
end
|
|
385
|
+
def verify: () -> untyped
|
|
243
386
|
|
|
244
|
-
|
|
245
|
-
|
|
387
|
+
def verify_all: () -> untyped
|
|
388
|
+
|
|
389
|
+
private
|
|
390
|
+
|
|
391
|
+
def build_verify_executor: (SpecConfig spec_config) -> untyped
|
|
392
|
+
end
|
|
246
393
|
|
|
247
|
-
|
|
248
|
-
|
|
394
|
+
module Dump
|
|
395
|
+
extend ActiveSupport::Concern
|
|
396
|
+
|
|
397
|
+
def dump: () -> nil
|
|
398
|
+
end
|
|
249
399
|
end
|
|
250
400
|
end
|