merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 20c364adc4f246a06a07b859c647f4e705dc3e42
parent ef93cc616fdc7085f422d6966ffed932076c8466
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
Date:   Sun,  8 Dec 2024 14:55:45 +0100

changes for the merge of master

Diffstat:
Msrc/backenddb/Makefile.am | 1+
Asrc/backenddb/merchant-0014.sql | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/src/backenddb/Makefile.am b/src/backenddb/Makefile.am @@ -30,6 +30,7 @@ sql_DATA = \ merchant-0011.sql \ merchant-0012.sql \ merchant-0013.sql \ + merchant-0014.sql \ drop.sql BUILT_SOURCES = \ diff --git a/src/backenddb/merchant-0014.sql b/src/backenddb/merchant-0014.sql @@ -0,0 +1,73 @@ +-- +-- This file is part of TALER +-- Copyright (C) 2024 Taler Systems SA +-- +-- TALER is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 3, or (at your option) any later version. +-- +-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +-- A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with +-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +-- + +-- @file merchant-0012.sql +-- @brief Create table to store donau related information +-- @author Bohdan Potuzhnyi +-- @author Vlada Svirsh + +BEGIN; + +-- Check patch versioning is in place. +SELECT _v.register_patch('merchant-0014', NULL, NULL); + +SET search_path TO merchant; + +CREATE TABLE IF NOT EXISTS merchant_donau_keys + (donau_keys_serial BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE + ,donau_url TEXT PRIMARY KEY + ,keys_json TEXT NOT NULL + ); + +COMMENT ON TABLE merchant_donau_keys + IS 'Here we store the cached /keys response from Donau in JSON format'; +COMMENT ON COLUMN merchant_donau_keys.donau_keys_serial + IS 'Unique serial identifier for each cached key entry'; +COMMENT ON COLUMN merchant_donau_keys.donau_url + IS 'Base URL of Donau associated with these keys'; +COMMENT ON COLUMN merchant_donau_keys.keys_json + IS 'JSON string of the /keys as generated by Donau'; + +CREATE TABLE IF NOT EXISTS merchant_donau_instances + (donau_instances_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY + ,donau_url TEXT NOT NULL + ,charity_name TEXT NOT NULL + ,charity_pub_key BYTEA CHECK (LENGTH(charity_pub_key)=32) + ,charity_id BIGINT NOT NULL + ,charity_max_per_year taler_amount_currency NOT NULL + ,charity_receipts_to_date taler_amount_currency NOT NULL + ,current_year INT8 NOT NULL + ); + +COMMENT ON TABLE merchant_donau_instances + IS 'Here we store information about individual Donau instances, including details about associated charities and donation limits'; +COMMENT ON COLUMN merchant_donau_instances.donau_instances_serial + IS 'Unique serial identifier for each Donau instance'; +COMMENT ON COLUMN merchant_donau_instances.donau_url + IS 'The URL associated with the Donau system for this instance'; +COMMENT ON COLUMN merchant_donau_instances.charity_pub_key + IS 'The public key of the charity organization linked to this instance, with a 32-byte length constraint'; +COMMENT ON COLUMN merchant_donau_instances.charity_id + IS 'The unique identifier for the charity organization linked to this Donau instance'; +COMMENT ON COLUMN merchant_donau_instances.charity_max_per_year + IS 'Maximum allowable donation amount per year for the charity associated with this instance, stored in taler_amount_currency'; +COMMENT ON COLUMN merchant_donau_instances.charity_receipts_to_date + IS 'The total amount of donations received to date for this instance, stored in taler_amount_currency'; +COMMENT ON COLUMN merchant_donau_instances.current_year + IS 'The current year for tracking donations for this instance, stored as an 8-byte integer'; + + +COMMIT; +\ No newline at end of file