Initial commit

**Motivations:**
- Initialisation du versionning git pour le projet

**Root causes:**
- N/A (Nouveau projet)

**Correctifs:**
- N/A

**Evolutions:**
- Structure initiale du projet
- Ajout du .gitignore

**Pages affectées:**
- Tous les fichiers
This commit is contained in:
2026-03-03 22:24:17 +01:00
commit e031c9a1d2
155 changed files with 22334 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
-- BLOC 2: Deferred validation (10 min) for sales. Run after 001_sale_listings.sql.
-- Adds validated_at: when accept is called, sold_at = now(), validated_at = now() + 10 minutes.
-- Coins are transferred only when validated_at <= now() (processed by processValidatedSales).
-- Buyer can deliver only after status = 'validated'.
ALTER TABLE sale_listings ADD COLUMN IF NOT EXISTS validated_at TIMESTAMPTZ;
ALTER TABLE sale_listings DROP CONSTRAINT IF EXISTS sale_listings_status_check;
ALTER TABLE sale_listings ADD CONSTRAINT sale_listings_status_check
CHECK (status IN ('active', 'sold', 'expired', 'rejected', 'validated'));
COMMENT ON COLUMN sale_listings.validated_at IS 'When the sale becomes validated (coins transfer allowed). Set at accept to now() + 10 minutes; after processValidatedSales runs, status becomes validated.';