Data Architecture
Design DB schema with the following tables:
users (id, telegram_id, name, is_deleted, created_at)
subscriptions (id, user_id, type, start_date, end_date, status)
chats (id, user_id, assistant_id)
messages (id, chat_id, sender_type, sender_id, text, timestamp)
📋 Acceptance Criteria
✅ What to consider:
- All database fields must have the correct data types.
- Constraints (e.g. NOT NULL, UNIQUE, FOREIGN KEY) must be enforced.
- Data insertion should succeed only when input matches the schema.
✅ Acceptance Criteria (AC):
-
GIVEN the database schema is deployed
-
WHEN valid data is inserted into the tables
-
THEN all fields accept values according to their defined types and constraints
-
GIVEN the schema includes constraints
-
WHEN invalid or duplicate data is inserted
-
THEN the database rejects it with the appropriate error
-
GIVEN foreign key relationships are defined
-
WHEN a related record is inserted
-
THEN the relationship is correctly enforced and stored
Edited by Arina Agafonova