chore(company): remove OETH eligibility and annual budget fields#33
Open
AntoinePoindron wants to merge 5 commits intomainfrom
Open
chore(company): remove OETH eligibility and annual budget fields#33AntoinePoindron wants to merge 5 commits intomainfrom
AntoinePoindron wants to merge 5 commits intomainfrom
Conversation
Member
|
Tu retires la valorisation AGEFIPH de l'UI mais pas de la DB c'est voulu ? |
Collaborator
Author
|
Oups non c'était un oubli, la PR est à jour |
The "Budget et obligation d'emploi" block on /client/settings is no
longer used and the underlying data isn't relied on for any business
logic — valorisable_agefiph on quotes is computed from total_ht
regardless of company OETH status (services/quotes.py).
Removes the two columns (oeth_eligible, budget_annual) end-to-end:
- DB: new alembic migration drops both columns from companies
- Model: Company columns removed
- Form: SettingsForm fields removed (BooleanField/DecimalField
still used elsewhere — no import cleanup needed)
- Route: /client/settings POST handler stops assigning them
- Templates: client settings block + admin views (company list/detail,
qualification detail) no longer reference the fields
- Seed: Acme/TechCorp fixtures stop setting them
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same theme as the OETH/budget removal in this PR — none of these displays drives a business action, they were AGEFIPH valorisation read-outs from a feature we no longer surface. Drop them from the templates without touching `Quote.valorisable_agefiph` (still computed in services/quotes.py and persisted on the row, in case a future view wants it back). Hits all four places it appeared: - templates/client/requests/detail.html → quote card "Devis reçus" - templates/client/orders/detail.html → "Devis accepté" panel - templates/caterer/orders/detail.html → "Montants" panel - templates/admin/orders/detail.html → "Montants" panel Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dev review on the AGEFIPH UI removal: the column was hidden in the templates but still computed, persisted, and shipped on every Quote and Invoice row. Drop it from the schema too so the DB matches what the user-facing surfaces actually use. - new alembic migration c9e8d7a4f1b2 drops the column from `quotes` and `invoices` (down_revision: b1d4f7e9a3c2) - models.py: remove the Mapped[Decimal | None] columns on Quote and Invoice - services/quotes.py: drop the `valorisable_agefiph = total_ht` computation and the matching key in the returned totals dict - services/stripe_service.py: stop passing valorisable_agefiph to Invoice() at billing time - blueprints/caterer/requests.py: stop assigning the field on Quote create / update - seed_data.py + scripts/demo_caterer_statuses.py: drop the fixture kwargs - tests/test_quote_calculations.py: drop the now-irrelevant `test_valorisable_agefiph_equals_total_ht` and the agefiph assertion in `test_empty_lines_returns_zeros`, plus the key in the Decimal-type guard Total HT is still computed for AGEFIPH-style external reporting should we ever need it again — calculate_quote_totals returns it under "total_ht". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Post-rebase fixups for the AGEFIPH DB removal series: - app.py: ruff format --check failed on the post-rebase file (a recent merge into main left it slightly off-spec). - tests/test_notifications.py: the new test test_visiting_request_detail_also_clears_child_quote_notifs (added by #36) was constructing a Quote with valorisable_agefiph=Decimal("100.00"). With the column dropped in this PR's earlier commit, that kwarg is now invalid and raises TypeError. Drop the kwarg. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d7b28d9 to
574901b
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Removes the "Budget et obligation d'emploi" block from
/client/settingsand every other usage ofCompany.oeth_eligibleandCompany.budget_annualin the codebase, since the data isn't relied on by any business logic anymore.Why
valorisable_agefiphon quotes is computed inservices/quotes.pyfromtotal_htdirectly — independent ofCompany.oeth_eligible. So dropping the flag has no impact on AGEFIPH calculation.Scope (end-to-end)
b1d4f7e9a3c2drops both columns fromcompanies.models.py):oeth_eligibleandbudget_annualcolumns removed.forms/client.py):SettingsForm.oeth_eligibleandSettingsForm.budget_annualfields removed.BooleanField/DecimalFieldimports kept (still used by other forms).blueprints/client/profile.py):/client/settingsPOST stops assigning the fields.templates/client/settings.html— the entire "Block 3: Budget et obligation d'emploi" sectiontemplates/admin/companies/detail.html— OETH header badge + Budget annuel info rowtemplates/admin/companies/list.html— OETH column (header + cells)templates/admin/qualification/detail.html— OETH badgeseed_data.py): Acme/TechCorp fixtures stop passing the kwargs.Test plan
Running upgrade e5b1c2a4d8f9 -> b1d4f7e9a3c2)/client/settingsno longer shows the block, save still works, admin views render without OETH columnMigration safety
The migration is a pure column drop. No data dependency. Reversible via
downgrade()(re-creates both columns with sensible defaults), although prod data will be lost on revert — same as any column drop.🤖 Generated with Claude Code