Files
Claude VM a6c03a091e initial: split from gov-agreg — vreau.digital standalone platform
Moved from gov-agreg/src/pages/achizitii/* to root (drop prefix).
- 22 pages migrated, 127 files total
- All internal links: /achizitii/X → /X (176 occurrences fixed)
- AchizitiiLayout subnav rewritten: /X paths, top-right link to vreaudigital.ro hub
- BaseLayout new (vreau.digital branding, OG tags, site URL)
- astro.config.mjs: site https://vreau.digital, server output (was static)
- docker-compose: port 5096 (vreaudigital is 5095), container vreau-digital
- deploy.sh: paths /opt/vreau-digital, log /var/log/vreau-digital-deploy.log

Backend shared with gov-agreg:
- PostgreSQL satra (same schemas: seap, firms, anaf, anre, ...)
- Photon, Martin tiles
- Infisical /vreaudigital path (DATABASE_URL etc. shared)

build: PASS (npx astro check 0 errors, npm run build 5s vite + 10s server)
2026-05-13 00:10:32 +03:00

44 lines
2.5 KiB
SQL
Raw Permalink 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.
-- 020_fonduri_proiect_v2.sql
-- Refactor fonduri.beneficiar_proiect to match what the source actually exposes.
-- Source: https://beneficiar.fonduri-ue.ro:8080/proiecte/details/1/{id}
--
-- The page exposes only 7 fields (Cod SMIS, Program operațional, Axa, Domeniul
-- de intervenție, Operațiune, Beneficiar, Data contract) — NOT valoare_totala/
-- valoare_eligibila/contributie_ue/data_start/data_end/judet/localitate that
-- the original aspirational schema (018) implied. Drop unused fields, add the
-- ones we can populate, split each "Program/Axa/Domeniul/Operațiune" into a
-- {cod, text} pair (first whitespace-separated token = code, rest = text).
--
-- The placeholder table from 018 has 0 rows → safe to drop + recreate.
DROP TABLE IF EXISTS fonduri.beneficiar_proiect;
CREATE TABLE fonduri.beneficiar_proiect (
id integer PRIMARY KEY, -- /proiecte/details/{type}/{id} → id
proiect_type smallint NOT NULL, -- 1=SMIS (only type seen so far)
smis_code text, -- "Cod SMIS" e.g. "313646"
titlu text, -- from <title> tag
beneficiar_name text, -- "REALMET SRL"
program_op_cod text, -- "PRNE" / "POIM" / "POR" / "PNRR" …
program_op_text text, -- "Program Regional Nord-Est"
axa_cod text, -- "PRNE_P1"
axa_text text, -- "P1.P1. Nord-Est O regiune mai competitivă…"
domeniul_cod text, -- "RSO1.3"
domeniul_text text, -- "RSO1.3_Intensificarea creșterii…"
operatiune_cod text, -- "PRNE_A18"
operatiune_text text, -- "Investiții pentru modernizarea…"
data_contract date,
cui text, -- fuzzy-matched later
cui_match_score real,
cui_match_method text,
matched_at timestamptz,
fetched_at timestamptz DEFAULT now(),
raw_html_sha256 char(64)
);
CREATE INDEX idx_ben_proiect_smis ON fonduri.beneficiar_proiect(smis_code);
CREATE INDEX idx_ben_proiect_program ON fonduri.beneficiar_proiect(program_op_cod);
CREATE INDEX idx_ben_proiect_axa ON fonduri.beneficiar_proiect(axa_cod);
CREATE INDEX idx_ben_proiect_cui ON fonduri.beneficiar_proiect(cui) WHERE cui IS NOT NULL;
CREATE INDEX idx_ben_proiect_data ON fonduri.beneficiar_proiect(data_contract DESC NULLS LAST);