chore(junction): type facility provenance

This commit is contained in:
que01 committed 2026-09-09 11:08:16 +08:00
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' }],
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 => ({
type: 'Feature',
properties: { junction_key: junction, object_key: object, arm_key: arm },
@@ -98,6 +102,13 @@ describe('authoritative junction structures', () => {
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', () => {
const descriptor = junctionDescriptors(state).find((item) => item.ref.type === 'cluster')!;
expect(descriptor.status).toBe('readonly');
+2
View File
@@ -96,6 +96,8 @@ export interface JunctionProvenance {
carriagewayKeys?: string[];
armKeys?: string[];
featureIds?: string[];
facilityEvidence?: 'source-crossing-node' | 'inferred-road-envelope' | 'source-osm-region' | string;
crossingNodeIds?: string[];
}
export interface JunctionSource extends JunctionProvenance {
nodeIds: string[];