Skip to content

Commit

Permalink
hotfix(condo): DOMA-10973 add skip deletedAt (#5698)
Browse files Browse the repository at this point in the history
(cherry picked from commit dcf73e8)
  • Loading branch information
tolmachev21 committed Jan 17, 2025
1 parent cab9a2f commit 6d8c42e
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const dayjs = require('dayjs')
const { get } = require('lodash')

const { getById, getByCondition } = require('@open-condo/keystone/schema')
const { getByCondition } = require('@open-condo/keystone/schema')
const { i18n } = require('@open-condo/locales/loader')

const { buildExportFile, DOCX_FILE_META } = require('@condo/domains/common/utils/createExportFile')
Expand Down Expand Up @@ -40,17 +40,25 @@ const generateTicketDocumentOfCompletionWorks = async ({ task, baseAttrs, contex
const timeZone = normalizeTimeZone(timeZoneFromUser) || DEFAULT_ORGANIZATION_TIMEZONE
const printDate = dayjs().tz(timeZone).locale(locale)

const property = await getById('Property', ticket.property)
const property = await getByCondition('Property', {
id: ticket.property,
deletedAt: null,
})

const { renderData, streetPart, settlement, cityType, cityName, houseName, block } = getAddressDetails(get(property, 'addressMeta', ticket.propertyAddressMeta))

const contact = ticket.contact
? await getById('Contact', ticket.contact)
? await getByCondition('Contact', {
id: ticket.contact,
deletedAt: null,
})
: null

const employee = organization.id && ticket.executor
? await getByCondition('OrganizationEmployee', {
organization: { id: organization.id },
user: { id: ticket.executor },
organization: { id: organization.id, deletedAt: null },
user: { id: ticket.executor, deletedAt: null },
deletedAt: null,
})
: null

Expand Down

0 comments on commit 6d8c42e

Please sign in to comment.