Add more services

This commit is contained in:
Urtzi Alfaro
2025-08-21 20:28:14 +02:00
parent d6fd53e461
commit c6dd6fd1de
85 changed files with 17842 additions and 1828 deletions

View File

@@ -16,6 +16,14 @@ interface RegisterForm {
acceptTerms: boolean;
}
interface RegisterFormErrors {
fullName?: string;
email?: string;
password?: string;
confirmPassword?: string;
acceptTerms?: string;
}
const RegisterPage: React.FC = () => {
const navigate = useNavigate();
const dispatch = useDispatch();
@@ -31,10 +39,10 @@ const RegisterPage: React.FC = () => {
const [showPassword, setShowPassword] = useState(false);
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [errors, setErrors] = useState<Partial<RegisterForm>>({});
const [errors, setErrors] = useState<RegisterFormErrors>({});
const validateForm = (): boolean => {
const newErrors: Partial<RegisterForm> = {};
const newErrors: RegisterFormErrors = {};
if (!formData.fullName.trim()) {
newErrors.fullName = 'El nombre es obligatorio';
@@ -95,7 +103,7 @@ const RegisterPage: React.FC = () => {
id: userData.id,
email: userData.email,
fullName: userData.full_name,
role: userData.role || 'admin',
role: (userData.role as "owner" | "admin" | "manager" | "worker") || 'admin',
isOnboardingComplete: false, // New users need onboarding
tenant_id: userData.tenant_id
};

View File

@@ -43,7 +43,11 @@ interface FilterState {
sort_order?: 'asc' | 'desc';
}
const InventoryPage: React.FC = () => {
interface InventoryPageProps {
view?: string;
}
const InventoryPage: React.FC<InventoryPageProps> = ({ view = 'stock-levels' }) => {
const {
items,
stockLevels,

View File

@@ -24,7 +24,11 @@ interface OrderItem {
suggested?: boolean;
}
const OrdersPage: React.FC = () => {
interface OrdersPageProps {
view?: string;
}
const OrdersPage: React.FC<OrdersPageProps> = ({ view = 'incoming' }) => {
const [orders, setOrders] = useState<Order[]>([]);
const [isLoading, setIsLoading] = useState(true);
const [showNewOrder, setShowNewOrder] = useState(false);

View File

@@ -53,9 +53,15 @@ interface Equipment {
maintenanceDue?: string;
}
const ProductionPage: React.FC = () => {
interface ProductionPageProps {
view?: 'schedule' | 'batches' | 'analytics' | 'staff' | 'equipment' | 'active-batches';
}
const ProductionPage: React.FC<ProductionPageProps> = ({ view = 'schedule' }) => {
const { todayForecasts, metrics, weather, isLoading } = useDashboard();
const [activeTab, setActiveTab] = useState<'schedule' | 'batches' | 'analytics' | 'staff' | 'equipment'>('schedule');
const [activeTab, setActiveTab] = useState<'schedule' | 'batches' | 'analytics' | 'staff' | 'equipment'>(
view === 'active-batches' ? 'batches' : view as 'schedule' | 'batches' | 'analytics' | 'staff' | 'equipment'
);
const [productionMetrics, setProductionMetrics] = useState<ProductionMetrics>({
efficiency: 87.5,
onTimeCompletion: 94.2,

View File

@@ -34,7 +34,11 @@ interface FilterState {
difficulty_level?: number;
}
const RecipesPage: React.FC = () => {
interface RecipesPageProps {
view?: string;
}
const RecipesPage: React.FC<RecipesPageProps> = ({ view }) => {
const {
recipes,
categories,

View File

@@ -11,7 +11,11 @@ import Button from '../../components/ui/Button';
type SalesPageView = 'overview' | 'analytics' | 'management';
const SalesPage: React.FC = () => {
interface SalesPageProps {
view?: string;
}
const SalesPage: React.FC<SalesPageProps> = ({ view = 'daily-sales' }) => {
const [activeView, setActiveView] = useState<SalesPageView>('overview');
const renderContent = () => {

View File

@@ -21,6 +21,8 @@ interface BakeryFormData {
name: string;
address: string;
business_type: 'individual' | 'central_workshop';
postal_code: string;
phone: string;
coordinates?: {
lat: number;
lng: number;