diff --git a/BankServices/RoutineEmailService/app.py b/BankServices/RoutineEmailService/app.py index 5d9aafa..c4b5822 100644 --- a/BankServices/RoutineEmailService/app.py +++ b/BankServices/RoutineEmailService/app.py @@ -109,7 +109,6 @@ def set_account_records_to_send_email() -> bool: if balance_error: print(f"Balance error detected {expected_second_balance} != {second_record.bank_balance}") - return False # Format rows for the email template list_of_rows = [] diff --git a/Schemas/event/event.py b/Schemas/event/event.py index 28f45b8..024f316 100644 --- a/Schemas/event/event.py +++ b/Schemas/event/event.py @@ -27,6 +27,7 @@ class Applications(CrudCollection): String, nullable=False, comment="Application Code" ) application_type: Mapped[str] = mapped_column(String, comment="Application Type") + application_for: Mapped[str] = mapped_column(String, server_default="EMP", comment="Application For") description: Mapped[str] = mapped_column(String, comment="Application Description") diff --git a/WebServices/management-frontend/setup-shadcn.sh b/WebServices/management-frontend/setup-shadcn.sh index 5f485bd..0ba99ad 100755 --- a/WebServices/management-frontend/setup-shadcn.sh +++ b/WebServices/management-frontend/setup-shadcn.sh @@ -40,6 +40,7 @@ npm install next-crypto@^1.0.8 --legacy-peer-deps npm install flatpickr@^4.6.13 --legacy-peer-deps npm install date-fns@^4.1.0 --legacy-peer-deps npm install react-day-picker@^8.10.1 --legacy-peer-deps +npm install lucide/react --legacy-peer-deps echo "✨ Setup complete! You can now use shadcn/ui components in your project." echo "📚 Documentation: https://ui.shadcn.com/docs" diff --git a/WebServices/management-frontend/src/app/(DashboardLayout)/application/page.tsx b/WebServices/management-frontend/src/app/(DashboardLayout)/application/page.tsx new file mode 100644 index 0000000..0bfb5f7 --- /dev/null +++ b/WebServices/management-frontend/src/app/(DashboardLayout)/application/page.tsx @@ -0,0 +1,35 @@ +import React from "react"; +import Header from "@/components/header/Header"; +import ClientMenu from "@/components/menu/menu"; +import { retrievePageByUrl } from "@/components/Pages/pageRetriever"; + +async function DashboardPage({ + searchParams, +}: { + searchParams: Promise<{ [key: string]: string | undefined }>; +}) { + const activePage = "/application"; + const searchParamsInstance = await searchParams; + const lang = (searchParamsInstance?.lang as "en" | "tr") || "en"; + const PageComponent = retrievePageByUrl(activePage); + + return ( + <> +
+ {/* Sidebar */} + + + {/* Main Content Area */} +
+ {/* Header Component */} +
+ +
+
+ + ); +} + +export default DashboardPage; diff --git a/WebServices/management-frontend/src/components/Pages/application/page.tsx b/WebServices/management-frontend/src/components/Pages/application/page.tsx index 77127f5..d63937a 100644 --- a/WebServices/management-frontend/src/components/Pages/application/page.tsx +++ b/WebServices/management-frontend/src/components/Pages/application/page.tsx @@ -1,8 +1,370 @@ -import React from "react"; -import { PageProps } from "@/components/validations/translations/translation"; +"use client"; +import React, { useState } from "react"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { User, Building, Save, Filter, Search, Link } from "lucide-react"; +import { + PageProps, + LanguageTranslation, +} from "@/components/validations/translations/translation"; -const ApplicationPage: React.FC = () => { - return
ApplicationPage
; +interface ApplicationData { + name: string; + application_code: string; + site_url: string; + application_type: string; + description: string; +} + +const translations: Record = { + typeSelection: { + en: "Type Selection", + tr: "Tür Seçimi", + }, + filterSelection: { + en: "Filter Selection", + tr: "Filtre Seçimi", + }, + employee: { + en: "Employee", + tr: "Çalışan", + }, + occupant: { + en: "Occupant", + tr: "Sakin", + }, + search: { + en: "Search", + tr: "Ara", + }, + siteUrl: { + en: "Site URL", + tr: "Site URL", + }, + applicationType: { + en: "Application Type", + tr: "Uygulama Türü", + }, + availableApplications: { + en: "Available Applications", + tr: "Mevcut Uygulamalar", + }, + code: { + en: "Code", + tr: "Kod", + }, + url: { + en: "URL", + tr: "URL", + }, + type: { + en: "Type", + tr: "Tür", + }, +}; + +const ApplicationPage: React.FC = ({ lang = "en" }) => { + const [selectedType, setSelectedType] = useState<"employee" | "occupant">( + "employee" + ); + const [selectedUrl, setSelectedUrl] = useState(""); + const [selectedAppType, setSelectedAppType] = useState(""); + const [searchQuery, setSearchQuery] = useState(""); + const [applicationData, setApplicationData] = useState({ + name: "", + application_code: "", + site_url: "", + application_type: "", + description: "", + }); + + // Available options for dropdowns + const urlOptions = [ + "/dashboard", + "/individual", + "/user", + "/settings", + "/reports", + ]; + const typeOptions = ["info", "Dash", "Admin"]; + + // Handle selection button click + const handleTypeSelect = (type: "employee" | "occupant") => { + setSelectedType(type); + }; + + // Handle application data input changes + const handleInputChange = (name: string, value: string) => { + setApplicationData({ + ...applicationData, + [name]: value, + }); + }; + + // Sample application data for the grid + const sampleApplications = [ + { + name: "Dashboard", + application_code: "app000001", + site_url: "/dashboard", + application_type: "info", + description: "Dashboard Page", + }, + { + name: "Individual", + application_code: "app000003", + site_url: "/individual", + application_type: "Dash", + description: "Individual Page for people", + }, + { + name: "User", + application_code: "app000004", + site_url: "/user", + application_type: "Dash", + description: "Individual Page for user", + }, + { + name: "Settings", + application_code: "app000005", + site_url: "/settings", + application_type: "Admin", + description: "Settings Page", + }, + { + name: "Reports", + application_code: "app000006", + site_url: "/reports", + application_type: "info", + description: "Reports Page", + }, + ]; + + // Generate grid of application cards + const renderApplicationGrid = () => { + return sampleApplications.map((app, index) => ( +
+ + +
{app.name}
+
+
+ + {translations.code[lang]}: + + {app.application_code} +
+
+ + {translations.url[lang]}: + + {app.site_url} +
+
+ + {translations.type[lang]}: + + {app.application_type} +
+
+
+
+
+ )); + }; + + return ( +
+ {/* Selection Buttons */} + + +
+ {/* User type selection - vertical on the left (w-1/2) */} +
+
+ + {translations.typeSelection[lang]} +
+ + +
+ + {/* Filters on the right (w-1/2) */} +
+
+ + {translations.filterSelection[lang]} +
+ + {/* Search input */} +
+ +
+ setSearchQuery(e.target.value)} + className="pl-8 w-full h-10" + /> + +
+
+ + {/* Site URL dropdown */} +
+ +
+ +
+
+
+
+
+
+ + {/* Grid of Application Cards */} + + + {translations.availableApplications[lang]} + + +
{renderApplicationGrid()}
+
+
+ + {/* Application Data Form */} + + + Application Details + + +
+
+ + handleInputChange("name", e.target.value)} + /> +
+
+ + + handleInputChange("application_code", e.target.value) + } + /> +
+
+ + handleInputChange("site_url", e.target.value)} + /> +
+
+ + +
+
+
+ +