Skip to content

📜 feat: Add script to set balance for user#4506

Merged
danny-avila merged 2 commits into
danny-avila:mainfrom
dennis531:feature/set-balance
Dec 3, 2024
Merged

📜 feat: Add script to set balance for user#4506
danny-avila merged 2 commits into
danny-avila:mainfrom
dennis531:feature/set-balance

Conversation

@dennis531

Copy link
Copy Markdown
Contributor

Summary

Add node script set-balance to set balance of specific user. This script bases on the add-balance script. This script simplifies the implementation of a balance-accruing system so that users can be granted a balance every month, for example.

Related #4320

Change Type

Please delete any irrelevant options.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.

Test Configuration:

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

@berry-13

Copy link
Copy Markdown
Collaborator

since this will create a duplicate

after finding the user, the script should:

  1. Display their current balance first
  2. If no balance amount was provided when running the script, prompt the user to enter the balance
  3. If a balance amount was included when running the script, update the balance with that amount directly

this removes the redundant add-balance step and makes the flow more straightforward - either taking the balance from the initial command or prompting for it after showing the current amount

@dennis531 dennis531 force-pushed the feature/set-balance branch from 44c46a1 to 253327f Compare October 23, 2024 07:56
Comment thread config/set-balance.js Outdated
@danny-avila danny-avila changed the title feat: Add script to set balance for user 📜 feat: Add script to set balance for user Dec 3, 2024
@danny-avila danny-avila merged commit d6f7279 into danny-avila:main Dec 3, 2024
@dennis531 dennis531 deleted the feature/set-balance branch December 5, 2024 13:06
BertKiv pushed a commit to BertKiv/LibreChat that referenced this pull request Dec 10, 2024
* feat: Add script to set balance for user

* Show current balance before updating
MichielMAnalytics pushed a commit to MichielMAnalytics/ProAI that referenced this pull request Jun 6, 2025
* feat: Add script to set balance for user

* Show current balance before updating
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.

3 participants