chore(global): remove a bunch of test and temp files

This commit is contained in:
2026-04-17 22:34:41 +00:00
parent a8c48e8c75
commit 5141ed20f9
23 changed files with 185 additions and 2529 deletions
+6 -1
View File
@@ -46,7 +46,7 @@ export const opportunities = {
// Resolve optional local FKs — nullify any that don't exist locally yet
// (the sync may be behind; these are all nullable in the schema)
const [companyExists, contactExists, siteExists] = await Promise.all([
const [companyExists, contactExists, siteExists, typeExists] = await Promise.all([
cwData.company?.id
? prisma.company.findFirst({ where: { id: cwData.company.id }, select: { id: true } })
: null,
@@ -56,16 +56,21 @@ export const opportunities = {
mapped.siteId != null
? prisma.companyAddress.findFirst({ where: { id: mapped.siteId }, select: { id: true } })
: null,
mapped.typeId != null
? prisma.opportunityType.findFirst({ where: { id: mapped.typeId }, select: { id: true } })
: null,
]);
const companyId = companyExists?.id ?? null;
const contactId = contactExists?.id ?? null;
const siteId = siteExists?.id ?? null;
const typeId = typeExists?.id ?? null;
const record = await prisma.opportunity.create({
data: {
id: cwData.id,
...mapped,
typeId,
companyId,
contactId,
siteId,