--
--



--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--

-- *not* creating schema, since initdb creates it


ALTER SCHEMA public OWNER TO postgres;

--
-- Name: commissiontype; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.commissiontype AS ENUM (
    'TIM_BUSINESS',
    'TIM_CASH'
);


ALTER TYPE public.commissiontype OWNER TO timcash;

--
-- Name: genreenum; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.genreenum AS ENUM (
    'HOMME',
    'FEMME',
    'AUTRE'
);


ALTER TYPE public.genreenum OWNER TO timcash;

--
-- Name: loanstatus; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.loanstatus AS ENUM (
    'PENDING',
    'APPROVED',
    'ACTIVE',
    'COMPLETED',
    'OVERDUE',
    'REJECTED'
);


ALTER TYPE public.loanstatus OWNER TO timcash;

--
-- Name: notificationpriority; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.notificationpriority AS ENUM (
    'LOW',
    'MEDIUM',
    'HIGH'
);


ALTER TYPE public.notificationpriority OWNER TO timcash;

--
-- Name: paymentmethod; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.paymentmethod AS ENUM (
    'MOBILE_MONEY',
    'CARD',
    'BANK_TRANSFER'
);


ALTER TYPE public.paymentmethod OWNER TO timcash;

--
-- Name: rechargestatus; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.rechargestatus AS ENUM (
    'PENDING',
    'PROCESSING',
    'COMPLETED',
    'FAILED',
    'CANCELLED',
    'REFUNDED'
);


ALTER TYPE public.rechargestatus OWNER TO timcash;

--
-- Name: timaccounttype; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.timaccounttype AS ENUM (
    'TIM_MINI',
    'TIM_MAXI',
    'TIM_BUSINESS'
);


ALTER TYPE public.timaccounttype OWNER TO timcash;

--
-- Name: transactionstatus; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.transactionstatus AS ENUM (
    'PENDING',
    'COMPLETED',
    'FAILED',
    'CANCELLED'
);


ALTER TYPE public.transactionstatus OWNER TO timcash;

--
-- Name: transactiontype; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.transactiontype AS ENUM (
    'NFC_DEPOSIT',
    'NFC_WITHDRAWAL',
    'RECHARGE_CINETPAY',
    'RECHARGE_BY_BUSINESS',
    'PRET_MOBILE',
    'COMMISSION',
    'REMBOURSEMENT_AUTO',
    'VIREMENT_BANCAIRE',
    'MOBILE_TRANSFER',
    'PRELEVEMENT',
    'DEPOT',
    'RECHARGEMENT',
    'RETRAIT',
    'TRANSFERT',
    'PAIEMENT'
);


ALTER TYPE public.transactiontype OWNER TO timcash;

--
-- Name: virtualcardcolor; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.virtualcardcolor AS ENUM (
    'gold',
    'amber',
    'green',
    'infinite',
    'silver',
    'black',
    'blue',
    'red',
    'purple',
    'orange'
);


ALTER TYPE public.virtualcardcolor OWNER TO timcash;

--
-- Name: virtualcardpurchasestatus; Type: TYPE; Schema: public; Owner: timcash
--

CREATE TYPE public.virtualcardpurchasestatus AS ENUM (
    'pending',
    'payment_initiated',
    'payment_completed',
    'card_created',
    'failed',
    'cancelled'
);


ALTER TYPE public.virtualcardpurchasestatus OWNER TO timcash;



--
-- Name: admin_stock; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.admin_stock (
    id integer NOT NULL,
    balance double precision,
    total_credits double precision,
    total_debits double precision,
    total_commissions double precision,
    updated_at timestamp with time zone
);


ALTER TABLE public.admin_stock OWNER TO timcash;

--
-- Name: admin_stock_id_seq; Type: SEQUENCE; Schema: public; Owner: timcash
--

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


ALTER SEQUENCE public.admin_stock_id_seq OWNER TO timcash;

--
-- Name: admin_stock_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: timcash
--

ALTER SEQUENCE public.admin_stock_id_seq OWNED BY public.admin_stock.id;


--
-- Name: advertisements; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.advertisements (
    id character varying NOT NULL,
    title character varying NOT NULL,
    description text,
    image_url character varying,
    ad_type character varying,
    status character varying,
    target_countries text,
    target_cities text,
    start_date timestamp with time zone,
    end_date timestamp with time zone,
    budget double precision,
    spent double precision,
    impressions integer,
    clicks integer,
    ctr double precision,
    created_by character varying NOT NULL,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.advertisements OWNER TO timcash;

--
-- Name: alembic_version; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.alembic_version (
    version_num character varying(32) NOT NULL
);


ALTER TABLE public.alembic_version OWNER TO timcash;

--
-- Name: cards; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.cards (
    id character varying(8) NOT NULL,
    status character varying(20),
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone,
    uid character varying(50) NOT NULL,
    user_id character varying NOT NULL
);


ALTER TABLE public.cards OWNER TO timcash;

--
-- Name: cards_virtual; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.cards_virtual (
    id character varying(8) NOT NULL,
    price double precision,
    type_card character varying NOT NULL,
    currency character varying NOT NULL,
    status character varying(20),
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone
);


ALTER TABLE public.cards_virtual OWNER TO timcash;

--
-- Name: cards_virtual_user; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.cards_virtual_user (
    id character varying(8) NOT NULL,
    user_id character varying NOT NULL,
    card_id character varying(8) NOT NULL,
    acquired_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.cards_virtual_user OWNER TO timcash;

--
-- Name: cinetpay_transfers; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.cinetpay_transfers (
    id character varying(50) NOT NULL,
    amount double precision NOT NULL,
    reference character varying(100) NOT NULL,
    cinetpay_transaction_id character varying(100),
    status character varying(20),
    created_at timestamp without time zone,
    completed_at timestamp without time zone,
    failed_at timestamp without time zone,
    failure_reason text,
    notes text
);


ALTER TABLE public.cinetpay_transfers OWNER TO timcash;

--
-- Name: cities; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.cities (
    id character varying NOT NULL,
    name character varying NOT NULL,
    country_id character varying NOT NULL,
    branch_code character varying,
    is_active boolean,
    users integer,
    volume double precision,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.cities OWNER TO timcash;

--
-- Name: commission_rates; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.commission_rates (
    id character varying NOT NULL,
    name character varying NOT NULL,
    rate_type character varying NOT NULL,
    value double precision NOT NULL,
    category character varying NOT NULL,
    description text,
    min_amount double precision,
    max_amount double precision,
    is_active boolean,
    updated_by character varying NOT NULL,
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone
);


ALTER TABLE public.commission_rates OWNER TO timcash;

--
-- Name: countries; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.countries (
    id character varying NOT NULL,
    name character varying NOT NULL,
    code character varying(3) NOT NULL,
    currency character varying,
    currency_symbol character varying,
    flag character varying,
    is_active boolean,
    total_users integer,
    total_volume double precision,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.countries OWNER TO timcash;

--
-- Name: device_capabilities; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.device_capabilities (
    id character varying NOT NULL,
    device_model character varying NOT NULL,
    brand character varying NOT NULL,
    has_nfc boolean,
    nfc_enabled boolean,
    os_version character varying,
    user_count integer,
    transaction_count integer,
    success_rate double precision,
    location character varying,
    country character varying,
    city character varying,
    last_seen timestamp with time zone DEFAULT now()
);


ALTER TABLE public.device_capabilities OWNER TO timcash;

--
-- Name: loans; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.loans (
    id character varying NOT NULL,
    user_id character varying NOT NULL,
    amount double precision NOT NULL,
    interest_rate double precision,
    penalty_rate double precision,
    remaining_balance double precision NOT NULL,
    monthly_payment double precision NOT NULL,
    total_payments integer NOT NULL,
    payments_completed integer,
    status public.loanstatus,
    due_date timestamp with time zone,
    days_overdue integer,
    guarantee_deposit double precision,
    deposit_paid boolean,
    auto_approved boolean,
    wallet_credited boolean,
    created_at timestamp with time zone DEFAULT now(),
    approved_at timestamp with time zone
);


ALTER TABLE public.loans OWNER TO timcash;

--
-- Name: nfc_card_transactions; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.nfc_card_transactions (
    id character varying NOT NULL,
    card_id character varying NOT NULL,
    transaction_id character varying NOT NULL,
    operation_type character varying NOT NULL,
    card_data text,
    device_info text,
    location character varying,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.nfc_card_transactions OWNER TO timcash;

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

CREATE TABLE public.notifications (
    id character varying NOT NULL,
    user_id character varying NOT NULL,
    title character varying NOT NULL,
    message text NOT NULL,
    type character varying NOT NULL,
    priority public.notificationpriority,
    is_read boolean,
    action_url character varying,
    amount double precision,
    merchant character varying,
    created_at timestamp with time zone DEFAULT now(),
    read_at timestamp with time zone,
    transaction_id character varying,
    reference character varying
);


ALTER TABLE public.notifications OWNER TO timcash;

--
-- Name: recharge_commissions; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.recharge_commissions (
    id character varying(50) NOT NULL,
    recharge_id character varying(50) NOT NULL,
    commission_type public.commissiontype NOT NULL,
    recipient_user_id character varying(50),
    recipient_type character varying(20) NOT NULL,
    amount double precision NOT NULL,
    percentage double precision NOT NULL,
    status character varying(20),
    credited_at timestamp without time zone,
    created_at timestamp without time zone,
    notes text
);


ALTER TABLE public.recharge_commissions OWNER TO timcash;

--
-- Name: tim_business_recharges; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.tim_business_recharges (
    id character varying(50) NOT NULL,
    business_user_id character varying(50) NOT NULL,
    business_account_type character varying(20),
    beneficiary_user_id character varying(50) NOT NULL,
    beneficiary_phone character varying(20) NOT NULL,
    beneficiary_account_type character varying(20) NOT NULL,
    amount double precision NOT NULL,
    total_commission double precision NOT NULL,
    business_commission double precision NOT NULL,
    timcash_commission double precision NOT NULL,
    total_amount double precision NOT NULL,
    business_balance_before double precision NOT NULL,
    business_balance_after double precision NOT NULL,
    beneficiary_balance_before double precision NOT NULL,
    beneficiary_balance_after double precision NOT NULL,
    status public.rechargestatus,
    created_at timestamp without time zone,
    completed_at timestamp without time zone,
    failed_at timestamp without time zone,
    reference character varying(100) NOT NULL,
    description text,
    failure_reason text,
    ip_address character varying(50),
    device_info text,
    location character varying(100)
);


ALTER TABLE public.tim_business_recharges OWNER TO timcash;

--
-- Name: timcash_company_account; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.timcash_company_account (
    id character varying(50) NOT NULL,
    balance double precision,
    total_commissions_received double precision,
    total_transferred_to_cinetpay double precision,
    total_recharges_count integer,
    last_recharge_at timestamp without time zone,
    created_at timestamp without time zone,
    updated_at timestamp without time zone
);


ALTER TABLE public.timcash_company_account OWNER TO timcash;

--
-- Name: transactions; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.transactions (
    id character varying NOT NULL,
    user_id character varying NOT NULL,
    transaction_type public.transactiontype NOT NULL,
    amount double precision NOT NULL,
    commission_amount double precision,
    commission_rate double precision,
    status public.transactionstatus,
    description text,
    reference character varying,
    external_reference character varying,
    payment_method public.paymentmethod,
    merchant_name character varying,
    location character varying,
    device_info text,
    created_at timestamp with time zone DEFAULT now(),
    completed_at timestamp with time zone
);


ALTER TABLE public.transactions OWNER TO timcash;

--
-- Name: virtual_card_prices; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.virtual_card_prices (
    id character varying NOT NULL,
    card_color public.virtualcardcolor NOT NULL,
    base_price double precision NOT NULL,
    tim_mini_price double precision,
    tim_maxi_price double precision,
    tim_business_price double precision,
    commission_rate double precision,
    is_available boolean,
    is_premium boolean,
    max_purchases_per_user integer,
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone
);


ALTER TABLE public.virtual_card_prices OWNER TO timcash;

--
-- Name: wallets; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.wallets (
    id character varying NOT NULL,
    user_id character varying NOT NULL,
    balance double precision,
    max_balance double precision,
    is_active boolean,
    nfc_enabled boolean,
    currency character varying(10),
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone
);


ALTER TABLE public.wallets OWNER TO timcash;

--
-- Name: workflows; Type: TABLE; Schema: public; Owner: timcash
--

CREATE TABLE public.workflows (
    id character varying NOT NULL,
    name character varying NOT NULL,
    description text,
    status character varying,
    category character varying NOT NULL,
    triggers integer,
    executions integer,
    success_rate double precision,
    steps text,
    last_run timestamp with time zone,
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone
);


ALTER TABLE public.workflows OWNER TO timcash;

--
-- Name: admin_stock id; Type: DEFAULT; Schema: public; Owner: timcash
--

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


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

COPY public.admin_stock (id, balance, total_credits, total_debits, total_commissions, updated_at) FROM stdin;
1	846996486.3	0	4000	486.3	2025-11-16 19:14:29.671644+00
\.


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

COPY public.advertisements (id, title, description, image_url, ad_type, status, target_countries, target_cities, start_date, end_date, budget, spent, impressions, clicks, ctr, created_by, created_at) FROM stdin;
\.


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

COPY public.alembic_version (version_num) FROM stdin;
e634cdf5a66b
\.


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

COPY public.cards (id, status, created_at, updated_at, uid, user_id) FROM stdin;
\.


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

COPY public.cards_virtual (id, price, type_card, currency, status, created_at, updated_at) FROM stdin;
88270851	650	Test	test	active	2025-11-15 13:12:22.14442+00	\N
31843848	650	Test	test	active	2025-11-15 13:13:00.484711+00	\N
88768963	650	AMBER	F CFA	active	2025-11-15 13:14:12.873655+00	\N
17220007	650	GREEN	F CFA	active	2025-11-15 13:14:34.934916+00	\N
28724412	650	GOLD	F CFA	active	2025-11-15 13:15:01.710681+00	\N
58937880	650	INFINITE	F CFA	active	2025-11-15 13:15:21.437433+00	\N
\.


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

COPY public.cards_virtual_user (id, user_id, card_id, acquired_at) FROM stdin;
89856176	03becfc8-6077-4baa-bfc7-bc941df5d2c8	17220007	2025-11-16 07:48:39.926337+00
24764479	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	58937880	2025-11-16 13:30:26.47727+00
51981914	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	17220007	2025-11-16 18:42:09.494824+00
62684103	51eac304-d12e-4dc2-b377-a60c757ff1c8	88768963	2025-11-16 19:15:28.848107+00
\.


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

COPY public.cinetpay_transfers (id, amount, reference, cinetpay_transaction_id, status, created_at, completed_at, failed_at, failure_reason, notes) FROM stdin;
\.


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

COPY public.cities (id, name, country_id, branch_code, is_active, users, volume, created_at) FROM stdin;
f7abf5ac-88eb-47c6-95c7-987d2cd1976a	Abidjan	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-ABJ	t	\N	\N	2025-11-10 21:37:46.924832+00
473b1a04-18e5-4345-81d5-5a80fad060dc	Yamoussoukro	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-YAM	t	\N	\N	2025-11-10 21:37:46.927518+00
245f4222-5ce6-4506-ad60-33715525eaa3	Bouaké	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-BOU	t	\N	\N	2025-11-10 21:37:46.930409+00
fe22df90-758a-4b60-93a8-2a07e11c02d5	Daloa	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-DAL	t	\N	\N	2025-11-10 21:37:46.931898+00
b73b45ff-515a-4679-afcd-447117d64582	San-Pédro	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-SPE	t	\N	\N	2025-11-10 21:37:46.933171+00
1d14c262-28d9-4b94-bf63-be51676e9005	Korhogo	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-KOR	t	\N	\N	2025-11-10 21:37:46.934361+00
30b0aecc-a364-4ac8-9f39-a1b11c4406f9	Man	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-MAN	t	\N	\N	2025-11-10 21:37:46.935634+00
3f46fcdd-2b66-4a8d-a943-9b32c587412b	Gagnoa	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-GAG	t	\N	\N	2025-11-10 21:37:46.936794+00
0e420bac-e554-4761-a827-f5c969aaefcd	Divo	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-DIV	t	\N	\N	2025-11-10 21:37:46.937993+00
1f3c34a6-7f38-4590-806e-301dcfc573a2	Abengourou	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-ABE	t	\N	\N	2025-11-10 21:37:46.939261+00
d4d678f2-0d2a-44ca-aa2e-00f2092c3106	Grand-Bassam	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-GBA	t	\N	\N	2025-11-10 21:37:46.940634+00
61584fbe-25f9-4b56-a0df-3b97b5ebc800	Soubré	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-SOU	t	\N	\N	2025-11-10 21:37:46.945803+00
a48f755c-bba7-45af-ad6f-f5eb7709c4ef	Agboville	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-AGB	t	\N	\N	2025-11-10 21:37:46.9479+00
1061ccc4-0ff4-4dc5-807e-1096882ce1d9	Bondoukou	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-BON	t	\N	\N	2025-11-10 21:37:46.949602+00
184a1f3f-6dde-47a3-ba78-fe0498abd959	Odienné	60084d2e-f803-45be-9736-63e472b10b60	TIM-CI-ODI	t	\N	\N	2025-11-10 21:37:46.951223+00
\.


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

COPY public.commission_rates (id, name, rate_type, value, category, description, min_amount, max_amount, is_active, updated_by, created_at, updated_at) FROM stdin;
830fd11b-7f0e-41b0-b9c1-f98f2632223a	Test	percentage	0.05	recharge_cinetpay	test	\N	\N	t	411e62fc-4b57-41e9-9f14-3b82d2c56df6	2025-11-10 21:38:56.739723+00	2025-11-10 21:53:46.194626+00
\.


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

COPY public.countries (id, name, code, currency, currency_symbol, flag, is_active, total_users, total_volume, created_at) FROM stdin;
60084d2e-f803-45be-9736-63e472b10b60	Côte d'Ivoire	CI	FCFA	FCFA	🇨🇮	t	\N	\N	2025-11-10 21:37:46.900972+00
\.


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

COPY public.device_capabilities (id, device_model, brand, has_nfc, nfc_enabled, os_version, user_count, transaction_count, success_rate, location, country, city, last_seen) FROM stdin;
\.


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

COPY public.loans (id, user_id, amount, interest_rate, penalty_rate, remaining_balance, monthly_payment, total_payments, payments_completed, status, due_date, days_overdue, guarantee_deposit, deposit_paid, auto_approved, wallet_credited, created_at, approved_at) FROM stdin;
892d81b8-0f19-4ef6-b0aa-ee31d38b802e	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	4000	0.06	0.15	4240	4240	1	0	APPROVED	2025-11-15 15:58:55.517624+00	0	0	f	f	f	2025-11-12 15:58:55.500686+00	\N
\.


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

COPY public.nfc_card_transactions (id, card_id, transaction_id, operation_type, card_data, device_info, location, created_at) FROM stdin;
\.


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

COPY public.notifications (id, user_id, title, message, type, priority, is_read, action_url, amount, merchant, created_at, read_at, transaction_id, reference) FROM stdin;
da2ed122-7ca3-4423-968f-20bd7cc31031	03becfc8-6077-4baa-bfc7-bc941df5d2c8	Wallet crédité	Votre wallet a été crédité de 500.0.	wallet_recharge	HIGH	f	\N	500	Kouassi Joel	2025-11-10 22:53:01.420086+00	\N	\N	\N
10a3d562-37f0-436d-8698-21c1e2846d94	03becfc8-6077-4baa-bfc7-bc941df5d2c8	Transfert effectué	Vous avez envoyé 300.0 XOF à ISSOUF. Commission : 3.0 XOF.	wallet_debit	MEDIUM	f	\N	303	ISSOUF	2025-11-10 23:07:23.583927+00	\N	\N	\N
46a6d65b-693e-4639-99ab-a3030804e377	ef66697a-d911-46f8-9e1d-5d2b23bd9cd8	Transfert reçu	Vous avez reçu 300.0 XOF de KOUASSI Joel.	wallet_credit	HIGH	t	\N	300	KOUASSI Joel	2025-11-10 23:07:23.583996+00	2025-11-10 23:10:17.574062+00	\N	\N
a8ac65a4-3881-4f93-a846-5267523f7c0c	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	Achat de carte virtuelle	Vous avez acheté la carte virtuelle AMBER pour 650.0 XOF.	wallet_debit	MEDIUM	f	\N	650	\N	2025-11-15 15:46:45.363788+00	\N	\N	\N
3d9b50b1-120b-47c6-926d-b4cb2f81af3c	03becfc8-6077-4baa-bfc7-bc941df5d2c8	Wallet crédité	Votre wallet a été crédité de 1000.0.	wallet_recharge	HIGH	f	\N	1000	Kouassi Joel	2025-11-16 07:46:53.624918+00	\N	\N	\N
647b5e72-2fc1-4621-a979-7c134573c915	03becfc8-6077-4baa-bfc7-bc941df5d2c8	Achat de carte virtuelle	Vous avez acheté la carte virtuelle GREEN pour 650.0 XOF.	wallet_debit	MEDIUM	f	\N	650	\N	2025-11-16 07:48:39.933639+00	\N	\N	\N
34423052-3bb7-4b71-aab8-78086de21e26	51eac304-d12e-4dc2-b377-a60c757ff1c8	Wallet crédité	Votre wallet a été crédité de 1000.0.	wallet_recharge	HIGH	f	\N	1000	Kouassi Joel	2025-11-16 19:14:29.687911+00	\N	\N	\N
a26f200b-b68e-482e-882f-97e3d20841d0	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	Wallet débité	Votre wallet a été débité de 1120.0 pour recharger le client Akissi Viviane .	wallet_debit	HIGH	f	\N	1120	Akissi Viviane 	2025-11-16 19:14:29.687992+00	\N	\N	\N
5bda1db1-11a3-47b9-b286-9de3a65aed5d	51eac304-d12e-4dc2-b377-a60c757ff1c8	Achat de carte virtuelle	Vous avez acheté la carte virtuelle AMBER pour 650.0 XOF.	wallet_debit	MEDIUM	f	\N	650	\N	2025-11-16 19:15:28.854446+00	\N	\N	\N
2cd76339-a241-4e04-9340-9a749a43e6b8	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	Wallet débité	Votre wallet a été débité de 1120.0 pour recharger le client KOUASSI Joel.	wallet_debit	HIGH	t	\N	1120	KOUASSI Joel	2025-11-16 07:46:53.625144+00	2025-11-16 19:36:17.031116+00	\N	\N
ada9ddea-f4cb-4309-92f3-0d2a9a7f7ff8	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	Achat de carte virtuelle	Vous avez acheté la carte virtuelle INFINITE pour 650.0 XOF.	wallet_debit	MEDIUM	t	\N	650	\N	2025-11-16 13:30:26.485378+00	2025-11-16 19:36:19.570542+00	\N	\N
\.


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

COPY public.recharge_commissions (id, recharge_id, commission_type, recipient_user_id, recipient_type, amount, percentage, status, credited_at, created_at, notes) FROM stdin;
\.


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

COPY public.tim_business_recharges (id, business_user_id, business_account_type, beneficiary_user_id, beneficiary_phone, beneficiary_account_type, amount, total_commission, business_commission, timcash_commission, total_amount, business_balance_before, business_balance_after, beneficiary_balance_before, beneficiary_balance_after, status, created_at, completed_at, failed_at, reference, description, failure_reason, ip_address, device_info, location) FROM stdin;
\.


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

COPY public.timcash_company_account (id, balance, total_commissions_received, total_transferred_to_cinetpay, total_recharges_count, last_recharge_at, created_at, updated_at) FROM stdin;
\.


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

COPY public.transactions (id, user_id, transaction_type, amount, commission_amount, commission_rate, status, description, reference, external_reference, payment_method, merchant_name, location, device_info, created_at, completed_at) FROM stdin;
b441e6fe-d482-4541-adc9-d815db94271a	51eac304-d12e-4dc2-b377-a60c757ff1c8	PAIEMENT	-650	0	0	COMPLETED	Achat de carte virtuelle AMBER	TRF-OUT-0e013396	a29d06de-a62e-4c15-a691-678ed3525c9f	\N	\N	\N	\N	2025-11-16 19:15:28.848107+00	\N
b7401de7-dd0f-4263-abff-00ef5c1073ee	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	RECHARGE_CINETPAY	1000	50	0.05	PENDING	Recharge CinetPay - 1000.0 FCFA (Commission TIM CASH: 50.0 FCFA)	RELOAD-7643e294	4f5b435da66e0c9c565f1fad4d4cf7bdc06eb80e507d06dc46556e9f44c52a2a9fc90687cf81193700b6a88f77b3aabd1cfb568eeab8fd	MOBILE_MONEY	\N	\N	\N	2025-11-10 21:53:57.820277+00	\N
f9908910-8211-4453-b93f-6f22a68396bc	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	RECHARGE_CINETPAY	1000	50	0.05	PENDING	Recharge CinetPay - 1000.0 FCFA (Commission TIM CASH: 50.0 FCFA)	RELOAD-3b601d95	8ce80dbce5090de5edd8fc6bf33de5c83a066cb9d32f537c003bc8de707e65f727aff1ead9274b88ced275900472b1ad99abb814309a69	MOBILE_MONEY	\N	\N	\N	2025-11-10 22:03:39.478182+00	\N
7ee979bd-b905-4cf7-bc61-ee5388397b2d	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	RECHARGE_CINETPAY	1000	50	0.05	PENDING	Recharge CinetPay - 1000.0 FCFA (Commission TIM CASH: 50.0 FCFA)	RELOAD-0c5b5741	af388353f9e272235160893561d29b56ac89ea41620930d83ebc530fefd6da4059d2b8d7e8ac7184bcb5c3d564034bc54b5cfe0b52640e	MOBILE_MONEY	\N	\N	\N	2025-11-10 22:11:40.298337+00	\N
6d61d9c1-ce05-49eb-8837-12125656fd65	03becfc8-6077-4baa-bfc7-bc941df5d2c8	RECHARGE_BY_BUSINESS	500	100	0.16666666666666666	COMPLETED	Recharge effectuée via Kouassi Joel	RCG-OUT-af0c01b2	af0c01b2-c623-49e5-939e-649fe9f83223	\N	\N	\N	\N	2025-11-10 22:53:01.399193+00	\N
0e1f55b1-bcd3-4231-a39b-25d675a61af0	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	RECHARGE_BY_BUSINESS	-560	60	0.10714285714285714	COMPLETED	Débit pour rechargement client KOUASSI Joel	RCG-DEB-af0c01b2	af0c01b2-c623-49e5-939e-649fe9f83223	\N	\N	\N	\N	2025-11-10 22:53:01.399193+00	\N
693027d0-113e-42ac-87b2-feaa4ba3a3e3	03becfc8-6077-4baa-bfc7-bc941df5d2c8	MOBILE_TRANSFER	-303	3	0.01	COMPLETED	Transfert de 300.0 à ISSOUF	TRF-OUT-12cda010	12cda010-bbb1-4f36-8d07-d6accfac8aac	\N	\N	\N	\N	2025-11-10 23:07:23.571863+00	\N
000134c2-2de7-4415-9c96-40b09cdbbe56	ef66697a-d911-46f8-9e1d-5d2b23bd9cd8	MOBILE_TRANSFER	300	0	0	COMPLETED	Réception de 300.0 de KOUASSI Joel	TRF-IN-12cda010	12cda010-bbb1-4f36-8d07-d6accfac8aac	\N	\N	\N	\N	2025-11-10 23:07:23.571863+00	\N
7334b4f1-9143-4aef-818d-658a1b782331	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	COMMISSION	12000	0	0	PENDING	Prêt SOS - Prêt d'urgence	\N	\N	\N	\N	\N	\N	2025-11-12 14:51:12.888189+00	\N
9df7a88f-7263-47e7-ab7f-805c6e7edec5	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	RECHARGE_CINETPAY	1000	500	0.5	COMPLETED	Recharge CinetPay - 1000.0 FCFA (Commission TIM CASH: 500.0 FCFA)	RELOAD-8e2fca9e	7334b4f1-9143-4aef-818d-658a1b782331	MOBILE_MONEY	\N	\N	\N	2025-11-10 21:52:35.51865+00	2025-11-12 15:21:36.675112+00
912085fc-85ce-400d-a8f5-afce9aadeb00	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	COMMISSION	12000	0	0	COMPLETED	Activations de commission - Prêt d'urgence	COMM-87c57f90	912085fc-85ce-400d-a8f5-afce9aadeb00	MOBILE_MONEY	\N	\N	\N	2025-11-12 15:40:27.895959+00	2025-11-12 15:42:38.683497+00
096c31d2-86fc-439e-b565-e6ffa1fc9e59	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	PRET_MOBILE	4000	240	0.06	COMPLETED	Approbation du prêt 892d81b8	LOAN-892d81b8	892d81b8-0f19-4ef6-b0aa-ee31d38b802e	\N	\N	\N	\N	2025-11-15 08:09:33.769362+00	\N
7a259bf9-4299-4fec-b25a-0c578885c029	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	PAIEMENT	-650	0	0	COMPLETED	Achat de carte virtuelle AMBER	TRF-OUT-3437812b	df591e06-653d-4a85-8459-6058534ab47f	\N	\N	\N	\N	2025-11-15 15:46:45.352146+00	\N
e313323c-15a0-4f4d-9736-5e2dcd545bd0	03becfc8-6077-4baa-bfc7-bc941df5d2c8	RECHARGE_BY_BUSINESS	1000	200	0.16666666666666666	COMPLETED	Recharge effectuée via Kouassi Joel	RCG-OUT-23dece1d	23dece1d-ffff-4cf8-857f-d94d3ab1ae3b	\N	\N	\N	\N	2025-11-16 07:46:53.604328+00	\N
0d2f9d8a-f184-4f10-a6c8-69e5d8c7608b	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	RECHARGE_BY_BUSINESS	-1120	120	0.10714285714285714	COMPLETED	Débit pour rechargement client KOUASSI Joel	RCG-DEB-23dece1d	23dece1d-ffff-4cf8-857f-d94d3ab1ae3b	\N	\N	\N	\N	2025-11-16 07:46:53.604328+00	\N
45fd187a-8fd7-4eab-88db-e6e2d55bc5b1	03becfc8-6077-4baa-bfc7-bc941df5d2c8	PAIEMENT	-650	0	0	COMPLETED	Achat de carte virtuelle GREEN	TRF-OUT-ecd17d6f	cc19dd50-413d-49cb-8c80-40f5b878c284	\N	\N	\N	\N	2025-11-16 07:48:39.926337+00	\N
ebf784e3-4927-462c-ace6-790a07b9c21b	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	PAIEMENT	-650	0	0	COMPLETED	Achat de carte virtuelle INFINITE	TRF-OUT-4a6d9b3f	b3e40c8d-169b-416a-b798-3b7f7edff441	\N	\N	\N	\N	2025-11-16 13:30:26.47727+00	\N
575144e4-2e1f-4fed-95a7-9ce276b57b4d	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	PAIEMENT	-650	0	0	COMPLETED	Achat de carte virtuelle GREEN	TRF-OUT-2e5a3550	3e44cd37-7146-4d00-a327-1565f431560b	\N	\N	\N	\N	2025-11-16 18:42:09.494824+00	\N
70011aef-d103-4b5d-a57a-a989ae6029c2	51eac304-d12e-4dc2-b377-a60c757ff1c8	RECHARGE_BY_BUSINESS	1000	200	0.16666666666666666	COMPLETED	Recharge effectuée via Kouassi Joel	RCG-OUT-f3c1f4db	f3c1f4db-f066-49cf-9a08-10b03f631bbd	\N	\N	\N	\N	2025-11-16 19:14:29.671644+00	\N
6e95f52c-9593-4c8b-8919-ab0ae60419bd	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	RECHARGE_BY_BUSINESS	-1120	120	0.10714285714285714	COMPLETED	Débit pour rechargement client Akissi Viviane 	RCG-DEB-f3c1f4db	f3c1f4db-f066-49cf-9a08-10b03f631bbd	\N	\N	\N	\N	2025-11-16 19:14:29.671644+00	\N
\.


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

COPY public.virtual_card_prices (id, card_color, base_price, tim_mini_price, tim_maxi_price, tim_business_price, commission_rate, is_available, is_premium, max_purchases_per_user, created_at, updated_at) FROM stdin;
\.


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

COPY public.wallets (id, user_id, balance, max_balance, is_active, nfc_enabled, currency, created_at, updated_at) FROM stdin;
b7676647-4621-4c82-ba4b-c9576f596812	411e62fc-4b57-41e9-9f14-3b82d2c56df6	0	\N	t	t	FCFA	2025-11-10 21:38:12.579499+00	\N
aa6a659d-6af4-4870-b909-8cfbcdc813fd	ef66697a-d911-46f8-9e1d-5d2b23bd9cd8	300	2000000	t	t	FCFA	2025-11-10 22:57:54.261422+00	2025-11-10 23:07:23.571863+00
e61956e2-a0b5-4189-8b35-8a023e61435b	03becfc8-6077-4baa-bfc7-bc941df5d2c8	547	2000000	t	t	FCFA	2025-11-10 22:42:16.571604+00	2025-11-16 07:48:39.926337+00
ea50ae67-6aa7-429a-b290-d329f29e64a0	7ab1ddf9-a059-4ddc-835c-e97ca2cd59b2	2600	\N	t	t	FCFA	2025-11-10 21:51:49.397263+00	2025-11-16 19:14:29.671644+00
4298045d-0e19-4dac-a698-ef7de26da943	51eac304-d12e-4dc2-b377-a60c757ff1c8	350	2000000	t	t	FCFA	2025-11-16 18:50:25.42057+00	2025-11-16 19:15:28.848107+00
\.


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

COPY public.workflows (id, name, description, status, category, triggers, executions, success_rate, steps, last_run, created_at, updated_at) FROM stdin;
\.



--
-- Name: admin_stock admin_stock_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.admin_stock
    ADD CONSTRAINT admin_stock_pkey PRIMARY KEY (id);


--
-- Name: advertisements advertisements_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.advertisements
    ADD CONSTRAINT advertisements_pkey PRIMARY KEY (id);


--
-- Name: alembic_version alembic_version_pkc; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.alembic_version
    ADD CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num);


--
-- Name: cards cards_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cards
    ADD CONSTRAINT cards_pkey PRIMARY KEY (id);


--
-- Name: cards_virtual cards_virtual_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cards_virtual
    ADD CONSTRAINT cards_virtual_pkey PRIMARY KEY (id);


--
-- Name: cards_virtual_user cards_virtual_user_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cards_virtual_user
    ADD CONSTRAINT cards_virtual_user_pkey PRIMARY KEY (id);


--
-- Name: cinetpay_transfers cinetpay_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cinetpay_transfers
    ADD CONSTRAINT cinetpay_transfers_pkey PRIMARY KEY (id);


--
-- Name: cinetpay_transfers cinetpay_transfers_reference_key; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cinetpay_transfers
    ADD CONSTRAINT cinetpay_transfers_reference_key UNIQUE (reference);


--
-- Name: cities cities_branch_code_key; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cities
    ADD CONSTRAINT cities_branch_code_key UNIQUE (branch_code);


--
-- Name: cities cities_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cities
    ADD CONSTRAINT cities_pkey PRIMARY KEY (id);


--
-- Name: commission_rates commission_rates_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.commission_rates
    ADD CONSTRAINT commission_rates_pkey PRIMARY KEY (id);


--
-- Name: countries countries_code_key; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.countries
    ADD CONSTRAINT countries_code_key UNIQUE (code);


--
-- Name: countries countries_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.countries
    ADD CONSTRAINT countries_pkey PRIMARY KEY (id);


--
-- Name: device_capabilities device_capabilities_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.device_capabilities
    ADD CONSTRAINT device_capabilities_pkey PRIMARY KEY (id);


--
-- Name: loans loans_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.loans
    ADD CONSTRAINT loans_pkey PRIMARY KEY (id);


--
-- Name: nfc_card_transactions nfc_card_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.nfc_card_transactions
    ADD CONSTRAINT nfc_card_transactions_pkey PRIMARY KEY (id);


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

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


--
-- Name: recharge_commissions recharge_commissions_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.recharge_commissions
    ADD CONSTRAINT recharge_commissions_pkey PRIMARY KEY (id);


--
-- Name: tim_business_recharges tim_business_recharges_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.tim_business_recharges
    ADD CONSTRAINT tim_business_recharges_pkey PRIMARY KEY (id);


--
-- Name: tim_business_recharges tim_business_recharges_reference_key; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.tim_business_recharges
    ADD CONSTRAINT tim_business_recharges_reference_key UNIQUE (reference);


--
-- Name: timcash_company_account timcash_company_account_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.timcash_company_account
    ADD CONSTRAINT timcash_company_account_pkey PRIMARY KEY (id);


--
-- Name: transactions transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.transactions
    ADD CONSTRAINT transactions_pkey PRIMARY KEY (id);


--
-- Name: virtual_card_prices virtual_card_prices_card_color_key; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.virtual_card_prices
    ADD CONSTRAINT virtual_card_prices_card_color_key UNIQUE (card_color);


--
-- Name: virtual_card_prices virtual_card_prices_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.virtual_card_prices
    ADD CONSTRAINT virtual_card_prices_pkey PRIMARY KEY (id);


--
-- Name: wallets wallets_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.wallets
    ADD CONSTRAINT wallets_pkey PRIMARY KEY (id);


--
-- Name: wallets wallets_user_id_key; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.wallets
    ADD CONSTRAINT wallets_user_id_key UNIQUE (user_id);


--
-- Name: workflows workflows_pkey; Type: CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.workflows
    ADD CONSTRAINT workflows_pkey PRIMARY KEY (id);


--
-- Name: ix_admin_stock_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_admin_stock_id ON public.admin_stock USING btree (id);


--
-- Name: ix_advertisements_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_advertisements_id ON public.advertisements USING btree (id);


--
-- Name: ix_cards_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_cards_id ON public.cards USING btree (id);


--
-- Name: ix_cards_uid; Type: INDEX; Schema: public; Owner: timcash
--

CREATE UNIQUE INDEX ix_cards_uid ON public.cards USING btree (uid);


--
-- Name: ix_cards_virtual_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_cards_virtual_id ON public.cards_virtual USING btree (id);


--
-- Name: ix_cards_virtual_user_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_cards_virtual_user_id ON public.cards_virtual_user USING btree (id);


--
-- Name: ix_cities_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_cities_id ON public.cities USING btree (id);


--
-- Name: ix_commission_rates_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_commission_rates_id ON public.commission_rates USING btree (id);


--
-- Name: ix_countries_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_countries_id ON public.countries USING btree (id);


--
-- Name: ix_device_capabilities_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_device_capabilities_id ON public.device_capabilities USING btree (id);


--
-- Name: ix_loans_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_loans_id ON public.loans USING btree (id);


--
-- Name: ix_nfc_card_transactions_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_nfc_card_transactions_id ON public.nfc_card_transactions USING btree (id);


--
-- Name: ix_notifications_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_notifications_id ON public.notifications USING btree (id);


--
-- Name: ix_transactions_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_transactions_id ON public.transactions USING btree (id);


--
-- Name: ix_transactions_reference; Type: INDEX; Schema: public; Owner: timcash
--

CREATE UNIQUE INDEX ix_transactions_reference ON public.transactions USING btree (reference);


--
-- Name: ix_virtual_card_prices_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_virtual_card_prices_id ON public.virtual_card_prices USING btree (id);


--
-- Name: ix_wallets_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_wallets_id ON public.wallets USING btree (id);


--
-- Name: ix_workflows_id; Type: INDEX; Schema: public; Owner: timcash
--

CREATE INDEX ix_workflows_id ON public.workflows USING btree (id);


--
-- Name: cards cards_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cards
    ADD CONSTRAINT cards_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: cards_virtual_user cards_virtual_user_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cards_virtual_user
    ADD CONSTRAINT cards_virtual_user_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: cities cities_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.cities
    ADD CONSTRAINT cities_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.countries(id);


--
-- Name: loans loans_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.loans
    ADD CONSTRAINT loans_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: nfc_card_transactions nfc_card_transactions_card_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.nfc_card_transactions
    ADD CONSTRAINT nfc_card_transactions_card_id_fkey FOREIGN KEY (card_id) REFERENCES public.nfc_cards(id);


--
-- Name: nfc_card_transactions nfc_card_transactions_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.nfc_card_transactions
    ADD CONSTRAINT nfc_card_transactions_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.transactions(id);


--
-- Name: notifications notifications_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.transactions(id);


--
-- Name: notifications notifications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: recharge_commissions recharge_commissions_recharge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.recharge_commissions
    ADD CONSTRAINT recharge_commissions_recharge_id_fkey FOREIGN KEY (recharge_id) REFERENCES public.tim_business_recharges(id);


--
-- Name: tim_business_recharges tim_business_recharges_beneficiary_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.tim_business_recharges
    ADD CONSTRAINT tim_business_recharges_beneficiary_user_id_fkey FOREIGN KEY (beneficiary_user_id) REFERENCES public.users(id);


--
-- Name: tim_business_recharges tim_business_recharges_business_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.tim_business_recharges
    ADD CONSTRAINT tim_business_recharges_business_user_id_fkey FOREIGN KEY (business_user_id) REFERENCES public.users(id);


--
-- Name: transactions transactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.transactions
    ADD CONSTRAINT transactions_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: wallets wallets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timcash
--

ALTER TABLE ONLY public.wallets
    ADD CONSTRAINT wallets_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
--

