Skip to content
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

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

Ivanov-Anton
Copy link
Collaborator

@Ivanov-Anton Ivanov-Anton commented Sep 14, 2024

Additional links

closes #1554

@Ivanov-Anton Ivanov-Anton linked an issue Sep 14, 2024 that may be closed by this pull request
@Ivanov-Anton Ivanov-Anton marked this pull request as draft September 14, 2024 18:06
@Ivanov-Anton Ivanov-Anton force-pushed the 1554-invoice-auto-approve branch 5 times, most recently from c19554a to 270d6a0 Compare September 16, 2024 06:29
@Ivanov-Anton Ivanov-Anton marked this pull request as ready for review September 16, 2024 09:14
@Ivanov-Anton Ivanov-Anton self-assigned this Sep 16, 2024
@Ivanov-Anton Ivanov-Anton added the Waiting for code review It means that the owner or member of the repositor can do a code review. label Sep 16, 2024
@@ -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)
Copy link
Contributor

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

Copy link
Collaborator Author

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

@Ivanov-Anton Ivanov-Anton removed the Waiting for code review It means that the owner or member of the repositor can do a code review. label Sep 18, 2024
@Ivanov-Anton Ivanov-Anton requested review from dmitry-sinina and removed request for senid231 September 18, 2024 13:08
@@ -4,6 +4,8 @@ module BillingInvoice
class Fill < ApplicationService
parameter :invoice, required: true

Error = Class.new(ApplicationService::Error)
Copy link
Collaborator Author

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.

@Ivanov-Anton Ivanov-Anton added the Waiting for code review It means that the owner or member of the repositor can do a code review. label Sep 23, 2024
@dmitry-sinina dmitry-sinina merged commit 6ed9dbc into master Sep 27, 2024
12 checks passed
@Ivanov-Anton Ivanov-Anton deleted the 1554-invoice-auto-approve branch September 27, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for code review It means that the owner or member of the repositor can do a code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invoice auto approve
2 participants