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(softTenants): add softTenant ids to assets measures documents #383

Merged
merged 6 commits into from
Dec 5, 2024

Conversation

thomas-mauran
Copy link
Member

@thomas-mauran thomas-mauran commented Nov 22, 2024

What does this PR do ?

Add softTenant fields to digitalTwins documents

Other changes

  • Import types derivative of ModelDefinition like AssetModel, DeviceModel and MeasureModel from iot-platform
  • Refactor some tests

Boyscout

  • Improve types export
  • Improve tests models definitions to simplify list to clear models for tests
  • Add basic VSCode settings

@thomas-mauran thomas-mauran marked this pull request as draft November 22, 2024 15:43
@afondard
Copy link
Contributor

Seems like there is a mapping issue because the dynamic property of the assets collection is set to strict, not allowing a new property like softTenants.

@thomas-mauran
Copy link
Member Author

Seems like there is a mapping issue because the dynamic property of the assets collection is set to strict, not allowing a new property like softTenants.

Yes this is still in draft and not working yet, I didn't had the time to finish

Copy link
Member

@etrousset etrousset left a comment

Choose a reason for hiding this comment

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

This feature should be done on 2-dev branch

@sebtiz13 sebtiz13 changed the base branch from 3-dev to 2-dev November 25, 2024 14:51
@sebtiz13 sebtiz13 self-assigned this Nov 28, 2024
@sebtiz13 sebtiz13 force-pushed the KZLPRD-677-add-groupIds-softTenant-to-asset-measure branch from 1a19c29 to 7ecf853 Compare November 28, 2024 19:34
@sebtiz13 sebtiz13 force-pushed the KZLPRD-677-add-groupIds-softTenant-to-asset-measure branch from 7ecf853 to 35e6324 Compare November 28, 2024 19:56
@sebtiz13 sebtiz13 force-pushed the KZLPRD-677-add-groupIds-softTenant-to-asset-measure branch from 72a4ef2 to ea49a1b Compare December 2, 2024 21:50
@etrousset etrousset added the 2.5 label Dec 3, 2024
@sebtiz13 sebtiz13 force-pushed the KZLPRD-677-add-groupIds-softTenant-to-asset-measure branch from 8f22ef7 to cc3c546 Compare December 3, 2024 09:29
@sebtiz13 sebtiz13 marked this pull request as ready for review December 3, 2024 09:34
@sebtiz13 sebtiz13 changed the title KZLPRD-677: add group ids soft tenant to asset measure KZLPRD-677: add softTenant ids to asset measure Dec 3, 2024
@sebtiz13 sebtiz13 changed the title KZLPRD-677: add softTenant ids to asset measure feat(softtenants): add softTenant ids to asset measure Dec 3, 2024
@sebtiz13 sebtiz13 changed the title feat(softtenants): add softTenant ids to asset measure feat(digitaltwin): add softTenant ids to asset measure Dec 3, 2024
@sebtiz13 sebtiz13 changed the title feat(digitaltwin): add softTenant ids to asset measure feat(digitaltwin): add softTenant ids to digitaltwin Dec 3, 2024
@sebtiz13 sebtiz13 force-pushed the KZLPRD-677-add-groupIds-softTenant-to-asset-measure branch from cc3c546 to 48d034c Compare December 3, 2024 12:58
lib/modules/asset/types/AssetApi.ts Outdated Show resolved Hide resolved
@etrousset etrousset changed the title feat(digitaltwin): add softTenant ids to digitaltwin feat(digitaltwin): add softTenant ids to assets measures documents Dec 3, 2024
@etrousset etrousset changed the title feat(digitaltwin): add softTenant ids to assets measures documents feat(softTenants): add softTenant ids to assets measures documents Dec 3, 2024
"/lib/modules/shared/exports.ts",
"/lib/modules/shared/types/exports.ts"
]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it normal for this file to be there?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, It's useful to share basic VSCode settings.
Especially on certain repositories like this one which still have a specific configuration like double quote style instead of simple quote.

Maybe we should rationalize these types of configurations between project but that need a huge PR to reformat all code, to accepted style. So for the moment IMHO, it's the better solution to share these settings for contributors

@@ -25,7 +25,10 @@ export const assetsMappings: CollectionMappings = {
date: { type: "date" },
},
},

softTenant: {
Copy link
Contributor

Choose a reason for hiding this comment

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

So there could be only 1 softTenant?

Copy link
Member

Choose a reason for hiding this comment

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

No, but it's currently implemented like that and change this need a migration of database so it's breaking if we change to pluralize now

Copy link
Contributor

Choose a reason for hiding this comment

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

Elasticsearch doesn't have array types in mappings, an object and an array of objects will have the exact same mapping definition.

@sebtiz13 sebtiz13 force-pushed the KZLPRD-677-add-groupIds-softTenant-to-asset-measure branch from 831550e to 1d6d203 Compare December 4, 2024 13:51
http: [
{ path: "device-manager/:engineId/assets/:_id", verb: "post" },
],
http: [{ path: "device-manager/:engineId/assets", verb: "put" }],
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking API change, this should be marked as such in the commits and lead to a semver-major release.

http: [
{ path: "device-manager/:engineId/devices/:_id", verb: "post" },
],
http: [{ path: "device-manager/:engineId/devices", verb: "put" }],
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking API change, this should be marked as such in the commits and lead to a semver-major release.

@sebtiz13 sebtiz13 merged commit 1b36fe0 into 2-dev Dec 5, 2024
5 checks passed
@sebtiz13 sebtiz13 deleted the KZLPRD-677-add-groupIds-softTenant-to-asset-measure branch December 5, 2024 12:48
github-actions bot pushed a commit that referenced this pull request Dec 5, 2024
# [2.5.0-dev.3](v2.5.0-dev.2...v2.5.0-dev.3) (2024-12-05)

### Features

* **softTenants:** add softTenant ids to assets measures documents ([#383](#383)) ([1b36fe0](1b36fe0))
github-actions bot pushed a commit that referenced this pull request Dec 5, 2024
# [2.5.0](v2.4.4...v2.5.0) (2024-12-05)

### Bug Fixes

* **assetservice:** can't replace metadata if not present in asset ([#384](#384)) ([eb65c0a](eb65c0a))
* backport fix ([#380](#380)) ([5392b56](5392b56))

### Features

* add editor hint support ([#386](#386)) ([a9b62df](a9b62df))
* **measure:** allow measures to be pushed on Assets via API (no devices) ([#344](#344)) ([c1073c1](c1073c1))
* **softTenants:** add softTenant ids to assets measures documents ([#383](#383)) ([1b36fe0](1b36fe0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants