chore(junction): type facility provenance
This commit is contained in:
1 parent
8929edcee4
commit
db904d3194
2 files changed
+13
No files matched your search
@@ -22,6 +22,10 @@ const structure: JunctionStructure = {
|
|||||||
corners: [{ key: 'corner:a', label: '角部 A', fromArmKey: 'arm:a', toArmKey: 'arm:b' }],
|
corners: [{ key: 'corner:a', label: '角部 A', fromArmKey: 'arm:a', toArmKey: 'arm:b' }],
|
||||||
facilities: [{ key: 'crossing:a', label: '过街 A', kind: 'crossing' }],
|
facilities: [{ key: 'crossing:a', label: '过街 A', kind: 'crossing' }],
|
||||||
};
|
};
|
||||||
|
structure.facilities[0].provenance = {
|
||||||
|
facilityEvidence: 'source-crossing-node',
|
||||||
|
crossingNodeIds: ['crossing-node-a'],
|
||||||
|
};
|
||||||
const feature = (object: string, junction = 'cluster:a', arm?: string): GeoFeature => ({
|
const feature = (object: string, junction = 'cluster:a', arm?: string): GeoFeature => ({
|
||||||
type: 'Feature',
|
type: 'Feature',
|
||||||
properties: { junction_key: junction, object_key: object, arm_key: arm },
|
properties: { junction_key: junction, object_key: object, arm_key: arm },
|
||||||
@@ -98,6 +102,13 @@ describe('authoritative junction structures', () => {
|
|||||||
expect(junctionObjectFeatures(state, structure, 'deleted')).toEqual([]);
|
expect(junctionObjectFeatures(state, structure, 'deleted')).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('keeps facility evidence available to scoped structure consumers', () => {
|
||||||
|
expect(structure.facilities[0].provenance).toEqual({
|
||||||
|
facilityEvidence: 'source-crossing-node',
|
||||||
|
crossingNodeIds: ['crossing-node-a'],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('scopes the canvas and preview using cluster ownership, retaining core features without node IDs', () => {
|
it('scopes the canvas and preview using cluster ownership, retaining core features without node IDs', () => {
|
||||||
const descriptor = junctionDescriptors(state).find((item) => item.ref.type === 'cluster')!;
|
const descriptor = junctionDescriptors(state).find((item) => item.ref.type === 'cluster')!;
|
||||||
expect(descriptor.status).toBe('readonly');
|
expect(descriptor.status).toBe('readonly');
|
||||||
|
|||||||
@@ -96,6 +96,8 @@ export interface JunctionProvenance {
|
|||||||
carriagewayKeys?: string[];
|
carriagewayKeys?: string[];
|
||||||
armKeys?: string[];
|
armKeys?: string[];
|
||||||
featureIds?: string[];
|
featureIds?: string[];
|
||||||
|
facilityEvidence?: 'source-crossing-node' | 'inferred-road-envelope' | 'source-osm-region' | string;
|
||||||
|
crossingNodeIds?: string[];
|
||||||
}
|
}
|
||||||
export interface JunctionSource extends JunctionProvenance {
|
export interface JunctionSource extends JunctionProvenance {
|
||||||
nodeIds: string[];
|
nodeIds: string[];
|
||||||
|
|||||||
Reference in new issue
Block a user