feat: implement calendar exceptions, realtime updates, and notifications

This commit is contained in:
2026-06-16 14:40:54 +01:00
parent 80f06019d3
commit a78b72b96f
6 changed files with 317 additions and 51 deletions

View File

@@ -70,7 +70,7 @@ export default function ShopDetails() {
Alert.alert('Sucesso', 'Produto adicionado ao carrinho.');
};
const schedule = shop.schedule || defaultSchedule;
const schedule = (shop.schedule || defaultSchedule).filter(s => !s.isException);
const currentDayIndex = new Date().getDay() === 0 ? 6 : new Date().getDay() - 1;
const isFav = isFavorite(shop.id);

View File

@@ -1,7 +1,7 @@
export type Barber = { id: string; name: string; imageUrl?: string; specialties: string[]; schedule: { day: string; slots: string[] }[] };
export type Service = { id: string; name: string; price: number; duration: number; barberIds: string[] };
export type Product = { id: string; name: string; price: number; stock: number };
export type ShopSchedule = { day: string; open: string; close: string; closed?: boolean };
export type ShopSchedule = { day: string; open: string; close: string; closed?: boolean; date?: string; isException?: boolean };
export type BarberShop = {
id: string;
name: string;
@@ -15,6 +15,7 @@ export type BarberShop = {
paymentMethods?: string[];
socialNetworks?: { whatsapp?: string; instagram?: string; facebook?: string };
contacts?: { phone1?: string; phone2?: string };
ownerId?: string;
};
export type AppointmentStatus = 'pendente' | 'confirmado' | 'concluido' | 'cancelado';
export type OrderStatus = 'pendente' | 'confirmado' | 'concluido' | 'cancelado';