Exclude mobile sites from fixed planning schedules
Filter out sites classified as "mobile" from the fixed planning module in server/routes.ts by modifying the site filtering logic. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e0b5b11c-5b75-4389-8ea9-5f3cd9332f88 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e0b5b11c-5b75-4389-8ea9-5f3cd9332f88/aneFGWm
This commit is contained in:
parent
c8fa396c8f
commit
52baa7f6c3
8
.replit
8
.replit
@ -19,6 +19,10 @@ externalPort = 80
|
|||||||
localPort = 33035
|
localPort = 33035
|
||||||
externalPort = 3001
|
externalPort = 3001
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 34357
|
||||||
|
externalPort = 6000
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 41295
|
localPort = 41295
|
||||||
externalPort = 5173
|
externalPort = 5173
|
||||||
@ -35,6 +39,10 @@ externalPort = 4200
|
|||||||
localPort = 42175
|
localPort = 42175
|
||||||
externalPort = 3002
|
externalPort = 3002
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 42187
|
||||||
|
externalPort = 6800
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 43169
|
localPort = 43169
|
||||||
externalPort = 5000
|
externalPort = 5000
|
||||||
|
|||||||
@ -929,7 +929,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
const weekEndTimestampForContract = new Date(weekEndYear, weekEndMonth - 1, weekEndDay, 23, 59, 59, 999);
|
const weekEndTimestampForContract = new Date(weekEndYear, weekEndMonth - 1, weekEndDay, 23, 59, 59, 999);
|
||||||
|
|
||||||
// Ottieni tutti i siti attivi della sede con contratto valido nelle date della settimana
|
// Ottieni tutti i siti attivi della sede con contratto valido nelle date della settimana
|
||||||
const activeSites = await db
|
const allActiveSites = await db
|
||||||
.select()
|
.select()
|
||||||
.from(sites)
|
.from(sites)
|
||||||
.leftJoin(serviceTypes, eq(sites.serviceTypeId, serviceTypes.id))
|
.leftJoin(serviceTypes, eq(sites.serviceTypeId, serviceTypes.id))
|
||||||
@ -944,6 +944,12 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Filtra solo siti FISSI in base alla classificazione del serviceType
|
||||||
|
// Esclude siti con classificazione "mobile" che vanno gestiti in Planning Mobile
|
||||||
|
const activeSites = allActiveSites.filter((s: any) =>
|
||||||
|
!s.service_types || s.service_types.classification?.toLowerCase() === "fisso"
|
||||||
|
);
|
||||||
|
|
||||||
// Ottieni tutti i turni della settimana per la sede
|
// Ottieni tutti i turni della settimana per la sede
|
||||||
// ✅ CORRETTO: Usa timestamp già creati correttamente sopra
|
// ✅ CORRETTO: Usa timestamp già creati correttamente sopra
|
||||||
const weekStartTimestamp = weekStartTimestampForContract;
|
const weekStartTimestamp = weekStartTimestampForContract;
|
||||||
@ -1526,7 +1532,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
|
|
||||||
// Filtra solo turni FISSI in base alla classificazione del serviceType
|
// Filtra solo turni FISSI in base alla classificazione del serviceType
|
||||||
const weekShifts = allWeekShifts.filter((s: any) =>
|
const weekShifts = allWeekShifts.filter((s: any) =>
|
||||||
s.serviceType && s.serviceType.classification === "fisso"
|
s.serviceType && s.serviceType.classification?.toLowerCase() === "fisso"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Ottieni tutte le assegnazioni per i turni della settimana
|
// Ottieni tutte le assegnazioni per i turni della settimana
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user