Conversation
- Introduced 'is_on_free_trial' field in the server entity to track free trial status. - Added minimum and maximum recharge amount settings in the payment configuration. - Updated various services and controllers to handle free trial eligibility and recharge limits. - Enhanced UI to reflect changes in server management and payment processes.
Prevented errors from being thrown if the user doesn't configure email
|
Thanks for the PR and clear summary - looks like a solid set of changes :) I’ll go through the code and test it in the next days. If I notice anything that needs adjusting or polishing, I’ll leave comments. Also, if you haven’t joined yet, feel free to hop into our Discord - it’s a good place to discuss things more directly or get quick feedback :) |
|
Thanks for this swift reply. I have joined the Discord and hope this contribution is well appreciated. If you have any problems or questions feel free to ask me. |
| { | ||
| public function getDescription(): string | ||
| { | ||
| return ''; |
| { | ||
| public function getDescription(): string | ||
| { | ||
| return ''; |
| private Server $server; | ||
|
|
||
| #[ORM\OneToOne(targetEntity: Product::class)] | ||
| #[ORM\ManyToOne(targetEntity: Product::class)] |
| { | ||
| public function getDescription(): string | ||
| { | ||
| return ''; |
There was a problem hiding this comment.
Thanks for the contribution! I see this migration was generated via doctrine:migrations:diff on a different local setup. It contains a lot of noise (index renames, default/colllation/type changes) that aren’t part of the feature and may break existing data (e.g. new UNIQUE constraints on server_product).
Could you please:
- Rebase on current main and regenerate a clean migration that includes only the intentional changes from this PR (e.g. the free-trial columns)?
- Drop unrelated index renames and type/default flips (unless there’s a mapping change that explicitly requires them and we agree on it).
- Confirm whether the new UNIQUE constraints are intended; if not, please revert them.
I try to keep migrations minimal and deterministic so different environments don’t fight over names/collations. Thanks!
This pull request introduces multiple changes to the database schema and application logic, focusing on adding support for free trials, enhancing payment settings, and improving server management. Below is a summary of the most important changes grouped by theme:
Database Schema Changes
user_paymenttable to track user payments, including fields for session ID, status, amount, currency, and related foreign keys (used_voucheranduser_id) (migrations/Version20250731202312.php).is_on_free_trialfield in theservertable to track servers created with a free trial (migrations/Version20250801080659.php).productandserver_producttables to change the type ofeggs_configurationfromVARCHAR(255)toLONGTEXT(migrations/Version20250801084437.php). This allows longer and more complex configurations.settingtable (migrations/Version20250802175001.php). Stripe requires transactions to be at least 50 cents and so a minimum threshold is required.Free Trial Support
ProductPriceInterfaceto handle free trial information, includinghasFreeTrial,getFreeTrialValue, andgetFreeTrialUnit(src/Core/Contract/ProductPriceInterface.php).CartControllerto check user eligibility for free trials (e.g., first-time customers) and pass this information to the view (src/Core/Controller/CartController.php).Payment Enhancements
BalanceControllerandCartController, ensuring user-entered amounts adhere to these constraints (src/Core/Controller/BalanceController.php).Server Management Improvements
ServerAutoRenewalServicedependency in theCartController(src/Core/Controller/CartController.php). This makes the application compliant towards EU Consumer Rights and canceling a server is as clear as possible.ServerCrudControllerto display theisOnFreeTrialfield in server details, ensuring it is non-editable (src/Core/Controller/Panel/ServerCrudController.php).Miscellaneous
ServerControllerto use a repository method that fetches servers along with their associated products (src/Core/Controller/ServerController.php).