Add optional KYC flow and service-backed account limits

This commit is contained in:
Stephan D committed 2026-09-12 09:28:24 +02:00
1 parent 61ccfc1844
commit 3397f04ab7
38 files changed
+3443 -36

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
# sxchnge_kyc
Shared Flutter identity verification and backend-owned visible limits. Both web
and future mobile clients consume the same models, providers and service contracts.
- `IdentityProvider` coordinates draft photos, validation errors, submission,
refresh and semantic analytics. Inject `IdentityService` and `PhotoService`.
- `LimitsProvider` fetches `LimitsService` models; it does not calculate caps from
a client-selected status. Refresh after status updates. Existing values are
marked stale after an error; out-of-order responses cannot replace newer data.
- `DummyIdentityService` keeps only review metadata in memory. `DummyLimitsService`
mimics backend policy with explicitly illustrative EUR fixtures. Neither is
production authorization. `review` exists only on the dummy service.
- `FilePhotoService` opens the platform picker and validates JPEG/PNG content,
10 MiB size, minimum 600px per dimension, maximum 40 megapixels and decodability.
It performs no face matching, OCR or identity approval. Camera capture is not
implemented; users can take a photo separately and select it.
- Photo models are transient; clients must dispose providers and evict sensitive
image cache entries. No disk, browser storage, network or document telemetry is
used by these stubs. No guarantee of cryptographic memory erasure is made.
Replace both identity and limits services when connecting a backend. A submit
adapter must reuse the supplied idempotency key across retries, scope requests to
the authenticated account, map safe errors and return server-confirmed status.
Numeric values use minor currency units (currently a two-decimal currency fixture);
extend the transport with currency precision before supporting other units.
The app's `/identity` route is an explicitly public demo, not an authenticated
account endpoint. Production requires session/email guards, server authorization,
private document storage, staff review and support integration. See
[the UX/measurement contract](../../../docs/ux/kyc.md).
Validation: `flutter pub get`, `flutter analyze`, `flutter test`.
Photo selection uses Flutter's [file_selector](https://pub.dev/packages/file_selector)
and [image metadata decoding](https://pub.dev/documentation/image/latest/image/Decoder-class.html).
For native macOS consumers enable the user-selected read-only file entitlement;
iOS/Android camera permissions are not required for this file-picker-only flow.