refactor: simplify order status model — remove DELIVERY_FEE_ADJUSTMENT and PAYMENT_VERIFICATION
- Add deliveryFeeLocked field to Order model - Remove DELIVERY_FEE_ADJUSTMENT and PAYMENT_VERIFICATION statuses (11→8) - 3 order paths: delivery+online (locked→unlocked→paid), pickup+online (unlocked→paid), pickup+on_pickup (direct to in_progress) - Update checkout to use PENDING_PAYMENT + deliveryFeeLocked - Update payment flow to stay in PENDING_PAYMENT until admin confirms - Update admin UI to use deliveryFeeLocked instead of status check - Update client payment UI with new deliveryFeeLocked logic
This commit is contained in:
@@ -17,6 +17,14 @@ describe('canTransitionAdminOrderStatus', () => {
|
||||
expect(canTransitionAdminOrderStatus({ status: 'DRAFT', ...delivery }, 'PAID')).toBe(false)
|
||||
})
|
||||
|
||||
it('PENDING_PAYMENT → PAID', () => {
|
||||
expect(canTransitionAdminOrderStatus({ status: 'PENDING_PAYMENT', ...delivery }, 'PAID')).toBe(true)
|
||||
})
|
||||
|
||||
it('PENDING_PAYMENT → CANCELLED', () => {
|
||||
expect(canTransitionAdminOrderStatus({ status: 'PENDING_PAYMENT', ...delivery }, 'CANCELLED')).toBe(true)
|
||||
})
|
||||
|
||||
it('PAID → IN_PROGRESS', () => {
|
||||
expect(canTransitionAdminOrderStatus({ status: 'PAID', ...delivery }, 'IN_PROGRESS')).toBe(true)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user