Releases: Project-Sloth/ps-mdt
Releases · Project-Sloth/ps-mdt
v3.1.2
What's Changed
- chore: removing dist from repo by @simsonas86 in #539
- feat(services): refactor auth and color configuration flow by @simsonas86 in #540
- fix(utils): stop returning mockData on timeout by @simsonas86 in #541
- Add release workflow for tagged commits by @complexza in #547
New Contributors
- @simsonas86 made their first contribution in #539
Full Changelog: 3.1.1...v3.1.2
3.1.1
What's Changed
- chore: remove claude properties and add gitignore by @complexza in #535
Full Changelog: 3.1.0...3.1.1
3.1.0
What's Changed
- refactor: simplify RegisterNetEvent handler by removing redundant AddEventHandler by @12LetterMeme in #533
New Contributors
- @12LetterMeme made their first contribution in #533
Full Changelog: 3.0.8...3.1.0
There are NEW SQL to be added for DOJ!
3.0.8
Full Changelog: 3.0.7...3.0.8
New SQL must be ran.
-- FTO (Field Training Officer) Tables
CREATE TABLE IF NOT EXISTS `mdt_fto_phases` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`job` varchar(50) NOT NULL DEFAULT 'police',
`name` varchar(200) NOT NULL,
`description` text DEFAULT NULL,
`duration_days` int(10) unsigned DEFAULT 0,
`sort_order` int(10) unsigned DEFAULT 0,
PRIMARY KEY (`id`),
KEY `job` (`job`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `mdt_fto_competencies` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`job` varchar(50) NOT NULL DEFAULT 'police',
`name` varchar(200) NOT NULL,
`category` varchar(100) DEFAULT 'General',
`sort_order` int(10) unsigned DEFAULT 0,
PRIMARY KEY (`id`),
KEY `job` (`job`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `mdt_fto_assignments` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`fto_number` varchar(20) NOT NULL DEFAULT '',
`trainee_citizenid` varchar(50) NOT NULL,
`trainee_name` varchar(100) NOT NULL,
`trainer_citizenid` varchar(50) NOT NULL,
`trainer_name` varchar(100) NOT NULL,
`current_phase_id` int(10) unsigned DEFAULT NULL,
`status` enum('active','completed','failed','suspended') NOT NULL DEFAULT 'active',
`start_date` varchar(20) DEFAULT NULL,
`end_date` varchar(20) DEFAULT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `fto_number` (`fto_number`),
KEY `trainee_citizenid` (`trainee_citizenid`),
KEY `trainer_citizenid` (`trainer_citizenid`),
KEY `status` (`status`),
KEY `current_phase_id` (`current_phase_id`),
CONSTRAINT `FK_fto_assignments_phase` FOREIGN KEY (`current_phase_id`) REFERENCES `mdt_fto_phases` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `mdt_fto_dors` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`assignment_id` int(10) unsigned NOT NULL,
`phase_id` int(10) unsigned DEFAULT NULL,
`author_citizenid` varchar(50) NOT NULL,
`author_name` varchar(100) NOT NULL,
`shift_date` varchar(20) NOT NULL,
`overall_rating` int(1) unsigned NOT NULL DEFAULT 3,
`notes` text DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
KEY `assignment_id` (`assignment_id`),
KEY `phase_id` (`phase_id`),
CONSTRAINT `FK_fto_dors_assignment` FOREIGN KEY (`assignment_id`) REFERENCES `mdt_fto_assignments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_fto_dors_phase` FOREIGN KEY (`phase_id`) REFERENCES `mdt_fto_phases` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `mdt_fto_dor_ratings` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`dor_id` int(10) unsigned NOT NULL,
`competency_id` int(10) unsigned NOT NULL,
`rating` int(1) unsigned NOT NULL DEFAULT 3,
`notes` text DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `dor_id` (`dor_id`),
KEY `competency_id` (`competency_id`),
CONSTRAINT `FK_fto_dor_ratings_dor` FOREIGN KEY (`dor_id`) REFERENCES `mdt_fto_dors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_fto_dor_ratings_competency` FOREIGN KEY (`competency_id`) REFERENCES `mdt_fto_competencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- FTO Default Data (change 'police' to your job name if different)
INSERT IGNORE INTO `mdt_fto_phases` (`id`, `job`, `name`, `description`, `duration_days`, `sort_order`) VALUES
(1, 'police', 'Phase 1 - Observation', 'Trainee observes the FTO during calls and patrol. FTO demonstrates proper procedures, report writing, and radio communication.', 14, 1),
(2, 'police', 'Phase 2 - Supervised Patrol', 'Trainee takes the lead on calls with FTO supervision. FTO evaluates decision-making, officer safety, and law application.', 21, 2),
(3, 'police', 'Phase 3 - Reduced Supervision', 'Trainee operates with minimal FTO input. FTO only intervenes when necessary and evaluates readiness for solo patrol.', 14, 3),
(4, 'police', 'Phase 4 - Solo Evaluation', 'Trainee patrols independently while the FTO observes from a distance or reviews reports. Final evaluation before sign-off.', 7, 4);
INSERT IGNORE INTO `mdt_fto_competencies` (`id`, `job`, `name`, `category`, `sort_order`) VALUES
(1, 'police', 'Driving and Vehicle Operations', 'Patrol', 1),
(2, 'police', 'Radio Communication', 'Communication', 2),
(3, 'police', 'Verbal Communication', 'Communication', 3),
(4, 'police', 'Report Writing', 'Documentation', 4),
(5, 'police', 'Knowledge of Penal Codes', 'Legal', 5),
(6, 'police', 'Knowledge of Traffic Laws', 'Legal', 6),
(7, 'police', 'Use of Force Decisions', 'Tactical', 7),
(8, 'police', 'Officer Safety and Awareness', 'Tactical', 8),
(9, 'police', 'Suspect Interaction and De-escalation', 'Communication', 9),
(10, 'police', 'Scene Management', 'Tactical', 10),
(11, 'police', 'Evidence Handling', 'Documentation', 11),
(12, 'police', 'Professionalism and Conduct', 'General', 12);
3.0.7
What's Changed
- Fix: Roster using nonexistent function to retrieve players on QBX by @Crayons0814 in #527
- Fix for missing table in QBX SQL files by @KodakZack in #530
New Contributors
- @KodakZack made their first contribution in #530
Full Changelog: 3.0.6...3.0.7
There are SQL changes - make sure that you review them and adjust them.
3.0.6
Full Changelog: 3.0.5...3.0.6
There is A LOT OF CHANGES TO THE SQL! Import all the new tables mdt_sop_* and the sample data if you want for the new SOP. Can be found under -- SOP Default Data (change 'police' to your job name if different)
3.0.5
Full Changelog: 3.0.4...3.0.5
MUST RUN NEW SQL UPDATE!
-- Internal Affairs
CREATE TABLE IF NOT EXISTS `mdt_ia_complaints` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`complaint_number` varchar(20) NOT NULL,
`complainant_citizenid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`complainant_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`complainant_phone` varchar(20) DEFAULT NULL,
`officer_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`officer_badge` varchar(20) DEFAULT NULL,
`category` enum('misconduct','excessive_force','corruption','negligence','discrimination','other') NOT NULL DEFAULT 'other',
`description` text NOT NULL,
`incident_date` varchar(20) DEFAULT NULL,
`incident_location` varchar(200) DEFAULT NULL,
`witnesses` text DEFAULT NULL,
`evidence` text DEFAULT NULL,
`status` enum('open','under_review','investigated','sustained','exonerated','unfounded','closed') NOT NULL DEFAULT 'open',
`assigned_to` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`assigned_to_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `complaint_number` (`complaint_number`),
KEY `status` (`status`),
KEY `assigned_to` (`assigned_to`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `mdt_ia_notes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`complaint_id` int(10) unsigned NOT NULL,
`content` text NOT NULL,
`author_citizenid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`author_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
KEY `complaint_id` (`complaint_id`),
CONSTRAINT `FK_ia_notes_complaints` FOREIGN KEY (`complaint_id`) REFERENCES `mdt_ia_complaints` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=UTF8MB4_GENERAL_CI;
CREATE TABLE IF NOT EXISTS `mdt_case_notes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`case_id` int(10) unsigned NOT NULL,
`content` text NOT NULL,
`author_citizenid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`author_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
KEY `case_id` (`case_id`),
CONSTRAINT `FK_mdt_case_notes_cases` FOREIGN KEY (`case_id`) REFERENCES `mdt_cases` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
3.0.4
Full Changelog: 3.0.3...3.0.4
3.0.3
Full Changelog: 3.0.2...3.0.3
Run this if you already have ps-mdt installed and want backwards compatibility with the EMS.
-- 1. Add job_type column (safe to run multiple times, will error silently if exists)
ALTER TABLE `mdt_tags` ADD COLUMN `job_type` ENUM('leo','ems','all') NOT NULL DEFAULT 'all' AFTER `color`;
-- 2. Set all existing officer tags to LEO
UPDATE `mdt_tags` SET `job_type` = 'leo' WHERE `type` = 'officer';
-- 3. Set all existing report tags to LEO
UPDATE `mdt_tags` SET `job_type` = 'leo' WHERE `type` = 'report';
-- 4. Insert EMS officer tags
INSERT IGNORE INTO `mdt_tags` (`name`, `type`, `color`, `job_type`) VALUES
('Paramedic', 'officer', '#ef4444', 'ems'),
('EMT', 'officer', '#f97316', 'ems'),
('Supervisor', 'officer', '#8b5cf6', 'ems'),
('Flight Medic', 'officer', '#06b6d4', 'ems'),
('Training', 'officer', '#10b981', 'ems');
-- 5. Insert EMS report tags
INSERT IGNORE INTO `mdt_tags` (`name`, `type`, `color`, `job_type`) VALUES
('Cardiac', 'report', '#ef4444', 'ems'),
('Trauma', 'report', '#f97316', 'ems'),
('Overdose', 'report', '#8b5cf6', 'ems'),
('Respiratory', 'report', '#06b6d4', 'ems'),
('Burn', 'report', '#f59e0b', 'ems'),
('Psychiatric', 'report', '#ec4899', 'ems'),
('DOA', 'report', '#6b7280', 'ems'),
('Mass Casualty', 'report', '#ef4444', 'ems'),
('Transport', 'report', '#3b82f6', 'ems'),
('Routine', 'report', '#10b981', 'ems');
-- 1. Add job_type column to mdt_report_templates
ALTER TABLE `mdt_report_templates`
ADD COLUMN `job_type` ENUM('leo','ems','all') NOT NULL DEFAULT 'all' AFTER `content`,
ADD KEY `idx_job_type` (`job_type`);
-- 2. Tag existing LEO templates
UPDATE `mdt_report_templates` SET `job_type` = 'leo' WHERE `job_type` = 'all';
-- 3. Insert default EMS templates
INSERT INTO `mdt_report_templates` (`name`, `type`, `content`, `job_type`) VALUES
('Standard Medical', 'Medical Report', '<h2>Medical Response Summary</h2>\n<p>On [DATE] at approximately [TIME] hours, [EMS NAME/UNIT] responded to a medical call at [LOCATION].</p>\n\n<h2>Patient Information</h2>\n<p><strong>Name:</strong> [PATIENT NAME]</p>\n<p><strong>Citizen ID:</strong> [ID]</p>\n<p><strong>Age/DOB:</strong> [AGE/DOB]</p>\n\n<h2>Assessment</h2>\n<p><strong>Chief Complaint:</strong> [COMPLAINT]</p>\n<p><strong>Vitals:</strong> BP [BP] / HR [HR] / SpO2 [SPO2] / Temp [TEMP]</p>\n<p><strong>Level of Consciousness:</strong> [ALERT/VERBAL/PAIN/UNRESPONSIVE]</p>\n\n<h2>Treatment Provided</h2>\n<ul>\n<li>[TREATMENT 1]</li>\n<li>[TREATMENT 2]</li>\n</ul>\n\n<h2>Transport</h2>\n<p><strong>Destination:</strong> [HOSPITAL/FACILITY]</p>\n<p><strong>Condition on Arrival:</strong> [STABLE/CRITICAL/DECEASED]</p>\n\n<h2>Notes</h2>\n<p>[ADDITIONAL OBSERVATIONS]</p>', 'ems'),
('Trauma Report', 'Trauma Report', '<h2>Trauma Response Summary</h2>\n<p>On [DATE] at approximately [TIME] hours, [EMS NAME/UNIT] responded to a trauma call at [LOCATION].</p>\n\n<h2>Patient Information</h2>\n<p><strong>Name:</strong> [PATIENT NAME]</p>\n<p><strong>Citizen ID:</strong> [ID]</p>\n\n<h2>Mechanism of Injury</h2>\n<p>[DESCRIBE: GSW, MVA, FALL, STABBING, ASSAULT, ETC.]</p>\n\n<h2>Injuries Observed</h2>\n<ul>\n<li>[INJURY 1 - LOCATION AND SEVERITY]</li>\n<li>[INJURY 2 - LOCATION AND SEVERITY]</li>\n</ul>\n\n<h2>Treatment Provided</h2>\n<ul>\n<li>[TREATMENT 1]</li>\n<li>[TREATMENT 2]</li>\n</ul>\n\n<h2>Scene Information</h2>\n<p><strong>LEO on Scene:</strong> [YES/NO - OFFICER NAME IF APPLICABLE]</p>\n<p><strong>Scene Safety:</strong> [SECURE/UNSECURE]</p>\n\n<h2>Transport</h2>\n<p><strong>Destination:</strong> [HOSPITAL]</p>\n<p><strong>Condition:</strong> [STABLE/CRITICAL/DECEASED]</p>', 'ems'),
('Overdose Report', 'Overdose Report', '<h2>Overdose Response Summary</h2>\n<p>On [DATE] at approximately [TIME] hours, [EMS NAME/UNIT] responded to a suspected overdose at [LOCATION].</p>\n\n<h2>Patient Information</h2>\n<p><strong>Name:</strong> [PATIENT NAME]</p>\n<p><strong>Citizen ID:</strong> [ID]</p>\n\n<h2>Substance Information</h2>\n<p><strong>Suspected Substance:</strong> [SUBSTANCE]</p>\n<p><strong>Route of Administration:</strong> [ORAL/IV/INHALATION/UNKNOWN]</p>\n<p><strong>Time of Ingestion:</strong> [ESTIMATED TIME]</p>\n\n<h2>Patient Presentation</h2>\n<p><strong>Level of Consciousness:</strong> [ALERT/VERBAL/PAIN/UNRESPONSIVE]</p>\n<p><strong>Respiratory Status:</strong> [NORMAL/DEPRESSED/ABSENT]</p>\n<p><strong>Pupil Response:</strong> [PINPOINT/DILATED/NORMAL]</p>\n\n<h2>Treatment Provided</h2>\n<ul>\n<li>[NARCAN ADMINISTERED - DOSE AND ROUTE]</li>\n<li>[ADDITIONAL TREATMENT]</li>\n</ul>\n\n<h2>Transport and Outcome</h2>\n<p><strong>Destination:</strong> [HOSPITAL]</p>\n<p><strong>Condition on Transport:</strong> [CONDITION]</p>', 'ems'),
('Psychiatric Response', 'Psychiatric Report', '<h2>Psychiatric Response Summary</h2>\n<p>On [DATE] at approximately [TIME] hours, [EMS NAME/UNIT] responded to a psychiatric emergency at [LOCATION].</p>\n\n<h2>Patient Information</h2>\n<p><strong>Name:</strong> [PATIENT NAME]</p>\n<p><strong>Citizen ID:</strong> [ID]</p>\n\n<h2>Presenting Behavior</h2>\n<p>[DESCRIBE BEHAVIOR: SUICIDAL IDEATION, PSYCHOSIS, AGITATION, ETC.]</p>\n<p><strong>Threat to Self:</strong> [YES/NO]</p>\n<p><strong>Threat to Others:</strong> [YES/NO]</p>\n\n<h2>Assessment</h2>\n<p><strong>Mental Status:</strong> [ORIENTED/DISORIENTED]</p>\n<p><strong>Mood/Affect:</strong> [DESCRIBE]</p>\n\n<h2>Intervention</h2>\n<ul>\n<li>[DE-ESCALATION TECHNIQUES USED]</li>\n<li>[MEDICATIONS ADMINISTERED IF ANY]</li>\n</ul>\n\n<h2>Transport</h2>\n<p><strong>Destination:</strong> [FACILITY]</p>\n<p><strong>Voluntary/Involuntary:</strong> [STATUS]</p>', 'ems'),
('Mass Casualty', 'Mass Casualty Report', '<h2>Mass Casualty Incident Report</h2>\n<p>On [DATE] at approximately [TIME] hours, a mass casualty incident was declared at [LOCATION].</p>\n\n<h2>Incident Type</h2>\n<p>[DESCRIBE: MVA, EXPLOSION, SHOOTING, NATURAL DISASTER, ETC.]</p>\n\n<h2>Triage Summary</h2>\n<p><strong>Total Patients:</strong> [NUMBER]</p>\n<ul>\n<li><strong>Red (Immediate):</strong> [NUMBER]</li>\n<li><strong>Yellow (Delayed):</strong> [NUMBER]</li>\n<li><strong>Green (Minor):</strong> [NUMBER]</li>\n<li><strong>Black (Deceased):</strong> [NUMBER]</li>\n</ul>\n\n<h2>EMS Units on Scene</h2>\n<ul>\n<li>[UNIT 1 - ASSIGNED PATIENTS]</li>\n<li>[UNIT 2 - ASSIGNED PATIENTS]</li>\n</ul>\n\n<h2>Transport Destinations</h2>\n<ul>\n<li>[HOSPITAL 1] - [NUMBER] patients</li>\n<li>[HOSPITAL 2] - [NUMBER] patients</li>\n</ul>\n\n<h2>Incident Command</h2>\n<p><strong>IC:</strong> [NAME]</p>\n<p><strong>LEO Liaison:</strong> [NAME]</p>\n\n<h2>Notes</h2>\n<p>[ADDITIONAL DETAILS]</p>', 'ems');
3.0.2
What's Changed
- Fix for issue #524 for QBX SQL files by @Crayons0814 in #525
Full Changelog: 3.0.1...3.0.2