Summary
The current import pipeline always creates a new TPoint (or finds an existing one by label + cave). Allow attaching a new observation to an existing point by ID instead of only by label.
Current Behaviour
EntityBuilder.build() resolves a point by matching profile.pointLabel + profile.caveId. If no match is found, a new point is created. There is no way to pass an existing pointId directly.
Proposed Enhancement
Add an optional pointId field to the import profile:
{
"pointId": 42,
"caveId": 1,
...
}
When pointId is provided:
ReferenceValidator verifies the point exists (TPoint.findOne({ id: pointId }))
EntityBuilder uses that point directly (skips label-based resolution/creation)
pointLabel becomes optional when pointId is present
Validation Rules
- If both
pointId and pointLabel are provided, pointId takes precedence
- If
pointId is provided, the point must exist (otherwise → IMPORT_REFERENCE_ERROR)
- If the point has a
cave FK, it should match profile.caveId (or warn)
Priority
Low — the current label-based resolution handles the common case. This is a convenience for users who want to attach multiple imports to a known point without risking label typos creating duplicates.
Summary
The current import pipeline always creates a new
TPoint(or finds an existing one by label + cave). Allow attaching a new observation to an existing point by ID instead of only by label.Current Behaviour
EntityBuilder.build()resolves a point by matchingprofile.pointLabel+profile.caveId. If no match is found, a new point is created. There is no way to pass an existingpointIddirectly.Proposed Enhancement
Add an optional
pointIdfield to the import profile:{ "pointId": 42, "caveId": 1, ... }When
pointIdis provided:ReferenceValidatorverifies the point exists (TPoint.findOne({ id: pointId }))EntityBuilderuses that point directly (skips label-based resolution/creation)pointLabelbecomes optional whenpointIdis presentValidation Rules
pointIdandpointLabelare provided,pointIdtakes precedencepointIdis provided, the point must exist (otherwise →IMPORT_REFERENCE_ERROR)caveFK, it should matchprofile.caveId(or warn)Priority
Low — the current label-based resolution handles the common case. This is a convenience for users who want to attach multiple imports to a known point without risking label typos creating duplicates.