fix: allow sellers to remove public contact methods
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-10 07:56:17 -04:00
parent 73c430b8a5
commit 9a790ce294
12 changed files with 122 additions and 22 deletions
+7
View File
@@ -190,3 +190,10 @@ Public listing and product details include nullable `sellerDescription` from
`PATCH /api/v1/admin/settings` accepts this optional plain-text field (trimmed,
maximum 2,000 characters); send an empty string to remove it. Omitted fields
retain their current values. Private settings are not exposed in public DTOs.
Seller contact removal uses the same explicit-empty-string convention:
`general.publicContactEmail` accepts a valid email or `""`, and
`general.publicContactPhone` accepts up to 50 characters or `""`. Both are trimmed;
whitespace-only strings clear the contact. Omitted contact fields retain their
saved values. `null` is not a settings input. Public listing/product detail DTOs
return `null` for empty or absent contacts, so no contact link is rendered.
+6
View File
@@ -208,3 +208,9 @@ Security events are stored separately.
Store money as integer minor units. Negative values are prohibited; zero is valid. USD is canonical for stored/calculated market values unless a documented external representation requires another currency.
Public seller descriptions use optional `general.publicDescription` in seller settings: trimmed plain text, at most 2,000 characters. An empty string clears the description. Public listing and product detail DTOs expose only this field as `sellerDescription`, alongside the existing public seller name and contact fields; other settings remain private. No database migration is required.
Public contact methods also use the existing seller settings JSON. Explicit
empty strings in `general.publicContactEmail` or `general.publicContactPhone`
represent removal; omitted fields retain their values during partial updates.
Public detail projections normalize empty contacts to `null`. No migration is
required, and seller ownership and private settings boundaries are unchanged.
+11 -3
View File
@@ -120,7 +120,7 @@ docker context use orbstack
| HTTP | Product and inventory creation, validation, authentication/recovery, CSRF, rate limiting, and session management |
| Integration | PostgreSQL catalog/session/audit/password recovery persistence and Redis-shared login throttling |
Verified locally: `npm test` passes 166 tests with no failures (23 domain, 79 application, and 64 HTTP); worker tests, web tests, web build, Storybook build, Storybook interaction/accessibility checks, integration tests, and authenticated E2E workflows also pass when their required local services and credentials are available.
Verified locally: `npm test` passes 167 tests with no failures (23 domain, 79 application, and 65 HTTP); worker tests, web tests, web build, Storybook build, Storybook interaction/accessibility checks, integration tests, and authenticated E2E workflows also pass when their required local services and credentials are available.
### Public Seller Description
@@ -138,7 +138,7 @@ Verified locally: `npm test` passes 166 tests with no failures (23 domain, 79 ap
- Added keyboard, 320px reflow, 200% text enlargement, and detail-state regression stories. Browser review and its native-zoom/screen-reader limitations are recorded in `docs/ACCESSIBILITY.md`.
- Validation: 166 API tests, 10 web tests, production web build, Storybook build, and 32 Storybook suites / 93 tests. This frontend-only slice changes no persistence or API contracts.
### Latest Vertical Slice: Public Navigation Accessibility
### Public Navigation Accessibility
- Catalog cards use router links; catalog and detail pages have descriptive titles and named, focused main landmarks on entry.
- Async responses and query updates preserve user focus. Filtered catalog URLs survive the explicit return link and browser Back; return destinations are restricted to the catalog.
@@ -146,7 +146,15 @@ Verified locally: `npm test` passes 166 tests with no failures (23 domain, 79 ap
- Validation: 166 API tests, 11 web tests, 3 public Playwright tests, production web build, Storybook build, and 32 Storybook suites / 93 tests. No API or persistence changes.
- Screen-reader speech and native browser zoom remain manual review items; this slice verifies browser focus and title behavior.
Next bounded slice: clearing configured seller contact methods. The Settings form currently converts blank email/phone values to omitted fields, so the server's partial-update merge retains old contacts. Support explicit removal through validation, settings UI/API, and public detail output, with edit/clear regression coverage.
### Latest Vertical Slice: Clear Public Contact Methods
- Settings now sends explicit empty strings when a seller clears email or phone; help text explains removal. Omitted API fields still retain existing values.
- Validation accepts empty/whitespace-only email as removal while rejecting invalid non-empty addresses. Both public detail repositories expose absent/cleared contacts as null.
- HTTP coverage exercises real settings-service merging, validation, persistence reads and unchanged fields; PostgreSQL integration coverage verifies clear-one/clear-both behavior for listing and product detail projections.
- Storybook covers clearing contacts while retaining the description and rendering seller information without contact links.
- Validation: 167 API tests, 23 isolated integration tests, 11 web tests, production web build, Storybook build, and 32 Storybook suites / 95 tests. No migration required.
Next bounded slice: Settings loading/error recovery. A failed settings read currently leaves editable default values visible. Hide the form until settings load successfully, provide a retry action, and preserve entered values across failed saves, with loading/error/retry Storybook coverage.
## Next Milestone