Giao diện
API · shortage
Trang sinh tự động
Parse từ schema.graphql (SDL backend export) bằng parser graphql. Mô tả và quyền lấy nguyên văn từ description trong SDL.
4 query · 2 mutation.
Query
opsOrderCancelPreview
Read-only preview of the Ops cancel for shortage of one order (button state and the Hệ quả list). Requires order.cancel.
query · quyền: order.cancel
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
orderId | ID! |
Trả về OpsOrderCancelPreview!
| Field | Kiểu | Mô tả |
|---|---|---|
orderId | ID! | |
version | Int | The version the apply must send as expectedVersion. |
statusVersion | Int | U28-P2-07: the stamp of the order and cycle status axes; send it back as expectedStatusVersion (AC09). |
state | OrderState | |
campaignType | CampaignType | |
orderStatus | OrderAxis | |
paymentStatus | PaymentAxis | |
shippingStatus | ShippingStatus | Mua chung shipping status (a Mua định kỳ order keeps its shipping on each cycle). |
eligible | Boolean! | |
blocker | OpsCancelBlocker | |
policyRef | String | |
reasons | [OpsCancelReason!]! | |
committedCycles | Int | |
deliveredCycles | Int | Delivered cycles are kept with the customer. |
createdShipments | Int! | Shipments of the order that are still CREATED. |
cyclesInShipment | [Int!]! | Mua định kỳ: the cycles in a shipment (they lock the cancel). |
undeliveredUnits | Int | |
cancelledCycles | [ShortageCycleUnits!] | Mua định kỳ: the cycles that become Đã hủy, last cycle first, with their units. |
cyclesCancelled | [Int!]! | Mua định kỳ: the cycle numbers that become Đã hủy (Chưa xử lý / Chờ đóng gói), ascending. |
cyclesKept | [OpsCancelKeptCycle!]! | Mua định kỳ: the cycles kept as they are (AC04). |
depositVnd | VndAmount | |
cashRefundVnd | VndAmount | Same as refundAmountVnd (kept for older clients). |
refundAmountVnd | VndAmount | ASSUME-01: the cash Operations refunds to the source (deposit + paid, undelivered cycles); null when not cancellable. |
paymentStatusAfter | PaymentAxis | ASSUME-01: the payment status after the cancel (WAITING_REFUND when something was paid). |
cashScope | String | |
pointsUsed | PointAmount | |
pointsValueVnd | VndAmount | |
pointsReturned | PointAmount | Pi-Point used by the order that goes back to the wallet automatically. |
pendingRewardsCancelled | PointAmount | Pending reward points of the order that are cancelled (Available points are kept). |
availableRewardsKept | PointAmount | U28-FU-API-B. Reward points of the order already Available: the cancel keeps them (null when not cancellable). |
campaignStatusUnchanged | Boolean! | Always true: the campaign status does not change. |
appliedRules | [String!]! | |
remainingObligation | String | |
refundProfile | OpsCancelRefundProfile! |
stockShortageCase
One case with its affected orders. Requires SHR-01 (GAP-83).
query · SDL không ghi quyền
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
id | ID! |
Trả về StockShortageCase!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
version | Int! | |
caseType | StockShortageCaseType! | |
status | String! | CONFIRMED: recorded together with the cancellations; immutable. |
campaignId | ID! | |
campaignProductId | ID! | |
cycleNo | Int | |
reason | String! | Internal note; never shown to the buyer. |
evidenceMediaIds | [ID!]! | |
policyRef | String! | |
orderCount | Int! | |
recordedBy | ID! | |
recordedAt | DateTime! | |
orders | [StockShortageCaseOrder!]! |
stockShortageCases
Shortage cases, newest first. Requires ops.shortage read (SHR-01, GAP-83).
query · quyền: ops.shortage
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
campaignId | ID | ||
page | Int | ||
pageSize | Int |
Trả về StockShortageCasePage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [StockShortageCase!]! | |
total | Int! | |
page | Int! | |
pageSize | Int! |
stockShortageImpact
Preview of affected orders (listed, or every LOCKED order of the product). Requires SHR-01.
query · SDL không ghi quyền
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
campaignProductId | ID! | ||
cycleNo | Int | ||
orderIds | [ID!] |
Trả về StockShortageImpact!
| Field | Kiểu | Mô tả |
|---|---|---|
campaignId | ID! | |
campaignType | CampaignType! | |
campaignProductId | ID! | |
cycleNo | Int | |
total | Int! | |
selectionUnit | String! | PARTIAL_UNITS: the missing units are cancelled; the whole Order only when nothing is left to deliver (DEC-CP-SHORTAGE, AS-02). |
orders | [StockShortageOrderImpact!]! |
Mutation
opsCancelOrder
Cancels the whole order for Hết hàng / thiếu hàng: idempotent by requestId, checks expectedVersion and eligibility at the server. Requires order.cancel.
mutation · quyền: order.cancel
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | OpsCancelOrderInput! |
Trả về OpsCancelOrderResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | The order id. |
version | Int! | The order version after the cancellation. |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | track_refund with the refund case id when one exists. |
orderId | ID! | |
orderStatus | OrderState! | |
paymentStatus | PaymentAxis | ASSUME-01: the payment status after the cancel. |
caseId | ID! | |
deliveredCycles | Int! | |
cancelledCycles | [ShortageCycleUnits!] | |
appliedRules | [String!]! | |
cash | OpsCancelStep! | |
points | OpsCancelStep! | |
pendingRewardsCancelled | PointAmount! | Pending reward points cancelled with the order. |
refundProfile | OpsCancelRefundProfile! |
recordStockShortage
Records a shortage of a Mua chung product: cancels and refunds each listed order WHOLE (every unit still owed; a smaller quantity answers conflict whole_order_only, Word B048.R02). A Mua định kỳ product answers conflict whole_order_only: use opsCancelOrder (DH-US-08 AC04, U19-R34). Requires ops.shortage manage (SHR-02, GAP-83).
mutation · quyền: ops.shortage
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | RecordStockShortageInput! |
Trả về RecordStockShortageResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | The case id. |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
caseId | ID! | |
caseStatus | String! | CONFIRMED (the case is born with its cancellations). |
policyRef | String! | DEC-CP-SHORTAGE@2026-10-05 for every case (the whole-Order rows keep the AS-01/AS-02 rules in appliedRules). |
cancelledOrders | [StockShortageCancelledOrder!]! |