Bug: No uniqueness enforcement on goal creation
Environment: Pre-live (apis-prelive.quran.foundation)
Description
POST /auth/v1/goals?mushafId=<id> does not enforce uniqueness per user + category.
Sending a second POST with the same category returns a new id and creates a second
goal rather than returning a conflict error.
Steps to reproduce
POST /auth/v1/goals?mushafId=5 with body:
{ "type": "QURAN_PAGES", "amount": 10, "category": "QURAN" }
- Note the returned
id
POST /auth/v1/goals?mushafId=5 again with the same or different amount
- A different
id is returned — both goals now exist simultaneously
Expected
Second POST should return 409 Conflict if an active goal already exists
for that user and category.
Actual
A duplicate goal is created silently. Each POST succeeds with a new id.
Bug: No uniqueness enforcement on goal creation
Environment: Pre-live (
apis-prelive.quran.foundation)Description
POST /auth/v1/goals?mushafId=<id>does not enforce uniqueness per user + category.Sending a second POST with the same category returns a new
idand creates a secondgoal rather than returning a conflict error.
Steps to reproduce
POST /auth/v1/goals?mushafId=5with body:{ "type": "QURAN_PAGES", "amount": 10, "category": "QURAN" }idPOST /auth/v1/goals?mushafId=5again with the same or differentamountidis returned — both goals now exist simultaneouslyExpected
Second
POSTshould return409 Conflictif an active goal already existsfor that user and category.
Actual
A duplicate goal is created silently. Each POST succeeds with a new
id.