Skip to content

Data Model Entities

Kolon detayları domain kararlarını yansıtır. Alan anlamları: Data Dictionary.

members

Kolon Tip Constraint Not
id uuid PK
display_name text not null, 1-50 Kamusal
email text unique, not null Hiçbir kamusal view'da yer almaz
gender enum not null male/female; Gender Wall temeli
languages text[] null TR/EN/AR...
city_id uuid FK cities(id) Pilot şehir
membership_status enum not null, default pending pending/approved/suspended
role enum not null, default member RBAC
created_at / verified_at / deleted_at timestamptz

places

Kolon Tip Constraint Not
id uuid PK
type enum not null mosque/cafe/restaurant/other
name text not null
address text not null
coordinates point not null Coarse location ile sorgulanır
amenity_tags text[] null halal, prayer_space, women_friendly, bookstore
status enum not null, default active active/pending/rejected
created_by uuid FK members(id), null Faz 2 nominasyon

mosque_details

Kolon Tip Constraint Not
place_id uuid PK, FK places(id) 1:1
women_section bool default false Filtre alanı
ablution_area bool default false Filtre alanı
library bool default false
has_english_imam bool default false Filtre alanı
prayer_calc_source text null Q-018

events

Kolon Tip Constraint Not
id uuid PK
place_id uuid FK places(id), not null PDR-006
creator_id uuid FK members(id), not null Organizatör
title / description text not null
start_at / end_at timestamptz not null
category enum not null religious/social/cultural
gender_type enum not null men_only/women_only/family/public
language text not null
capacity int not null, > 0 Atomik düşüm
attendee_count int not null, default 0 Denormalize sayaç
price_info text null Ödeme alınmaz
status enum not null draft/pending_moderation/published/cancelled/closed
after_prayer bool default false After Prayer mini buluşması işareti
prayer enum null after_prayer ise vakit

attendances

Kolon Tip Constraint Not
id uuid PK
event_id uuid FK events(id)
member_id uuid FK members(id)
created_at timestamptz not null
cancelled_at timestamptz null Vazgeçme

Unique: (event_id, member_id) - aynı kullanıcı iki kez katılamaz.

joins

Kolon Tip Constraint Not
id uuid PK
mosque_id uuid FK places(id) type=mosque olmalı
member_id uuid FK members(id)
prayer enum not null fajr..isha
prayer_date date not null
created_at timestamptz not null
expires_at timestamptz not null TTL; vakit sonrası silinir

Unique: (mosque_id, member_id, prayer, prayer_date).

questions / answers

Kolon Tip Constraint Not
questions.channel enum not null community/diyanet
questions.category text diyanet'te not null İbadet, aile, mali hayat, sosyal
questions.visibility enum not null, default public public/private
questions.anonymous_publish_allowed bool default false Diyanet kanalı
questions.status enum not null pending/published/quarantined/archived/answered
answers.question_id uuid FK questions(id)
answers.status enum not null pending/published/quarantined

circles / circle_members

Kolon Tip Constraint Not
circles.name / purpose text not null Amaç zorunlu
circles.max_members int not null Q-022
circles.join_policy enum not null invite/approval
circle_members.role enum not null, default member member/owner/moderator

moderation_queue / audit_log

Kolon Tip Constraint Not
moderation_queue.entity_type text not null question/answer/review/event/place
moderation_queue.entity_id uuid not null
moderation_queue.status enum not null pending/approved/rejected
audit_log.actor_id uuid not null Moderatör
audit_log.action text not null Değiştirilemez kayıt

Index'ler

Tablo Index Amaç
places GIST(coordinates) Yakındaki mekân sorgusu
events (place_id, start_at) Mekân detayında etkinlik listesi
events (gender_type, start_at) Gender filtreli akış
joins (mosque_id, prayer, prayer_date) Vakit bazlı sayaç
joins (expires_at) TTL temizliği
questions (channel, status, category) Kuyruk ve arama