Enhance the functionality of the web service
Given:
A service on Laravel (admin panel Orchid) that allows sending notifications via Telegram/Viber bot to users
Task:
Implement the functionality of sending "redirect links" based on the existing logic with the option to receive results via webhook:
1. In the admin panel of the service, it is necessary to add the entity "Redirect link" with the following configuration options:
- Link name
- Redirect link (to a third-party service that will send a webhook to our service with the result upon the user meeting the conditions on their side)
- Link lifespan (after the time expires, the link becomes invalid)
- Response lifespan (after the time expires, the sent message is marked as failed)
2. In the admin panel of the service, it is necessary to add the entity "Redirect result" with the following configuration options:
- Redirect link
- Redirect status (successful/failed)
- Redirect data (a field for storing data received via webhook)
3. Expand the current message sending functionality with the logic of sending links (unique for each user) with the option to receive results via webhook:
- When sending a message to the user on Telegram/Viber, a button "Go to link" (or with the text specified when creating the link) is added
- When the button is pressed, the user goes to the redirect link (the redirect occurs on our service's side)
- The fact of the redirect is saved in the database in the entity "Redirect result"
- After going to the link on the third-party service, the condition is met and a webhook is sent to our service with the result
- The result is saved in the database in the entity "Redirect result"
4. Upon a successful redirect result, the user is awarded bonuses (the logic for awarding bonuses is already implemented in the service)
Conditions:
- All new logic must be covered by unit tests
- All changes are made via git
- All actions must be accompanied by logs on the service side