UNPKG

abp-blueprint

Version:

RoadieJS blueprint to support Ordnance Survey's AddressBase Premium

132 lines (112 loc) 3.52 kB
[ { "element": "schema", "id": "blpus", "config": { "key": "uprn", "fields": { "uprn": { "type": "Long", "required": true }, "logicalStatus": { "type": "Number", "required": true }, "blpuState": { "type": "Number", "required": false }, "blpuStateDate": { "type": "Date", "required": false }, "parentUprn": { "type": "Long", "required": false }, "xCoordinate": { "type": "Number", "required": true }, "yCoordinate": { "type": "Number", "required": true }, "rpc": { "type": "Number", "required": true }, "localCustodianCode": { "type": "Number", "required": true }, "startDate": { "type": "Date", "required": true }, "endDate": { "type": "Date", "required": false }, "lastUpdateDate": { "type": "Date", "required": false }, "entryDate": { "type": "Date", "required": true }, "postalAddress": { "type": "String", "required": true }, "postcodeLocator": { "type": "String", "required": false }, "multiOccCount": { "type": "Number", "required": false }, "_postalAddress": { "type": "String", "required": false } }, "search": { "standardFields": { "category": { "literal": "gazetteer" }, "subCategory": { "literal": "Property" }, "title": { "path": "context.bestLabel" }, "openWith": { "flowTemplateId": "maintainProperty" } } } } }, { "element": "docTask", "parent": "schema.blpus", "id": "filterDeliveries", "config": { "taskName": "filterCollection", "options": { "arrayPath": "doc.deliveries", "target": "context.delivery", "optionalIdentifiers": ["endDate"], "retainExpression": "!endDate" } } }, { "element": "docTask", "id": "pickFirstDeliveryAddress", "parent": "schema.blpus", "config": { "taskName": "collectionToObject", "options": { "source": "context.delivery", "target": "context.delivery", "strategy": { "type": "first" } } } }, { "element": "docTask", "id": "makePostalAddress", "parent": "schema.blpus", "config": { "taskName": "addressBuilder", "options": { "target": "doc._postalAddress", "primaryMappings": { "organisation": "context.delivery.organisationName", "department": "context.delivery.departmentName", "box": "context.delivery.poBoxNumber", "subBuilding": "context.delivery.subBuildingName", "building": "context.delivery.buildingName", "buildingNumber": "context.delivery.buildingNumber", "secondaryStreetName": "context.delivery.dependentThoroughfareName", "streetName": "context.delivery.thoroughfareName", "secondaryLocality": "context.delivery.doubleDependentLocality", "locality": "context.delivery.dependentLocality", "town": "context.delivery.postTown", "postcode": "context.delivery.postcode" } } } }, { "element": "docTask", "id": "getBestLabel", "parent": "schema.blpus", "config": { "taskName": "coalesce", "options": { "valuePaths": [ "doc._postalAddress" ], "target": "context.bestLabel" } } } ]