feat(bisaya): implement child marriage proposal and wooing features, update age rules and relationships
All checks were successful
Deploy to production / deploy (push) Successful in 3m15s

This commit is contained in:
Torsten Schulz (local)
2026-09-08 14:46:26 +02:00
parent 0a9174c486
commit 3d235a621a
12 changed files with 281 additions and 90 deletions

View File

@@ -112,8 +112,11 @@ private:
JOIN falukant_data."character" AS c
ON c.user_id = fu.id
JOIN falukant_data.relationship AS rel2
ON rel2.character1_id = c.id
OR rel2.character2_id = c.id
ON p.relationship_id = rel2.id
OR (
p.relationship_id IS NULL
AND (rel2.character1_id = c.id OR rel2.character2_id = c.id)
)
JOIN falukant_type.relationship AS rt2
ON rt2.id = rel2.relationship_type_id
AND rt2.tr = 'engaged'
@@ -121,19 +124,15 @@ private:
-- Die Feier muss für diese bereits bestehende Verlobung bestellt worden sein.
AND p.created_at >= rel2.created_at
-- Ein realer Tag entspricht einem Spieljahr: Hochzeit ab 14.
AND c.birthdate <= CURRENT_DATE - INTERVAL '14 days'
AND (
(rel2.character1_id = c.id AND EXISTS (
SELECT 1 FROM falukant_data."character" partner
WHERE partner.id = rel2.character2_id
AND partner.birthdate <= CURRENT_DATE - INTERVAL '14 days'
))
OR
(rel2.character2_id = c.id AND EXISTS (
SELECT 1 FROM falukant_data."character" partner
WHERE partner.id = rel2.character1_id
AND partner.birthdate <= CURRENT_DATE - INTERVAL '14 days'
))
AND EXISTS (
SELECT 1 FROM falukant_data."character" spouse1
WHERE spouse1.id = rel2.character1_id
AND spouse1.birthdate <= CURRENT_DATE - INTERVAL '14 days'
)
AND EXISTS (
SELECT 1 FROM falukant_data."character" spouse2
WHERE spouse2.id = rel2.character2_id
AND spouse2.birthdate <= CURRENT_DATE - INTERVAL '14 days'
)
)
RETURNING character1_id, character2_id