-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Add external billing id on enterprises #12980
Open
pacodelaluna
wants to merge
25
commits into
openfoodfoundation:master
Choose a base branch
from
pacodelaluna:add-external-billing-id-on-enterprises
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
fa91082
Add external_billing_id field on enterprises table
pacodelaluna 2d34ea0
Add new field on enterprise admin form
pacodelaluna df50a93
Deal with translations
pacodelaluna c196acb
Handle the async action for entreprises sells field changes
pacodelaluna 49b89d6
Move admin_only tab upper
pacodelaluna a16f5b2
Add unit tests for admin entreprises changes
pacodelaluna 27fcf76
Add external_billing_id field on revenues_by_hub report
pacodelaluna ce7f041
Repair field placeholder translation
pacodelaluna d270dda
Repair specs
pacodelaluna dc07e5a
Put back permalink fields on primary details panel
pacodelaluna 3d9793b
Fix spec
pacodelaluna 77ba7e0
Add spinner
pacodelaluna 7d37fcd
Use params value only if present
pacodelaluna 0511fc2
Do explicit save in specs when switching tabs
pacodelaluna 129ceac
Revert "Do explicit save in specs when switching tabs"
pacodelaluna a6990d3
Revert "Use params value only if present"
pacodelaluna 905f535
Revert "Add spinner"
pacodelaluna 980c510
Revert "Fix spec"
pacodelaluna 47b3310
Revert "Put back permalink fields on primary details panel"
pacodelaluna ba7db00
Remove Admin Only tab logic
pacodelaluna 3bcca1e
Isolate into an Admin Only section
pacodelaluna 104a6f0
Improve specs
pacodelaluna a15874d
Merge branch 'master' into add-external-billing-id-on-enterprises
pacodelaluna 33f7d8d
Fix specs
pacodelaluna 363640c
Re-instate check for external_billing_id
dacook File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
db/migrate/20241113185651_add_external_billing_id_on_enterprises.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddExternalBillingIdOnEnterprises < ActiveRecord::Migration[7.0] | ||
def change | ||
add_column :enterprises, :external_billing_id, :string, limit: 128 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,4 +73,13 @@ | |
end | ||
end | ||
end | ||
|
||
context "when there is a external billing id" do | ||
let(:enterprise) { create(:distributor_enterprise, external_billing_id: 'INV123456') } | ||
|
||
it "includes URLs of image versions" do | ||
serializer = Api::Admin::EnterpriseSerializer.new(enterprise) | ||
expect(serializer.as_json[:external_billing_id]).to eq('INV123456') | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I think we don't really need an extra test for this, we could add the expectation to the first test in this file (because we don't need to test "when there is no billing id"). |
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ | |
"Hub", | ||
"Hub ID", | ||
"Hub Business Number", | ||
"Hub External Billing Id", | ||
"Hub Legal Name", | ||
"Hub Contact Name", | ||
"Hub Public Email", | ||
|
@@ -89,6 +90,7 @@ | |
"none", | ||
"none", | ||
"none", | ||
"none", | ||
dacook marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"[email protected]", | ||
"none", | ||
"10 Lovely Street", | ||
|
@@ -110,6 +112,7 @@ | |
"none", | ||
"none", | ||
"none", | ||
"none", | ||
"[email protected]", | ||
"none", | ||
"10 Lovely Street", | ||
|
@@ -131,6 +134,7 @@ | |
"none", | ||
"none", | ||
"none", | ||
"none", | ||
"[email protected]", | ||
"none", | ||
"10 Lovely Street", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I put the limit at 128 chars as it seems enough, but it can be of course changed in case.
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.
Makes sense, I agree that there shouldn't be more than 128 chars in this field.
Scanning schema.rb, I see that most fields are set to 255 🤷 Probably it doesn't matter.