HslgAccountOrderClient.mjs
Source file: apps/mobile/src/services/HslgAccountOrderClient.mjs
Module: app-mobile
Size: 65 lines
SHA-256: f2167ab08da1c872e68bc92ca088b279cf8d1c84835e1fa1e33995daaf5dc68e
Responsibility
Runs the real customer UI with native or fail-closed device and backend services; no simulated success.
Declared entry points
HslgAccountOrderClient— source line 6.url— source line 8.headers— source line 21.token— source line 24.response— source line 28.payload— source line 45.payload— source line 57.payload— source line 61.
Imports and dependencies
No direct import declarations detected in this file.
Behaviour and audit locations
- Line 3:
* This is not bound to the mobile entry until Capacitor and the vault exist. - Line 30:
credentials:'omit',redirect:'error',cache:'no-store',
HTTP contract and security
The constructor enforces an HTTPS base ending in /hslg/v1/, requires a token vault with get/set/clear methods, and rejects invalid fetch implementations. Requests disable browser cookies and automatic redirects, set no-store caching and apply bearer tokens only to authenticated operations. The client handles registration, verification, recovery, login, profile reads/updates, logout and unpriced order drafts. Login only saves a structurally valid returned token through the supplied vault; logout clears the local token even if the server call fails. The draft result must explicitly report draft_only, not payment or kitchen acceptance.
Relationship to the system
This page is the file-level source reference, not the architecture rationale. Read the module explanation, the corresponding architecture decision and user guide before changing behaviour. Names and line locations above are extracted from this exact source version; they are reference points, not proof that an external service or a phone feature works.
Change verification
Review the entry points and errors in this file, then run the module’s associated tests, source dependency gate, history gate and documentation coverage check. If the file changes an API response, user interaction, data model, deployment or third-party dependency, revise those human explanations and disaster recovery/licensing when relevant. Do not infer actual native or external API operation from source presence.