Files
jspg/fixtures/filter.json

222 lines
5.4 KiB
JSON

[
{
"description": "Filter Synthesis Object-Oriented Composition",
"database": {
"puncs": [],
"enums": [],
"relations": [
{
"id": "rel1",
"type": "relation",
"constraint": "fk_person_billing_address",
"source_type": "person",
"source_columns": [
"billing_address_id"
],
"destination_type": "address",
"destination_columns": [
"id"
],
"prefix": "billing_address"
}
],
"types": [
{
"id": "type1",
"type": "type",
"name": "person",
"module": "core",
"source": "person",
"hierarchy": [
"person"
],
"variations": [
"person"
],
"schemas": {
"person": {
"type": "object",
"properties": {
"first_name": {
"type": "string"
},
"age": {
"type": "integer"
},
"billing_address": {
"type": "address"
},
"birth_date": {
"type": "string",
"format": "date-time"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"ad_hoc": {
"type": "object",
"properties": {
"foo": {
"type": "string"
}
}
}
}
}
}
},
{
"id": "type2",
"type": "type",
"name": "address",
"module": "core",
"source": "address",
"hierarchy": [
"address"
],
"variations": [
"address"
],
"schemas": {
"address": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
}
}
}
},
{
"id": "type3",
"type": "type",
"name": "filter",
"module": "core",
"source": "filter",
"hierarchy": [
"filter"
],
"variations": [
"filter",
"string.condition",
"integer.condition",
"date.condition"
],
"schemas": {
"condition": {
"type": "object",
"properties": {
"kind": {
"type": "string"
}
}
},
"string.condition": {
"type": "condition",
"properties": {
"$eq": {
"type": [
"string",
"null"
]
}
}
},
"integer.condition": {
"type": "condition",
"properties": {
"$eq": {
"type": [
"integer",
"null"
]
}
}
},
"date.condition": {
"type": "condition",
"properties": {
"$eq": {
"type": [
"string",
"null"
]
}
}
}
}
}
]
},
"tests": [
{
"description": "Assert filter generation map accurately represents strongly typed conditions natively.",
"action": "compile",
"expect": {
"success": true,
"schemas": {
"person": {},
"person.filter": {
"type": "object",
"compiledPropertyNames": [
"age",
"billing_address",
"birth_date",
"first_name"
],
"properties": {
"first_name": {
"type": [
"string.condition",
"null"
]
},
"age": {
"type": [
"integer.condition",
"null"
]
},
"billing_address": {
"type": [
"address.filter",
"null"
]
},
"birth_date": {
"type": [
"date.condition",
"null"
]
}
}
},
"address": {},
"address.filter": {
"type": "object",
"compiledPropertyNames": [
"city"
],
"properties": {
"city": {
"type": [
"string.condition",
"null"
]
}
}
},
"condition": {},
"string.condition": {},
"integer.condition": {},
"date.condition": {}
}
}
}
]
}
]