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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user