Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(condo): DOMA-8629 added property meters importer #5589

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

abshnko
Copy link
Member

@abshnko abshnko commented Dec 9, 2024

  • cc (will merge cc before merging this PR)
  • add excel template for property meters

@abshnko abshnko added the 🚨 Migrations We have a database migrations here! label Dec 9, 2024
Copy link

sonarqubecloud bot commented Dec 9, 2024

Comment on lines +25 to +27
interface IExtraProps {
isPropertyMeters?: boolean
}
Copy link
Member

@AleX83Xpert AleX83Xpert Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is used in all imports (except meters). Maybe its better to add extra field explicitly in meters domain?
Another option is add extraProps field using generic interface: define interface of extraProps within particular domain.

export interface IImportWrapperProps<TExtraProps = unknown> {
  ...
  extraProps?: TExtraProps,
}

} = props

const intl = useIntl()
const domain = 'meter'
const domain = extraProps?.isPropertyMeters ? 'propertyMeter' : 'meter'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

domain was a constant, but now it is a variable. Please add it to the dependency list of hooks below.

@@ -64,6 +65,7 @@ const MetersImportWrapper: React.FC<IMetersImportWrapperProps> = (props) => {
file: fileRef,
userId: user?.id || null,
organizationId: organization?.id || null,
isPropertyMeters: extraProps?.isPropertyMeters ? extraProps.isPropertyMeters : false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's simpler a bit.

Suggested change
isPropertyMeters: extraProps?.isPropertyMeters ? extraProps.isPropertyMeters : false,
isPropertyMeters: Boolean(extraProps?.isPropertyMeters),

@@ -49,7 +50,7 @@ const { EXCEL } = require('@condo/domains/common/constants/export')
const { LOCALE_EN } = require('@condo/domains/user/constants/common')


async function createTestMeterResource (client, extraAttrs = {}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please tune your IDE settings.
In most cases, we use space when defining functions and not use space when calling functions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, i confused the styling for some reason

@@ -524,5 +546,6 @@ module.exports = {
createTestReadingData, registerMetersReadingsByTestClient,
MeterReadingsImportTask, createTestMeterReadingsImportTask, updateTestMeterReadingsImportTask,
MeterReadingExportTask, createTestMeterReadingExportTask, updateTestMeterReadingExportTask,
/* AUTOGENERATE MARKER <EXPORTS> */
registerPropertyMetersReadingsByTestClient,
/* AUTOGENERATE MARKER <EXPORTS> */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* AUTOGENERATE MARKER <EXPORTS> */
/* AUTOGENERATE MARKER <EXPORTS> */

@abshnko abshnko force-pushed the feat/condo/DOMA-8629/add-property-readings-importer branch from f5d5126 to 8a7b7da Compare January 13, 2025 07:09
…ion for possible new integrations that might pass house globalId
…mportTask and canExecuteRegisterPropertyMetersReadings field to B2BAppAccessRightSet
@abshnko abshnko force-pushed the feat/condo/DOMA-8629/add-property-readings-importer branch from 6bff482 to 84ac334 Compare January 19, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 Migrations We have a database migrations here!
Development

Successfully merging this pull request may close these issues.

4 participants