Age update automatically every year and DOB(Year mandatory) should be taken
Issue Description
Currently, the system stores the user's age directly in the database. Because of this, the age does not update automatically as time passes. Age should change every year based on the user's Date of Birth (DOB).
To solve this, the system should store the user's Date of Birth (DOB) and automatically calculate the age from the DOB whenever the user profile is accessed or updated.
For existing users who only have age stored but no DOB, the system should automatically generate a default DOB using the formula:
DOB = January 1 of (Current Year - User Age)
This generated DOB should be marked with a flag (dob_auto_generated = true) to indicate that it was created automatically by the system.
After this implementation:
- New users must provide their Date of Birth during registration.
- The system will calculate and update the age automatically every year based on the stored DOB.
- Existing users without DOB will have an auto-generated DOB derived from their stored age.
- The database will store
date_of_birthanddob_auto_generatedfields in the users table.
Edited by POORNA CHANDRA SAI TEJA KUMPATLA