
SET transaction_timeout = 0;

--
-- Name: calculate_monthly_budget(bigint, date); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.calculate_monthly_budget(p_article_id bigint, p_target_month date DEFAULT CURRENT_DATE) RETURNS numeric
    LANGUAGE plpgsql
    AS $$
            DECLARE
                v_monthly_budget DECIMAL(10,2);
                v_target_year INTEGER;
                v_target_month_num INTEGER;
            BEGIN
                -- Extract year and month from target date
                v_target_year := EXTRACT(YEAR FROM p_target_month);
                v_target_month_num := EXTRACT(MONTH FROM p_target_month);

                -- Sum all forecast_quantity values for the specified calendar month
                SELECT COALESCE(SUM(forecast_quantity), 0)
                INTO v_monthly_budget
                FROM sales_forecasts
                WHERE article_id = p_article_id
                  AND EXTRACT(YEAR FROM forecast_date) = v_target_year
                  AND EXTRACT(MONTH FROM forecast_date) = v_target_month_num;

                RETURN v_monthly_budget;
            END;
            $$;


--
-- Name: calculate_production_data(bigint); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.calculate_production_data(p_article_id bigint) RETURNS void
    LANGUAGE plpgsql
    AS $$
            DECLARE
                v_stock_disponible DECIMAL(10,2);
                v_monthly_budget DECIMAL(10,2);
                v_target_coverage_months INTEGER;
                v_batch_size DECIMAL(10,2);
                v_initial_coverage DECIMAL(10,2);
                v_quantity_to_produce DECIMAL(10,2);
                v_batches_to_produce DECIMAL(10,2);
                v_month_year RECORD;
            BEGIN
                -- Get stock and article data
                SELECT
                    COALESCE(a.stock, 0),
                    a.target_coverage_months,
                    COALESCE(a.batch_size, 1)
                INTO
                    v_stock_disponible,
                    v_target_coverage_months,
                    v_batch_size
                FROM articles a
                WHERE a.id = p_article_id;

                -- Loop through all months that have forecast data for this article
                FOR v_month_year IN
                    SELECT DISTINCT
                        make_date(EXTRACT(YEAR FROM forecast_date)::INTEGER, EXTRACT(MONTH FROM forecast_date)::INTEGER, 1) as calculation_date
                    FROM sales_forecasts
                    WHERE article_id = p_article_id
                    ORDER BY calculation_date
                LOOP
                    -- Calculate monthly_budget from sales forecasts for this specific month
                    v_monthly_budget := calculate_monthly_budget(p_article_id, v_month_year.calculation_date);

                    -- Calculate initial_coverage
                    IF v_monthly_budget > 0 THEN
                        v_initial_coverage := (v_stock_disponible / v_monthly_budget) * 26;
                    ELSE
                        v_initial_coverage := 0;
                    END IF;

                    -- Calculate quantity_to_produce
                    v_quantity_to_produce := (v_target_coverage_months - (v_initial_coverage / 26)) * v_monthly_budget;

                    IF v_quantity_to_produce < 0 THEN
                        v_quantity_to_produce := 0;
                    END IF;

                    -- Calculate batches_to_produce
                    IF v_batch_size > 0 THEN
                        v_batches_to_produce := CEIL(v_quantity_to_produce / v_batch_size);
                    ELSE
                        v_batches_to_produce := 0;
                    END IF;

                    -- Insert or update for this specific month
                    INSERT INTO production_calculations (
                        article_id, calculation_date, initial_coverage,
                        monthly_budget, quantity_to_produce, batches_to_produce, created_at, updated_at
                    ) VALUES (
                        p_article_id, v_month_year.calculation_date, v_initial_coverage,
                        v_monthly_budget, v_quantity_to_produce, v_batches_to_produce, NOW(), NOW()
                    )
                    ON CONFLICT (article_id, calculation_date)
                    DO UPDATE SET
                        initial_coverage = EXCLUDED.initial_coverage,
                        monthly_budget = EXCLUDED.monthly_budget,
                        quantity_to_produce = EXCLUDED.quantity_to_produce,
                        batches_to_produce = EXCLUDED.batches_to_produce,
                        updated_at = NOW();
                END LOOP;
            END;
            $$;


--
-- Name: calculate_quantity_per_lot(); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.calculate_quantity_per_lot() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
            DECLARE
                parent_batch_size DECIMAL(10,2);
            BEGIN
                SELECT batch_size INTO parent_batch_size
                FROM articles
                WHERE id = NEW.parent_article_id;

                IF parent_batch_size IS NOT NULL THEN
                    NEW.quantity_per_lot := parent_batch_size * NEW.quantity_per_unit;
                END IF;

                RETURN NEW;
            END;
            $$;


--
-- Name: should_process_notification(text); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.should_process_notification(source text) RETURNS boolean
    LANGUAGE plpgsql
    AS $$
            BEGIN
                -- Skip processing notifications from excel imports
                RETURN source != 'excel_import';
            END;
            $$;


--
-- Name: trigger_calculate_production(); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.trigger_calculate_production() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
            BEGIN
                -- Handle different table triggers
                IF TG_TABLE_NAME = 'stock_details' THEN
                    PERFORM calculate_production_data(NEW.article_id);
                ELSIF TG_TABLE_NAME = 'articles' THEN
                    PERFORM calculate_production_data(NEW.id);
                END IF;

                RETURN NEW;
            END;
            $$;


--
-- Name: trigger_update_monthly_budget(); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.trigger_update_monthly_budget() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
            BEGIN
                -- Handle INSERT and UPDATE
                IF TG_OP = 'DELETE' THEN
                    -- For DELETE, use OLD record
                    PERFORM calculate_production_data(OLD.article_id);
                    RETURN OLD;
                ELSE
                    -- For INSERT and UPDATE, use NEW record
                    PERFORM calculate_production_data(NEW.article_id);
                    RETURN NEW;
                END IF;
            END;
            $$;


--
-- Name: update_product_compositions_on_article_change(); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.update_product_compositions_on_article_change() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
            BEGIN
                IF OLD.batch_size IS DISTINCT FROM NEW.batch_size THEN
                    UPDATE product_compositions
                    SET quantity_per_lot = NEW.batch_size * quantity_per_unit
                    WHERE parent_article_id = NEW.id;
                END IF;

                RETURN NEW;
            END;
            $$;




--
-- Name: article_families; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.article_families (
    id bigint NOT NULL,
    family_code character varying(255) NOT NULL,
    family_name character varying(255) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    CONSTRAINT check_family_code_valid CHECK (((family_code)::text = ANY ((ARRAY['MP'::character varying, 'PF'::character varying, 'AC'::character varying, 'SF'::character varying])::text[])))
);


--
-- Name: COLUMN article_families.family_code; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.article_families.family_code IS 'c_famille_article';


--
-- Name: COLUMN article_families.family_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.article_families.family_name IS 'libelle_famille_article';


--
-- Name: article_families_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.article_families_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: article_families_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.article_families_id_seq OWNED BY public.article_families.id;


--
-- Name: articles; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.articles (
    id bigint NOT NULL,
    article_family_id bigint,
    article_code character varying(255) NOT NULL,
    article_name character varying(255) NOT NULL,
    inn character varying(255),
    category character varying(50),
    material_type character varying(50),
    form character varying(100),
    batch_size numeric(10,2),
    abc_classification character varying(1),
    unit_purchase character varying(20),
    unit_stock character varying(20),
    bulk_code character varying(50),
    is_complex boolean,
    is_sample boolean,
    target_coverage_months integer,
    stock numeric(10,2) DEFAULT '0'::numeric NOT NULL,
    is_active boolean DEFAULT true NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


--
-- Name: COLUMN articles.article_code; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.article_code IS 'ITMREF_0, HC0099/C12028/V13001...';


--
-- Name: COLUMN articles.article_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.article_name IS 'ITMDES1_0';


--
-- Name: COLUMN articles.inn; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.inn IS 'TSICOD0_0, International Nonproprietary Name, OME';


--
-- Name: COLUMN articles.category; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.category IS 'TSICOD1_0, OFFICINAL or HOSPITALIER (finished_product), OFF/PIL/ETU';


--
-- Name: COLUMN articles.material_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.material_type IS 'TSICOD2_0, type primary_material, AC1/AC2/PRA/EXC...';


--
-- Name: COLUMN articles.form; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.form IS 'TSICOD3_0, Article form (tablet, capsule, gel, etc.), GEL/CAP/TAB/...';


--
-- Name: COLUMN articles.batch_size; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.batch_size IS 'REOMINQTY_0, taille_lot, 100/1000/10000...';


--
-- Name: COLUMN articles.abc_classification; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.abc_classification IS 'ABC inventory classification (A/B/C), used for prioritization';


--
-- Name: COLUMN articles.unit_purchase; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.unit_purchase IS 'PUU_0, Purchase unit of measure (primary_material), UN/MIL/KG...';


--
-- Name: COLUMN articles.unit_stock; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.unit_stock IS 'STU_0, Stock unit of measure (primary_material), UN/G...';


--
-- Name: COLUMN articles.bulk_code; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.bulk_code IS 'code_vrac (finished_product), IM1231/IM1232/...';


--
-- Name: COLUMN articles.is_complex; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.is_complex IS 'Complex articles: 4-6 months coverage (finished_product)';


--
-- Name: COLUMN articles.is_sample; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.is_sample IS 'echantillon (finished_product)';


--
-- Name: COLUMN articles.target_coverage_months; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.target_coverage_months IS 'coverture_cible_mois';


--
-- Name: COLUMN articles.stock; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.articles.stock IS 'Total stock quantity (sum of initial_quantity from stock_details with status A only)';


--
-- Name: articles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.articles_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: articles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.articles_id_seq OWNED BY public.articles.id;


--
-- Name: db_change_notifications; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.db_change_notifications (
    id integer NOT NULL,
    table_name character varying(255) NOT NULL,
    operation character varying(50) NOT NULL,
    record_id bigint NOT NULL,
    changed_data jsonb NOT NULL,
    source character varying(100) DEFAULT 'db_trigger'::character varying,
    processed boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


--
-- Name: db_change_notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.db_change_notifications_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: db_change_notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.db_change_notifications_id_seq OWNED BY public.db_change_notifications.id;


--
-- Name: failed_jobs; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.failed_jobs (
    id bigint NOT NULL,
    uuid character varying(255) NOT NULL,
    connection text NOT NULL,
    queue text NOT NULL,
    payload text NOT NULL,
    exception text NOT NULL,
    failed_at timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


--
-- Name: failed_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.failed_jobs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: failed_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.failed_jobs_id_seq OWNED BY public.failed_jobs.id;


--
-- Name: job_batches; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.job_batches (
    id character varying(255) NOT NULL,
    name character varying(255) NOT NULL,
    total_jobs integer NOT NULL,
    pending_jobs integer NOT NULL,
    failed_jobs integer NOT NULL,
    failed_job_ids text NOT NULL,
    options text,
    cancelled_at integer,
    created_at integer NOT NULL,
    finished_at integer
);


--
-- Name: jobs; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.jobs (
    id bigint NOT NULL,
    queue character varying(255) NOT NULL,
    payload text NOT NULL,
    attempts smallint NOT NULL,
    reserved_at integer,
    available_at integer NOT NULL,
    created_at integer NOT NULL
);


--
-- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.jobs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.jobs_id_seq OWNED BY public.jobs.id;


--
-- Name: migrations; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.migrations (
    id integer NOT NULL,
    migration character varying(255) NOT NULL,
    batch integer NOT NULL
);


--
-- Name: migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.migrations_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.migrations_id_seq OWNED BY public.migrations.id;


--
-- Name: notification_user; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.notification_user (
    id bigint NOT NULL,
    notification_id bigint NOT NULL,
    user_id bigint NOT NULL,
    read_at timestamp(0) without time zone,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


--
-- Name: notification_user_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.notification_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: notification_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.notification_user_id_seq OWNED BY public.notification_user.id;


--
-- Name: notifications; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.notifications (
    id bigint NOT NULL,
    type character varying(255) NOT NULL,
    content jsonb NOT NULL,
    source character varying(100) DEFAULT 'application'::character varying NOT NULL,
    user_id bigint,
    read_at timestamp(0) without time zone,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


--
-- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.notifications_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id;


--
-- Name: personal_access_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.personal_access_tokens_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: personal_access_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.personal_access_tokens_id_seq OWNED BY public.personal_access_tokens.id;


--
-- Name: product_compositions; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.product_compositions (
    id bigint NOT NULL,
    parent_article_id bigint NOT NULL,
    component_article_id bigint NOT NULL,
    quantity_per_unit numeric(10,4) NOT NULL,
    quantity_per_lot numeric(10,4) NOT NULL,
    operating_unit character varying(20) DEFAULT 'g'::character varying NOT NULL,
    conversion_factor numeric(10,6) DEFAULT '1'::numeric NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


--
-- Name: COLUMN product_compositions.parent_article_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.product_compositions.parent_article_id IS 'ITMREF_0, References the main article, HC0099/C12028/V13001...';


--
-- Name: COLUMN product_compositions.component_article_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.product_compositions.component_article_id IS 'CPNITMREF_0,References the component article, C15129/IM1231...';


--
-- Name: COLUMN product_compositions.quantity_per_unit; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.product_compositions.quantity_per_unit IS 'BOMQTY_0, Quantity per product unit, 1/14/0.02/...';


--
-- Name: COLUMN product_compositions.quantity_per_lot; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.product_compositions.quantity_per_lot IS 'Total quantity per production lot';


--
-- Name: COLUMN product_compositions.operating_unit; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.product_compositions.operating_unit IS 'BOMUOM_0, UN/G...';


--
-- Name: COLUMN product_compositions.conversion_factor; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.product_compositions.conversion_factor IS 'BOMSTUCOE_0, Conversion coefficient between units, 1/0.1/0.01...';


--
-- Name: product_compositions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.product_compositions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: product_compositions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.product_compositions_id_seq OWNED BY public.product_compositions.id;


--
-- Name: production_calculations; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.production_calculations (
    id bigint NOT NULL,
    article_id bigint NOT NULL,
    initial_coverage numeric(10,2),
    monthly_budget numeric(10,2),
    calculation_date date NOT NULL,
    quantity_to_produce numeric(10,2),
    batches_to_produce numeric(10,2),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


--
-- Name: COLUMN production_calculations.initial_coverage; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.production_calculations.initial_coverage IS 'Initial coverage in days: (stock_disponible / monthly_budget) * 26';


--
-- Name: COLUMN production_calculations.monthly_budget; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.production_calculations.monthly_budget IS 'Monthly budget calculated from sum of forecast_quantity grouped by calendar month';


--
-- Name: COLUMN production_calculations.calculation_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.production_calculations.calculation_date IS 'First day of the month for which calculations are performed (YYYY-MM-01)';


--
-- Name: COLUMN production_calculations.quantity_to_produce; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.production_calculations.quantity_to_produce IS 'Quantity to produce: (target_coverage_months - initial_coverage_months) * monthly_budget';


--
-- Name: COLUMN production_calculations.batches_to_produce; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.production_calculations.batches_to_produce IS 'Batches to produce: quantity_to_produce / batch_size';


--
-- Name: production_calculations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.production_calculations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: production_calculations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.production_calculations_id_seq OWNED BY public.production_calculations.id;


--
-- Name: production_orders; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.production_orders (
    id bigint NOT NULL,
    article_id bigint NOT NULL,
    code character varying(100),
    status character varying(50) NOT NULL,
    batch_count integer NOT NULL,
    batch_size_override numeric(10,2),
    batch_sales_quantity numeric(10,2),
    batch_sample_quantity numeric(10,2),
    selected_sf_stock_detail_id bigint,
    notes text,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    CONSTRAINT check_status_values CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'in_progress'::character varying, 'completed'::character varying, 'cancelled'::character varying])::text[])))
);


--
-- Name: COLUMN production_orders.article_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.production_orders.article_id IS 'References a finished product article';


--
-- Name: COLUMN production_orders.status; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.production_orders.status IS 'Order status: pending, in_progress, completed, cancelled';


--
-- Name: COLUMN production_orders.batch_count; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.production_orders.batch_count IS 'number_lots';


--
-- Name: COLUMN production_orders.batch_size_override; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.production_orders.batch_size_override IS 'Batch size override for this order only (overrides article batch_size)';


--
-- Name: production_orders_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.production_orders_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: production_orders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.production_orders_id_seq OWNED BY public.production_orders.id;


--
-- Name: sales_forecasts; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.sales_forecasts (
    id bigint NOT NULL,
    article_id bigint NOT NULL,
    warehouse_id bigint,
    forecast_code character varying(100) NOT NULL,
    forecast_date date NOT NULL,
    forecast_quantity numeric(10,2) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


--
-- Name: COLUMN sales_forecasts.forecast_code; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sales_forecasts.forecast_code IS 'VCRNUM_0, Unique forecast code, SENDAR14057844/SENDAR14057845/...';


--
-- Name: COLUMN sales_forecasts.forecast_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sales_forecasts.forecast_date IS 'STRDAT_0, Weekly forecast date, 2025-01-01/2025-01-07...';


--
-- Name: COLUMN sales_forecasts.forecast_quantity; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sales_forecasts.forecast_quantity IS 'EXTQTY_0, Forecast quantity for the week, 425/1000/10000...';


--
-- Name: sales_forecasts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sales_forecasts_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: sales_forecasts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.sales_forecasts_id_seq OWNED BY public.sales_forecasts.id;


--
-- Name: sessions; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.sessions (
    id character varying(255) NOT NULL,
    user_id bigint,
    ip_address character varying(45),
    user_agent text,
    payload text NOT NULL,
    last_activity integer NOT NULL
);


--
-- Name: stock_details; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.stock_details (
    id bigint NOT NULL,
    article_id bigint NOT NULL,
    article_family_id bigint,
    warehouse_id bigint,
    batch_number_fp character varying(100),
    batch_number_rm character varying(100),
    status character varying(20) DEFAULT 'A'::character varying NOT NULL,
    initial_quantity numeric(10,2) DEFAULT '0'::numeric NOT NULL,
    expiry_date date,
    inspection_date date,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


--
-- Name: COLUMN stock_details.batch_number_fp; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.stock_details.batch_number_fp IS 'LOT_0, Batch number for finished products, DAR250029/DAR220998...';


--
-- Name: COLUMN stock_details.batch_number_rm; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.stock_details.batch_number_rm IS 'Batch number for raw materials';


--
-- Name: COLUMN stock_details.status; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.stock_details.status IS 'STA_0, Stock status, A/Q, A: accepte, Q: quitable';


--
-- Name: COLUMN stock_details.initial_quantity; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.stock_details.initial_quantity IS 'QTYSTU_0, Initial quantity (available stock), 2518/1/10...';


--
-- Name: COLUMN stock_details.expiry_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.stock_details.expiry_date IS 'SHLDAT_0, Expiry date, 2025-01-01/2025-01-02/...';


--
-- Name: COLUMN stock_details.inspection_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.stock_details.inspection_date IS 'Inspection date for quality control';


--
-- Name: stock_details_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.stock_details_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: stock_details_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.stock_details_id_seq OWNED BY public.stock_details.id;


--
-- Name: stock_movements; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.stock_movements (
    id bigint NOT NULL,
    article_id bigint NOT NULL,
    warehouse_id bigint,
    movement_date date NOT NULL,
    quantity numeric(10,2) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


--
-- Name: COLUMN stock_movements.movement_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.stock_movements.movement_date IS 'IPTDAT_0 - Daily Date of the stock movement';


--
-- Name: COLUMN stock_movements.quantity; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.stock_movements.quantity IS 'QTYSTU_0 - Quantity moved (negative for outgoing), -108/-36';


--
-- Name: stock_movements_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.stock_movements_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: stock_movements_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.stock_movements_id_seq OWNED BY public.stock_movements.id;


--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.users_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;


--
-- Name: warehouses; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.warehouses (
    id bigint NOT NULL,
    warehouse_code character varying(50) NOT NULL,
    warehouse_name character varying(255) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


--
-- Name: warehouses_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.warehouses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: warehouses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.warehouses_id_seq OWNED BY public.warehouses.id;


--
-- Name: article_families id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.article_families ALTER COLUMN id SET DEFAULT nextval('public.article_families_id_seq'::regclass);


--
-- Name: articles id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.articles ALTER COLUMN id SET DEFAULT nextval('public.articles_id_seq'::regclass);


--
-- Name: db_change_notifications id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.db_change_notifications ALTER COLUMN id SET DEFAULT nextval('public.db_change_notifications_id_seq'::regclass);


--
-- Name: failed_jobs id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.failed_jobs ALTER COLUMN id SET DEFAULT nextval('public.failed_jobs_id_seq'::regclass);


--
-- Name: jobs id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.jobs ALTER COLUMN id SET DEFAULT nextval('public.jobs_id_seq'::regclass);


--
-- Name: migrations id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.migrations ALTER COLUMN id SET DEFAULT nextval('public.migrations_id_seq'::regclass);


--
-- Name: notification_user id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notification_user ALTER COLUMN id SET DEFAULT nextval('public.notification_user_id_seq'::regclass);


--
-- Name: notifications id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass);


--
-- Name: product_compositions id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_compositions ALTER COLUMN id SET DEFAULT nextval('public.product_compositions_id_seq'::regclass);


--
-- Name: production_calculations id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.production_calculations ALTER COLUMN id SET DEFAULT nextval('public.production_calculations_id_seq'::regclass);


--
-- Name: production_orders id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.production_orders ALTER COLUMN id SET DEFAULT nextval('public.production_orders_id_seq'::regclass);


--
-- Name: sales_forecasts id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sales_forecasts ALTER COLUMN id SET DEFAULT nextval('public.sales_forecasts_id_seq'::regclass);


--
-- Name: stock_details id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.stock_details ALTER COLUMN id SET DEFAULT nextval('public.stock_details_id_seq'::regclass);


--
-- Name: stock_movements id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.stock_movements ALTER COLUMN id SET DEFAULT nextval('public.stock_movements_id_seq'::regclass);


--
-- Name: warehouses id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.warehouses ALTER COLUMN id SET DEFAULT nextval('public.warehouses_id_seq'::regclass);


--
-- Data for Name: article_families; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.article_families (id, family_code, family_name, created_at, updated_at) FROM stdin;
1	MP	Matière Première	2025-08-27 15:58:27	2025-08-27 15:58:27
2	PF	Produit Fini	2025-08-27 15:58:27	2025-08-27 15:58:27
3	AC	Article de Conditionnement	2025-08-27 15:58:27	2025-08-27 15:58:27
4	SF	Semi-Fini	2025-08-27 15:58:27	2025-08-27 15:58:27
\.


--
-- Data for Name: articles; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.articles (id, article_family_id, article_code, article_name, inn, category, material_type, form, batch_size, abc_classification, unit_purchase, unit_stock, bulk_code, is_complex, is_sample, target_coverage_months, stock, is_active, created_at, updated_at) FROM stdin;
4	3	C12028	C12028	\N	PIL	AC1	\N	0.00	\N	MIL	UN	\N	\N	\N	\N	240595.00	t	2025-08-28 00:37:07	2025-08-28 00:37:07
5	3	C13024	C13024	\N	\N	\N	\N	0.00	\N	MIL	UN	\N	\N	\N	\N	91541.00	t	2025-08-28 00:37:07	2025-08-28 00:37:07
6	3	C25037	C25037	\N	CAR	AC1	\N	0.00	\N	MIL	UN	\N	\N	\N	\N	8497.00	t	2025-08-28 00:37:07	2025-08-28 00:37:07
7	3	C15768	C15768	\N	PRO	AC2	\N	0.00	\N	MIL	UN	\N	\N	\N	\N	17799.00	t	2025-08-28 00:37:07	2025-08-28 00:37:07
8	3	C14205	C14205	\N	ETU	AC2	\N	0.00	\N	MIL	UN	\N	\N	\N	\N	10747.00	t	2025-08-28 00:37:07	2025-08-28 00:37:07
10	3	C15129	C15129	\N	ETI	AC2	\N	1000.00	\N	MIL	UN	\N	\N	\N	\N	10697.00	t	2025-08-28 00:37:18	2025-08-28 00:37:18
2	1	H19156	H19156	\N		PRA	\N	0.00	\N	KG	G	\N	\N	\N	\N	76477.00	t	2025-08-28 00:37:07	2025-08-28 00:37:07
3	1	V13001	V13001	\N	EXC	EXC	GEL	0.00	\N	MIL	UN	\N	\N	\N	\N	1684232.00	t	2025-08-28 00:37:07	2025-08-28 00:37:07
9	4	IM1231	IM1231	\N	SF	\N	GEL	107296.00	\N	UN	UN	\N	\N	\N	\N	15284.00	t	2025-08-28 00:37:07	2025-08-28 00:37:07
1	2	HC0099	HC0099	OME	OFF	\N	GEL	7642.00	\N	UN	UN	IM1231	t	t	6	1300.00	t	2025-08-27 16:12:49	2025-08-28 11:08:33
\.


--
-- Data for Name: db_change_notifications; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.db_change_notifications (id, table_name, operation, record_id, changed_data, source, processed, created_at) FROM stdin;
2	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": null, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": null, "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:07:43.681267
3	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 7642.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:09:28.949997
4	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 7642.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:09:39.563311
5	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": null, "batch_size": 7642.00, "created_at": null, "is_complex": true, "unit_stock": "UN", "updated_at": null, "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:11:22.526656
6	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": null, "batch_size": 7642.00, "created_at": null, "is_complex": true, "unit_stock": "UN", "updated_at": null, "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:11:53.347582
7	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": null, "is_complex": true, "unit_stock": "UN", "updated_at": null, "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:12:09.393882
8	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": null, "is_complex": true, "unit_stock": "UN", "updated_at": null, "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:12:40.426135
10	articles	INSERT	2	{"id": 2, "inn": null, "form": null, "stock": 0.00, "category": "EXC", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": null, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "H19156", "article_name": "H19156", "material_type": null, "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:17:55.759044
11	articles	UPDATE	2	{"id": 2, "inn": null, "form": null, "stock": 0.00, "category": "", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": null, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "H19156", "article_name": "H19156", "material_type": null, "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:18:01.325823
12	articles	UPDATE	2	{"id": 2, "inn": null, "form": null, "stock": 0.00, "category": "", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": null, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "H19156", "article_name": "H19156", "material_type": "PRA", "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:18:43.025412
13	articles	INSERT	3	{"id": 3, "inn": null, "form": null, "stock": 0.00, "category": null, "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": null, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "V13001", "article_name": "V13001", "material_type": "EXC", "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:18:43.025412
14	articles	UPDATE	3	{"id": 3, "inn": null, "form": null, "stock": 0.00, "category": "EXC", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": null, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "V13001", "article_name": "V13001", "material_type": "EXC", "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:18:58.393562
15	articles	UPDATE	3	{"id": 3, "inn": null, "form": "GEL", "stock": 0.00, "category": "EXC", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": null, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "V13001", "article_name": "V13001", "material_type": "EXC", "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:19:50.144228
16	articles	UPDATE	2	{"id": 2, "inn": null, "form": null, "stock": 0.00, "category": "", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "H19156", "article_name": "H19156", "material_type": "PRA", "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:20:11.626843
50	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:55:14", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:55:14.458126
19	articles	UPDATE	3	{"id": 3, "inn": null, "form": "GEL", "stock": 0.00, "category": "EXC", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "V13001", "article_name": "V13001", "material_type": "EXC", "unit_purchase": "MIL", "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:21:24.649243
18	articles	UPDATE	2	{"id": 2, "inn": null, "form": null, "stock": 0.00, "category": "", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "G", "updated_at": null, "article_code": "H19156", "article_name": "H19156", "material_type": "PRA", "unit_purchase": "KG", "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:21:24.649243
20	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 1}	db_trigger	t	2025-08-27 16:22:40.520679
21	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:22:54.572876
22	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:28:17.261271
23	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:28:26.634199
24	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:28:28.558123
25	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:28:30.453955
26	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:28:43.952775
27	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:29:58.868464
28	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:30:13.558003
29	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:31:20.896695
31	sales_forecasts	INSERT	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:39:35", "warehouse_id": 1, "forecast_code": "SENDAR24124153", "forecast_date": "2025-08-25", "forecast_quantity": 381.00}	db_trigger	t	2025-08-27 16:39:34.604426
30	production_calculations	INSERT	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:39:35", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:39:34.604426
32	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:50:33", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:50:33.33495
34	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:50:48", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": 0.00, "quantity_to_produce": 0.00}	db_trigger	t	2025-08-27 16:50:48.387528
35	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:50:48", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 1}	db_trigger	t	2025-08-27 16:50:48.387528
36	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:51:19", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": 1.00, "quantity_to_produce": 2054.03}	db_trigger	t	2025-08-27 16:51:19.02439
37	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:51:19", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-27 16:51:19.02439
38	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:52:27", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:52:27.111471
39	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:51:19", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:52:27.111471
40	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:55:14", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:55:14.458126
41	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:51:19", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:55:14.458126
42	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:55:14", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:55:14.458126
43	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:51:19", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:55:14.458126
44	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:55:14", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:55:14.458126
45	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:51:19", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:55:14.458126
46	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:55:14", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:55:14.458126
47	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:51:19", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:55:14.458126
48	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:55:14", "monthly_budget": 381.00, "calculation_date": "2025-08-01", "initial_coverage": 171.83, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:55:14.458126
49	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:51:19", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:55:14.458126
54	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:58:52", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 42.96, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:58:52.413736
52	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:58:52", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 42.96, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:58:52.413736
53	sales_forecasts	INSERT	2	{"id": 2, "article_id": 1, "created_at": "2025-08-27T16:58:52", "updated_at": "2025-08-27T16:58:52", "warehouse_id": 1, "forecast_code": "SENDAR24124152", "forecast_date": "2025-08-18", "forecast_quantity": 381.00}	db_trigger	t	2025-08-27 16:58:52.413736
55	sales_forecasts	INSERT	3	{"id": 3, "article_id": 1, "created_at": "2025-08-27T16:58:52", "updated_at": "2025-08-27T16:58:52", "warehouse_id": 1, "forecast_code": "SENDAR24124151", "forecast_date": "2025-08-11", "forecast_quantity": 381.00}	db_trigger	t	2025-08-27 16:58:52.413736
56	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T16:58:52", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 42.96, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 16:58:52.413736
57	sales_forecasts	INSERT	4	{"id": 4, "article_id": 1, "created_at": "2025-08-27T16:58:52", "updated_at": "2025-08-27T16:58:52", "warehouse_id": 1, "forecast_code": "SENDAR24124150", "forecast_date": "2025-08-04", "forecast_quantity": 381.00}	db_trigger	t	2025-08-27 16:58:52.413736
58	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:01:59", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 42.96, "batches_to_produce": 1.00, "quantity_to_produce": 6625.88}	db_trigger	t	2025-08-27 17:01:59.418017
59	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:01:59", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-27 17:01:59.418017
60	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:09:10", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 34.12, "batches_to_produce": 1.00, "quantity_to_produce": 7144.04}	db_trigger	t	2025-08-27 17:09:10.403224
61	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2000.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:01:59", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-27 17:09:10.403224
62	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:09:46", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 42.96, "batches_to_produce": 1.00, "quantity_to_produce": 6625.88}	db_trigger	t	2025-08-27 17:09:45.690439
63	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:01:59", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-27 17:09:45.690439
64	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:09:59", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 42.96, "batches_to_produce": 3.00, "quantity_to_produce": 15769.88}	db_trigger	t	2025-08-27 17:09:59.300324
65	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:09:59", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-27 17:09:59.300324
66	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:10:34", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 34.12, "batches_to_produce": 3.00, "quantity_to_produce": 16288.04}	db_trigger	t	2025-08-27 17:10:33.602993
67	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2000.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:09:59", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-27 17:10:33.602993
68	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:10:43", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 25.59, "batches_to_produce": 3.00, "quantity_to_produce": 16788.03}	db_trigger	t	2025-08-27 17:10:42.76948
70	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:11:05", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 3.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:11:04.600461
71	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:09:59", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-27 17:11:04.600461
72	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:11:18", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 1.00, "quantity_to_produce": 223.91}	db_trigger	t	2025-08-27 17:11:17.778522
73	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:11:17", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 1}	db_trigger	t	2025-08-27 17:11:17.778522
74	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:11:32", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 3.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:11:32.198516
75	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:11:32", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-27 17:11:32.198516
76	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T18:13:10", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:13:10.933102
77	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T18:13:16", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 1.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:13:16.733611
78	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T18:13:36", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 0.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:13:36.418694
79	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T18:14:37", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 4.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:14:37.801701
80	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:16:09", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 3.00, "quantity_to_produce": 15463.91}	db_trigger	t	2025-08-27 17:16:09.232171
82	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:16:15", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 3.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:16:15.208462
83	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:16:15", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-27 17:16:15.208462
84	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T18:17:02", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 0.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:17:02.158088
85	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T18:17:09", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 6.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:17:09.703737
86	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:17:51", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 3.00, "quantity_to_produce": 15463.91}	db_trigger	t	2025-08-27 17:17:50.918962
87	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:17:50", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 11}	db_trigger	t	2025-08-27 17:17:50.918962
88	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T18:18:04", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 15463.91}	db_trigger	t	2025-08-27 17:18:04.368347
89	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:18:13", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 3.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:18:12.991825
90	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:18:12", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-27 17:18:12.991825
91	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:19:15", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 3.00, "quantity_to_produce": 15463.91}	db_trigger	t	2025-08-27 17:19:15.48228
92	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:19:15", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 11}	db_trigger	t	2025-08-27 17:19:15.48228
93	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:19:18", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 3.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-27 17:19:17.520423
94	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:19:17", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-27 17:19:17.520423
95	stock_movements	INSERT	1	{"id": 1, "quantity": -65.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-18"}	db_trigger	t	2025-08-27 17:38:17.270804
96	stock_movements	INSERT	2	{"id": 2, "quantity": -78.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-19"}	db_trigger	t	2025-08-27 17:38:17.270804
97	stock_movements	INSERT	3	{"id": 3, "quantity": -92.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-20"}	db_trigger	t	2025-08-27 17:38:17.270804
98	stock_movements	INSERT	4	{"id": 4, "quantity": -85.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-21"}	db_trigger	t	2025-08-27 17:38:17.270804
99	stock_movements	INSERT	5	{"id": 5, "quantity": -89.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-22"}	db_trigger	t	2025-08-27 17:38:17.270804
100	stock_movements	INSERT	6	{"id": 6, "quantity": -48.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-23"}	db_trigger	t	2025-08-27 17:38:17.270804
101	stock_movements	INSERT	7	{"id": 7, "quantity": -4.00, "article_id": 1, "created_at": "2025-08-27T17:38:53", "updated_at": "2025-08-27T17:38:53", "warehouse_id": 1, "movement_date": "2025-08-22"}	db_trigger	t	2025-08-27 17:38:52.902443
1	articles	INSERT	1	{"id": 1, "inn": "OME", "form": null, "stock": 0.00, "category": null, "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": null, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": null, "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:06:09.723107
9	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 0.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T16:12:49", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:12:48.688667
17	articles	UPDATE	3	{"id": 3, "inn": null, "form": "GEL", "stock": 0.00, "category": "EXC", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "V13001", "article_name": "V13001", "material_type": "EXC", "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:20:11.626843
33	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:22:40", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:50:33.33495
51	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 2518.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T17:51:19", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 16:55:14.458126
69	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1500.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:09:59", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-27 17:10:42.76948
81	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:16:09", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 11}	db_trigger	t	2025-08-27 17:16:09.232171
102	stock_movements	UPDATE	5	{"id": 5, "quantity": -95.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-22"}	db_trigger	t	2025-08-27 17:39:55.653801
103	stock_movements	DELETE	7	{"id": 7, "quantity": -4.00, "article_id": 1, "created_at": "2025-08-27T17:38:53", "updated_at": "2025-08-27T17:38:53", "warehouse_id": 1, "movement_date": "2025-08-22"}	db_trigger	t	2025-08-27 17:39:55.653801
104	stock_movements	UPDATE	5	{"id": 5, "quantity": -94.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-22"}	db_trigger	t	2025-08-27 17:40:17.271362
105	stock_movements	UPDATE	5	{"id": 5, "quantity": -93.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-22"}	db_trigger	t	2025-08-27 17:40:32.48896
106	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T17:41:26", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 17:41:26.196531
107	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-27T18:19:17", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 17:41:26.196531
108	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T23:07:00", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 9367.91}	db_trigger	t	2025-08-27 23:06:59.830594
109	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T00:06:59", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 7}	db_trigger	t	2025-08-27 23:06:59.830594
110	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T23:07:31", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 7843.91}	db_trigger	t	2025-08-27 23:07:30.545552
141	articles	UPDATE	6	{"id": 6, "inn": null, "form": null, "stock": 204.00, "category": "CAR", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C25037", "article_name": "C25037", "material_type": "AC1", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:10:20.783326
111	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T00:07:30", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-27 23:07:30.545552
112	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-27T23:17:29", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-27 23:17:29.113505
113	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T00:07:30", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:17:29.113505
114	articles	INSERT	4	{"id": 4, "inn": null, "form": null, "stock": 0.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "3", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:35:47.785617
115	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 0.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:36:04.04069
116	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 0.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:41:38.04156
117	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 3018.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:41:38.04156
120	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 3018.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:43:55.204105
121	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 32595.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:43:55.204105
122	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 149595.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:43:55.204105
123	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 240595.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:43:55.204105
178	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T01:32:04", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 7843.91}	db_trigger	t	2025-08-28 01:32:03.918487
124	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 240595.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:44:08.446589
125	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 240595.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:44:38.916186
126	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 240595.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:44:38.916186
127	articles	INSERT	5	{"id": 5, "inn": null, "form": null, "stock": 0.00, "category": null, "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": null, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C13024", "article_name": "C13024", "material_type": null, "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:47:44.792541
128	articles	UPDATE	5	{"id": 5, "inn": null, "form": null, "stock": 0.00, "category": null, "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": null, "updated_at": null, "article_code": "C13024", "article_name": "C13024", "material_type": null, "unit_purchase": null, "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:47:56.549738
129	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 240595.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:49:39.209463
130	articles	UPDATE	5	{"id": 5, "inn": null, "form": null, "stock": 0.00, "category": null, "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C13024", "article_name": "C13024", "material_type": null, "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:49:39.209463
131	articles	UPDATE	5	{"id": 5, "inn": null, "form": null, "stock": 0.00, "category": null, "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C13024", "article_name": "C13024", "material_type": null, "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:53:18.847514
134	articles	UPDATE	5	{"id": 5, "inn": null, "form": null, "stock": 318.00, "category": null, "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C13024", "article_name": "C13024", "material_type": null, "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:56:40.871797
135	articles	UPDATE	5	{"id": 5, "inn": null, "form": null, "stock": 91541.00, "category": null, "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C13024", "article_name": "C13024", "material_type": null, "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:56:40.871797
136	articles	INSERT	6	{"id": 6, "inn": null, "form": null, "stock": 0.00, "category": "CAR", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C25037", "article_name": "C25037", "material_type": "AC1", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-27 23:59:58.868833
137	articles	UPDATE	6	{"id": 6, "inn": null, "form": null, "stock": 29.00, "category": "CAR", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C25037", "article_name": "C25037", "material_type": "AC1", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:07:31.998984
140	articles	UPDATE	6	{"id": 6, "inn": null, "form": null, "stock": 44.00, "category": "CAR", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C25037", "article_name": "C25037", "material_type": "AC1", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:10:20.783326
144	articles	INSERT	7	{"id": 7, "inn": null, "form": null, "stock": 0.00, "category": "PRO", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C15768", "article_name": "C15768", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:17:01.8148
142	articles	UPDATE	6	{"id": 6, "inn": null, "form": null, "stock": 3067.00, "category": "CAR", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C25037", "article_name": "C25037", "material_type": "AC1", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:10:20.783326
143	articles	UPDATE	6	{"id": 6, "inn": null, "form": null, "stock": 8497.00, "category": "CAR", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C25037", "article_name": "C25037", "material_type": "AC1", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:10:20.783326
145	articles	UPDATE	7	{"id": 7, "inn": null, "form": null, "stock": 1274.00, "category": "PRO", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C15768", "article_name": "C15768", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:18:23.543805
146	articles	UPDATE	7	{"id": 7, "inn": null, "form": null, "stock": 17799.00, "category": "PRO", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C15768", "article_name": "C15768", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:18:58.565371
147	articles	INSERT	8	{"id": 8, "inn": null, "form": null, "stock": 0.00, "category": "ETU", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C14205", "article_name": "C14205", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:21:58.445076
148	articles	UPDATE	8	{"id": 8, "inn": null, "form": null, "stock": 10747.00, "category": "ETU", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C14205", "article_name": "C14205", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:23:33.511171
149	articles	INSERT	9	{"id": 9, "inn": null, "form": "GEL", "stock": 0.00, "category": "SF", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 107296.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "IM1231", "article_name": "IM1231", "material_type": null, "unit_purchase": "UN", "article_family_id": 4, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:27:31.001872
150	articles	UPDATE	9	{"id": 9, "inn": null, "form": "GEL", "stock": 1170.00, "category": "SF", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 107296.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "IM1231", "article_name": "IM1231", "material_type": null, "unit_purchase": "UN", "article_family_id": 4, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:30:07.112497
151	articles	UPDATE	9	{"id": 9, "inn": null, "form": "GEL", "stock": 2340.00, "category": "SF", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 107296.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "IM1231", "article_name": "IM1231", "material_type": null, "unit_purchase": "UN", "article_family_id": 4, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:30:31.62355
152	articles	UPDATE	2	{"id": 2, "inn": null, "form": null, "stock": 0.00, "category": "", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "G", "updated_at": "2025-08-28T00:37:07", "article_code": "H19156", "article_name": "H19156", "material_type": "PRA", "unit_purchase": "KG", "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:07.494228
153	articles	UPDATE	3	{"id": 3, "inn": null, "form": "GEL", "stock": 0.00, "category": "EXC", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "V13001", "article_name": "V13001", "material_type": "EXC", "unit_purchase": "MIL", "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:07.494228
154	articles	UPDATE	4	{"id": 4, "inn": null, "form": null, "stock": 240595.00, "category": "PIL", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "C12028", "article_name": "C12028", "material_type": "AC1", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:07.494228
155	articles	UPDATE	5	{"id": 5, "inn": null, "form": null, "stock": 91541.00, "category": null, "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "C13024", "article_name": "C13024", "material_type": null, "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:07.494228
156	articles	UPDATE	6	{"id": 6, "inn": null, "form": null, "stock": 8497.00, "category": "CAR", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "C25037", "article_name": "C25037", "material_type": "AC1", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:07.494228
157	articles	UPDATE	7	{"id": 7, "inn": null, "form": null, "stock": 17799.00, "category": "PRO", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "C15768", "article_name": "C15768", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:07.494228
158	articles	UPDATE	8	{"id": 8, "inn": null, "form": null, "stock": 10747.00, "category": "ETU", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "C14205", "article_name": "C14205", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:07.494228
159	articles	UPDATE	9	{"id": 9, "inn": null, "form": "GEL", "stock": 2340.00, "category": "SF", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 107296.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "IM1231", "article_name": "IM1231", "material_type": null, "unit_purchase": "UN", "article_family_id": 4, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:07.494228
160	articles	INSERT	10	{"id": 10, "inn": null, "form": null, "stock": 0.00, "category": "ETI", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 1000.00, "created_at": null, "is_complex": null, "unit_stock": "UN", "updated_at": null, "article_code": "C15129", "article_name": "C15129", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:07.494228
161	articles	UPDATE	10	{"id": 10, "inn": null, "form": null, "stock": 0.00, "category": "ETI", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 1000.00, "created_at": "2025-08-28T00:37:18", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:18", "article_code": "C15129", "article_name": "C15129", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:37:18.329575
162	articles	UPDATE	10	{"id": 10, "inn": null, "form": null, "stock": 10697.00, "category": "ETI", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 1000.00, "created_at": "2025-08-28T00:37:18", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:18", "article_code": "C15129", "article_name": "C15129", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:41:14.873656
163	articles	UPDATE	10	{"id": 10, "inn": null, "form": null, "stock": 10697.00, "category": "ETI", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 1000.00, "created_at": "2025-08-28T00:37:18", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:18", "article_code": "C15129", "article_name": "C15129", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:41:25.610043
164	articles	UPDATE	10	{"id": 10, "inn": null, "form": null, "stock": 10697.00, "category": "ETI", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 1000.00, "created_at": "2025-08-28T00:37:18", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:18", "article_code": "C15129", "article_name": "C15129", "material_type": "AC2", "unit_purchase": "MIL", "article_family_id": 3, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:44:19.293995
165	articles	UPDATE	2	{"id": 2, "inn": null, "form": null, "stock": 76477.00, "category": "", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "G", "updated_at": "2025-08-28T00:37:07", "article_code": "H19156", "article_name": "H19156", "material_type": "PRA", "unit_purchase": "KG", "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:44:19.293995
166	articles	UPDATE	3	{"id": 3, "inn": null, "form": "GEL", "stock": 634232.00, "category": "EXC", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "V13001", "article_name": "V13001", "material_type": "EXC", "unit_purchase": "MIL", "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:46:06.121131
167	articles	UPDATE	3	{"id": 3, "inn": null, "form": "GEL", "stock": 1684232.00, "category": "EXC", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 0.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "V13001", "article_name": "V13001", "material_type": "EXC", "unit_purchase": "MIL", "article_family_id": 1, "target_coverage_months": null}	db_trigger	t	2025-08-28 00:46:06.121131
168	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T00:52:50", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 7843.91}	db_trigger	t	2025-08-28 00:52:50.046358
169	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T01:52:50", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-28 00:52:50.046358
170	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T01:14:30", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-28 01:14:30.169198
171	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T01:52:50", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-28 01:14:30.169198
172	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T01:30:19", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 7843.91}	db_trigger	t	2025-08-28 01:30:19.414132
173	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T02:30:19", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-28 01:30:19.414132
174	stock_movements	UPDATE	6	{"id": 6, "quantity": -49.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-23"}	db_trigger	t	2025-08-28 02:31:23.598937
175	stock_movements	UPDATE	6	{"id": 6, "quantity": -48.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-23"}	db_trigger	t	2025-08-28 02:31:38.49614
176	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T01:32:01", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 1.00, "quantity_to_produce": 6319.91}	db_trigger	t	2025-08-28 01:32:00.620115
177	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T02:32:00", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 5}	db_trigger	t	2025-08-28 01:32:00.620115
179	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T02:32:03", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-28 01:32:03.918487
180	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T06:50:08", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-28 06:50:07.701245
181	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T02:32:03", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-28 06:50:07.701245
182	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T05:58:36", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 7843.91}	db_trigger	t	2025-08-28 05:58:36.091156
183	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T06:58:36", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-28 05:58:36.091156
184	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T06:59:32", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": null, "quantity_to_produce": null}	db_trigger	t	2025-08-28 06:59:31.625379
185	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T06:58:36", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": null}	db_trigger	t	2025-08-28 06:59:31.625379
186	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T06:05:53", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 7843.91}	db_trigger	t	2025-08-28 06:05:52.669788
187	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T07:05:52", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-28 06:05:52.669788
188	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T06:06:20", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 13939.91}	db_trigger	t	2025-08-28 06:06:20.044641
189	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T07:06:20", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 10}	db_trigger	t	2025-08-28 06:06:20.044641
190	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T06:06:28", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 3.00, "quantity_to_produce": 16987.91}	db_trigger	t	2025-08-28 06:06:27.819933
191	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T07:06:27", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 12}	db_trigger	t	2025-08-28 06:06:27.819933
192	stock_movements	UPDATE	6	{"id": 6, "quantity": -49.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-23"}	db_trigger	t	2025-08-28 07:08:28.138908
193	stock_movements	UPDATE	6	{"id": 6, "quantity": -48.00, "article_id": 1, "created_at": "2025-08-27T17:38:17", "updated_at": "2025-08-27T17:38:17", "warehouse_id": 1, "movement_date": "2025-08-23"}	db_trigger	t	2025-08-28 07:08:33.932353
194	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T08:39:10", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 1.00, "quantity_to_produce": 3271.91}	db_trigger	t	2025-08-28 08:39:09.697939
195	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T09:39:09", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 3}	db_trigger	t	2025-08-28 08:39:09.697939
196	articles	UPDATE	9	{"id": 9, "inn": null, "form": "GEL", "stock": 15284.00, "category": "SF", "bulk_code": null, "is_active": true, "is_sample": null, "batch_size": 107296.00, "created_at": "2025-08-28T00:37:07", "is_complex": null, "unit_stock": "UN", "updated_at": "2025-08-28T00:37:07", "article_code": "IM1231", "article_name": "IM1231", "material_type": null, "unit_purchase": "UN", "article_family_id": 4, "target_coverage_months": null}	db_trigger	t	2025-08-28 09:59:42.052668
197	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T09:33:47", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 1.00, "quantity_to_produce": 4795.91}	db_trigger	t	2025-08-28 09:33:46.523362
198	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T10:33:46", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 4}	db_trigger	t	2025-08-28 09:33:46.523362
199	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T10:54:46", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 0.00, "quantity_to_produce": 4795.91}	db_trigger	t	2025-08-28 09:54:46.940455
200	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-08-28T10:08:34", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 7843.91}	db_trigger	t	2025-08-28 10:08:33.73822
201	articles	UPDATE	1	{"id": 1, "inn": "OME", "form": "GEL", "stock": 1300.00, "category": "OFF", "bulk_code": "IM1231", "is_active": true, "is_sample": true, "batch_size": 7642.00, "created_at": "2025-08-27T16:12:49", "is_complex": true, "unit_stock": "UN", "updated_at": "2025-08-28T11:08:33", "article_code": "HC0099", "article_name": "HC0099", "material_type": null, "unit_purchase": "UN", "article_family_id": 2, "target_coverage_months": 6}	db_trigger	t	2025-08-28 10:08:33.73822
202	production_calculations	UPDATE	1	{"id": 1, "article_id": 1, "created_at": "2025-08-27T16:39:35", "updated_at": "2025-09-01T12:57:49", "monthly_budget": 1524.00, "calculation_date": "2025-08-01", "initial_coverage": 22.18, "batches_to_produce": 2.00, "quantity_to_produce": 7843.91}	db_trigger	t	2025-09-01 12:57:48.516289
203	production_calculations	INSERT	49	{"id": 49, "article_id": 1, "created_at": "2025-09-01T12:57:49", "updated_at": "2025-09-01T12:57:49", "monthly_budget": 381.00, "calculation_date": "2025-09-01", "initial_coverage": 88.71, "batches_to_produce": 1.00, "quantity_to_produce": 986.06}	db_trigger	t	2025-09-01 12:57:48.516289
204	sales_forecasts	INSERT	5	{"id": 5, "article_id": 1, "created_at": "2025-08-27T16:58:52", "updated_at": "2025-08-27T16:58:52", "warehouse_id": 1, "forecast_code": "SENDAR24124111", "forecast_date": "2025-09-04", "forecast_quantity": 381.00}	db_trigger	t	2025-09-01 12:57:48.516289
205	production_calculations	UPDATE	49	{"id": 49, "article_id": 1, "created_at": "2025-09-01T12:57:49", "updated_at": "2025-09-01T13:15:30", "monthly_budget": 381.00, "calculation_date": "2025-09-01", "initial_coverage": 88.71, "batches_to_produce": 2.00, "quantity_to_produce": 986.06}	db_trigger	t	2025-09-01 12:15:30.82288
206	production_calculations	UPDATE	49	{"id": 49, "article_id": 1, "created_at": "2025-09-01T12:57:49", "updated_at": "2025-09-03T14:04:42", "monthly_budget": 381.00, "calculation_date": "2025-09-01", "initial_coverage": 88.71, "batches_to_produce": 0.00, "quantity_to_produce": 986.06}	db_trigger	t	2025-09-03 13:04:42.69888
207	production_calculations	UPDATE	49	{"id": 49, "article_id": 1, "created_at": "2025-09-01T12:57:49", "updated_at": "2025-09-03T14:04:54", "monthly_budget": 381.00, "calculation_date": "2025-09-01", "initial_coverage": 88.71, "batches_to_produce": 22.00, "quantity_to_produce": 986.06}	db_trigger	t	2025-09-03 13:04:54.0686
208	production_calculations	UPDATE	49	{"id": 49, "article_id": 1, "created_at": "2025-09-01T12:57:49", "updated_at": "2025-09-03T15:45:13", "monthly_budget": 381.00, "calculation_date": "2025-09-01", "initial_coverage": 88.71, "batches_to_produce": 21.00, "quantity_to_produce": 986.06}	db_trigger	t	2025-09-03 14:45:13.006392
209	production_calculations	UPDATE	49	{"id": 49, "article_id": 1, "created_at": "2025-09-01T12:57:49", "updated_at": "2025-09-03T15:45:28", "monthly_budget": 381.00, "calculation_date": "2025-09-01", "initial_coverage": 88.71, "batches_to_produce": 22.00, "quantity_to_produce": 986.06}	db_trigger	t	2025-09-03 14:45:28.954553
\.


--
-- Data for Name: failed_jobs; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.failed_jobs (id, uuid, connection, queue, payload, exception, failed_at) FROM stdin;
\.


--
-- Data for Name: job_batches; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.job_batches (id, name, total_jobs, pending_jobs, failed_jobs, failed_job_ids, options, cancelled_at, created_at, finished_at) FROM stdin;
\.


--
-- Data for Name: jobs; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.jobs (id, queue, payload, attempts, reserved_at, available_at, created_at) FROM stdin;
\.


--
-- Data for Name: migrations; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.migrations (id, migration, batch) FROM stdin;
1	0001_01_01_000000_create_users_table	1
2	0001_01_01_000001_create_cache_table	1
3	0001_01_01_000002_create_jobs_table	1
4	2025_03_27_100329_create_personal_access_tokens_table	1
5	2025_04_03_000000_create_article_families_table	1
6	2025_04_03_000001_create_articles_table	1
7	2025_04_03_000002_create_warehouses_table	1
8	2025_04_03_000003_create_stock_details_table	1
9	2025_04_03_000004_create_sales_forecasts_table	1
10	2025_04_03_000005_create_stock_movements_table	1
11	2025_04_03_000006_create_production_orders_table	1
12	2025_04_03_000007_create_product_compositions_table	1
13	2025_04_03_000008_create_production_calculations_table	1
14	2025_04_18_143107_create_notifications_table	1
15	2025_04_18_172811_create_notification_user_table	1
16	2025_04_20_000000_create_db_notification_system	1
\.


--
-- Data for Name: notification_user; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.notification_user (id, notification_id, user_id, read_at, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: notifications; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.notifications (id, type, content, source, user_id, read_at, created_at, updated_at) FROM stdin;
45	priority	{"id": 1756361187, "read": false, "time": "28/08/2025 07:06", "type": "priority", "title": "Couverture Critique - Produit Fini", "message": "Produit: HC0099, Couverture: 22.2 jours", "coverage": 22.2, "articleCode": "HC0099"}	application	\N	\N	2025-08-28 07:06:27	2025-08-28 07:06:27
47	variance_alert	{"id": "1756361314_HC0099", "read": false, "time": "28/08/2025 07:08", "type": "variance_alert", "title": "Alerte Écart - Prévisions vs Réalisations", "actual": 461, "message": "Produit: HC0099, Écart: +21.0% (Prév: 381, Réel: 461) - Semaine du 18/08/2025", "forecast": 381, "variance": 21, "week_start": "2025-08-18", "articleCode": "HC0099"}	application	\N	\N	2025-08-28 07:08:34	2025-08-28 07:08:34
48	priority	{"id": 1756370349, "read": false, "time": "28/08/2025 09:39", "type": "priority", "title": "Couverture Critique - Produit Fini", "message": "Produit: HC0099, Couverture: 22.2 jours", "coverage": 22.2, "articleCode": "HC0099"}	application	\N	\N	2025-08-28 09:39:09	2025-08-28 09:39:09
49	priority	{"id": 1756373626, "read": false, "time": "28/08/2025 10:33", "type": "priority", "title": "Couverture Critique - Produit Fini", "message": "Produit: HC0099, Couverture: 22.2 jours", "coverage": 22.2, "articleCode": "HC0099"}	application	\N	\N	2025-08-28 10:33:46	2025-08-28 10:33:46
50	priority	{"id": 1756374886, "read": false, "time": "28/08/2025 10:54", "type": "priority", "title": "Couverture Critique - Produit Fini", "message": "Produit: HC0099, Couverture: 22.2 jours", "coverage": 22.2, "articleCode": "HC0099"}	application	\N	\N	2025-08-28 10:54:46	2025-08-28 10:54:46
51	priority	{"id": 1756375713, "read": false, "time": "28/08/2025 11:08", "type": "priority", "title": "Couverture Critique - Produit Fini", "message": "Produit: HC0099, Couverture: 22.2 jours", "coverage": 22.2, "articleCode": "HC0099"}	application	\N	\N	2025-08-28 11:08:33	2025-08-28 11:08:33
\.


--
-- Data for Name: product_compositions; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.product_compositions (id, parent_article_id, component_article_id, quantity_per_unit, quantity_per_lot, operating_unit, conversion_factor, created_at, updated_at) FROM stdin;
1	1	5	1.0000	7642.0000	UN	1.000000	2025-08-28 00:55:52	2025-08-28 00:55:52
2	1	4	1.0000	7642.0000	UN	1.000000	2025-08-28 00:58:08	2025-08-28 00:58:08
3	1	6	0.0278	212.4476	UN	1.000000	2025-08-28 00:59:50	2025-08-28 00:59:50
4	1	7	1.0000	7642.0000	UN	1.000000	2025-08-28 01:02:56	2025-08-28 01:02:56
5	1	8	1.0000	7642.0000	UN	1.000000	2025-08-28 01:03:55	2025-08-28 01:03:55
6	1	9	1.0000	7642.0000	UN	1.000000	2025-08-28 01:05:33	2025-08-28 01:05:33
7	1	10	1.0000	7642.0000	UN	1.000000	2025-08-28 01:06:02	2025-08-28 01:06:02
\.


--
-- Data for Name: production_calculations; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.production_calculations (id, article_id, initial_coverage, monthly_budget, calculation_date, quantity_to_produce, batches_to_produce, created_at, updated_at) FROM stdin;
1	1	22.18	1524.00	2025-08-01	7843.91	2.00	2025-08-27 16:39:35	2025-09-01 12:57:49
49	1	88.71	381.00	2025-09-01	986.06	22.00	2025-09-01 12:57:49	2025-09-03 15:45:28
\.


--
-- Data for Name: production_orders; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.production_orders (id, article_id, code, status, batch_count, batch_size_override, batch_sales_quantity, batch_sample_quantity, selected_sf_stock_detail_id, notes, created_at, updated_at, deleted_at) FROM stdin;
8	1	\N	in_progress	1	\N	\N	\N	\N	Ordre de production de 1 lot(s)	2025-08-28 10:44:53	2025-08-28 10:54:46	\N
9	1	\N	pending	22	7642.00	\N	\N	23	\N	2025-09-01 13:02:31	2025-09-03 14:04:54	\N
10	1	aaaa	pending	1	7642.00	7642.00	\N	\N	Ordre de production de 1 lot(s) sur les 2 recommandés	2025-09-01 13:20:04	2025-09-03 15:45:38	\N
\.


--
-- Data for Name: sales_forecasts; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.sales_forecasts (id, article_id, warehouse_id, forecast_code, forecast_date, forecast_quantity, created_at, updated_at) FROM stdin;
1	1	1	SENDAR24124153	2025-08-25	381.00	2025-08-27 16:39:35	2025-08-27 16:39:35
2	1	1	SENDAR24124152	2025-08-18	381.00	2025-08-27 16:58:52	2025-08-27 16:58:52
3	1	1	SENDAR24124151	2025-08-11	381.00	2025-08-27 16:58:52	2025-08-27 16:58:52
4	1	1	SENDAR24124150	2025-08-04	381.00	2025-08-27 16:58:52	2025-08-27 16:58:52
5	1	1	SENDAR24124111	2025-09-04	381.00	2025-08-27 16:58:52	2025-08-27 16:58:52
\.


--
-- Data for Name: sessions; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.sessions (id, user_id, ip_address, user_agent, payload, last_activity) FROM stdin;
xRZY7q0IX4TqBrrXTlNkSAGjqPzdLdYQmDCGWoAb	1	197.14.18.176	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36	YTo0OntzOjY6Il90b2tlbiI7czo0MDoiS2g1Vkk5bWVZRnA5YTlvZ3hETDlvQnpMOUVUemFVcjlqb2hGeklYRyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTtzOjk6Il9wcmV2aW91cyI7YToxOntzOjM6InVybCI7czoxMTg6Imh0dHA6Ly81NC4zOC4zMi4xNjEvZGFyLWVzc2F5ZGFsaS9wdWJsaWMvcHJvZHVjdGlvbi1vcmRlcnMvZGF0YT9wZXJQYWdlPTIwJnNvcnRGaWVsZD1wcmlvcml0eSZzb3J0T3JkZXI9YXNjJnN0YXJ0Um93PTAiO319	1756910738
wx876iEJwgFR60xWQAkxtcM73mx7Wut0dYNtnz1G	\N	197.14.18.176	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36	YToyOntzOjY6Il90b2tlbiI7czo0MDoidHNlR0M5ZEtkRkhMNHNHUzlJazNFbTJSbWFWNkVPbW1GYUhTYlY2QiI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==	1756914379
\.


--
-- Data for Name: stock_details; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.stock_details (id, article_id, article_family_id, warehouse_id, batch_number_fp, batch_number_rm, status, initial_quantity, expiry_date, inspection_date, created_at, updated_at) FROM stdin;
2	1	2	1	DAR210384	\N	Q	1.00	2023-08-01	\N	2025-08-27 16:55:14	2025-08-27 16:55:14
3	1	2	1	DAR210550	\N	Q	1.00	2023-08-01	\N	2025-08-27 16:55:14	2025-08-27 16:55:14
4	1	2	1	DAR220320	\N	Q	1.00	2024-03-01	\N	2025-08-27 16:55:14	2025-08-27 16:55:14
5	1	2	1	DAR220321	\N	Q	2.00	2024-03-01	\N	2025-08-27 16:55:14	2025-08-27 16:55:14
6	1	2	1	DAR220797	\N	Q	10.00	2024-06-01	\N	2025-08-27 16:55:14	2025-08-27 16:55:14
7	1	2	1	DAR220998	\N	Q	11.00	2024-06-01	\N	2025-08-27 16:55:14	2025-08-27 16:55:14
1	1	2	1	DAR250029	\N	A	1300.00	2026-12-01	\N	2025-08-27 16:50:33	2025-08-27 16:50:33
8	4	3	1	24040308	\N	A	3018.00	2029-05-20	\N	2025-08-27 23:43:55	2025-08-27 23:43:55
9	4	3	1	24080636	\N	A	29577.00	2029-10-07	\N	2025-08-27 23:43:55	2025-08-27 23:43:55
10	4	3	1	25040277	\N	A	117000.00	2030-05-06	\N	2025-08-27 23:43:55	2025-08-27 23:43:55
11	4	3	1	25040278	\N	A	91000.00	2030-05-09	\N	2025-08-27 23:43:55	2025-08-27 23:43:55
12	5	3	1	21070570	\N	Q	77600.00	2022-07-26	\N	2025-08-27 23:53:19	2025-08-27 23:53:19
13	5	3	1	24040301	\N	A	318.00	2025-05-17	\N	2025-08-27 23:53:19	2025-08-27 23:53:19
14	5	3	1	25040280	\N	A	91223.00	2026-05-06	\N	2025-08-27 23:53:19	2025-08-27 23:53:19
15	6	3	1	24030202	\N	A	29.00	2029-03-19	\N	2025-08-28 00:07:32	2025-08-28 00:07:32
16	6	3	1	24060504	\N	A	15.00	2029-06-29	\N	2025-08-28 00:07:32	2025-08-28 00:07:32
17	6	3	1	24080650	\N	A	160.00	2029-09-13	\N	2025-08-28 00:07:32	2025-08-28 00:07:32
18	6	3	1	25010005	\N	A	2863.00	2030-01-14	\N	2025-08-28 00:07:32	2025-08-28 00:07:32
19	6	3	1	25060430	\N	A	5430.00	2030-06-11	\N	2025-08-28 00:07:32	2025-08-28 00:07:32
20	7	3	1	24070589	\N	A	1274.00	2027-08-13	\N	2025-08-28 00:18:24	2025-08-28 00:18:24
21	7	3	1	25040226	\N	A	16525.00	2028-04-11	\N	2025-08-28 00:18:24	2025-08-28 00:18:24
22	8	3	1	25010031	\N	A	10747.00	2030-01-21	\N	2025-08-28 00:23:34	2025-08-28 00:23:34
24	9	4	1	21090785	\N	A	1170.00	2999-12-31	\N	2025-08-28 00:30:07	2025-08-28 00:30:07
25	10	3	1	25010037	\N	A	10697.00	2027-01-28	\N	2025-08-28 00:41:15	2025-08-28 00:41:15
26	2	1	1	25010025	\N	A	76477.00	2027-09-01	\N	2025-08-28 00:44:19	2025-08-28 00:44:19
27	3	1	1	24110867	\N	A	634232.00	2029-09-19	\N	2025-08-28 00:46:06	2025-08-28 00:46:06
28	3	1	1	25030190	\N	A	1050000.00	2030-02-08	\N	2025-08-28 00:46:06	2025-08-28 00:46:06
23	9	4	1	21090784	\N	A	14114.00	2999-12-31	\N	2025-08-28 00:30:07	2025-08-28 00:30:07
\.


--
-- Data for Name: stock_movements; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.stock_movements (id, article_id, warehouse_id, movement_date, quantity, created_at, updated_at) FROM stdin;
1	1	1	2025-08-18	-65.00	2025-08-27 17:38:17	2025-08-27 17:38:17
2	1	1	2025-08-19	-78.00	2025-08-27 17:38:17	2025-08-27 17:38:17
3	1	1	2025-08-20	-92.00	2025-08-27 17:38:17	2025-08-27 17:38:17
4	1	1	2025-08-21	-85.00	2025-08-27 17:38:17	2025-08-27 17:38:17
5	1	1	2025-08-22	-93.00	2025-08-27 17:38:17	2025-08-27 17:38:17
6	1	1	2025-08-23	-48.00	2025-08-27 17:38:17	2025-08-27 17:38:17
\.


--
-- Data for Name: warehouses; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.warehouses (id, warehouse_code, warehouse_name, created_at, updated_at) FROM stdin;
1	WH001	Stockage Produits Finis	2025-08-27 16:28:17	2025-08-27 16:28:17
\.



--
-- Name: article_families article_families_family_code_unique; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.article_families
    ADD CONSTRAINT article_families_family_code_unique UNIQUE (family_code);


--
-- Name: article_families article_families_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.article_families
    ADD CONSTRAINT article_families_pkey PRIMARY KEY (id);


--
-- Name: articles articles_article_code_unique; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.articles
    ADD CONSTRAINT articles_article_code_unique UNIQUE (article_code);


--
-- Name: articles articles_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.articles
    ADD CONSTRAINT articles_pkey PRIMARY KEY (id);


--
-- Name: db_change_notifications db_change_notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.db_change_notifications
    ADD CONSTRAINT db_change_notifications_pkey PRIMARY KEY (id);


--
-- Name: failed_jobs failed_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.failed_jobs
    ADD CONSTRAINT failed_jobs_pkey PRIMARY KEY (id);


--
-- Name: failed_jobs failed_jobs_uuid_unique; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.failed_jobs
    ADD CONSTRAINT failed_jobs_uuid_unique UNIQUE (uuid);


--
-- Name: job_batches job_batches_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.job_batches
    ADD CONSTRAINT job_batches_pkey PRIMARY KEY (id);


--
-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.jobs
    ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);


--
-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.migrations
    ADD CONSTRAINT migrations_pkey PRIMARY KEY (id);


--
-- Name: notification_user notification_user_notification_id_user_id_unique; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notification_user
    ADD CONSTRAINT notification_user_notification_id_user_id_unique UNIQUE (notification_id, user_id);


--
-- Name: notification_user notification_user_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notification_user
    ADD CONSTRAINT notification_user_pkey PRIMARY KEY (id);


--
-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_pkey PRIMARY KEY (id);


--
-- Name: product_compositions product_compositions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_compositions
    ADD CONSTRAINT product_compositions_pkey PRIMARY KEY (id);


--
-- Name: production_calculations production_calculations_article_id_calculation_date_unique; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.production_calculations
    ADD CONSTRAINT production_calculations_article_id_calculation_date_unique UNIQUE (article_id, calculation_date);


--
-- Name: production_calculations production_calculations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.production_calculations
    ADD CONSTRAINT production_calculations_pkey PRIMARY KEY (id);


--
-- Name: production_orders production_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.production_orders
    ADD CONSTRAINT production_orders_pkey PRIMARY KEY (id);


--
-- Name: sales_forecasts sales_forecasts_forecast_code_unique; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sales_forecasts
    ADD CONSTRAINT sales_forecasts_forecast_code_unique UNIQUE (forecast_code);


--
-- Name: sales_forecasts sales_forecasts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sales_forecasts
    ADD CONSTRAINT sales_forecasts_pkey PRIMARY KEY (id);


--
-- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sessions
    ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);


--
-- Name: stock_details stock_details_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.stock_details
    ADD CONSTRAINT stock_details_pkey PRIMARY KEY (id);


--
-- Name: stock_movements stock_movements_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.stock_movements
    ADD CONSTRAINT stock_movements_pkey PRIMARY KEY (id);


--
-- Name: warehouses warehouses_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.warehouses
    ADD CONSTRAINT warehouses_pkey PRIMARY KEY (id);


--
-- Name: warehouses warehouses_warehouse_code_unique; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.warehouses
    ADD CONSTRAINT warehouses_warehouse_code_unique UNIQUE (warehouse_code);


--
-- Name: jobs_queue_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX jobs_queue_index ON public.jobs USING btree (queue);


--
-- Name: notification_user_user_id_read_at_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX notification_user_user_id_read_at_index ON public.notification_user USING btree (user_id, read_at);


--
-- Name: notifications_source_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX notifications_source_index ON public.notifications USING btree (source);


--
-- Name: notifications_type_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX notifications_type_index ON public.notifications USING btree (type);


--
-- Name: notifications_user_id_read_at_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX notifications_user_id_read_at_index ON public.notifications USING btree (user_id, read_at);


--
-- Name: production_calculations_calculation_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX production_calculations_calculation_date_index ON public.production_calculations USING btree (calculation_date);


--
-- Name: sessions_last_activity_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sessions_last_activity_index ON public.sessions USING btree (last_activity);


--
-- Name: sessions_user_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sessions_user_id_index ON public.sessions USING btree (user_id);


--
-- Name: articles articles_batch_size_trigger; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER articles_batch_size_trigger AFTER UPDATE ON public.articles FOR EACH ROW EXECUTE FUNCTION public.update_product_compositions_on_article_change();


--
-- Name: articles articles_calculation_trigger; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER articles_calculation_trigger AFTER INSERT OR UPDATE ON public.articles FOR EACH ROW EXECUTE FUNCTION public.trigger_calculate_production();


--
-- Name: articles articles_change_trigger; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER articles_change_trigger AFTER INSERT OR DELETE OR UPDATE ON public.articles FOR EACH ROW EXECUTE FUNCTION public.log_table_change();


--
-- Name: product_compositions product_compositions_quantity_trigger; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER product_compositions_quantity_trigger BEFORE INSERT OR UPDATE ON public.product_compositions FOR EACH ROW EXECUTE FUNCTION public.calculate_quantity_per_lot();


--
-- Name: production_calculations production_calculations_change_trigger; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER production_calculations_change_trigger AFTER INSERT OR DELETE OR UPDATE ON public.production_calculations FOR EACH ROW EXECUTE FUNCTION public.log_table_change();


--
-- Name: sales_forecasts sales_forecasts_budget_trigger; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER sales_forecasts_budget_trigger AFTER INSERT OR DELETE OR UPDATE ON public.sales_forecasts FOR EACH ROW EXECUTE FUNCTION public.trigger_update_monthly_budget();


--
-- Name: sales_forecasts sales_forecasts_change_trigger; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER sales_forecasts_change_trigger AFTER INSERT OR DELETE OR UPDATE ON public.sales_forecasts FOR EACH ROW EXECUTE FUNCTION public.log_table_change();


--
-- Name: stock_movements stock_movements_change_trigger; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER stock_movements_change_trigger AFTER INSERT OR DELETE OR UPDATE ON public.stock_movements FOR EACH ROW EXECUTE FUNCTION public.log_table_change();


--
-- Name: stock_details trigger_update_article_stock_after_delete; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER trigger_update_article_stock_after_delete AFTER DELETE ON public.stock_details FOR EACH ROW EXECUTE FUNCTION public.update_article_stock();


--
-- Name: stock_details trigger_update_article_stock_after_insert; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER trigger_update_article_stock_after_insert AFTER INSERT ON public.stock_details FOR EACH ROW EXECUTE FUNCTION public.update_article_stock();


--
-- Name: stock_details trigger_update_article_stock_after_update; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER trigger_update_article_stock_after_update AFTER UPDATE ON public.stock_details FOR EACH ROW EXECUTE FUNCTION public.update_article_stock();


--
-- Name: articles articles_article_family_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.articles
    ADD CONSTRAINT articles_article_family_id_foreign FOREIGN KEY (article_family_id) REFERENCES public.article_families(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: notification_user notification_user_notification_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notification_user
    ADD CONSTRAINT notification_user_notification_id_foreign FOREIGN KEY (notification_id) REFERENCES public.notifications(id) ON DELETE CASCADE;


--
-- Name: notification_user notification_user_user_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notification_user
    ADD CONSTRAINT notification_user_user_id_foreign FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: notifications notifications_user_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_user_id_foreign FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: product_compositions product_compositions_component_article_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_compositions
    ADD CONSTRAINT product_compositions_component_article_id_foreign FOREIGN KEY (component_article_id) REFERENCES public.articles(id) ON DELETE CASCADE;


--
-- Name: product_compositions product_compositions_parent_article_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_compositions
    ADD CONSTRAINT product_compositions_parent_article_id_foreign FOREIGN KEY (parent_article_id) REFERENCES public.articles(id) ON DELETE CASCADE;


--
-- Name: production_calculations production_calculations_article_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.production_calculations
    ADD CONSTRAINT production_calculations_article_id_foreign FOREIGN KEY (article_id) REFERENCES public.articles(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: production_orders production_orders_article_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.production_orders
    ADD CONSTRAINT production_orders_article_id_foreign FOREIGN KEY (article_id) REFERENCES public.articles(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: production_orders production_orders_selected_sf_stock_detail_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.production_orders
    ADD CONSTRAINT production_orders_selected_sf_stock_detail_id_foreign FOREIGN KEY (selected_sf_stock_detail_id) REFERENCES public.stock_details(id);


--
-- Name: sales_forecasts sales_forecasts_article_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sales_forecasts
    ADD CONSTRAINT sales_forecasts_article_id_foreign FOREIGN KEY (article_id) REFERENCES public.articles(id) ON DELETE CASCADE;


--
-- Name: sales_forecasts sales_forecasts_warehouse_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sales_forecasts
    ADD CONSTRAINT sales_forecasts_warehouse_id_foreign FOREIGN KEY (warehouse_id) REFERENCES public.warehouses(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: stock_details stock_details_article_family_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.stock_details
    ADD CONSTRAINT stock_details_article_family_id_foreign FOREIGN KEY (article_family_id) REFERENCES public.article_families(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: stock_details stock_details_article_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.stock_details
    ADD CONSTRAINT stock_details_article_id_foreign FOREIGN KEY (article_id) REFERENCES public.articles(id) ON DELETE CASCADE;


--
-- Name: stock_details stock_details_warehouse_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.stock_details
    ADD CONSTRAINT stock_details_warehouse_id_foreign FOREIGN KEY (warehouse_id) REFERENCES public.warehouses(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: stock_movements stock_movements_article_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.stock_movements
    ADD CONSTRAINT stock_movements_article_id_foreign FOREIGN KEY (article_id) REFERENCES public.articles(id) ON DELETE CASCADE;


--
-- Name: stock_movements stock_movements_warehouse_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.stock_movements
    ADD CONSTRAINT stock_movements_warehouse_id_foreign FOREIGN KEY (warehouse_id) REFERENCES public.warehouses(id) ON UPDATE CASCADE ON DELETE SET NULL;