flowchart TB subgraph Raw["Raw Data Layer"] RD["R Data Files"] EM["Excel/CSV Files"] end subgraph Control["Control & Metadata Layer"] CT["PROCESS_CONTROL Table"] MD["Metadata Definitions"] Config["Configuration Settings"] CT -->|Validates| MD MD -->|Configures| Config end subgraph Bronze["Bronze Layer (Landing)"] BT["Bronze Tables"] BV["Bronze Views"] BT -->|Transforms| BV end subgraph Silver["Silver Layer (Standardized)"] ST["Silver Tables"] SV["Silver Views"] ST -->|Transforms| SV end subgraph Gold["Gold Layer (Business)"] GT["Gold Tables"] GV["Gold Views"] GT -->|Transforms| GV end %% Control Table Interactions CT -->|Tracks Ingestion| RD CT -->|Monitors Loading| EM CT -->|Records Status| BT CT -->|Validates Rules| ST CT -->|Ensures Quality| GT %% Data Flow RD -->|Load| BT EM -->|Load| BT BV -->|Clean & Standardize| ST SV -->|Business Logic| GT %% Metadata Influence MD -->|Schema Definition| BT MD -->|Data Standards| ST MD -->|Business Rules| GT %% Configuration Flow Config -->|Processing Rules| BT Config -->|Transformation Logic| ST Config -->|Aggregation Rules| GT classDef controlNode fill:#f9f,stroke:#333,stroke-width:2px classDef dataNode fill:#bbf,stroke:#333,stroke-width:2px classDef metaNode fill:#ffb,stroke:#333,stroke-width:2px class CT,MD,Config controlNode class RD,EM,BT,BV,ST,SV,GT,GV dataNode class Bronze,Silver,Gold metaNode
Technical Documentation
System Architecture Details 🏗️
Component Specifications
Database Schema 💾
Table Definitions
CREATE TABLE BRONZE_CATCH_DATA (
ID INTEGER, -- DuckDB will auto-increment
MONTH INTEGER,
YEAR INTEGER,
VARCHAR, -- DuckDB doesn't need length specifications
LICENCE_NO VARCHAR,
HOLDERS_NAME INTEGER,
LOG_NO INTEGER,
PAGE_NO INTEGER,
NON_COLLECTING_CODE DATE VARCHAR,
VARCHAR,
LOCATION_NAME DOUBLE, -- Using DOUBLE instead of NUMERIC for DuckDB
COLLECTION_TIME_HOURS VARCHAR,
SPECIES INTEGER,
NUMBER_OF_DEAD_SPECIMENS INTEGER,
NUMBER_OF_LIVE_SPECIMENS VARCHAR,
WEATHER_CONDITION DATE,
DATA_DATE VARCHAR,
COUNTRY TIMESTAMP,
LOADING_DATETIME VARCHAR,
SOURCE_FILE VARCHAR DEFAULT 'UNPROCESSED',
PROCESSING_STATUS VARCHAR
ERROR_MESSAGE
);
CREATE TABLE Trips (
INT PRIMARY KEY,
trip_id INT FOREIGN KEY REFERENCES Vessels(vessel_id),
vessel_id DATE,
start_date DATE
end_date );