Add configuration for Code Review Automation and enhance .gitignore. Introduce .coderabbit.yml for automated reviews with profiles for correctness, maintainability, security, and performance. Update paths to include relevant directories and exclude generated files. Modify .gitignore to include coverage reports and generated files. Refactor Docker Compose to use updated paths for database initialization scripts. Update Go module dependencies and enhance Makefile with new code generation tasks. Transition domain models to a new DTO structure for better separation of concerns.

This commit is contained in:
windyboy
2025-11-17 11:47:23 +08:00
parent 12fda00df9
commit 204217015d
45 changed files with 252 additions and 175 deletions
+44
View File
@@ -0,0 +1,44 @@
CREATE SCHEMA IF NOT EXISTS aviation;
CREATE EXTENSION IF NOT EXISTS timescaledb;
CREATE TABLE aviation.telegrams (
uuid UUID NOT NULL,
message_id TEXT,
date_time TEXT,
priority_indicator TEXT,
primary_address TEXT,
secondary_addresses TEXT,
originator TEXT,
originator_date_time TEXT,
category TEXT,
content TEXT,
body_data JSONB,
status TEXT NOT NULL DEFAULT 'parsed',
error_reason TEXT,
received_at TIMESTAMPTZ NOT NULL,
parsed_at TIMESTAMPTZ,
dispatched_at TIMESTAMPTZ,
need_dispatch BOOLEAN,
PRIMARY KEY (uuid, received_at)
);
SELECT create_hypertable('aviation.telegrams', 'received_at', if_not_exists => TRUE);
-- Indexes for better query performance
CREATE INDEX idx_telegrams_message_id ON aviation.telegrams (message_id);
CREATE INDEX idx_telegrams_date_time ON aviation.telegrams (date_time);
CREATE INDEX idx_telegrams_priority_indicator ON aviation.telegrams (priority_indicator);
CREATE INDEX idx_telegrams_primary_address ON aviation.telegrams (primary_address);
CREATE INDEX idx_telegrams_received_at ON aviation.telegrams (received_at);
CREATE INDEX idx_telegrams_uuid ON aviation.telegrams (uuid);
CREATE TABLE IF NOT EXISTS aviation.telegrams_raw (
uuid UUID NOT NULL,
status TEXT NOT NULL,
error_reason TEXT,
content TEXT NOT NULL,
received_at TIMESTAMPTZ NOT NULL,
metadata JSONB,
PRIMARY KEY (uuid, received_at)
);