feat: add License.purchaseOrderId (nullable FK)

Nullable FK from License to PurchaseOrder for supply-side traceability
(which PO a license came in through), mirroring AssetItem.purchaseOrderId's
just-merged pattern exactly. Separate commit from the earlier
License.vendorId retrofit per the project's 1-commit-per-business-change
convention.
This commit is contained in:
toanhoang
2026-08-02 20:17:09 -04:00
parent fb52f473a5
commit abec58d239
5 changed files with 221 additions and 20 deletions
+3 -1
View File
@@ -22,13 +22,15 @@ export async function POST(request: Request): Promise<NextResponse> {
return NextResponse.json({ error: "Request body must be a JSON object" }, { status: 400 });
}
const { name, vendorId, seatsTotal, expiryDate, licenseType } = body as Record<string, unknown>;
const { name, vendorId, seatsTotal, expiryDate, licenseType, purchaseOrderId } =
body as Record<string, unknown>;
const validation = validateCreateLicenseInput({
name,
vendorId,
seatsTotal,
expiryDate,
licenseType,
purchaseOrderId,
});
if (!validation.ok) {