Add contract details and service times to site management
Introduce new fields for contract reference, start/end dates, and service times in the `sites` schema and UI for managing site contracts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e5565357-90e1-419f-b9a8-6ee8394636df Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e5565357-90e1-419f-b9a8-6ee8394636df/UBH5igx
This commit is contained in:
parent
76af862a6b
commit
c8b273d9a6
@ -43,6 +43,11 @@ export default function Sites() {
|
||||
minGuards: 1,
|
||||
requiresArmed: false,
|
||||
requiresDriverLicense: false,
|
||||
contractReference: "",
|
||||
contractStartDate: undefined,
|
||||
contractEndDate: undefined,
|
||||
serviceStartTime: "",
|
||||
serviceEndTime: "",
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
@ -56,6 +61,11 @@ export default function Sites() {
|
||||
minGuards: 1,
|
||||
requiresArmed: false,
|
||||
requiresDriverLicense: false,
|
||||
contractReference: "",
|
||||
contractStartDate: undefined,
|
||||
contractEndDate: undefined,
|
||||
serviceStartTime: "",
|
||||
serviceEndTime: "",
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
@ -123,6 +133,11 @@ export default function Sites() {
|
||||
minGuards: site.minGuards,
|
||||
requiresArmed: site.requiresArmed,
|
||||
requiresDriverLicense: site.requiresDriverLicense,
|
||||
contractReference: site.contractReference || "",
|
||||
contractStartDate: site.contractStartDate || undefined,
|
||||
contractEndDate: site.contractEndDate || undefined,
|
||||
serviceStartTime: site.serviceStartTime || "",
|
||||
serviceEndTime: site.serviceEndTime || "",
|
||||
isActive: site.isActive,
|
||||
});
|
||||
};
|
||||
@ -180,6 +195,64 @@ export default function Sites() {
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="border-t pt-4 space-y-4">
|
||||
<p className="text-sm font-medium">Dati Contrattuali</p>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="contractReference"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Riferimento Contratto</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="CT-2025-001" {...field} value={field.value || ""} data-testid="input-contract-reference" />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="contractStartDate"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Data Inizio Contratto</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="date"
|
||||
{...field}
|
||||
value={field.value || ""}
|
||||
data-testid="input-contract-start-date"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="contractEndDate"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Data Fine Contratto</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="date"
|
||||
{...field}
|
||||
value={field.value || ""}
|
||||
data-testid="input-contract-end-date"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="shiftType"
|
||||
@ -253,6 +326,49 @@ export default function Sites() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="border-t pt-4 space-y-4">
|
||||
<p className="text-sm font-medium">Orari Servizio</p>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="serviceStartTime"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Orario Inizio</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="time"
|
||||
{...field}
|
||||
value={field.value || ""}
|
||||
data-testid="input-service-start-time"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="serviceEndTime"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Orario Fine</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="time"
|
||||
{...field}
|
||||
value={field.value || ""}
|
||||
data-testid="input-service-end-time"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex gap-3 pt-4">
|
||||
<Button
|
||||
type="button"
|
||||
@ -317,6 +433,64 @@ export default function Sites() {
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="border-t pt-4 space-y-4">
|
||||
<p className="text-sm font-medium">Dati Contrattuali</p>
|
||||
|
||||
<FormField
|
||||
control={editForm.control}
|
||||
name="contractReference"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Riferimento Contratto</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="CT-2025-001" {...field} value={field.value || ""} data-testid="input-edit-contract-reference" />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<FormField
|
||||
control={editForm.control}
|
||||
name="contractStartDate"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Data Inizio Contratto</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="date"
|
||||
{...field}
|
||||
value={field.value || ""}
|
||||
data-testid="input-edit-contract-start-date"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={editForm.control}
|
||||
name="contractEndDate"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Data Fine Contratto</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="date"
|
||||
{...field}
|
||||
value={field.value || ""}
|
||||
data-testid="input-edit-contract-end-date"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FormField
|
||||
control={editForm.control}
|
||||
name="shiftType"
|
||||
@ -403,6 +577,49 @@ export default function Sites() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="border-t pt-4 space-y-4">
|
||||
<p className="text-sm font-medium">Orari Servizio</p>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<FormField
|
||||
control={editForm.control}
|
||||
name="serviceStartTime"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Orario Inizio</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="time"
|
||||
{...field}
|
||||
value={field.value || ""}
|
||||
data-testid="input-edit-service-start-time"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={editForm.control}
|
||||
name="serviceEndTime"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Orario Fine</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="time"
|
||||
{...field}
|
||||
value={field.value || ""}
|
||||
data-testid="input-edit-service-end-time"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex gap-3 pt-4">
|
||||
<Button
|
||||
type="button"
|
||||
|
||||
@ -214,6 +214,11 @@ export const sites = pgTable("sites", {
|
||||
serviceStartTime: varchar("service_start_time"), // Orario inizio servizio
|
||||
serviceEndTime: varchar("service_end_time"), // Orario fine servizio
|
||||
|
||||
// Dati contrattuali
|
||||
contractReference: varchar("contract_reference"), // Riferimento/numero contratto
|
||||
contractStartDate: date("contract_start_date"), // Data inizio contratto
|
||||
contractEndDate: date("contract_end_date"), // Data fine contratto
|
||||
|
||||
// Coordinates for geofencing (future use)
|
||||
latitude: varchar("latitude"),
|
||||
longitude: varchar("longitude"),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user