diff --git a/lib/useCases/LeaseContractUseCases.tsx b/lib/useCases/LeaseContractUseCases.tsx index 709fad9..2f32e61 100644 --- a/lib/useCases/LeaseContractUseCases.tsx +++ b/lib/useCases/LeaseContractUseCases.tsx @@ -8,6 +8,7 @@ import AbstractUseCases from './AbstractUseCases'; import { generateGoogleUrlRedirect } from '../drivers/network/googleapis'; import { daysBetween, monthsBetween } from '../utils/datesHelper'; import EventUseCases from './EventUseCases'; +import PropertyUseCases from './PropertyUseCases'; import TaskUseCases from './TaskUseCases'; import TenantUseCases from './TenantUseCases'; @@ -65,24 +66,23 @@ export default class LeaseContractUseCases extends AbstractUseCases< const object = unknownObj as unknown; const objValues = object as StepMapper; - const tenant = objValues[0]; - const property = objValues[1]; - /* const tenantUseCase = new TenantUseCases(); - if (tenant._id) - await tenantUseCase.update(unknownObj[0] as Record); - else - tenant = await tenantUseCase.create( - unknownObj[0] as Record - ); + let tenant = objValues[0]; + const tenantUseCase = new TenantUseCases(); + if (tenant._id) + await tenantUseCase.update(unknownObj[0] as Record); + else + tenant = await tenantUseCase.create( + unknownObj[0] as Record + ); - let property = objValues[1]; - const propertyUseCase = new PropertyUseCases(); - if (property._id) - await propertyUseCase.update(unknownObj[1] as Record); - else - property = await propertyUseCase.create( - unknownObj[1] as Record - ); */ + let property = objValues[1]; + const propertyUseCase = new PropertyUseCases(); + if (property._id) + await propertyUseCase.update(unknownObj[1] as Record); + else + property = await propertyUseCase.create( + unknownObj[1] as Record + ); const workInProgressState = ( this.repository as LeaseContractRepository