openydt-coupon
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCRITICAL:开始前 MUST 先用 Read 工具读取(认证 / profile / 签名 / 状态码 / 限速 / 安全规则)。未读共享基座不要执行任何命令。../openydt-shared/SKILL.md
CRITICAL: MUST use the Read tool to readbefore starting (Authentication / Profile / Signature / Status Code / Rate Limiting / Security Rules). Do not execute any commands without reading the shared base document.../openydt-shared/SKILL.md
何时用本技能
When to Use This Skill
本技能覆盖电子券与商家域(coupon):商家(trader)的创建与维护、电子券模板的创建、把券售卖给商家、给车辆发放电子券、查询券与商家信息、以及券的回收。车辆在停车场用电子券可抵扣部分或全部停车费。
意图路由:
- "新建一个商家 / 加个商户 / 录入商家账号" → (写,需
openydt coupon create-trader)。--yes - "改商家信息 / 冻结商家 / 解冻 / 删除商家" → /
openydt coupon edit-trader/frozen-trader(写,需delete-trader)。--yes - "查商家列表 / 看某个商家信息 / 校验商家账号密码" → /
openydt coupon get-trader-list/get-trader-info-by-trader-code。validate-trader-account-and-password - "建一个券模板 / 创建优惠券 / 建固定券" → /
openydt coupon create-coupon-template/create-coupon(写,需create-fixed-coupon)。--yes - "把券卖给商家 / 售卖电子券" → (写,需
openydt coupon sell-coupon)。--yes - "给这辆车发券 / 发放优惠券 / 按券编码发券 / 扫码发券" → /
openydt coupon send-coupon/send-coupon-by-coupon-code(写,需sync-scan-coupon-qr-code)。--yes - "查这辆车有哪些券 / 已发放的券 / 可用券 / 券信息" → /
openydt coupon query-car-code-valid-coupon/query-usable-coupon。query-coupon - "回收这张券 / 退券 / 锁券 / 打印券" → /
openydt coupon cancel-coupon/lock-coupon(写,需print-coupon)。--yes
用券抵扣后的实际查费 / 缴费在 trade 域();在场车确认在 parking 域(openydt trade --help)。openydt parking --help
This skill covers the E-Voucher & Merchant Domain (coupon): creation and maintenance of merchants (trader), creation of e-voucher templates, selling vouchers to merchants, issuing e-vouchers to vehicles, querying voucher and merchant information, and reclaiming vouchers. Vehicles can use e-vouchers in parking lots to deduct part or all of the parking fee.
Intent Routing:
- "Create a merchant / Add a merchant / Enter merchant account" → (Write operation, requires
openydt coupon create-trader).--yes - "Edit merchant info / Freeze merchant / Unfreeze / Delete merchant" → /
openydt coupon edit-trader/frozen-trader(Write operation, requiresdelete-trader).--yes - "Query merchant list / View a merchant's info / Verify merchant account password" → /
openydt coupon get-trader-list/get-trader-info-by-trader-code.validate-trader-account-and-password - "Create a voucher template / Create coupon / Create fixed voucher" → /
openydt coupon create-coupon-template/create-coupon(Write operation, requirescreate-fixed-coupon).--yes - "Sell vouchers to merchant / Sell e-vouchers" → (Write operation, requires
openydt coupon sell-coupon).--yes - "Issue voucher to this vehicle / Distribute coupon / Issue by voucher code / Scan to issue voucher" → /
openydt coupon send-coupon/send-coupon-by-coupon-code(Write operation, requiressync-scan-coupon-qr-code).--yes - "Query vouchers for this vehicle / Issued vouchers / Available vouchers / Voucher info" → /
openydt coupon query-car-code-valid-coupon/query-usable-coupon.query-coupon - "Reclaim this voucher / Refund voucher / Lock voucher / Print voucher" → /
openydt coupon cancel-coupon/lock-coupon(Write operation, requiresprint-coupon).--yes
Querying actual fee after voucher deduction / Payment is in the trade domain (); Parking vehicle confirmation is in the parking domain (openydt trade --help).openydt parking --help
可用命令
Available Commands
| 中文名 | 命令 | 读/写 | 关键参数 |
|---|---|---|---|
| 获取商家信息 | | 读 | |
| 校验商家用户账户密码 | | 读 | |
| 创建商家 | | 写 | |
| 编辑商家 | | 写 | |
| 冻结或解冻商家 | | 写 | |
| 删除商家(不可恢复) | | 写 | |
| 查询商家列表 | | 读 | |
| 创建电子券模板 | | 写 | |
| 创建电子券并售卖给商户 | | 写 | |
| 创建固定电子券(一码多券) | | 写 | |
| 售卖电子券给商家 | | 写 | |
| 给指定车辆发放电子券 | | 写 | |
| 根据券编码发放商家券 | | 写 | |
| 同步电子券二维码扫码 | | 写 | |
| 检查电子券是否可发放 | | 读 | |
| 检查电子券二维码有效性 | | 读 | |
| 打印电子券(标记已发放) | | 写 | |
| 查询电子券打印记录 | | 读 | |
| 锁定电子券 | | 写 | |
| 回收电子券 | | 写 | |
| 查询已发放电子券(按车牌/卡号) | | 读 | |
| 查询电子券信息 | | 读 | |
| 查询可用的电子券 | | 读 | |
| 根据券编码查询适用车场 | | 读 | |
| 根据券模板代码查询券模板 | | 读 | |
| 根据券编码查询券模板 | | 读 | |
| 根据券编码查询商家信息 | | 读 | |
| 查询电子券售卖记录 | | 读 | |
| 查询商家发券记录 | | 读 | |
| 查询优惠券列表(按车牌) | | 读 | |
所有写命令(/create-trader/edit-trader/frozen-trader/delete-trader/create-coupon-template/create-coupon/create-fixed-coupon/sell-coupon/send-coupon/send-coupon-by-coupon-code/sync-scan-coupon-qr-code/print-coupon/lock-coupon)执行时必须加cancel-coupon确认,否则会被拦截。--yes
| English Name | Command | Read/Write | Key Parameters |
|---|---|---|---|
| Get Merchant Info | | Read | |
| Verify Merchant User Account Password | | Read | |
| Create Merchant | | Write | |
| Edit Merchant | | Write | |
| Freeze or Unfreeze Merchant | | Write | |
| Delete Merchant (Irreversible) | | Write | |
| Query Merchant List | | Read | |
| Create E-Voucher Template | | Write | |
| Create E-Voucher and Sell to Merchant | | Write | |
| Create Fixed E-Voucher (One Code for Multiple Vouchers) | | Write | |
| Sell E-Vouchers to Merchant | | Write | |
| Issue E-Voucher to Specified Vehicle | | Write | |
| Issue Merchant Voucher by Voucher Code | | Write | |
| Sync E-Voucher QR Code Scan | | Write | |
| Check If E-Voucher Is Issuable | | Read | |
| Check E-Voucher QR Code Validity | | Read | |
| Print E-Voucher (Mark as Issued) | | Write | |
| Query E-Voucher Print Records | | Read | |
| Lock E-Voucher | | Write | |
| Reclaim E-Voucher | | Write | |
| Query Issued E-Vouchers (By License Plate/Card Number) | | Read | |
| Query E-Voucher Info | | Read | |
| Query Available E-Vouchers | | Read | |
| Query Applicable Parking Lots by Voucher Code | | Read | |
| Query Voucher Template by Voucher Template Code | | Read | |
| Query Voucher Template by Voucher SN | | Read | |
| Query Merchant Info by Voucher Code | | Read | |
| Query E-Voucher Sales Records | | Read | |
| Query Merchant Voucher Issuance Records | | Read | |
| Query Coupon List (By License Plate) | | Read | |
All write commands (/create-trader/edit-trader/frozen-trader/delete-trader/create-coupon-template/create-coupon/create-fixed-coupon/sell-coupon/send-coupon/send-coupon-by-coupon-code/sync-scan-coupon-qr-code/print-coupon/lock-coupon) must includecancel-couponfor confirmation, otherwise they will be blocked.--yes
业务流程
Business Process
电子券闭环(建商家+建模板 → 售卖 → 发券 → 查询 → 回收)
E-Voucher Closed Loop (Create Merchant + Create Template → Sell → Issue → Query → Reclaim)
逐步执行,务必把前序命令响应里的字段作为后续命令入参(商家编码 traderCode、券模板编码 traderCouponTemplateCode、销售账单 sellBillId、券唯一编号 couponSn),不要凭空构造:
-
创建商家 + 创建券模板(写,均需):
--yesopenydt coupon create-trader --yes \ --trader-name <商家名> --contact <联系人> --phone <手机号> \ --park-code <车场编号> --login-account <账号> --password <密码> openydt coupon create-coupon-template --yes \ --name <券名> --sell-from ... --sell-to ... --grant-from ... --grant-to ... \ --valid-minute 60 --balance-type 0 --coupon-type 1 \ --face-value 500 --original-price 600 --real-price 500 \ --use-rule-from 0 --use-rule-to 1000- 从 响应取商家编码
create-trader(也可用traderCode反查)→ 作为后续所有命令的get-trader-list;--trader-code - 从 响应取券模板编码(商家券模板代码)→ 作为第 2 步
create-coupon-template的sell-coupon(也可用--trader-coupon-template-code核对)。query-coupon-template-by-coupon-code --code <模板代码>
- 从
-
售卖给商家(写,需)— 用第 1 步拿到的商家编码 + 模板编码:
--yesopenydt coupon sell-coupon --yes \ --trader-coupon-template-code <来自 create-coupon-template> \ --trader-code <来自 create-trader> \ --sell-num 100 --sell-money 0.01 --sell-time "2018-04-16 09:00:00"- 从 响应取销售账单
sell-coupon→ 作为第 3 步sellBillId的send-coupon(也可用--sell-bill-id核对该批次可发放余量)。query-usable-coupon --trader-code <traderCode> --sell-bill-id <id>
- 从
-
发放给车辆(写,需)— 用第 2 步拿到的
--yes+ 商家编码:sellBillIdopenydt coupon send-coupon --yes \ --trader-code <来自 create-trader> \ --sell-bill-id <来自 sell-coupon> \ --car-code <车牌> --car-code-color 1也可按券编码发券:(send-coupon-by-coupon-code --yes --coupon-code <券编码> --car-no <车牌>与--car-no不能同时为空)。发券前可先--card-no确认是否可发。check-coupon-whether-send-available --coupon-code <券编码> -
查询券(读)— 确认券已落到车辆 / 商家:
openydt coupon query-car-code-valid-coupon --park-code <车场> --car-code <车牌> openydt coupon query-coupon --trader-code <traderCode> --query-type 1 --page 1 --page-size 10- 从查询响应取券唯一编号 → 作为第 5 步
couponSn的cancel-coupon(按券编码反查商家用--coupon-sn)。query-trader-info-by-coupon-code --coupon-sn <couponSn>
- 从查询响应取券唯一编号
-
回收(写,需)— 用第 4 步取到的
--yes+ 商家编码:couponSnopenydt coupon cancel-coupon --yes --trader-code <traderCode> --coupon-sn <来自 query>
Execute step by step, must use fields from the previous command response as parameters for subsequent commands (merchant code traderCode, voucher template code traderCouponTemplateCode, sales bill sellBillId, unique voucher number couponSn), do not construct them out of thin air:
-
Create Merchant + Create Voucher Template (Write operations, both require):
--yesopenydt coupon create-trader --yes \ --trader-name <Merchant Name> --contact <Contact Person> --phone <Phone Number> \ --park-code <Parking Lot Code> --login-account <Account> --password <Password> openydt coupon create-coupon-template --yes \ --name <Voucher Name> --sell-from ... --sell-to ... --grant-from ... --grant-to ... \ --valid-minute 60 --balance-type 0 --coupon-type 1 \ --face-value 500 --original-price 600 --real-price 500 \ --use-rule-from 0 --use-rule-to 1000- Extract merchant code from the
traderCoderesponse (can also be retrieved viacreate-trader) → use asget-trader-listfor all subsequent commands;--trader-code - Extract voucher template code (merchant voucher template code) from the response → use as
create-coupon-templatefor--trader-coupon-template-codein Step 2 (can also verify viasell-coupon).query-coupon-template-by-coupon-code --code <Template Code>
- Extract merchant code
-
Sell to Merchant (Write operation, requires) — use the merchant code + template code obtained in Step 1:
--yesopenydt coupon sell-coupon --yes \ --trader-coupon-template-code <From create-coupon-template> \ --trader-code <From create-trader> \ --sell-num 100 --sell-money 0.01 --sell-time "2018-04-16 09:00:00"- Extract sales bill from the
sellBillIdresponse → use assell-couponfor--sell-bill-idin Step 3 (can also check the available issuance quantity of this batch viasend-coupon).query-usable-coupon --trader-code <traderCode> --sell-bill-id <id>
- Extract sales bill
-
Issue to Vehicle (Write operation, requires) — use the
--yes+ merchant code obtained in Step 2:sellBillIdopenydt coupon send-coupon --yes \ --trader-code <From create-trader> \ --sell-bill-id <From sell-coupon> \ --car-code <License Plate> --car-code-color 1You can also issue by voucher code:(Cannot leave bothsend-coupon-by-coupon-code --yes --coupon-code <Voucher Code> --car-no <License Plate>and--car-noempty). Before issuing, you can confirm if it's issuable via--card-no.check-coupon-whether-send-available --coupon-code <Voucher Code> -
Query Vouchers (Read operation) — confirm vouchers have been assigned to the vehicle / merchant:
openydt coupon query-car-code-valid-coupon --park-code <Parking Lot> --car-code <License Plate> openydt coupon query-coupon --trader-code <traderCode> --query-type 1 --page 1 --page-size 10- Extract unique voucher number from the query response → use as
couponSnfor--coupon-snin Step 5 (To query merchant info via voucher code, usecancel-coupon).query-trader-info-by-coupon-code --coupon-sn <couponSn>
- Extract unique voucher number
-
Reclaim (Write operation, requires) — use the
--yes+ merchant code obtained in Step 4:couponSnopenydt coupon cancel-coupon --yes --trader-code <traderCode> --coupon-sn <From query>
示例
Examples
创建商家(写操作,必须加 ;参数取自 catalog sampleBody):
--yesopenydt coupon create-trader --yes \
--trader-name 测试商家 --trader-type 5 \
--contact 联系人 --phone 13800000000 \
--park-code 2KNTYVWC --login-account trader001 --password 123456售卖电子券给商家(写操作,必须加 ;模板编码 / 商家编码取自前序响应):
--yesopenydt coupon sell-coupon --yes \
--trader-coupon-template-code GCSH3FI1YNDN \
--trader-code NWTSZY49BH67 \
--sell-num 100 --sell-money 0.01 --sell-remark 测试 \
--sell-time "2018-04-16 09:00:00"按车牌查询已发放电子券(读操作):
openydt coupon query-car-code-valid-coupon --park-code 2KKN6111 --car-code 粤B88888Create Merchant (Write operation, must include ; parameters from catalog sampleBody):
--yesopenydt coupon create-trader --yes \
--trader-name Test Merchant --trader-type 5 \
--contact Contact Person --phone 13800000000 \
--park-code 2KNTYVWC --login-account trader001 --password 123456Sell E-Vouchers to Merchant (Write operation, must include ; template code / merchant code from previous responses):
--yesopenydt coupon sell-coupon --yes \
--trader-coupon-template-code GCSH3FI1YNDN \
--trader-code NWTSZY49BH67 \
--sell-num 100 --sell-money 0.01 --sell-remark Test \
--sell-time "2018-04-16 09:00:00"Query Issued E-Vouchers by License Plate (Read operation):
openydt coupon query-car-code-valid-coupon --park-code 2KKN6111 --car-code 粤B88888