This commit is contained in:
Tykayn 2025-01-15 22:20:14 +01:00 committed by tykayn
commit 996524bc6d
107 changed files with 1295536 additions and 0 deletions

View file

@ -0,0 +1,148 @@
import MappingConfigType from "../../mappings/mapping-config.type";
/**
* configurations de mapping pour les cas de tests
*/
export const mappingRemoveAll: MappingConfigType = {
config_name: 'testing config mappingRemoveAll',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {},
tags: {},
add_not_mapped_tags_too: false,
source: {
geojson_path: "",
url: ""
},
filters: {},
}
export const mappingSame: MappingConfigType = {
config_name: 'testing config mappingSame',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {},
tags: {
equal: 'equal'
},
add_not_mapped_tags_too: false,
source: {
geojson_path: "",
url: ""
},
filters: {},
}
export const mappingName: MappingConfigType = {
config_name: 'testing config mappingName',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {},
add_not_mapped_tags_too: false,
tags: {
nom_amenageur: 'name'
},
source: {
geojson_path: "",
url: ""
},
filters: {},
}
export const mappingPhone: MappingConfigType = {
config_name: 'testing config mappingPhone',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {},
tags: {
telephone_operateur: {
key_converted: 'phone',
convert_to_phone: true, // convertit en yes ou no
},
},
add_not_mapped_tags_too: false,
source: {
geojson_path: "",
url: ""
},
filters: {},
}
export const mappingBoolean: MappingConfigType = {
config_name: 'testing config mappingBoolean',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {},
tags: {
consolidated_is_lon_lat_correct: {
convert_to_boolean_value: true,
},
},
add_not_mapped_tags_too: false,
source: {
geojson_path: "",
url: ""
},
filters: {},
}
export const mappingTruthy: MappingConfigType = {
config_name: 'testing config mappingTruthy',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {},
tags: {
consolidated_is_lon_lat_correct: {
truthy_value: "succès",
},
},
add_not_mapped_tags_too: false,
source: {
geojson_path: "",
url: ""
},
filters: {},
}
export const mappingFalsy: MappingConfigType = {
config_name: 'testing config mappingFalsy',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {},
tags: {
consolidated_city: {
falsy_value: "pas ouf succès",
},
},
add_not_mapped_tags_too: false,
source: {
geojson_path: "",
url: ""
},
filters: {},
}
export const mappingIgnoreFalsy: MappingConfigType = {
config_name: 'testing config mappingIgnore',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {},
tags: {
consolidated_city: {
ignore_if_falsy: true,
},
},
add_not_mapped_tags_too: false,
source: {
geojson_path: "",
url: ""
},
filters: {},
}
export const mappingIgnoreTruthy: MappingConfigType = {
config_name: 'testing config mappingIgnore',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {},
tags: {
consolidated_is_lon_lat_correct: {
ignore_if_truthy: true,
},
},
add_not_mapped_tags_too: false,
source: {
geojson_path: "",
url: ""
},
filters: {},
}

24
tests/data/testing.json Normal file
View file

@ -0,0 +1,24 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
4.822159,
45.635079
]
},
"properties": {
"nom_amenageur": "Bob",
"siren_amenageur": "891624884",
"telephone_operateur": "0123456789",
"equal": "same value",
"consolidated_commune": "S\u00e9r\u00e9zin-du-Rh\u00f4ne",
"consolidated_is_lon_lat_correct": true,
"consolidated_city": false
}
}
]
}