12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/rivulet/cli/generate/service/operation.rb', line 12
def call(name:, **)
service_name, operation_name = name.split('.')
service_dir = underscore(service_name)
operation_dir = underscore(operation_name)
service_module = camelize(service_dir)
operation_module = camelize(operation_dir)
base = "app/services/#{service_dir}"
mkdir "#{base}/projections"
write "#{base}/operations/#{operation_dir}.rb", operation_template(service_module, operation_module)
write "#{base}/contracts/#{operation_dir}.rb", contract_template(service_module, operation_module)
register_operation(base, service_dir, service_module, operation_dir, operation_module)
end
|