Jelajahi Sumber

feat: :sparkles: feat(informa falta) Implementação do fluxo de falta do prestador no frontend

Foi implementado o fluxo de falta do prestador no frontend, com identificação dos bloqueios por tipo e integração com as regras de penalidade. Bloqueios automáticos por falta não podem ser alterados ou desbloqueados, enquanto os bloqueios manuais continuam podendo ser gerenciados normalmente. Também foram ajustadas as mensagens e integrações com o backend.

fase:dev | origin:escopo
kayo henrique 7 jam lalu
induk
melakukan
f715b9c5fd

+ 26 - 3
src/components/profile/ProfileAvailabilityDialog.vue

@@ -393,16 +393,39 @@ const confirmBlockPeriod = async () => {
 };
 
 const unblockDay = async (blockedDay) => {
-  loadingUnblock.value = { ...loadingUnblock.value, [blockedDay.id]: true };
+  if (blockedDay.type === 'auto_cancel') {
+    $q.notify({
+      type: 'negative',
+      message:
+        'Este dia foi bloqueado automaticamente por falta do prestador e não pode ser desbloqueado.',
+    });
+
+    return;
+  }
+
+  loadingUnblock.value = {
+    ...loadingUnblock.value,
+    [blockedDay.id]: true,
+  };
+
   try {
     await deleteProviderBlockedDay(blockedDay.id);
+
     await loadBlockedDays();
+
     if (currentDateBlockedDays.value.length === 0) {
       closeActionSheet();
     }
-    $q.notify({ type: 'positive', message: t('profile.availability.unblocked_success') });
+
+    $q.notify({
+      type: 'positive',
+      message: t('profile.availability.unblocked_success'),
+    });
   } catch {
-    $q.notify({ type: 'negative', message: t('http.errors.failed') });
+    $q.notify({
+      type: 'negative',
+      message: t('http.errors.failed'),
+    });
   } finally {
     const updated = { ...loadingUnblock.value };
     delete updated[blockedDay.id];

+ 1 - 1
src/pages/profile/ProfilePage.vue

@@ -177,7 +177,7 @@ import { Browser } from '@capacitor/browser';
 import { useAuth } from 'src/composables/useAuth';
 import { useProviderApproval } from 'src/composables/useProviderApproval';
 import { getUser } from 'src/api/user';
-import { Share } from '@capacitor/share';
+// import { Share } from '@capacitor/share';
 import ProfileEditDialog from './ProfileEditDialog.vue';
 import ProfileAddressDialog from 'src/components/profile/ProfileAddressDialog.vue';
 import ProfileBankDataDialog from 'src/components/profile/ProfileBankDataDialog.vue';