docs(feature-control): fix flag key prefix fc. → at. across all docs

Real key pattern is at.<domain>.<name> (e.g. at.ios.only, at.promo).
The fc. prefix in the BFF README and API_Mobile_App.md was incorrect.

- API_Mobile_App.md: updated request keys, response raw examples,
  flag table, and Swift usage examples to at. prefix
- API_Mobile_App.md: clarified that app uses raw["at.key"] not
  simplified flags object (FeatureFlagsState.isEnabled reads raw)
- feature-control-bff/README.md: updated DEFAULTS_JSON example,
  request keys, response flags/raw examples, added note about raw usage
This commit is contained in:
Daniel Arantes Loverde
2026-06-05 16:30:57 -03:00
parent 09396ebcf3
commit e62bd60e9a
2 changed files with 73 additions and 50 deletions

View File

@@ -27,11 +27,10 @@ Exemplo de `FEATURE_CONTROL_DEFAULTS_JSON`:
```json
{
"fc.promo": { "enabled": true, "variant": "on" },
"fc.promo-codes": { "enabled": true, "variant": "on" },
"fc.android": { "enabled": true, "variant": "on" },
"fc.city-aguai": { "enabled": true, "variant": "on" },
"fc.ios": { "enabled": true, "variant": "on" }
"at.ios.only": { "enabled": true, "variant": "on" },
"at.android.only": { "enabled": true, "variant": "on" },
"at.promo": { "enabled": true, "variant": "on" },
"at.city.aguai": { "enabled": true, "variant": "on" }
}
```
@@ -40,7 +39,7 @@ Exemplo de `FEATURE_CONTROL_DEFAULTS_JSON`:
```json
{
"environment": "production",
"keys": ["fc.promo", "fc.promo-codes", "fc.android", "fc.city-aguai", "fc.ios"],
"keys": ["at.ios.only", "at.android.only", "at.promo", "at.city.aguai"],
"context": {
"subjectType": "customer",
"subjectId": "cust_123",
@@ -48,8 +47,7 @@ Exemplo de `FEATURE_CONTROL_DEFAULTS_JSON`:
"platform": "ios",
"appVersion": "2.3.1",
"attributes": {
"city": "Belo Horizonte",
"tier": "gold"
"city": "Aguaí"
}
}
}
@@ -66,14 +64,19 @@ Se o app enviar `Authorization: Bearer <JWT>`, o BFF tenta extrair `subjectId` d
"configVersion": 7,
"evaluatedAt": "2026-04-16T12:00:00.000Z",
"flags": {
"promo": true,
"promoCodes": true,
"android": true,
"cityAguai": true,
"ios": true
"atiosonly": true,
"atandroidonly": false,
"atpromo": true,
"atcityaguai": true
},
"raw": {
"fc.promo": {
"at.ios.only": {
"enabled": true,
"variant": "on",
"payload": null,
"reason": "rollout"
},
"at.promo": {
"enabled": true,
"variant": "on",
"payload": null,
@@ -83,6 +86,9 @@ Se o app enviar `Authorization: Bearer <JWT>`, o BFF tenta extrair `subjectId` d
}
```
> O app Swift usa o campo **`raw`** indexado pela chave original (ex: `raw["at.promo"]`). O campo `flags` é uma versão simplificada gerada mecanicamente (pontos removidos).
```
Quando o upstream falha (ex.: `429`, `500`, timeout), o BFF devolve `fallback` com defaults estáticos.
## Execução local