Admin business: optional fields such as withholdingTaxCompanyId can't be cleared
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- postgresql, typescript
Research direction
Start with packages/server/src/modules/financial-entities/providers/admin-businesses.provider.ts and compare its update query with the tax-representation handling added in #5230. Read packages/server/src/modules/financial-entities/helpers/admin-businesses.helper.ts and the existing update integration test; first decide whether cleared array fields should be NULL or empty arrays. Done means each nullable field supports keep, clear and set, required fields retain their constraint with an explanatory comment, and the integration test covers those cases.
Written by the indexing model from the issue text.
Description
Several optional admin-business fields can be set but never cleared. The update query in packages/server/src/modules/financial-entities/providers/admin-businesses.provider.ts writes them as COALESCE($param, column). A null therefore means "keep", and there is no value that empties the column. Affected:
company_tax_id(withholdingTaxCompanyId)business_registration_start_dateadvance_tax_ratestax_advances_idssocial_security_employer_idswithholding_tax_annual_ids
Once one of these holds a value, a user who empties it in the admin business settings gets the old value back.
The three tax-representation fields added in #5230 already work differently:
tax_assessing_office,tax_representative_name,tax_representative_license- An omitted field keeps its value;
''ornullclears it. - Implementation: a
CASE WHEN $x::TEXT IS NULL THEN column ELSE NULLIF($x, '') ENDin the SQL, plustoClearableTextinpackages/server/src/modules/financial-entities/helpers/admin-businesses.helper.ts. - Covered by
providers/__tests__/admin-businesses-update.integration.test.ts.
Done when
- Each nullable field above can be cleared from the UI, and an omitted field still keeps its value.
- The array fields need a decision: is "cleared"
NULLor an empty array? - Fields that must never be empty (for example
company_tax_id, if required) stay as they are, with a comment saying why. - The integration test covers keep, clear and set for the changed fields.
- Dominant language
- TypeScript
- Stars
- 30
- Forks
- 10
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 276
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Urigo/accounter-fullstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Urigo/accounter-fullstack#5302 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Urigo/accounter-fullstack#5257 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#5256 ·
Maintainers usually reply within 2 days
-
annual-audit-workflow
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Urigo/accounter-fullstack#5252 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#4919 ·
Maintainers usually reply within 2 days
All issues in Urigo/accounter-fullstack
Similar issues
-
area: integrations documentation priority: P2 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eddiejaoude/StackDash#798 ·
Maintainers usually reply within 1 day
-
bot:ai-assisted component:midnight-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midnightntwrk/midnight-js#1790 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day