Improve service planning display and guard information retrieval
Updates the header text for the service planning page from "Visione Servizi" to "Planning di Servizio". Modifies the backend to retrieve and display guard names by concatenating first and last names, instead of using a single `fullName` field. Adjusts database query ordering for guards and patrol route stops, and refactors the `patrolRouteStops` join condition. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e0b5b11c-5b75-4389-8ea9-5f3cd9332f88 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e0b5b11c-5b75-4389-8ea9-5f3cd9332f88/rjLU1aT
This commit is contained in:
parent
bb50965eba
commit
fbc4f96a46
4
.replit
4
.replit
@ -19,6 +19,10 @@ externalPort = 80
|
|||||||
localPort = 33035
|
localPort = 33035
|
||||||
externalPort = 3001
|
externalPort = 3001
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 35903
|
||||||
|
externalPort = 6000
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 41295
|
localPort = 41295
|
||||||
externalPort = 5173
|
externalPort = 5173
|
||||||
|
|||||||
@ -140,7 +140,7 @@ export default function ServicePlanning() {
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-3xl font-bold">Visione Servizi</h1>
|
<h1 className="text-3xl font-bold">Planning di Servizio</h1>
|
||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
Visualizza orari e dotazioni per agente fisso, agente mobile o per sito
|
Visualizza orari e dotazioni per agente fisso, agente mobile o per sito
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@ -1501,7 +1501,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
.select()
|
.select()
|
||||||
.from(guards)
|
.from(guards)
|
||||||
.where(eq(guards.location, location as any))
|
.where(eq(guards.location, location as any))
|
||||||
.orderBy(guards.fullName);
|
.orderBy(guards.firstName, guards.lastName);
|
||||||
|
|
||||||
// Ottieni tutti i turni della settimana
|
// Ottieni tutti i turni della settimana
|
||||||
const allWeekShifts = await db
|
const allWeekShifts = await db
|
||||||
@ -1579,7 +1579,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
guardId: guard.id,
|
guardId: guard.id,
|
||||||
guardName: guard.fullName,
|
guardName: `${guard.firstName} ${guard.lastName}`,
|
||||||
badgeNumber: guard.badgeNumber,
|
badgeNumber: guard.badgeNumber,
|
||||||
shifts,
|
shifts,
|
||||||
totalHours,
|
totalHours,
|
||||||
@ -1616,7 +1616,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
.select()
|
.select()
|
||||||
.from(guards)
|
.from(guards)
|
||||||
.where(eq(guards.location, location as any))
|
.where(eq(guards.location, location as any))
|
||||||
.orderBy(guards.fullName);
|
.orderBy(guards.firstName, guards.lastName);
|
||||||
|
|
||||||
// Ottieni tutte le patrol routes della settimana per la sede
|
// Ottieni tutte le patrol routes della settimana per la sede
|
||||||
const weekRoutes = await db
|
const weekRoutes = await db
|
||||||
@ -1646,7 +1646,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
})
|
})
|
||||||
.from(patrolRouteStops)
|
.from(patrolRouteStops)
|
||||||
.innerJoin(sites, eq(patrolRouteStops.siteId, sites.id))
|
.innerJoin(sites, eq(patrolRouteStops.siteId, sites.id))
|
||||||
.where(eq(patrolRouteStops.routeId, routeData.route.id))
|
.where(eq(patrolRouteStops.patrolRouteId, routeData.route.id))
|
||||||
.orderBy(asc(patrolRouteStops.sequenceOrder));
|
.orderBy(asc(patrolRouteStops.sequenceOrder));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -1680,7 +1680,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
guardId: guard.id,
|
guardId: guard.id,
|
||||||
guardName: guard.fullName,
|
guardName: `${guard.firstName} ${guard.lastName}`,
|
||||||
badgeNumber: guard.badgeNumber,
|
badgeNumber: guard.badgeNumber,
|
||||||
routes: guardRoutes,
|
routes: guardRoutes,
|
||||||
totalRoutes,
|
totalRoutes,
|
||||||
@ -1723,7 +1723,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
.select()
|
.select()
|
||||||
.from(guards)
|
.from(guards)
|
||||||
.where(eq(guards.location, location as any))
|
.where(eq(guards.location, location as any))
|
||||||
.orderBy(guards.fullName);
|
.orderBy(guards.firstName, guards.lastName);
|
||||||
|
|
||||||
// Ottieni tutti i turni della settimana per la sede (con JOIN su sites per filtrare location)
|
// Ottieni tutti i turni della settimana per la sede (con JOIN su sites per filtrare location)
|
||||||
const weekShifts = await db
|
const weekShifts = await db
|
||||||
@ -1792,7 +1792,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
guardId: guard.id,
|
guardId: guard.id,
|
||||||
guardName: guard.fullName,
|
guardName: `${guard.firstName} ${guard.lastName}`,
|
||||||
badgeNumber: guard.badgeNumber,
|
badgeNumber: guard.badgeNumber,
|
||||||
shifts,
|
shifts,
|
||||||
totalHours,
|
totalHours,
|
||||||
@ -1961,7 +1961,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
.select()
|
.select()
|
||||||
.from(guards)
|
.from(guards)
|
||||||
.where(eq(guards.location, location as any))
|
.where(eq(guards.location, location as any))
|
||||||
.orderBy(guards.fullName);
|
.orderBy(guards.firstName, guards.lastName);
|
||||||
|
|
||||||
// Ottieni tutti i turni del mese per la sede
|
// Ottieni tutti i turni del mese per la sede
|
||||||
const monthShifts = await db
|
const monthShifts = await db
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user