-
Notifications
You must be signed in to change notification settings - Fork 38
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
base: main
Are you sure you want to change the base?
feat(condo): DOMA-8629 added property meters importer #5589
Conversation
abshnko
commented
Dec 9, 2024
•
edited
Loading
edited
- cc (will merge cc before merging this PR)
- add excel template for property meters
|
interface IExtraProps { | ||
isPropertyMeters?: boolean | ||
} |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
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 = {}) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* AUTOGENERATE MARKER <EXPORTS> */ | |
/* AUTOGENERATE MARKER <EXPORTS> */ |
f5d5126
to
8a7b7da
Compare
…ion for possible new integrations that might pass house globalId
…rom addresses (when no unitName passed)
…mportTask and canExecuteRegisterPropertyMetersReadings field to B2BAppAccessRightSet
6bff482
to
84ac334
Compare
|