6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/services/spree_cm_commissioner/agency_categories/create.rb', line 6
def call(params:, current_vendor:)
taxon = Spree::Taxon.new(
name: params[:name],
parent_id: params[:parent_id],
taxonomy_id: params[:taxonomy_id],
vendor_id: current_vendor.id,
public_metadata: {
'fee_type' => params[:fee_type],
'commission_fee' => params[:commission_fee]
}
)
if taxon.save
success(taxon: taxon)
else
failure(taxon, taxon.errors.full_messages.join(', '))
end
end
|