Skip to content

Commit

Permalink
#36: Added new DD 1.7 and DD 2.0 metadata files (#37)
Browse files Browse the repository at this point in the history
* #36: Added new DD 1.7 and DD 2.0 metadata files

* Update metadata-report.json

Added Payloads

* Update metadata-report.json

Added Payloads

* #36: fix tests

---------

Co-authored-by: darnjo <josh@reso.org>
Co-authored-by: mohit-s96 <mohitsrivastava67@gmail.com>
  • Loading branch information
3 people authored Nov 9, 2023
1 parent 418d33f commit acfa71c
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 99 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ dist

# TernJS port file
.tern-port

.DS_Store
5 changes: 3 additions & 2 deletions lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ const getStandardMetadata = (version = CURRENT_DD_VERSION) =>
* @type function(string): string[]
*/
const getStandardResources = version => {
const { resources = [] } = getMetadata(version);
return resources?.map(resource => resource?.resourceName);
const metadata = getMetadata(version);
const resources = [...new Set(metadata.fields.map(f => f.resourceName))];
return resources;
};

const getFieldDetails = async (fieldName, resourceName) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/references/dd-1.7/metadata-report.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/references/dd-2.0/metadata-report.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"url": "https://github.com/RESOStandards/reso-certification-etl/issues"
},
"homepage": "https://github.com/RESOStandards/reso-certification-etl#readme",
"engines": {
"node": ">=18.0.0"
},
"devDependencies": {
"mocha": "^10.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion test/data-availability.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {
} = require('..');
const assert = require('assert');

describe('process-metadata', function () {
describe('processDataAvailability', function () {
it('should match the expected data', async () => {
const processedReport = await processDataAvailability(daReport);
assert.deepStrictEqual(JSON.parse(JSON.stringify(processedReport)), expectedReport);
Expand Down
2 changes: 1 addition & 1 deletion test/data-dictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {
} = require('..');
const assert = require('assert');

describe('process-metadata', function () {
describe('processMetadata', function () {
it('should match the expected data', () => {
const processedReport = processMetadataReport(metadataReport);
assert.deepStrictEqual(JSON.parse(JSON.stringify(processedReport)), expectedReport);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,61 +8,31 @@
"resourceName": "Office",
"fieldName": "OfficeStateOrProvince",
"frequency": 1000,
"availability": 1,
"eqZero": false,
"gtZero": true,
"gte25": true,
"gte50": true,
"gte75": true,
"eq100": true
"availability": 1
},
{
"resourceName": "Property",
"fieldName": "AccessibilityFeatures",
"frequency": 2000,
"availability": 2,
"eqZero": false,
"gtZero": true,
"gte25": true,
"gte50": true,
"gte75": true,
"eq100": false
"availability": 2
},
{
"resourceName": "Property",
"fieldName": "StandardStatus",
"frequency": 1000,
"availability": 1,
"eqZero": false,
"gtZero": true,
"gte25": true,
"gte50": true,
"gte75": true,
"eq100": true
"availability": 1
},
{
"resourceName": "Property",
"fieldName": "ListPrice",
"frequency": 999,
"availability": 0.999,
"eqZero": false,
"gtZero": true,
"gte25": true,
"gte50": true,
"gte75": true,
"eq100": false
"availability": 0.999
},
{
"resourceName": "Property",
"fieldName": "CustomLookupField123",
"frequency": 500,
"availability": 0.5,
"eqZero": false,
"gtZero": true,
"gte25": true,
"gte50": true,
"gte75": false,
"eq100": false
"availability": 0.5
}
],
"lookups": [
Expand All @@ -77,91 +47,49 @@
"fieldName": "OfficeStateOrProvince",
"lookupValue": "CA",
"frequency": 900,
"availability": 0.9,
"eqZero": false,
"gtZero": true,
"gte25": true,
"gte50": true,
"gte75": true,
"eq100": false
"availability": 0.9
},
{
"resourceName": "Office",
"fieldName": "OfficeStateOrProvince",
"lookupValue": "HI",
"frequency": 100,
"availability": 0.1,
"eqZero": false,
"gtZero": true,
"gte25": false,
"gte50": false,
"gte75": false,
"eq100": false
"availability": 0.1
},
{
"resourceName": "Property",
"fieldName": "AccessibilityFeatures",
"lookupValue": "Accessible Approach with Ramp",
"frequency": 100,
"availability": 0.1,
"eqZero": false,
"gtZero": true,
"gte25": false,
"gte50": false,
"gte75": false,
"eq100": false
"availability": 0.1
},
{
"resourceName": "Property",
"fieldName": "AccessibilityFeatures",
"lookupValue": "ReinforcedFloors",
"frequency": 100,
"availability": 0.1,
"eqZero": false,
"gtZero": true,
"gte25": false,
"gte50": false,
"gte75": false,
"eq100": false
"availability": 0.1
},
{
"resourceName": "Property",
"fieldName": "StandardStatus",
"lookupValue": "Active Under Contract",
"frequency": 900,
"availability": 0.9,
"eqZero": false,
"gtZero": true,
"gte25": true,
"gte50": true,
"gte75": true,
"eq100": false
"availability": 0.9
},
{
"resourceName": "Property",
"fieldName": "StandardStatus",
"lookupValue": "Pending",
"frequency": 100,
"availability": 0.1,
"eqZero": false,
"gtZero": true,
"gte25": false,
"gte50": false,
"gte75": false,
"eq100": false
"availability": 0.1
},
{
"resourceName": "Property",
"fieldName": "CustomLookupField123",
"lookupValue": "PENDING",
"frequency": 10,
"availability": 0.01,
"eqZero": false,
"gtZero": true,
"gte25": false,
"gte50": false,
"gte75": false,
"eq100": false
"availability": 0.01
}
],
"resources": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
},
{
"lookupName": "PropertyEnums.AccessibilityFeatures",
"lookupValue": "Accessible Approach with Ramp",
"lookupValue": "_23923049",
"type": "Edm.Int32",
"standardRESO": true,
"standardDisplayName": "Accessible Approach with Ramp"
"standardRESO": false
},
{
"lookupName": "PropertyEnums.AccessibilityFeatures",
Expand All @@ -83,10 +82,9 @@
},
{
"lookupName": "PropertyEnums.Statuses",
"lookupValue": "Active Under Contract",
"lookupValue": "ACTIVE_UC",
"type": "Edm.Int32",
"standardRESO": true,
"standardDisplayName": "Active Under Contract"
"standardRESO": false
},
{
"lookupName": "CustomLookups.LookupField123",
Expand All @@ -101,8 +99,8 @@
"standardResourcesCount": 2,
"localResourcesCount": 0,
"totalResourcesCount": 2,
"standardLookupsCount": 6,
"localLookupsCount": 2,
"standardLookupsCount": 4,
"localLookupsCount": 4,
"totalLookupsCount": 8,
"iDXFieldsCount": 4,
"iDXResourcesCount": 2,
Expand All @@ -114,7 +112,7 @@
},
"Property": {
"fields": { "total": 4, "reso": 3, "idx": 3, "local": 1 },
"lookups": { "total": 6, "reso": 4, "idx": 2, "local": 2 }
"lookups": { "total": 6, "reso": 2, "idx": 1, "local": 4 }
}
}
}

0 comments on commit acfa71c

Please sign in to comment.