> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Complete the low-price order flow by restricting it to normal orders, requiring approval confirmation, returning successful submissions to the pending list, and rejecting invalid price boundaries.
**Goal:** Complete the low-price order flow by exposing only the low-price order business type, requiring approval confirmation, returning successful submissions to the pending list, and rejecting invalid price boundaries.
**Architecture:** Reuse the existing low-price approval sheet and pure approval-list builder. Add low-price-aware order-type helpers, a pure price-boundary helper consumed by both input and submit paths, and a small success-navigation helper so ordinary orders retain their current flow.
...
...
@@ -13,7 +13,7 @@
- Preserve the user's existing `config.js` and `yarn.lock` changes.
- Use only `价格未触发最低价,其他正常单请到生意助手侧录单` when no goods triggers the minimum price.
- A low-price order is eligible when any submitted goods entry has `validMinSellPrice === 'Y'` and a current base price strictly below numeric `minSellPrice`.
- Low-price orders allow only order type `1` (`正常订单`).
- Low-price pages display only `低价订单`; the compatible payload remains `djOrderType=1 + lowPriceFlag=1`.
- Reject prices below `0` with `商品价格不能小于0元` and prices above `100000` with `商品价格不能大于100000元`.
- Do not add dependencies, APIs, or `import.meta` to mini-program runtime files.
-[x] Change tests to require only normal order for `lowPriceFlag=1`, while normal restricted scenes retain normal and internal settlement.
-[x] Change tests to require only the “低价订单” display option for `lowPriceFlag=1`, while normal restricted scenes retain normal and internal settlement.
-[x] Run `node scripts/run-node-tests.mjs tabWorkOrder/pages/createOrder/tests/orderMerchantConfig.test.mjs` and verify the new assertions fail under the two-type implementation.
-[x] Add the optional `lowPriceFlag` argument and pass `orderObj.lowPriceFlag` from `applyOrderTypeConfig`; normalize low-price order data to type `1`.
-[x] Re-run the focused test and verify it passes.
# Low-Price Customer Required Settings Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Make low-price customer required fields use the selected 4S store's employee-app recording settings, including vehicle fields and phone configuration.
**Architecture:** Add one pure settings adapter that normalizes the employee-app response and builds the page's managed required fields. The store queries and caches by selected 4S store while using the park store only to select phone defaults; the create page consumes the normalized result without accumulating stale required fields.
**Tech Stack:** WeChat Mini Program JavaScript, ES modules, Node.js built-in test runner.
## Global Constraints
- Query required settings for the selected 4S store, not the park store.
- Use `dj.api.smartcarlife.order.field.lightChange.setting.list` with `scene: 1`.
- Preserve customer-profile-only import; do not import goods or payment information.
- Preserve unrelated user changes in `README.md` and `config.js`.
- Do not add dependencies, runtime `import.meta`, or make a git commit unless the user asks.
Expected: FAIL because `utils/orderRequiredSettings.helpers.js` does not exist.
-[]**Step 3: Implement the minimal pure adapter**
```js
constFIELD_FLAG_MAP={
carBrand:'carTypeRequiredFlag',
carNo:'standNoRequiredFlag',
plateNo:'plateNumRequiredFlag',
customerPhone:'customerPhoneRequiredFlag',
phone:'customerPhoneRequiredFlag',
mobile:'customerPhoneRequiredFlag'
}
```
Map explicit `true/false`, `1/0`, and `Y/N`; preserve non-managed required fields; default only `customerPhone` to required when the interface has no phone flag.
-[]**Step 4: Re-run the pure test and verify GREEN**
Expected: FAIL because the request still uses the park store and the response is not normalized.
-[]**Step 3: Implement the store/API fix**
Use `{ scene: 1, merchantId: shopMerchantId }`, normalize `orderFieldSettingList`, filter phone config by `yqMerchantId`, and cache only when both selected store identities match.
-[]**Step 4: Re-run the focused test and verify GREEN**
- Consumes: `buildCustomerRequiredList` and `shouldValidateCustomerPhone` from Task 1.
- Page data: `requiredList` contains `carBrand`, `standNo`, `plateNumber`, and/or `customerPhone` only when configured, except the employee-app-compatible phone fallback.
-[]**Step 1: Write failing page and template tests**
Test that `getSetting()` passes `shopMerchantId: 44210895`, a `plateNo/isRequired=false` response removes `plateNumber`, and the WXML `required` property for all four customer rows reads `requiredList`.
Replace the managed customer portion of `requiredList`; validate phone format only when required or non-empty; fix the configured-phone `.find` callback without mutating the list; bind model and phone stars to `requiredList`.
-[]**Step 4: Re-run focused page tests and verify GREEN**
Record the endpoint, request identity split, four managed fields, phone fallback, and that the customer remains profile-only.
-[]**Step 2: Run complete regression tests**
Run: `npm run test:workOrder`
Expected: exit code `0` with no failed tests.
-[]**Step 3: Run static compatibility checks**
Run `git diff --check`, scan modified runtime JavaScript for `import.meta`, and run `node --check` on the modified runtime files.
-[]**Step 4: Review final scope**
Confirm `README.md` and `config.js` remain untouched, customer import still excludes goods/payment data, and no migration manifest is required because this is a localized defect fix.
# Low-Price Order Type Display 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.