# Flash Delivery v1-v2 Merge Implementation Plan > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. **Goal:** Merge the flash-delivery, rider-capacity and merchant-list work from `test-202609v1` into `test-202609v2` without losing v2 payment-gate or night-market self-delivery behavior. **Architecture:** Keep the v1 flash-delivery application service as the fulfillment baseline because it owns multi-pickup stops, vehicle snapshots, capacity checks and route fallback. Reapply v2 payment-gate dependencies and behavior to that baseline, then merge DTO, controller, localization and tests so rider new-task filtering applies both vehicle and accepted payment type. **Tech Stack:** Java 21, Spring Boot, MyBatis, JUnit 5, Mockito, MySQL migration documentation. **Spec:** `specs/024-flash-delivery/spec.md`, `specs/031-payment-method-config/spec.md` ## Global Constraints - Do not execute database SQL; record migrations only in `updatesql/sql.md`. - Preserve v2 deletion of `messages_vi.properties`; do not reintroduce Vietnamese resources. - Preserve existing night-market self-delivery behavior and payment-method gate behavior. - Run affected flash-delivery and payment-gate tests with JDK 21 before committing. --- ### Task 1: Resolve production conflicts **Files:** - Modify: `ruoyi-admin/src/main/java/com/ruoyi/app/flashdelivery/service/FlashDeliveryApplicationService.java` - Modify: `ruoyi-admin/src/main/java/com/ruoyi/app/flashdelivery/controller/FlashDeliveryRiderController.java` - Modify: `ruoyi-admin/src/main/java/com/ruoyi/app/flashdelivery/dto/FlashDeliveryHomeView.java` - Modify: `ruoyi-admin/src/main/java/com/ruoyi/app/flashdelivery/dto/FlashDeliveryQuoteRequest.java` **Interfaces:** - Consumes: `PaymentMethodGateService`, `RiderDeliveryAcceptanceService`, vehicle snapshots and multi-pickup stop services. - Produces: vehicle-and-payment filtered rider new-task queries, payment-gated flash creation and idempotent rider payment confirmation. - [ ] Keep v1 multi-pickup, vehicle route/pricing, estimated-duration fallback and rider-capacity calls. - [ ] Add v2 `PaymentMethodGateService` dependency, home/quote payment options, payment validation, rider accepted-payment filtering and `confirmPayment` behavior. - [ ] Combine `newTask` query constraints using both `vehicle_type` and accepted `pay_type` values. ### Task 2: Resolve contract, localization and test conflicts **Files:** - Modify: `ruoyi-admin/src/main/resources/i18n/messages*.properties` - Delete: `ruoyi-admin/src/main/resources/i18n/messages_vi.properties` - Modify: `ruoyi-admin/src/test/java/com/ruoyi/app/flashdelivery/service/FlashDeliveryApplicationServiceTest.java` - Modify: `ruoyi-admin/src/test/java/com/ruoyi/app/flashdelivery/dto/FlashDeliveryRiderOrderListViewTest.java` **Interfaces:** - Consumes: merged production APIs from Task 1. - Produces: tests asserting both vehicle and payment behavior, while maintaining v2 language policy. - [ ] Retain v2 payment and self-delivery messages plus v1 vehicle/capacity messages in supported resource bundles. - [ ] Keep `messages_vi.properties` deleted because v2 intentionally removed Vietnamese support. - [ ] Update test fixtures for the merged application-service constructor and assert neither payment filtering nor vehicle filtering is dropped. ### Task 3: Verify and integrate **Files:** - Modify: `specs/024-flash-delivery/tasks.md` - Modify: `updatesql/sql.md` only if merge resolution requires preserving both documented migrations. **Interfaces:** - Consumes: merged production and test sources. - Produces: one merge commit on `test-202609v2`. - [ ] Verify no conflict markers remain and that both self-delivery DDL and vehicle DDL remain documented. - [ ] Run JDK 21 targeted flash-delivery and payment-method tests, then `git diff --check`. - [ ] Review staged paths, commit the merge, and report the SHA plus unexecuted external integration checks.