Skip to content

Conversation

@JayWebtech
Copy link
Contributor

Dynamic Congratulatory Messages for Impact Product Level Claims

Description

This PR implements a dynamic congratulatory message system that provides personalized feedback when users claim different levels of the DeCleanup Impact Product. The messages are tailored based on whether it's the user's first claim, a level upgrade, or the final milestone.

Changes

  • Added a new helper function getCongratulatoryMessage in rewards.controller.ts to generate context-aware messages
  • Updated the claimReward endpoint to include the congratulatory message in the response
  • Implemented three distinct message types:
    1. First Level (Level 1): Encourages sharing and future engagement
    2. Level Upgrade (Levels 2-9): Acknowledges progress and encourages continued participation
    3. Final Milestone (Level 10): Celebrates completion and hints at future updates

Technical Details

  • Messages are generated server-side to ensure consistency
  • Integration with existing impact level tracking system
  • Maintains backward compatibility with existing API response structure
  • Added message field to the API response payload

Testing

The feature can be tested using Postman with the following scenarios:

  1. First-time claim (Level 1)
  2. Level upgrade (Levels 2-9)
  3. Final milestone (Level 10)

Test Cases

  • Verify correct message generation for each level
  • Confirm message inclusion in API response
  • Validate error handling for invalid levels
  • Check authentication requirements

API Response Example

{
    "success": true,
    "data": {
        "numericLevel": 1,
        "impactLevel": "NEWBIE",
        "shouldConnectTwitter": true,
        "twitterShareUrl": null,
        "message": "Congratulations! You've just received the first level of DeCleanup Impact Product. Come back for more! Share your referral with friends and earn more DCU Points."
    }
}

Related Issues

Checklist

  • Code follows project style guidelines
  • Added appropriate error handling
  • Checked for potential security implications

@LuminaEnvision LuminaEnvision requested a review from mr13tech May 4, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic Confirmation Message Logic – Impact Product Claims

1 participant