Skip to content

feat(order): add prepaid status - #2955

Open
syedgalib wants to merge 5 commits into
sovware:developmentfrom
syedgalib:feat/order-system
Open

feat(order): add prepaid status#2955
syedgalib wants to merge 5 commits into
sovware:developmentfrom
syedgalib:feat/order-system

Conversation

@syedgalib

Copy link
Copy Markdown
Collaborator

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

How to reproduce the issue or how to test the changes

  1. Confirm Directorist\Enums\Order\Status::all() includes prepaid.
  2. Run Directorist install/update so the directorist_orders.status enum is synced with the new status.
  3. Create or update an order to prepaid and confirm payment records are not updated to an unsupported payment status.

This PR adds a prepaid order status for collected-but-not-yet-renewed payment flows and keeps payment status syncing limited to valid payment statuses.

Any linked issues

Fixes #

Checklist

@RabbiIslamRony RabbiIslamRony left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prepaid enum, REST mappings, and order/payment synchronization behavior work as intended in the targeted tests. However, the database migration introduces a blocking schema regression.

sync_order_status_enum() runs ALTER TABLE ... MODIFY status ENUM(...) DEFAULT ..., but the replacement column definition omits NOT NULL. MySQL MODIFY replaces the complete column definition, so this changes directorist_orders.status from NOT NULL to nullable. An isolated local migration test confirmed Null changed from NO to YES and a NULL status value was accepted.

Please preserve the complete status column definition, including NOT NULL and the pending default, and verify both fresh-install and existing-table upgrade paths. The migration should also confirm that existing order data remains unchanged.

Local functional validation on commit 6630660 confirmed that prepaid leaves the payment pending and a later paid transition correctly synchronizes the payment.

@RabbiIslamRony RabbiIslamRony left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked the updated migration on commit 2cb30a0. The order status column now preserves NOT NULL with the pending default. Existing-table upgrade and fresh-install tests passed, existing rows remained unchanged, prepaid values were accepted, and NULL values were rejected. The prepaid-to-paid order and payment synchronization flow also passed. Approved.

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.

2 participants