From 3327220557e6031f1879f566b86824786a249c9d Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 25 Aug 2026 13:00:55 -0500 Subject: [PATCH] fix(settings): stop dropping the tarifas and domicilios flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getSettings rebuilt the response into a hand-written map and left both feature flags out, so SettingEntity always read null. Everything gated on them stayed off no matter what the backend said: - "Mostrar tarifa" in the professional profile could not be switched on - "Servicio a domicilio" never rendered, and touching the on-site switch forced location to office, losing both/delivery - the patient never saw the home-vs-office dialog, so every appointment was created as office with the professional's address - every appointment was created with rate 0 The web reads the response as-is and never had this. Note the backend does not ship a `tarifas` key at all yet, so rates stay off until it is added to settings.global — this fix only stops the app from discarding it. Co-Authored-By: Claude Opus 5 --- .../lib/src/repositories/api_setting_repository.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/setting_repository/lib/src/repositories/api_setting_repository.dart b/packages/setting_repository/lib/src/repositories/api_setting_repository.dart index 2bf8628..13402e7 100644 --- a/packages/setting_repository/lib/src/repositories/api_setting_repository.dart +++ b/packages/setting_repository/lib/src/repositories/api_setting_repository.dart @@ -38,6 +38,12 @@ class ApiSettingRepository implements SettingRepository { final politicas = data['politicas'] as Map? ?? {}; final doc = { + // Feature flags. They were missing from this hand-built map, so + // SettingEntity always saw null: the "Mostrar tarifa" and "Servicio a + // domicilio" switches could never be turned on, and every appointment + // was created with rate 0 and location "office". + 'tarifas': data['tarifas'], + 'domicilios': data['domicilios'], 'version_android': version['android'], 'version_ios': version['ios'], 'titulo_soporte': soporte['titulo'] ?? data['support_title'],