Description: This endpoint allows new users to register for an account. Upon successful registration, a verification email will be sent to the user's provided email address with a verification code.
Input Validation: The API checks if both email and password are provided in the request body. If either is missing, a 400 Bad Request error is returned.
2.
Token Generation: A unique verification token is generated for the user.
3.
User Creation: A new user record is created in the database with the provided email, hashed password, name, verification token, and a flag indicating the user is not yet verified.
4.
Email Verification: An email containing the verification token is sent to the user's provided email address. The email includes a link for the user to verify their account.
5.
Transaction Management: The operation is wrapped in a transaction to ensure that either all operations succeed or none do. In case of any errors, the transaction is rolled back.