fix(rectification): skip settlement for free turns
This commit is contained in:
@@ -209,7 +209,7 @@ export async function POST(request: Request) {
|
||||
async reserve() {
|
||||
// opening / read-only turns are free; the first substantive run
|
||||
// reserves once, and resume/retry reuse the same case-bound request.
|
||||
if (action === "opening" || action === "read_only") {
|
||||
if (action !== "message") {
|
||||
return { success: true, status: 200 };
|
||||
}
|
||||
try {
|
||||
@@ -233,6 +233,7 @@ export async function POST(request: Request) {
|
||||
}
|
||||
},
|
||||
async complete(usage) {
|
||||
if (action !== "message") return true;
|
||||
try {
|
||||
const billingRequestId = await rectificationBillingRequestId(accounting, userId, caseId);
|
||||
const settlement = await completeUsage(accounting, userId, billingRequestId, {
|
||||
|
||||
Reference in New Issue
Block a user