Remove FXP files from tracking and update gitignore
- Remove nfjson/nfjsonread.FXP from git tracking - Add Python cache patterns (__pycache__/, *.py[cod], *$py.class) - Add environment file patterns (.env, .env.local, .env.*.local) - Reorganize project structure with VFP files moved to vfp/ directory - Add comprehensive database scripts and documentation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
43
api/database-scripts/01_create_table.sql
Normal file
43
api/database-scripts/01_create_table.sql
Normal file
@@ -0,0 +1,43 @@
|
||||
-- ====================================================================
|
||||
-- P1-001: Tabel ARTICOLE_TERTI pentru mapări SKU → CODMAT
|
||||
-- Sistem Import Comenzi Web → ROA
|
||||
-- ====================================================================
|
||||
|
||||
-- Creare tabel pentru mapări complexe articole
|
||||
CREATE TABLE ARTICOLE_TERTI (
|
||||
sku VARCHAR2(100) NOT NULL, -- SKU din platforma web
|
||||
codmat VARCHAR2(50) NOT NULL, -- CODMAT din nom_articole
|
||||
cantitate_roa NUMBER(10,3) DEFAULT 1, -- Câte unități ROA = 1 web
|
||||
procent_pret NUMBER(5,2) DEFAULT 100, -- % din preț pentru seturi
|
||||
activ NUMBER(1) DEFAULT 1, -- 1=activ, 0=inactiv
|
||||
data_creare DATE DEFAULT SYSDATE, -- Timestamp creare
|
||||
data_modif DATE DEFAULT SYSDATE, -- Timestamp ultima modificare
|
||||
id_util_creare NUMBER(10) DEFAULT -3, -- ID utilizator care a creat
|
||||
id_util_modif NUMBER(10) DEFAULT -3 -- ID utilizator care a modificat
|
||||
);
|
||||
|
||||
-- Adaugare constraint-uri ca instructiuni separate
|
||||
ALTER TABLE ARTICOLE_TERTI ADD CONSTRAINT pk_articole_terti PRIMARY KEY (sku, codmat);
|
||||
|
||||
ALTER TABLE ARTICOLE_TERTI ADD CONSTRAINT chk_art_terti_cantitate CHECK (cantitate_roa > 0);
|
||||
|
||||
ALTER TABLE ARTICOLE_TERTI ADD CONSTRAINT chk_art_terti_procent CHECK (procent_pret >= 0 AND procent_pret <= 100);
|
||||
|
||||
ALTER TABLE ARTICOLE_TERTI ADD CONSTRAINT chk_art_terti_activ CHECK (activ IN (0, 1));
|
||||
|
||||
-- Index pentru performanță pe căutări frecvente după SKU
|
||||
CREATE INDEX idx_articole_terti_sku ON ARTICOLE_TERTI (sku, activ);
|
||||
|
||||
|
||||
-- Comentarii pentru documentație
|
||||
COMMENT ON TABLE ARTICOLE_TERTI IS 'Mapări SKU-uri web → CODMAT ROA pentru reîmpachetări și seturi';
|
||||
COMMENT ON COLUMN ARTICOLE_TERTI.sku IS 'SKU din platforma web (ex: GoMag)';
|
||||
COMMENT ON COLUMN ARTICOLE_TERTI.codmat IS 'CODMAT din nom_articole ROA';
|
||||
COMMENT ON COLUMN ARTICOLE_TERTI.cantitate_roa IS 'Câte unități ROA pentru 1 unitate web';
|
||||
COMMENT ON COLUMN ARTICOLE_TERTI.procent_pret IS 'Procent din preț web alocat acestui CODMAT (pentru seturi)';
|
||||
COMMENT ON COLUMN ARTICOLE_TERTI.activ IS '1=mapare activă, 0=dezactivată';
|
||||
|
||||
-- Date de test pentru validare
|
||||
INSERT INTO ARTICOLE_TERTI (sku, codmat, cantitate_roa, procent_pret, activ) VALUES ('CAFE100', 'CAF01', 10, 100, 1);
|
||||
INSERT INTO ARTICOLE_TERTI (sku, codmat, cantitate_roa, procent_pret, activ) VALUES ('SET01', 'CAF01', 2, 60, 1);
|
||||
INSERT INTO ARTICOLE_TERTI (sku, codmat, cantitate_roa, procent_pret, activ) VALUES ('SET01', 'FILT01', 1, 40, 1);
|
||||
Reference in New Issue
Block a user