feat: add order governance flags and reconciliation
This commit is contained in:
@@ -20,6 +20,8 @@ export const OrderService = {
|
||||
content_title,
|
||||
type,
|
||||
status,
|
||||
is_flagged,
|
||||
is_reconciled,
|
||||
created_at_from,
|
||||
created_at_to,
|
||||
paid_at_from,
|
||||
@@ -49,6 +51,8 @@ export const OrderService = {
|
||||
content_title,
|
||||
type,
|
||||
status,
|
||||
is_flagged,
|
||||
is_reconciled,
|
||||
created_at_from: iso(created_at_from),
|
||||
created_at_to: iso(created_at_to),
|
||||
paid_at_from: iso(paid_at_from),
|
||||
@@ -86,5 +90,25 @@ export const OrderService = {
|
||||
idempotency_key
|
||||
}
|
||||
});
|
||||
},
|
||||
async flagOrder(orderID, { is_flagged, reason } = {}) {
|
||||
if (!orderID) throw new Error('orderID is required');
|
||||
return requestJson(`/super/v1/orders/${orderID}/flag`, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
is_flagged: Boolean(is_flagged),
|
||||
reason
|
||||
}
|
||||
});
|
||||
},
|
||||
async reconcileOrder(orderID, { is_reconciled, note } = {}) {
|
||||
if (!orderID) throw new Error('orderID is required');
|
||||
return requestJson(`/super/v1/orders/${orderID}/reconcile`, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
is_reconciled: Boolean(is_reconciled),
|
||||
note
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user