esameits24-26backend/initdb/02_seed.sql
AV77web 3e94fdb6d9
All checks were successful
Deploy to VPS / build (push) Successful in 16s
Deploy to VPS / deploy (push) Successful in 18s
commit per adattare il data model alla web app Academy aziendale
2026-07-14 10:31:30 +02:00

95 lines
3.4 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ============================================================
-- Dati iniziali di test esameits24-26 (Academy aziendale)
-- Password per tutti gli utenti: Password123!
--
-- 1 Andrea Villari admin@academy.it (Referente Academy)
-- 2 Maria Bianchi maria.bianchi@academy.it (Dipendente)
-- 3 Luca Conti luca.conti@academy.it (Dipendente)
-- 4 Elena Rossi elena.rossi@academy.it (Dipendente)
-- ============================================================
USE `esameits24-26`;
-- ------------------------------------------------------------
-- Utenti
-- ------------------------------------------------------------
INSERT INTO utente (Nome, Cognome, Email, PasswordHash, Ruolo) VALUES
('Andrea', 'Villari', 'admin@academy.it', '$2b$10$7Z80qZcDydZCdLrOcaH/VOa9knKWjQVyyg8MtEgBAvgfNMsiLEZze', 'Referente Academy'),
('Maria', 'Bianchi', 'maria.bianchi@academy.it', '$2b$10$7Z80qZcDydZCdLrOcaH/VOa9knKWjQVyyg8MtEgBAvgfNMsiLEZze', 'Dipendente'),
('Luca', 'Conti', 'luca.conti@academy.it', '$2b$10$7Z80qZcDydZCdLrOcaH/VOa9knKWjQVyyg8MtEgBAvgfNMsiLEZze', 'Dipendente'),
('Elena', 'Rossi', 'elena.rossi@academy.it', '$2b$10$7Z80qZcDydZCdLrOcaH/VOa9knKWjQVyyg8MtEgBAvgfNMsiLEZze', 'Dipendente');
-- ------------------------------------------------------------
-- Catalogo corsi
-- ------------------------------------------------------------
INSERT INTO corso (Titolo, Descrizione, Categoria, DurataOre, Obbligatorio, Attivo) VALUES
(
'Sicurezza sul lavoro',
'Norme base su rischi, DPI e procedure di emergenza in azienda.',
'Sicurezza',
8,
1,
1
),
(
'GDPR e privacy',
'Trattamento dei dati personali, diritti degli interessati e documentazione privacy.',
'Compliance',
4,
1,
1
),
(
'Comunicazione efficace',
'Tecniche di ascolto attivo, feedback e gestione dei conflitti nel team.',
'Soft Skills',
6,
0,
1
),
(
'Excel avanzato',
'Tabelle pivot, funzioni avanzate e automazioni per report aziendali.',
'IT',
10,
0,
1
),
(
'Primo soccorso (edizione 2023)',
'Corso storico non più disponibile per nuove assegnazioni.',
'Sicurezza',
4,
0,
0
);
-- ------------------------------------------------------------
-- Assegnazioni corsi
-- UtenteID: 2 Maria, 3 Luca, 4 Elena
-- CorsoID: 1 Sicurezza, 2 GDPR, 3 Comunicazione, 4 Excel, 5 Primo soccorso
-- ------------------------------------------------------------
INSERT INTO assegnazione_corso (
CorsoID,
DipendenteID,
DataAssegnazione,
DataScadenza,
Stato,
DataCompletamento
) VALUES
-- Maria: mix di stati per test filtri e statistiche maggio 2026
(1, 2, '2026-05-01', '2026-06-30', 'Assegnato', NULL),
(2, 2, '2026-04-10', '2026-05-20', 'Completato', '2026-05-12'),
(4, 2, '2026-01-15', '2026-03-01', 'Scaduto', NULL),
(3, 2, '2026-03-01', '2026-04-30', 'Annullato', NULL),
-- Luca: completamenti e corsi in corso
(1, 3, '2026-05-05', '2026-06-15', 'Completato', '2026-05-18'),
(2, 3, '2026-05-08', '2026-06-30', 'Assegnato', NULL),
(3, 3, '2026-02-01', '2026-03-15', 'Scaduto', NULL),
-- Elena: dati aggiuntivi per riepiloghi per categoria
(1, 4, '2026-05-10', '2026-07-01', 'Completato', '2026-05-25'),
(2, 4, '2026-05-12', '2026-06-20', 'Completato', '2026-05-28'),
(4, 4, '2026-05-15', '2026-07-15', 'Assegnato', NULL),
(3, 4, '2026-04-01', '2026-05-10', 'Completato', '2026-05-05');