import { prismaClient as prisma } from '../../../prismaClient' import { condoManagerLogger } from '../../logger' import GeneralUtils from '../../general' export default async function updateProjectInformation({ projectId, apartmentNumber, address1, zip, state, city, country, numberOfProperties, name, }: { projectId: string apartmentNumber: string address1: string zip: string state: string city: string country: string numberOfProperties: number name: string }) { condoManagerLogger.info('Updating project and building informations') await prisma.project.update({ where: { id: projectId, }, data: { name: name, nameInitials: GeneralUtils.getThreeLettersInitial(name), numberOfProperties: numberOfProperties, building: { update: { address: { update: { apartmentNumber, address1, zip, state, city, country, }, }, }, }, }, }) condoManagerLogger.info('Done updating project and building informations') }