-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1554, Invoice auto approve configuration #1555
Conversation
c19554a
to
270d6a0
Compare
config/initializers/_config.rb
Outdated
@@ -90,6 +90,10 @@ def self.setting_files(config_root, _env) | |||
end | |||
|
|||
optional(:customer_api_cdr_hide_fields).array(:string) | |||
|
|||
optional(:invoice).schema do | |||
required(:auto_approve).value(:bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto_approve should be optional and by default false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I will change as optional and regarding default behavious
by default application will not approve invoice after generation
file: app/services/billing_invoice/generate.rb
approve_invoice!(invoice) if YetiConfig.invoice&.auto_approve
270d6a0
to
e7f34a3
Compare
@@ -4,6 +4,8 @@ module BillingInvoice | |||
class Fill < ApplicationService | |||
parameter :invoice, required: true | |||
|
|||
Error = Class.new(ApplicationService::Error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class has been introduced because when we use the BillingInvoice::Fill
service, we expect it to raise an error of type BillingInvoice::Fill::Error
. However, currently, the service raises an error of type ApplicationService::Error
, which is not the expected behavior. When I want to catch service king of error class I'll use ApplicationService::Error
explicitly.
Additional links
closes #1554