profile name change

This commit is contained in:
2026-09-08 19:20:42 +05:30
parent 035ceb44a7
commit a94c23c20e
4 changed files with 67 additions and 6 deletions

View File

@@ -33,8 +33,9 @@
* Two things the design asks for do not exist behind it, and are shown as
* absent rather than invented: a separate TRADE LICENCE (the `tenants` table
* has one licence column, `licenseno`, which is where FSSAI goes), and a store
* manager (`firstname`, `lastname` and `Accountname` come back empty for every
* merchant read so far). `created` does exist and is now returned — the column
* admin (`tenants.firstname` — there is no lastname column — which was
* collected by no form and permitted by no allowlist until now, so it is empty
* on every merchant created before this). `created` does exist and is now returned — the column
* was always there and the endpoint simply never selected it.
*/
@@ -77,6 +78,7 @@ type CardId = 'basic' | 'contact' | 'licence' | 'more';
/** Every field this page may write, so a save cannot send anything else. */
const EDITABLE = [
'tenantname',
'firstname',
'tenanttype',
'primarycontact',
'primaryemail',
@@ -95,7 +97,7 @@ const EDITABLE = [
type Editable = (typeof EDITABLE)[number];
const CARD_FIELDS: Record<CardId, readonly Editable[]> = {
basic: ['tenantname', 'tenanttype'],
basic: ['tenantname', 'firstname', 'tenanttype'],
contact: ['primarycontact', 'primaryemail', 'address', 'suburb', 'city', 'state', 'postcode'],
licence: ['licenseno'],
more: ['tenantinfo', 'minorder', 'registrationno'],
@@ -262,7 +264,7 @@ export function ShopProfilePage() {
<Fact label="Branch" value={branchLabel(text('locationname')) || '—'} />
<Fact label="City" value={text('city') || '—'} />
<Fact
label="Store manager"
label="Store admin"
value={
[text('firstname'), text('lastname')].filter(Boolean).join(' ') ||
String(record['Accountname'] ?? '').trim() ||
@@ -337,6 +339,20 @@ export function ShopProfilePage() {
onChange={set('tenantname')}
/>
</Field>
{/* `tenants.firstname`, and there is no lastname column — so
this is the whole name. Collected at onboarding from now
on; editable here because every merchant created before
that has it empty. */}
<Field label="Store admin">
<TextInput
label="Store admin"
isLabelHidden
size="sm"
value={form['firstname'] ?? ''}
onChange={set('firstname')}
placeholder="The person who administers this shop"
/>
</Field>
<Field label="Store type">
<TextInput
label="Store type"
@@ -354,7 +370,7 @@ export function ShopProfilePage() {
<Row label="Branch" value={branchLabel(text('locationname'))} />
<Row label="Registered as" value={text('companyname')} />
<Row
label="Store manager"
label="Store admin"
value={[text('firstname'), text('lastname')].filter(Boolean).join(' ')}
/>
<Row label="Store type" value={text('tenanttype')} />
@@ -591,7 +607,12 @@ export function ShopProfilePage() {
<Row label="App location" value={text('applocation')} />
<Row
label="Category"
value={String(record['subcategoryname'] ?? '') || `Category ${record['categoryid'] ?? '—'}`}
/* The NAME, never "Category 2". The join has always produced it;
`categoryname` is newly carried on the response. */
value={
String(record['categoryname'] ?? '').trim() ||
String(record['subcategoryname'] ?? '').trim()
}
/>
<Row
label="Approved"