Show the store's scannable QR code right after onboarding
The consumer app resolves a storefront by scanning a QR that encodes
{tenantid, locationid}. Store Onboarding was creating the location but never
surfacing its QR, so operators had to hunt for it later in the store detail
view. Now that the backend returns the created location's locationid in the
onboarding response, render the existing StoreQRView component directly in
the "Store Branch Active!" success panel (both onboarding UI variants) so the
printable QR is available the moment the branch is created.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,7 @@ import {
|
||||
useFiestaAllTenants
|
||||
} from '../services/fiestaQueries';
|
||||
import { FIESTA_TENANT_ID, str as fstr, num as fnum } from '../services/fiestaApi';
|
||||
import StoreQRView from './StoreQRView';
|
||||
|
||||
export default function AdminConsole({ activeTab: propActiveTab, showHeader = true, onBack, tenantId }: { activeTab?: 'tenant' | 'store' | 'rider', showHeader?: boolean, onBack?: () => void, tenantId?: number }) {
|
||||
const [activeTab, setActiveTab] = useState<'tenant' | 'store' | 'rider'>(propActiveTab || 'tenant');
|
||||
@@ -448,6 +449,15 @@ VALUES (${newUserId}, 1, 'Active', NOW());
|
||||
<p className="text-xs text-emerald-700 max-w-md mx-auto">
|
||||
Store <strong>{storeForm.locationname}</strong> has been initialized. A default placeholder manager user has been spawned in inactive mode (requires password setup).
|
||||
</p>
|
||||
<div className="max-w-xs mx-auto">
|
||||
<StoreQRView
|
||||
tenantId={storeForm.tenantid}
|
||||
locationid={storeSuccess?.details?.locationid}
|
||||
storeName={storeForm.locationname}
|
||||
storeZone={storeForm.city}
|
||||
storeAddress={storeForm.address}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex justify-center gap-3">
|
||||
{onBack && (
|
||||
<button
|
||||
@@ -1188,6 +1198,15 @@ VALUES (${newUserId}, 1, 'Active', NOW());
|
||||
<p className="text-xs text-emerald-700 max-w-md mx-auto">
|
||||
Store <strong>{storeForm.locationname}</strong> has been initialized. A default placeholder manager user has been spawned in inactive mode (requires password setup).
|
||||
</p>
|
||||
<div className="max-w-xs mx-auto">
|
||||
<StoreQRView
|
||||
tenantId={storeForm.tenantid}
|
||||
locationid={storeSuccess?.details?.locationid}
|
||||
storeName={storeForm.locationname}
|
||||
storeZone={storeForm.city}
|
||||
storeAddress={storeForm.address}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex justify-center gap-3">
|
||||
{onBack && (
|
||||
<button
|
||||
|
||||
@@ -1095,7 +1095,12 @@ export interface CreateTenantLocationInput {
|
||||
roleid?: number;
|
||||
}
|
||||
|
||||
/** POST /tenants/createtenantlocation — Create a new store location under a tenant. */
|
||||
/**
|
||||
* POST /tenants/createtenantlocation — Create a new store location under a tenant.
|
||||
* The envelope's `details` is the created location row (including the
|
||||
* DB-assigned `locationid`), needed right after onboarding to build the
|
||||
* store's QR code via `buildStoreQrPayload`.
|
||||
*/
|
||||
export async function createTenantLocation(input: CreateTenantLocationInput): Promise<Row> {
|
||||
return fiestaSend<Row>('tenants/createtenantlocation', 'POST', input);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user