Commit Graph

29 Commits

Author SHA1 Message Date
javayhu
afdaeba2be refactor: remove updateUserLastRefreshAt function and its calls to streamline credit update logic 2025-08-24 09:56:19 +08:00
javayhu
258ddad399 refactor: consolidate credit addition logic into a single function to improve maintainability and clarity 2025-08-24 09:24:59 +08:00
javayhu
e6bc1ea9e8 refactor: rename 'credits' to 'amount' in credit-related configurations and components for consistency 2025-08-24 01:16:39 +08:00
javayhu
e15d76461f feat: add function to check if subscription credits can be added based on last refresh time 2025-08-23 20:21:54 +08:00
javayhu
1ff42009d8 chore: update function parameters planId instead of priceId 2025-08-23 20:07:32 +08:00
javayhu
a6a5d92dc1 refactor: implement batch processing for expired credits in credit cron job 2025-08-22 00:39:17 +08:00
javayhu
7c0e6a5131 chore: enhance error handling and optimize database queries in user credit functions 2025-08-18 00:58:46 +08:00
javayhu
f1d02720d0 refactor: restructure credit distribution logic and enhance user credit handling 2025-08-17 23:26:10 +08:00
javayhu
064576f48e refactor: streamline user payment retrieval by utilizing a subquery for latest active payments 2025-08-10 15:54:46 +08:00
javayhu
0be53d3251 feat: optimize credit distribution by batching user processing and enhancing database queries 2025-08-10 14:26:53 +08:00
javayhu
2814f87578 feat: update user last refresh time and refine user selection criteria 2025-08-10 13:53:48 +08:00
javayhu
78f76f35b9 feat: add basic auth to distribute credits cron jobs 2025-08-10 11:48:53 +08:00
javayhu
346d154604 feat: support cron jobs 2025-08-10 11:13:21 +08:00
javayhu
a89910489a refactor: rename addSubscriptionRenewalCredits to addSubscriptionCredits for clarity 2025-07-13 09:26:16 +08:00
javayhu
f5e639bbc7 refactor: improve plan filtering in credits logic 2025-07-13 00:53:31 +08:00
javayhu
52aeb2d61c refactor: rename functions to remove 'IfNeed' suffix for clarity and consistency 2025-07-13 00:37:01 +08:00
javayhu
31116cbf8b refactor: remove unused Stripe dependency and update credit expiration logic 2025-07-12 23:41:50 +08:00
javayhu
b4e8585929 chore: add credits when subscription renewal and lifetime payment 2025-07-12 17:27:35 +08:00
javayhu
a5c6c8b493 feat: display user email and customer ID in UserDetailViewer 2025-07-12 08:10:31 +08:00
javayhu
9f3c5e80c2 feat: add daily credit distribution function and integrate with existing credits logic 2025-07-12 00:37:49 +08:00
javayhu
6cf9d4db9c refactor: improve credit transaction filtering in processExpiredCredits and consumeCredits functions 2025-07-10 22:53:04 +08:00
javayhu
861502c28f feat: implement credit distribution for all users based on subscription status 2025-07-10 14:52:23 +08:00
javayhu
737bd7f80f feat: enhance credits management with subscription renewal and lifetime monthly credits 2025-07-10 14:42:36 +08:00
javayhu
cd710bb9ed feat: support register gift credits 2025-07-10 09:58:48 +08:00
javayhu
04f7f891a4 feat: update credit expiration handling and configuration
- Added expireDays property to credit packages and related configurations in website.tsx for better management of credit expiration.
- Modified addCredits function to handle expireDays more flexibly, allowing for undefined values.
- Updated functions for adding register gift and monthly free credits to utilize the new expireDays configuration.
- Enhanced type definitions for credits to include optional expireDays for improved clarity.
- Removed obsolete creditExpireDays from the credits configuration to streamline the codebase.
2025-07-10 01:12:11 +08:00
javayhu
adb9b80572 fix: update default expireDays assignment in addCredits function 2025-07-08 00:51:04 +08:00
javayhu
2e8f70dc76 feat: enhance credits management with new configurations
- Added credit expiration days, register gift credits, and free monthly credits options in website configuration.
- Updated credits handling functions to utilize the new configuration settings for improved flexibility and maintainability.
- Removed obsolete constants related to credits from constants.ts to streamline the codebase.
- Enhanced type definitions for credits configuration in index.d.ts for better clarity.
2025-07-08 00:48:17 +08:00
javayhu
0af0aa3b09 refactor: reorganize credit transaction types and update imports
- Moved CREDIT_TRANSACTION_TYPE from constants to a new types.ts file for better modularity.
- Updated import paths in credit-related components to reflect the new structure.
- Removed the old CREDIT_TRANSACTION_TYPE definition from constants.ts to streamline the codebase.
2025-07-06 23:25:38 +08:00
javayhu
75083b32e4 refactor: reorganize credit-related imports and enhance user feedback
- Updated import paths for credit-related actions and functions to improve module organization.
- Removed redundant refresh trigger declaration in CreditPackages component.
- Simplified success toast message in CreditPackages and PaymentForm components for clarity.
- Introduced a new credits.ts file to centralize credit management logic and improve maintainability.
2025-07-06 00:15:07 +08:00