feat(registratie): WP-34 — phone field + BRP address read-only
Reshape the adreswijziging form into a contact-change form: the BRP address is
authoritative and shown read-only (you change it at the gemeente), and the phone
number becomes the editable/submittable field. New Telefoonnummer value object
(parse-don't-validate); backend RejectPhoneChange re-validates as authority.
POST /change-requests now carries { telefoon } (typed client regenerated).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -3,21 +3,18 @@ import { ApiClient } from '@shared/infrastructure/api-client';
|
||||
import { Valid } from '@registratie/domain/change-request.machine';
|
||||
|
||||
/**
|
||||
* Infrastructure adapter for the adreswijziging POST (`/api/v1/change-requests`) —
|
||||
* the single place the network client lives for change requests, so the command
|
||||
* and the UI never touch `ApiClient`. Returns the server reference; the server
|
||||
* re-validates and is the authority.
|
||||
* Infrastructure adapter for the telefoonwijziging POST (`/api/v1/change-requests`) —
|
||||
* the single place the network client lives for contact changes, so the command
|
||||
* and the UI never touch `ApiClient`. The BRP address is authoritative and not
|
||||
* submitted (WP-34); only the phone number is. Returns the server reference; the
|
||||
* server re-validates and is the authority.
|
||||
*/
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ChangeRequestAdapter {
|
||||
private client = inject(ApiClient);
|
||||
|
||||
async changeRequest(data: Valid): Promise<string> {
|
||||
const res = await this.client.changeRequests({
|
||||
straat: data.straat,
|
||||
postcode: data.postcode,
|
||||
woonplaats: data.woonplaats,
|
||||
});
|
||||
const res = await this.client.changeRequests({ telefoon: data.telefoon });
|
||||
return res.referentie ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user