Skip to main content

Edit Customer — send empty-string address subfields when initial address is null

Jira Story: TF-3516 · Task: TF-3505 (linked via "Work item split" — direction currently backwards, pending fix; see bucket README) · Epic: TF-3477

Overview

When a customer's initial address is null and the user submits an update on the Edit Customer form, the FE currently sends the stringified literal "null" for each address subfield instead of an empty string:

// existing (wrong)
"address": {
"city": "null",
"district": "null",
"province": "",
"subdistrict": "null",
"zip_code": "null"
}

// expected
"address": {
"province": "",
"city": "",
"district": "",
"subdistrict": "",
"zip_code": ""
}

This leaves the stored address in an inconsistent, literally-the-string-"null" state rather than a clean empty value, which can trip up downstream consumers expecting either a real value or an empty string.

Scope Changes

  • Frontend — Edit Customer form submit payload construction for the address object.

8. User Stories + Acceptance Criteria

User StoryImportanceMockup / Technical NotesAcceptance Criteria
[EDITCUST-S01] — Clean empty address on submit when initial address is null

As a user editing a Customer whose address was previously unset (null), I want my submission to send proper empty strings for each address subfield, so that the stored record doesn't contain the literal text "null".
Should HaveRepro: jam.dev/c/ece2209e-.... Fix scoped to the submit-payload construction step for address when the initial value was null.— Happy Path —
• AC-1: Given a Customer whose initial address is null, when the user edits and submits the form without filling in address fields, then the submitted address object has every subfield (province, city, district, subdistrict, zip_code) as an empty string "", never the literal text "null".
— Guard-rail —
• NEG-1: Given a Customer whose initial address already has real values, when the user edits and submits, then those values are sent unchanged (fix only affects the null-initial-value path).

Verification

Jira status as of 2026-07-14: Ready to Test (In Progress statusCategory) — not yet Done; tracked here as in-review at the bucket-tracker level.