#LoopbackParis
Starting soon ...
Développeuse javascript freelance
Arbitre et joueuse Magic The Gathering
@purple_orwel
Aurélie VIOLETTE
{
"name": "Judge",
[...]
"properties": {
"firstname": {
"type": "string",
"required": true
},
"lastname": {
"type": "string",
"required": true
},
"nationality": {
"type": "string",
"required": true
}
}
[...]
}
{
"name": "Shop",
[...]
"properties": {
"name": {
"type": "string",
"required": true
}
}
[...]
}
{
"name": "Tournament",
[...]
"properties": {
"location": {
"type": "string",
"required": true
},
"type": {
"type": "string",
"required": true
}
},
"relations": {
"shop": {
"type": "belongsTo",
"model": "Shop"
},
"judge": {
"type": "belongsTo",
"model": "Judge"
}
}
[...]
}
Trouver tous les tournois à Paris, avec leur arbitre et leur boutique
"filter": {
"where": {
"location": "Paris"
},
"include": ["judge", "shop"]
}
[
{
"location": "Paris",
"type": "PPTQ",
"id": 1,
"judgeId": 1,
"shopId": 1,
"judge": {
"firstname": "Aurélie",
"lastname": "Violette",
"nationality": "Française",
"id": 1
},
"shop": {
"name": "Bazaar of Moxen",
"id": 1
}
},
{
"location": "Paris",
"type": "RPTQ",
"id": 2,
"judgeId": 1,
"shopId": 1,
"judge": {
"firstname": "Aurélie",
"lastname": "Violette",
"nationality": "Française",
"id": 1
},
"shop": {
"name": "Bazaar of Moxen",
"id": 1
}
}
]
Trouver tous les tournois organisés par Trollune avec leur arbitre
"filter": {
"include":[
"judge",
{
"relation":"shop",
"where": {"name":"Trollune"}
}
]
}
[
{
"location": "Lyon",
"type": "PPTQ",
"id": 3,
"judgeId": 1,
"shopId": 2,
"judge": {
"firstname": "Aurélie",
"lastname": "Violette",
"nationality": "Française",
"id": 1
},
"shop": {
"name": "Trollune",
"id": 2
}
}
]
TOUT
Trouver tous les PPTQs, arbitrés par un français et organisé par CartaJeux
API CLIENT
MODEL
DATASOURCE
RELATED MODEL
result
result
data
fetch
data
query
fetch
query
API CLIENT
MODEL
DATASOURCE
RELATED MODEL
Trouver tous les PPTQs, arbitrés par un français et organisé par CartaJeux
"filter": {
"where": {"type": "PPTQ"},
"include":["judge", "shop"]
},
"siftFilter": {
"judge":{"nationality": "Française"},
"shop": {"name": "CartaJeux"}
}
[
{
"location": "Lyon",
"type": "PPTQ",
"id": 4,
"judgeId": 2,
"shopId": 3,
"judge": {
"firstname": "Kevin",
"lastname": "Desprez",
"nationality": "Française",
"id": 2
},
"shop": {
"name": "CartaJeux",
"id": 3
}
}
]
Une solution simple à mettre en place
Pas adaptée à toutes les situations
Open issue sur github ici, version SQL en cours