We need an endpoint that lists the currently available tokens. The application is configured to always have 4 ready-to-use tokens. However, there might be instances where fewer than 4 tokens are available.
The endpoint should perform the following actions:
Retrieve the available ready-to-use tokens.
If fewer than 4 tokens are available, generate the remaining tokens to ensure there are always 4 tokens available.
Return the list of available tokens after ensuring the count is up to 4.
Acceptance Criteria:
Create an endpoint to list available tokens.
The endpoint should first retrieve the ready-to-use tokens from the database.
If there are fewer than 4 tokens available:
Generate the remaining tokens to ensure a total of 4 tokens.
Save the newly generated tokens to the database.
Return a list of 4 available tokens.
Additional Notes:
Ensure that the token generation logic adheres to existing validation rules.
Handle any potential errors in the token retrieval or generation process.
We need an endpoint that lists the currently available tokens. The application is configured to always have 4 ready-to-use tokens. However, there might be instances where fewer than 4 tokens are available.
The endpoint should perform the following actions:
Acceptance Criteria:
Additional Notes: