--
-- PostgreSQL database dump
--

-- Dumped from database version 16.9 (165f042)
-- Dumped by pg_dump version 16.9

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: absence_type; Type: TYPE; Schema: public; Owner: neondb_owner
--

CREATE TYPE public.absence_type AS ENUM (
    'sick_leave',
    'vacation',
    'personal_leave',
    'injury'
);


ALTER TYPE public.absence_type OWNER TO neondb_owner;

--
-- Name: certification_status; Type: TYPE; Schema: public; Owner: neondb_owner
--

CREATE TYPE public.certification_status AS ENUM (
    'valid',
    'expiring_soon',
    'expired'
);


ALTER TYPE public.certification_status OWNER TO neondb_owner;

--
-- Name: shift_preference; Type: TYPE; Schema: public; Owner: neondb_owner
--

CREATE TYPE public.shift_preference AS ENUM (
    'morning',
    'afternoon',
    'night',
    'any'
);


ALTER TYPE public.shift_preference OWNER TO neondb_owner;

--
-- Name: shift_status; Type: TYPE; Schema: public; Owner: neondb_owner
--

CREATE TYPE public.shift_status AS ENUM (
    'planned',
    'active',
    'completed',
    'cancelled'
);


ALTER TYPE public.shift_status OWNER TO neondb_owner;

--
-- Name: shift_type; Type: TYPE; Schema: public; Owner: neondb_owner
--

CREATE TYPE public.shift_type AS ENUM (
    'fixed_post',
    'patrol',
    'night_inspection',
    'quick_response'
);


ALTER TYPE public.shift_type OWNER TO neondb_owner;

--
-- Name: site_preference_type; Type: TYPE; Schema: public; Owner: neondb_owner
--

CREATE TYPE public.site_preference_type AS ENUM (
    'preferred',
    'blacklisted'
);


ALTER TYPE public.site_preference_type OWNER TO neondb_owner;

--
-- Name: training_status; Type: TYPE; Schema: public; Owner: neondb_owner
--

CREATE TYPE public.training_status AS ENUM (
    'scheduled',
    'completed',
    'expired',
    'cancelled'
);


ALTER TYPE public.training_status OWNER TO neondb_owner;

--
-- Name: user_role; Type: TYPE; Schema: public; Owner: neondb_owner
--

CREATE TYPE public.user_role AS ENUM (
    'admin',
    'coordinator',
    'guard',
    'client'
);


ALTER TYPE public.user_role OWNER TO neondb_owner;

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: absence_affected_shifts; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.absence_affected_shifts (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    absence_id character varying NOT NULL,
    shift_id character varying NOT NULL,
    is_substituted boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.absence_affected_shifts OWNER TO neondb_owner;

--
-- Name: absences; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.absences (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    guard_id character varying NOT NULL,
    type public.absence_type NOT NULL,
    start_date date NOT NULL,
    end_date date NOT NULL,
    certificate_url character varying,
    notes text,
    is_approved boolean DEFAULT false,
    needs_substitute boolean DEFAULT true,
    substitute_guard_id character varying,
    created_at timestamp without time zone DEFAULT now(),
    approved_at timestamp without time zone,
    approved_by character varying
);


ALTER TABLE public.absences OWNER TO neondb_owner;

--
-- Name: certifications; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.certifications (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    guard_id character varying NOT NULL,
    type character varying NOT NULL,
    name character varying NOT NULL,
    issue_date date NOT NULL,
    expiry_date date NOT NULL,
    status public.certification_status DEFAULT 'valid'::public.certification_status NOT NULL,
    document_url character varying,
    created_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.certifications OWNER TO neondb_owner;

--
-- Name: contract_parameters; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.contract_parameters (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    contract_type character varying DEFAULT 'CCNL_VIGILANZA_2023'::character varying NOT NULL,
    max_hours_per_day integer DEFAULT 8 NOT NULL,
    max_overtime_per_day integer DEFAULT 2 NOT NULL,
    max_hours_per_week integer DEFAULT 40 NOT NULL,
    max_overtime_per_week integer DEFAULT 8 NOT NULL,
    min_daily_rest_hours integer DEFAULT 11 NOT NULL,
    min_weekly_rest_hours integer DEFAULT 24 NOT NULL,
    max_night_hours_per_week integer DEFAULT 48,
    holiday_pay_increase integer DEFAULT 30,
    night_pay_increase integer DEFAULT 20,
    overtime_pay_increase integer DEFAULT 15,
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.contract_parameters OWNER TO neondb_owner;

--
-- Name: guard_constraints; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.guard_constraints (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    guard_id character varying NOT NULL,
    preferred_shift_type public.shift_preference DEFAULT 'any'::public.shift_preference,
    max_hours_per_day integer DEFAULT 10,
    max_hours_per_week integer DEFAULT 48,
    preferred_days_off integer[],
    available_on_holidays boolean DEFAULT true,
    notes text,
    updated_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.guard_constraints OWNER TO neondb_owner;

--
-- Name: guards; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.guards (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    user_id character varying,
    badge_number character varying NOT NULL,
    phone_number character varying,
    is_armed boolean DEFAULT false,
    has_fire_safety boolean DEFAULT false,
    has_first_aid boolean DEFAULT false,
    has_driver_license boolean DEFAULT false,
    languages text[],
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.guards OWNER TO neondb_owner;

--
-- Name: holiday_assignments; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.holiday_assignments (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    holiday_id character varying NOT NULL,
    guard_id character varying NOT NULL,
    shift_id character varying,
    created_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.holiday_assignments OWNER TO neondb_owner;

--
-- Name: holidays; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.holidays (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    name character varying NOT NULL,
    date date NOT NULL,
    is_national boolean DEFAULT true,
    worked_guard_ids text[],
    created_at timestamp without time zone DEFAULT now(),
    year integer NOT NULL
);


ALTER TABLE public.holidays OWNER TO neondb_owner;

--
-- Name: notifications; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.notifications (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    user_id character varying NOT NULL,
    title character varying NOT NULL,
    message text NOT NULL,
    type character varying NOT NULL,
    is_read boolean DEFAULT false,
    related_entity_id character varying,
    created_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.notifications OWNER TO neondb_owner;

--
-- Name: sessions; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.sessions (
    sid character varying NOT NULL,
    sess jsonb NOT NULL,
    expire timestamp without time zone NOT NULL
);


ALTER TABLE public.sessions OWNER TO neondb_owner;

--
-- Name: shift_assignments; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.shift_assignments (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    shift_id character varying NOT NULL,
    guard_id character varying NOT NULL,
    assigned_at timestamp without time zone DEFAULT now(),
    confirmed_at timestamp without time zone,
    check_in_time timestamp without time zone,
    check_out_time timestamp without time zone
);


ALTER TABLE public.shift_assignments OWNER TO neondb_owner;

--
-- Name: shifts; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.shifts (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    site_id character varying NOT NULL,
    start_time timestamp without time zone NOT NULL,
    end_time timestamp without time zone NOT NULL,
    status public.shift_status DEFAULT 'planned'::public.shift_status NOT NULL,
    notes text,
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.shifts OWNER TO neondb_owner;

--
-- Name: site_preferences; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.site_preferences (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    site_id character varying NOT NULL,
    guard_id character varying NOT NULL,
    preference character varying NOT NULL,
    priority integer DEFAULT 0,
    reason text,
    created_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.site_preferences OWNER TO neondb_owner;

--
-- Name: sites; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.sites (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    name character varying NOT NULL,
    address character varying NOT NULL,
    client_id character varying,
    shift_type public.shift_type NOT NULL,
    min_guards integer DEFAULT 1 NOT NULL,
    requires_armed boolean DEFAULT false,
    requires_driver_license boolean DEFAULT false,
    latitude character varying,
    longitude character varying,
    is_active boolean DEFAULT true,
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.sites OWNER TO neondb_owner;

--
-- Name: training_courses; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.training_courses (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    guard_id character varying NOT NULL,
    course_name character varying NOT NULL,
    course_type character varying NOT NULL,
    scheduled_date date,
    completion_date date,
    expiry_date date,
    status public.training_status DEFAULT 'scheduled'::public.training_status NOT NULL,
    certificate_url character varying,
    provider character varying,
    hours integer,
    notes text,
    created_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.training_courses OWNER TO neondb_owner;

--
-- Name: users; Type: TABLE; Schema: public; Owner: neondb_owner
--

CREATE TABLE public.users (
    id character varying DEFAULT gen_random_uuid() NOT NULL,
    email character varying,
    first_name character varying,
    last_name character varying,
    profile_image_url character varying,
    role public.user_role DEFAULT 'guard'::public.user_role NOT NULL,
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now()
);


ALTER TABLE public.users OWNER TO neondb_owner;

--
-- Data for Name: absence_affected_shifts; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.absence_affected_shifts (id, absence_id, shift_id, is_substituted, created_at) FROM stdin;
\.


--
-- Data for Name: absences; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.absences (id, guard_id, type, start_date, end_date, certificate_url, notes, is_approved, needs_substitute, substitute_guard_id, created_at, approved_at, approved_by) FROM stdin;
\.


--
-- Data for Name: certifications; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.certifications (id, guard_id, type, name, issue_date, expiry_date, status, document_url, created_at) FROM stdin;
\.


--
-- Data for Name: contract_parameters; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.contract_parameters (id, contract_type, max_hours_per_day, max_overtime_per_day, max_hours_per_week, max_overtime_per_week, min_daily_rest_hours, min_weekly_rest_hours, max_night_hours_per_week, holiday_pay_increase, night_pay_increase, overtime_pay_increase, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: guard_constraints; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.guard_constraints (id, guard_id, preferred_shift_type, max_hours_per_day, max_hours_per_week, preferred_days_off, available_on_holidays, notes, updated_at) FROM stdin;
\.


--
-- Data for Name: guards; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.guards (id, user_id, badge_number, phone_number, is_armed, has_fire_safety, has_first_aid, has_driver_license, languages, created_at, updated_at) FROM stdin;
bd6451cc-2b35-49f2-9fc6-249a32892fe3	\N	GPV-BPxp	+39 333 1234567	t	f	f	f	{}	2025-10-11 10:06:22.578144	2025-10-11 10:06:22.578144
54b94b52-e7c7-440c-a3fc-7a3eb73bc0ec	\N	Guardia di test		t	t	t	t	{}	2025-10-11 10:08:48.44518	2025-10-11 10:08:48.44518
d969de12-6b2e-4922-856a-25ef7ffb4151	\N	ARMEDQ7Z	+393331111111	t	t	f	f	{italiano}	2025-10-11 10:47:21.967514	2025-10-11 10:47:21.967514
6939d71f-ec78-47ff-a5cc-8b34862264a6	\N	NOARMPo1	+393332222222	f	f	t	t	{italiano}	2025-10-11 10:47:36.37076	2025-10-11 10:47:36.37076
6f8f5d9d-0f10-4c25-9390-7d179fe53455	\N	ARMZ7	3910000000	t	f	f	f	{it}	2025-10-11 10:56:56.418186	2025-10-11 10:56:56.418186
guard-edit-test	\N	GPV-EDIT-002	+39 999 8888777	t	t	f	t	{}	2025-10-11 15:51:27.834342	2025-10-11 15:52:31.214
\.


--
-- Data for Name: holiday_assignments; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.holiday_assignments (id, holiday_id, guard_id, shift_id, created_at) FROM stdin;
\.


--
-- Data for Name: holidays; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.holidays (id, name, date, is_national, worked_guard_ids, created_at, year) FROM stdin;
aef7418f-10bc-4e30-a7cb-b161de8c268f	Natale 2025	2025-12-25	t	\N	2025-10-11 19:22:16.473591	2025
\.


--
-- Data for Name: notifications; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.notifications (id, user_id, title, message, type, is_read, related_entity_id, created_at) FROM stdin;
\.


--
-- Data for Name: sessions; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.sessions (sid, sess, expire) FROM stdin;
EOx2wCIiYXs6ymvWltapMxSk_OnpDO1X	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T09:29:52.444Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760178591, "iat": 1760174991, "iss": "https://test-mock-oidc.replit.app/", "jti": "d2897fd603422350e9c771fdfb2bb0c2", "sub": "admin001", "role": "admin", "email": "admin@vigilanza.it", "auth_time": 1760174991, "last_name": "Rossi", "first_name": "Mario"}, "expires_at": 1760178591, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 09:36:39
bHcuoH7eaupU1HmlAUuhDCWk1OCai1yX	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T15:17:29.732Z", "httpOnly": true, "originalMaxAge": 604800000}, "test-mock-oidc.replit.app": {"code_verifier": "XVRn_28dGTxuDcD_EqY_1FVcvsg6T_VLw8LBM0mDOeo"}}	2025-10-18 15:17:30
j_-MaFHmjhRMHMo0tmPD_zDtYfmJY9NM	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-20T07:19:22.605Z", "httpOnly": true, "originalMaxAge": 604800000}, "replit.com": {"code_verifier": "7aA8NPNPCXpK5DZZ8EtIsAzPlvRdwY3yTq1iiSB5OvQ"}}	2025-10-22 08:09:45
MaoXbrXPuQZddUf3Oc5pG9wXmV8Vpvqg	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T09:29:10.214Z", "httpOnly": true, "originalMaxAge": 604800000}, "replit.com": {"code_verifier": "ftUe_DWh6Lzz_1Yqg51bbkUZQIs_D3Q5l0BOiFp-1lg"}}	2025-10-18 09:29:11
BCb25dspMJL_35e-GK-uhPg4JZqE6a8N	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T10:03:26.943Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760180606, "iat": 1760177006, "iss": "https://test-mock-oidc.replit.app/", "jti": "e0fe7223680d5c9f10d10e365296e745", "sub": "RELy01vi", "role": "admin", "email": "test-jv_1@vigilanza.it", "auth_time": 1760177006, "last_name": "User", "first_name": "Test"}, "expires_at": 1760180606, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 10:07:03
pUCOXknX_aeGMXMO3Thr_IG5vnEuFX7t	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-20T07:12:32.468Z", "httpOnly": true, "originalMaxAge": 604800000}, "replit.com": {"code_verifier": "dPtnXTfpcDEqx_ONtmKbQ93jnP7p-sc4I22t0LJyLBc"}}	2025-10-20 07:12:33
0MK06XSaPIpFv4XSuJeGKXvi1SxOlenq	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T19:52:57.199Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760215976, "iat": 1760212376, "iss": "https://replit.com/oidc", "sub": "48531002", "email": "marco@lanzara.eu", "at_hash": "eJHjY3-MxDZI-SmzsihfmQ", "username": "marco370", "auth_time": 1760196628, "last_name": "Lanzara", "first_name": "Marco"}, "expires_at": 1760215976, "access_token": "[REDACTED]", "refresh_token": "[REDACTED]"}}}	2025-10-18 19:56:04
MGRsxqgxDuQWtazi3fyWmpKRzAnln9HH	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T14:54:00.458Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760198039, "iat": 1760194439, "iss": "https://replit.com/oidc", "sub": "48531002", "email": "marco@lanzara.eu", "at_hash": "ULFFV2r1H9HpeXPMBm9Pjg", "username": "marco370", "auth_time": 1760194438, "last_name": "Lanzara", "first_name": "Marco"}, "expires_at": 1760198039, "access_token": "[REDACTED]", "refresh_token": "[REDACTED]"}}}	2025-10-18 14:54:08
9R3eXldzJgCJtvRidjnATOHleQqU-VPm	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T15:05:15.530Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760198715, "iat": 1760195115, "iss": "https://test-mock-oidc.replit.app/", "jti": "2638b26901698500dad7ac25664d26fc", "sub": "menu-test-user", "role": "admin", "email": "menu@test.it", "auth_time": 1760195114, "last_name": "Tester", "first_name": "Menu"}, "expires_at": 1760198715, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 15:05:19
h-lYn0EHxUnWyDm0-Uw2Kpkb-Qc8YKtz	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-20T07:19:36.520Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760343575, "iat": 1760339975, "iss": "https://replit.com/oidc", "sub": "48531002", "email": "marco@lanzara.eu", "at_hash": "6TmaYJVt8NoBvvHW0zODKw", "username": "marco370", "auth_time": 1760176372, "last_name": "Lanzara", "first_name": "Marco"}, "expires_at": 1760343575, "access_token": "[REDACTED]", "refresh_token": "[REDACTED]"}}}	2025-10-20 07:21:03
CGdg7w4Rx4yhNg4HzM6x83UxA7erKxcK	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T09:47:16.831Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760179636, "iat": 1760176036, "iss": "https://replit.com/oidc", "sub": "48531002", "email": "marco@lanzara.eu", "at_hash": "UH5Ee9wj0LQVDxxlcC4xlA", "username": "marco370", "auth_time": 1760176035, "last_name": "Lanzara", "first_name": "Marco"}, "expires_at": 1760179636, "access_token": "[REDACTED]", "refresh_token": "[REDACTED]"}}}	2025-10-18 09:47:54
sF24qvCjN9H31oy-4Qe43JaY44TUj9PE	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T09:48:05.682Z", "httpOnly": true, "originalMaxAge": 604800000}, "replit.com": {"code_verifier": "tXX4r9Lnnc4S47qzYkKHaxakmskn6bQdO2H5aCCKkgc"}, "test-mock-oidc.replit.app": {"code_verifier": "fq9U9BlmiFYq481ShXN75xVKhrA33PNWHoLNR83uitc"}}	2025-10-18 09:48:06
oWaGRXLDo4rpH0G6I6lOD5WGgvcsDs9n	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T10:56:23.918Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760183783, "iat": 1760180183, "iss": "https://test-mock-oidc.replit.app/", "jti": "3f7e81adf85c2185fdd5c44b9120aef3", "sub": "jGUQSg", "role": "admin", "email": "refetch-cYC@test.it", "auth_time": 1760180183, "last_name": "Test", "first_name": "Refetch"}, "expires_at": 1760183783, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 11:00:41
rr6VHF5XVx-H_UGZLQLkpauI9ryJ7Y14	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T10:39:18.339Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760182757, "iat": 1760179157, "iss": "https://test-mock-oidc.replit.app/", "jti": "6db441aed924d3f8a1376a445910e73b", "sub": "xujCTTYv", "role": "admin", "email": "assign-test-l71q@vigilanza.it", "auth_time": 1760179157, "last_name": "Test", "first_name": "Assignment"}, "expires_at": 1760182757, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 10:45:07
-NyLj_NDThlkVS_V1S3wEscq70x8tRNG	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T10:46:50.670Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760183210, "iat": 1760179610, "iss": "https://test-mock-oidc.replit.app/", "jti": "eb3cd3d5cf59b547a03194ee2324b94a", "sub": "K4vWdf31", "role": "admin", "email": "fix-test-iq8w@vigilanza.it", "auth_time": 1760179610, "last_name": "User", "first_name": "FixTest"}, "expires_at": 1760183210, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 10:54:13
qHdexxU_vkm0SANJWvqXEsBvmGKnxktG	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T10:10:40.581Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760181039, "iat": 1760177439, "iss": "https://test-mock-oidc.replit.app/", "jti": "42ef5883a7ed0f48274417a33674620a", "sub": "cS6VwdUj", "role": "admin", "email": "final-test-T6pt@vigilanza.it", "auth_time": 1760177439, "last_name": "Test", "first_name": "Final"}, "expires_at": 1760181039, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 10:14:16
wSmAm4Srk2KEuQ01VGmNE0Vq3zT0eCaR	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T09:59:42.800Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760180382, "iat": 1760176782, "iss": "https://test-mock-oidc.replit.app/", "jti": "314219805b34fb5c71c433e7daac2ccd", "sub": "vCRhJG-V", "role": "admin", "email": "admin-UNbw8C@vigilanza.it", "auth_time": 1760176781, "last_name": "Rossi", "first_name": "Mario"}, "expires_at": 1760180382, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 10:00:30
aTDDzJwwmT3UbBAN5TASdAZPLMAAXopj	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T10:17:37.663Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760181456, "iat": 1760177856, "iss": "https://test-mock-oidc.replit.app/", "jti": "9b777e0d39bd576a633b45ba3fcb76f7", "sub": "IDxjtq9A", "role": "admin", "email": "final-zod-wxYt@vigilanza.it", "auth_time": 1760177856, "last_name": "Test", "first_name": "Zod"}, "expires_at": 1760181456, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 10:19:36
rBOv-IOJDsfLpoqpD2dULNNIXRNVIS6Y	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T10:23:07.251Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760181786, "iat": 1760178186, "iss": "https://test-mock-oidc.replit.app/", "jti": "cf4d4c31d279a71c40b28e5491d85763", "sub": "JMGdwYph", "role": "admin", "email": "refine-fix-sigB@vigilanza.it", "auth_time": 1760178186, "last_name": "Fix", "first_name": "Refine"}, "expires_at": 1760181786, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 10:26:27
O4cjg1auQoYPvA9kIeugk2b-7uwsbxSU	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T10:28:18.421Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760182097, "iat": 1760178497, "iss": "https://test-mock-oidc.replit.app/", "jti": "b1b6c1050ccfca9db2f8adcbecfd3901", "sub": "eVS7usSc", "role": "admin", "email": "debug-IoeB@test.it", "auth_time": 1760178497, "last_name": "User", "first_name": "Debug"}, "expires_at": 1760182097, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 10:29:53
sqnKaJZhmGqrBQ0mVupW1z_-HeqPSv9b	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T15:50:29.528Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760201428, "iat": 1760197828, "iss": "https://test-mock-oidc.replit.app/", "jti": "61a7a06f540598b0fe43bd089b85683f", "sub": "admin-test-2", "email": "admin2@test.com", "auth_time": 1760197828, "last_name": "Test", "first_name": "Admin"}, "expires_at": 1760201428, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 15:50:33
CTsWAmVjRCDIeJWmv2gu3EByl_nNK1Er	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T15:22:48.261Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760199767, "iat": 1760196167, "iss": "https://test-mock-oidc.replit.app/", "jti": "deec8b729995ac3f71974438f94ba6bb", "sub": "security-test-admin", "email": "security-admin@test.it", "auth_time": 1760196167, "last_name": "Admin", "first_name": "Security"}, "expires_at": 1760199767, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 15:23:14
rSR1OAJ1n-2EJf4uKVhr7ZEvMT7drJZY	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T15:24:32.968Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760199872, "iat": 1760196272, "iss": "https://test-mock-oidc.replit.app/", "jti": "a84ed05c9dfee4cea533cc8450efa714", "sub": "marco-lanzara-admin", "email": "marco@lanzara.eu", "auth_time": 1760196272, "last_name": "Lanzara", "first_name": "Marco"}, "expires_at": 1760199872, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 15:24:37
8RpUruKQx6G5UgL98xG4h_PD8MME56kT	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T15:18:57.242Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760199536, "iat": 1760195936, "iss": "https://test-mock-oidc.replit.app/", "jti": "c3aca2826c2b6b6dc4bd3c864d622b12", "sub": "marco-admin", "email": "marco@lanzara.eu", "auth_time": 1760195936, "last_name": "Lanzara", "first_name": "Marco"}, "expires_at": 1760199536, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 15:20:06
LplSh1-TmAlPl9VqBYRZOmQhHAlFkNtf	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T15:48:20.085Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760201299, "iat": 1760197699, "iss": "https://test-mock-oidc.replit.app/", "jti": "518e0a1c09594f15a5f2dc183738f1b5", "sub": "admin-test", "email": "admin@test.com", "auth_time": 1760197699, "last_name": "Test", "first_name": "Admin"}, "expires_at": 1760201299, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 15:48:47
YfwL6PA7Xv2fL1R4Saj7uVlxWClGbCj_	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T14:51:13.614Z", "httpOnly": true, "originalMaxAge": 604800000}}	2025-10-18 14:51:16
i1-TNkwzaiBtwt7prUEQc0IlverS_FB5	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T09:55:07.280Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760180106, "iat": 1760176506, "iss": "https://test-mock-oidc.replit.app/", "jti": "8ed556ffcd8e0b7c03f612e8699504dc", "sub": "test-admin-001", "email": "admin@vigilanza.test", "auth_time": 1760176506, "last_name": "Admin", "first_name": "Test"}, "expires_at": 1760180106, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 09:55:42
-U9sF1yoO4caKgRnSqmF_MgbJpJvFQ8C	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T19:25:48.729Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760214348, "iat": 1760210748, "iss": "https://test-mock-oidc.replit.app/", "jti": "9c53a7347cd119fce6eb7bbd02e65122", "sub": "test-admin-planning-v2", "email": "admin@planning-v2.test", "auth_time": 1760210748, "last_name": "PlanningV2", "first_name": "Admin"}, "expires_at": 1760214348, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 19:28:10
bf_EBibyQEKJ6BzLDgQt-ixp3tjoVyAE	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T19:18:42.177Z", "httpOnly": true, "originalMaxAge": 604800000}, "passport": {"user": {"claims": {"aud": "6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80", "exp": 1760213921, "iat": 1760210321, "iss": "https://test-mock-oidc.replit.app/", "jti": "92511eea1d9a22cdee4343b6d56bd014", "sub": "test-admin-planning", "email": "admin@planning.test", "auth_time": 1760210321, "last_name": "Planning", "first_name": "Admin"}, "expires_at": 1760213921, "access_token": "[REDACTED], "refresh_token": "[REDACTED]"}}}	2025-10-18 19:23:05
sIMx1lBq3K5NzCEOvdzEQ-H0ec7hks_i	{"cookie": {"path": "/", "secure": true, "expires": "2025-10-18T15:56:05.693Z", "httpOnly": true, "originalMaxAge": 604800000}}	2025-10-18 15:56:09
\.


--
-- Data for Name: shift_assignments; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.shift_assignments (id, shift_id, guard_id, assigned_at, confirmed_at, check_in_time, check_out_time) FROM stdin;
69698965-69f2-4167-93c3-a5d5ca38b726	4da5e14f-d0a4-46fa-a77f-58f35d55fa6d	bd6451cc-2b35-49f2-9fc6-249a32892fe3	2025-10-11 10:45:03.991232	\N	\N	\N
b333cbb8-cbad-4edb-94b6-885f8d2b30f0	855172fc-ce14-47a0-a01f-294a2cc85898	d969de12-6b2e-4922-856a-25ef7ffb4151	2025-10-11 11:00:38.786784	\N	\N	\N
\.


--
-- Data for Name: shifts; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.shifts (id, site_id, start_time, end_time, status, notes, created_at, updated_at) FROM stdin;
1bc94a2a-b48a-4e96-9da7-53ee4d68a764	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-11 09:55:45.524	2025-10-11 09:55:45.524	planned	\N	2025-10-11 09:55:50.21058	2025-10-11 09:55:50.21058
96b40beb-dac9-4369-8981-e0b011501d08	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-12 08:00:00	2025-10-12 16:00:00	planned	\N	2025-10-11 10:05:22.835039	2025-10-11 10:05:22.835039
ad5c4ddd-1491-4d02-bbde-44cb47964501	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-11 10:09:03.219	2025-10-11 10:09:03.219	planned	\N	2025-10-11 10:09:14.142048	2025-10-11 10:09:14.142048
12eeb4f4-bb02-4e26-86d6-6e681c44eb70	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-15 09:00:00	2025-10-15 17:00:00	planned	\N	2025-10-11 10:12:01.045964	2025-10-11 10:12:01.045964
d1051d76-9dcb-4947-bbcf-9748d6dec917	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-11 10:14:00	2025-10-18 13:16:00	planned	\N	2025-10-11 10:14:11.573726	2025-10-11 10:14:11.573726
0bba1222-fbf1-4b31-9a9c-2a7e1b5722ea	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-17 10:00:00	2025-10-17 18:00:00	planned	\N	2025-10-11 10:14:15.001963	2025-10-11 10:14:15.001963
7ed9101f-822c-443d-bc9a-50ecb59eb21f	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-20 08:00:00	2025-10-20 16:00:00	planned	\N	2025-10-11 10:19:34.302835	2025-10-11 10:19:34.302835
f0a16c0a-d1e9-432a-ac9b-f8ce759d2b03	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-09 10:20:00	2025-10-12 10:20:00	planned	\N	2025-10-11 10:21:03.458271	2025-10-11 10:21:03.458271
6b7876db-f358-458e-b298-1a9aa37ae092	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-22 10:00:00	2025-10-22 18:00:00	planned	\N	2025-10-11 10:25:59.585871	2025-10-11 10:25:59.585871
cd4892cc-bbdb-4248-b522-3661628f9fd1	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-10-25 09:00:00	2025-10-25 17:00:00	planned	\N	2025-10-11 10:29:31.629532	2025-10-11 10:29:31.629532
4da5e14f-d0a4-46fa-a77f-58f35d55fa6d	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-11-01 08:00:00	2025-11-01 16:00:00	planned	\N	2025-10-11 10:40:56.469271	2025-10-11 10:40:56.469271
55cde829-6d69-4865-a91b-5686a6bfdacc	c46d254f-769a-4184-9b92-0bd2c7dd9468	2025-11-05 09:00:00	2025-11-05 17:00:00	planned	\N	2025-10-11 10:50:13.34427	2025-10-11 10:50:13.34427
adccf142-4fe3-43b9-aaa5-8239a496b33a	c46d254f-769a-4184-9b92-0bd2c7dd9468	2025-11-05 09:00:00	2025-11-05 17:00:00	planned	\N	2025-10-11 10:51:53.092243	2025-10-11 10:51:53.092243
855172fc-ce14-47a0-a01f-294a2cc85898	7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	2025-11-10 10:00:00	2025-11-10 18:00:00	planned	\N	2025-10-11 10:59:22.833298	2025-10-11 10:59:22.833298
shift-abc-123	site-edit-456	2025-11-02 10:00:00	2025-11-01 14:00:00	completed	\N	2025-10-11 15:55:02.374157	2025-10-11 15:55:42.802
\.


--
-- Data for Name: site_preferences; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.site_preferences (id, site_id, guard_id, preference, priority, reason, created_at) FROM stdin;
\.


--
-- Data for Name: sites; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.sites (id, name, address, client_id, shift_type, min_guards, requires_armed, requires_driver_license, latitude, longitude, is_active, created_at, updated_at) FROM stdin;
76745907-a110-4765-a7c3-de87902385a9	Centro Commerciale Nord	Via Roma 123, Milano	\N	fixed_post	1	f	f	\N	\N	t	2025-10-11 09:32:54.993576	2025-10-11 09:32:54.993576
aeaf38d4-2aa6-4fe3-b981-6c9e1a92cc18	Final Test Site	Via Finale 1	\N	fixed_post	2	f	f	\N	\N	t	2025-10-11 10:10:51.630603	2025-10-11 10:10:51.630603
b479db14-0a4d-4944-812e-cfdf51d234c6	Zod Test Site	Via Zod 1	\N	fixed_post	2	f	f	\N	\N	t	2025-10-11 10:17:56.74085	2025-10-11 10:17:56.74085
28a669ce-dcf2-45d3-ad19-dd7f0126c0ff	Test Site z6X	Via Test 1	\N	fixed_post	2	f	f	\N	\N	t	2025-10-11 10:23:25.629625	2025-10-11 10:23:25.629625
ef1f9633-baf9-4578-8ece-aed2b9e60278	Debug Site	Via Debug 1	\N	fixed_post	1	f	f	\N	\N	t	2025-10-11 10:28:28.07614	2025-10-11 10:28:28.07614
c46d254f-769a-4184-9b92-0bd2c7dd9468	Site Assignment Test s_y	Via Test 456	\N	fixed_post	1	t	f	\N	\N	t	2025-10-11 10:47:07.798685	2025-10-11 10:47:07.798685
6ed41828-85a3-46d1-8000-038d4c943039	Refetch Site	Via Test 1	\N	fixed_post	1	t	f	\N	\N	t	2025-10-11 10:56:41.584119	2025-10-11 10:56:41.584119
site-edit-456	Site UPDATED	Via Milano 77	\N	patrol	5	t	f	\N	\N	t	2025-10-11 15:53:18.999264	2025-10-11 15:54:25.705
7d80b4c8-77c6-4c26-8641-f8a2fbb067cc	Centro Commerciale Test	Via Roma 123, Milano	\N	fixed_post	2	f	f	\N	\N	t	2025-10-11 09:32:22.875284	2025-10-11 19:55:28.047
\.


--
-- Data for Name: training_courses; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.training_courses (id, guard_id, course_name, course_type, scheduled_date, completion_date, expiry_date, status, certificate_url, provider, hours, notes, created_at) FROM stdin;
\.


--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: neondb_owner
--

COPY public.users (id, email, first_name, last_name, profile_image_url, role, created_at, updated_at) FROM stdin;
admin001	admin@vigilanza.it	Mario	Rossi	\N	guard	2025-10-11 09:29:52.16585	2025-10-11 09:29:52.16585
test-admin-001	admin@vigilanza.test	Test	Admin	\N	guard	2025-10-11 09:55:07.018946	2025-10-11 09:55:07.018946
vCRhJG-V	admin-UNbw8C@vigilanza.it	Mario	Rossi	\N	guard	2025-10-11 09:59:42.539995	2025-10-11 09:59:42.539995
RELy01vi	test-jv_1@vigilanza.it	Test	User	\N	guard	2025-10-11 10:03:26.683873	2025-10-11 10:03:26.683873
cS6VwdUj	final-test-T6pt@vigilanza.it	Final	Test	\N	guard	2025-10-11 10:10:40.310873	2025-10-11 10:10:40.310873
IDxjtq9A	final-zod-wxYt@vigilanza.it	Zod	Test	\N	guard	2025-10-11 10:17:37.400835	2025-10-11 10:17:37.400835
JMGdwYph	refine-fix-sigB@vigilanza.it	Refine	Fix	\N	guard	2025-10-11 10:23:06.994371	2025-10-11 10:23:06.994371
eVS7usSc	debug-IoeB@test.it	Debug	User	\N	guard	2025-10-11 10:28:18.161956	2025-10-11 10:28:18.161956
xujCTTYv	assign-test-l71q@vigilanza.it	Assignment	Test	\N	guard	2025-10-11 10:39:18.074376	2025-10-11 10:39:18.074376
K4vWdf31	fix-test-iq8w@vigilanza.it	FixTest	User	\N	guard	2025-10-11 10:46:50.407768	2025-10-11 10:46:50.407768
jGUQSg	refetch-cYC@test.it	Refetch	Test	\N	guard	2025-10-11 10:56:23.656146	2025-10-11 10:56:23.656146
nav-test	nav@test.it	Nav	Test	\N	admin	2025-10-11 14:44:42.051639	2025-10-11 14:47:56.327881
menu-test-user	menu@test.it	Menu	Tester	\N	guard	2025-10-11 15:05:15.256762	2025-10-11 15:05:15.256762
role-test-user	roletest@vigilanza.it	Role	Tester	\N	coordinator	2025-10-11 15:19:18.363578	2025-10-11 15:20:04.305
security-test-admin	security-admin@test.it	Security	Admin	\N	admin	2025-10-11 15:22:47.998495	2025-10-11 15:22:47.998495
48531002	marco@lanzara.eu	Marco	Lanzara	\N	admin	2025-10-11 09:47:16.558501	2025-10-11 15:30:30.389
admin-test	admin@test.com	Admin	Test	\N	admin	2025-10-11 15:48:19.825178	2025-10-11 15:48:19.825178
admin-test-2	admin2@test.com	Admin	Test	\N	admin	2025-10-11 15:50:29.267968	2025-10-11 15:51:03.533
test-admin-planning	admin@planning.test	Admin	Planning	\N	guard	2025-10-11 19:18:41.917524	2025-10-11 19:18:41.917524
test-admin-planning-v2	admin@planning-v2.test	Admin	PlanningV2	\N	admin	2025-10-11 19:25:29.373216	2025-10-11 19:25:48.409
\.


--
-- Name: absence_affected_shifts absence_affected_shifts_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.absence_affected_shifts
    ADD CONSTRAINT absence_affected_shifts_pkey PRIMARY KEY (id);


--
-- Name: absences absences_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.absences
    ADD CONSTRAINT absences_pkey PRIMARY KEY (id);


--
-- Name: certifications certifications_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.certifications
    ADD CONSTRAINT certifications_pkey PRIMARY KEY (id);


--
-- Name: contract_parameters contract_parameters_contract_type_unique; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.contract_parameters
    ADD CONSTRAINT contract_parameters_contract_type_unique UNIQUE (contract_type);


--
-- Name: contract_parameters contract_parameters_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.contract_parameters
    ADD CONSTRAINT contract_parameters_pkey PRIMARY KEY (id);


--
-- Name: guard_constraints guard_constraints_guard_id_unique; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.guard_constraints
    ADD CONSTRAINT guard_constraints_guard_id_unique UNIQUE (guard_id);


--
-- Name: guard_constraints guard_constraints_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.guard_constraints
    ADD CONSTRAINT guard_constraints_pkey PRIMARY KEY (id);


--
-- Name: guards guards_badge_number_unique; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.guards
    ADD CONSTRAINT guards_badge_number_unique UNIQUE (badge_number);


--
-- Name: guards guards_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.guards
    ADD CONSTRAINT guards_pkey PRIMARY KEY (id);


--
-- Name: holiday_assignments holiday_assignments_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.holiday_assignments
    ADD CONSTRAINT holiday_assignments_pkey PRIMARY KEY (id);


--
-- Name: holidays holidays_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.holidays
    ADD CONSTRAINT holidays_pkey PRIMARY KEY (id);


--
-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_pkey PRIMARY KEY (id);


--
-- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.sessions
    ADD CONSTRAINT sessions_pkey PRIMARY KEY (sid);


--
-- Name: shift_assignments shift_assignments_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.shift_assignments
    ADD CONSTRAINT shift_assignments_pkey PRIMARY KEY (id);


--
-- Name: shifts shifts_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.shifts
    ADD CONSTRAINT shifts_pkey PRIMARY KEY (id);


--
-- Name: site_preferences site_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.site_preferences
    ADD CONSTRAINT site_preferences_pkey PRIMARY KEY (id);


--
-- Name: sites sites_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.sites
    ADD CONSTRAINT sites_pkey PRIMARY KEY (id);


--
-- Name: training_courses training_courses_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.training_courses
    ADD CONSTRAINT training_courses_pkey PRIMARY KEY (id);


--
-- Name: users users_email_unique; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_email_unique UNIQUE (email);


--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- Name: IDX_session_expire; Type: INDEX; Schema: public; Owner: neondb_owner
--

CREATE INDEX "IDX_session_expire" ON public.sessions USING btree (expire);


--
-- Name: unique_absence_shift; Type: INDEX; Schema: public; Owner: neondb_owner
--

CREATE UNIQUE INDEX unique_absence_shift ON public.absence_affected_shifts USING btree (absence_id, shift_id);


--
-- Name: unique_holiday_date_year; Type: INDEX; Schema: public; Owner: neondb_owner
--

CREATE UNIQUE INDEX unique_holiday_date_year ON public.holidays USING btree (date, year);


--
-- Name: unique_holiday_guard; Type: INDEX; Schema: public; Owner: neondb_owner
--

CREATE UNIQUE INDEX unique_holiday_guard ON public.holiday_assignments USING btree (holiday_id, guard_id);


--
-- Name: unique_site_guard_preference; Type: INDEX; Schema: public; Owner: neondb_owner
--

CREATE UNIQUE INDEX unique_site_guard_preference ON public.site_preferences USING btree (site_id, guard_id);


--
-- Name: absence_affected_shifts absence_affected_shifts_absence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.absence_affected_shifts
    ADD CONSTRAINT absence_affected_shifts_absence_id_fkey FOREIGN KEY (absence_id) REFERENCES public.absences(id) ON DELETE CASCADE;


--
-- Name: absence_affected_shifts absence_affected_shifts_shift_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.absence_affected_shifts
    ADD CONSTRAINT absence_affected_shifts_shift_id_fkey FOREIGN KEY (shift_id) REFERENCES public.shifts(id) ON DELETE CASCADE;


--
-- Name: absences absences_approved_by_users_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.absences
    ADD CONSTRAINT absences_approved_by_users_id_fk FOREIGN KEY (approved_by) REFERENCES public.users(id);


--
-- Name: absences absences_guard_id_guards_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.absences
    ADD CONSTRAINT absences_guard_id_guards_id_fk FOREIGN KEY (guard_id) REFERENCES public.guards(id) ON DELETE CASCADE;


--
-- Name: absences absences_substitute_guard_id_guards_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.absences
    ADD CONSTRAINT absences_substitute_guard_id_guards_id_fk FOREIGN KEY (substitute_guard_id) REFERENCES public.guards(id);


--
-- Name: certifications certifications_guard_id_guards_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.certifications
    ADD CONSTRAINT certifications_guard_id_guards_id_fk FOREIGN KEY (guard_id) REFERENCES public.guards(id) ON DELETE CASCADE;


--
-- Name: guard_constraints guard_constraints_guard_id_guards_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.guard_constraints
    ADD CONSTRAINT guard_constraints_guard_id_guards_id_fk FOREIGN KEY (guard_id) REFERENCES public.guards(id) ON DELETE CASCADE;


--
-- Name: guards guards_user_id_users_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.guards
    ADD CONSTRAINT guards_user_id_users_id_fk FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: holiday_assignments holiday_assignments_guard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.holiday_assignments
    ADD CONSTRAINT holiday_assignments_guard_id_fkey FOREIGN KEY (guard_id) REFERENCES public.guards(id) ON DELETE CASCADE;


--
-- Name: holiday_assignments holiday_assignments_holiday_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.holiday_assignments
    ADD CONSTRAINT holiday_assignments_holiday_id_fkey FOREIGN KEY (holiday_id) REFERENCES public.holidays(id) ON DELETE CASCADE;


--
-- Name: holiday_assignments holiday_assignments_shift_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.holiday_assignments
    ADD CONSTRAINT holiday_assignments_shift_id_fkey FOREIGN KEY (shift_id) REFERENCES public.shifts(id) ON DELETE SET NULL;


--
-- Name: notifications notifications_user_id_users_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_user_id_users_id_fk FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: shift_assignments shift_assignments_guard_id_guards_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.shift_assignments
    ADD CONSTRAINT shift_assignments_guard_id_guards_id_fk FOREIGN KEY (guard_id) REFERENCES public.guards(id) ON DELETE CASCADE;


--
-- Name: shift_assignments shift_assignments_shift_id_shifts_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.shift_assignments
    ADD CONSTRAINT shift_assignments_shift_id_shifts_id_fk FOREIGN KEY (shift_id) REFERENCES public.shifts(id) ON DELETE CASCADE;


--
-- Name: shifts shifts_site_id_sites_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.shifts
    ADD CONSTRAINT shifts_site_id_sites_id_fk FOREIGN KEY (site_id) REFERENCES public.sites(id) ON DELETE CASCADE;


--
-- Name: site_preferences site_preferences_guard_id_guards_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.site_preferences
    ADD CONSTRAINT site_preferences_guard_id_guards_id_fk FOREIGN KEY (guard_id) REFERENCES public.guards(id) ON DELETE CASCADE;


--
-- Name: site_preferences site_preferences_site_id_sites_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.site_preferences
    ADD CONSTRAINT site_preferences_site_id_sites_id_fk FOREIGN KEY (site_id) REFERENCES public.sites(id) ON DELETE CASCADE;


--
-- Name: sites sites_client_id_users_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.sites
    ADD CONSTRAINT sites_client_id_users_id_fk FOREIGN KEY (client_id) REFERENCES public.users(id);


--
-- Name: training_courses training_courses_guard_id_guards_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: neondb_owner
--

ALTER TABLE ONLY public.training_courses
    ADD CONSTRAINT training_courses_guard_id_guards_id_fk FOREIGN KEY (guard_id) REFERENCES public.guards(id) ON DELETE CASCADE;


--
-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: cloud_admin
--

ALTER DEFAULT PRIVILEGES FOR ROLE cloud_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO neon_superuser WITH GRANT OPTION;


--
-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: cloud_admin
--

ALTER DEFAULT PRIVILEGES FOR ROLE cloud_admin IN SCHEMA public GRANT ALL ON TABLES TO neon_superuser WITH GRANT OPTION;


--
-- PostgreSQL database dump complete
--

