Skip to content

Commit

Permalink
feat (document-numbering): Add support for new document numbering fie…
Browse files Browse the repository at this point in the history
…lds (#164)

* add support for document numbering fields

* fix tests
  • Loading branch information
lovrocolic authored Dec 11, 2023
1 parent 3ede87f commit 83dd9b9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/lago/api/resources/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def whitelist_params(params)
tax_identification_number: params[:tax_identification_number],
timezone: params[:timezone],
email_settings: params[:email_settings],
document_numbering: params[:document_numbering],
document_number_prefix: params[:document_number_prefix],
}.compact

whitelist_billing_configuration(params[:billing_configuration]).tap do |config|
Expand Down
2 changes: 2 additions & 0 deletions spec/factories/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
legal_number { 'legal2' }
net_payment_term { 0 }
tax_identification_number { 'EU123456789' }
document_numbering { 'per_customer' }
document_number_prefix { 'ORG-1234' }
billing_configuration do
{
invoice_footer: 'footer',
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/api/organization.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"net_payment_term": 0,
"tax_identification_number": "EU123456789",
"timezone": "America/New_York",
"document_numbering": "per_customer",
"document_number_prefix": "ORG-1234",
"billing_configuration": {
"invoice_footer": null,
"invoice_grace_period": 3,
Expand Down
2 changes: 2 additions & 0 deletions spec/lago/api/resources/organization_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
expect(organization.webhook_url).to eq('https://test-example.example')
expect(organization.webhook_urls).to eq(['https://test-example.example'])
expect(organization.net_payment_term).to eq(0)
expect(organization.document_numbering).to eq('per_customer')
expect(organization.document_number_prefix).to eq('ORG-1234')
expect(organization.tax_identification_number).to eq('EU123456789')
expect(organization.billing_configuration.invoice_grace_period).to eq(3)
end
Expand Down

0 comments on commit 83dd9b9

Please sign in to comment.