Closed magemax closed 4 years ago
J'approuve.
Ajout de la prise en compte des variations :
dotations: {
montants: {
dgf: number;
dsr: {
variation: -90000000
},
dsu: {
variation: 90000000
},
}
communes: {
...
}
}
Fixed by #29 [+ #30] + #31
Une requête complète et sa réponse pour l'histoire :
{
"descriptionCasTypes":[
{
"code":"76384"
},
{
"code":"76214"
},
{
"code":"77186"
}
],
"reforme":{
"dotations":{
"montants":{
"dgf":26846874416,
"dsu": {"variation": 10000000000},
"dsr": {"variation": 10000000000}
},
"communes":{
"dsr":{
"eligibilite":{
"popChefLieuMax":20000,
"popMax":10000
},
"bourgCentre":{
"eligibilite":{
"partPopCantonMin":0.15,
"exclusion":{
"agglomeration":{
"partPopDepartementMin":0.1,
"popMin":250000,
"popCommuneMin":100000
},
"canton":{
"popChefLieuMin":10000
},
"potentielFinancier":{
"rapportPotentielFinancierMoyen":2
}
}
},
"attribution":{
"popLimite":10000,
"effortFiscalLimite":1.2,
"coefMultiplicateurRevitalisationRurale":1.3,
"plafonnementPopulation":{
"0":500,
"100":1000,
"500":2250,
"15000000":999999999
}
}
},
"perequation":{
"eligibilite":{
"rapportPotentielFinancier":2
},
"attribution":{
"repartition":{
"ponderationPotentielFinancier":0.3,
"ponderationLongueurVoirie":0.3,
"ponderationNbreEnfants":0.3,
"ponderationPotentielFinancierParHectare":0.1
}
}
},
"cible":{
"eligibilite":{
"premieresCommunes":10000,
"indiceSynthetique":{
"ponderationPotentielFinancier":0.7,
"ponderationRevenu":0.3
}
}
}
},
"dsu":{
"eligibilite":{
"popMinSeuilBas":5000,
"popMinSeuilHaut":10000,
"rapportPotentielFinancier":2.5,
"pourcentageRangSeuilBas":0.1,
"pourcentageRangSeuilHaut":0.666667,
"indiceSynthetique":{
"ponderationPotentielFinancier":0.3,
"ponderationLogementsSociaux":0.15,
"ponderationAideAuLogement":0.3,
"ponderationRevenu":0.25
}
},
"attribution":{
"effortFiscalLimite":1.3,
"facteurClassementMax":4,
"facteurClassementMin":0.5,
"poidsSupplementaireZoneUrbaineSensible":2,
"poidsSupplementaireZoneFrancheUrbaine":1,
"augmentationMax":4000000
}
}
}
}
},
"strates":[
{
"habitants":500
},
{
"habitants":1000
},
{
"habitants":2000
},
{
"habitants":3500
},
{
"habitants":5000
},
{
"habitants":7500
},
{
"habitants":10000
},
{
"habitants":15000
},
{
"habitants":20000
},
{
"habitants":35000
},
{
"habitants":50000
},
{
"habitants":75000
},
{
"habitants":100000
},
{
"habitants":200000
},
{
"habitants":-1
}
]
}
Response :
{
"amendement": {
"communes": {
"dsr": {
"communes": [
{
"code": "76384",
"dotationParHab": 16.8102925326111,
"dotationParHabAnneeSuivante": 8.165465917256245,
"dureeAvantTerme": 5,
"eligible": true
},
{
"code": "76214",
"dotationParHab": 40.347455085440075,
"dotationParHabAnneeSuivante": 17.775280898876403,
"dureeAvantTerme": 6,
"eligible": true
},
{
"code": "77186",
"dotationParHab": 57.982412060301506,
"dotationParHabAnneeSuivante": 26.701822831690922,
"dureeAvantTerme": 6,
"eligible": true
}
],
"eligibles": 33368,
"strates": [
{
"dotationMoyenneParHab": 271.45358586925136,
"eligibles": 17731,
"habitants": 0,
"partDotationTotale": 0.10556814574716197,
"partEligibles": 0.9762153829213236,
"partPopTotale": 0.06007980567659335,
"potentielFinancierMoyenParHabitant": 785.8454228127517
},
{
"dotationMoyenneParHab": 330.6269978226543,
"eligibles": 6580,
"habitants": 500,
"partDotationTotale": 0.14797435677880716,
"partEligibles": 0.9782931906036277,
"partPopTotale": 0.06914158898029957,
"potentielFinancierMoyenParHabitant": 806.3467400384064
},
{
"dotationMoyenneParHab": 394.7741293527728,
"eligibles": 4533,
"habitants": 1000,
"partDotationTotale": 0.2410078060210481,
"partEligibles": 0.979049676025918,
"partPopTotale": 0.09431345042545572,
"potentielFinancierMoyenParHabitant": 872.0326152731276
},
{
"dotationMoyenneParHab": 372.2735567312287,
"eligibles": 2223,
"habitants": 2000,
"partDotationTotale": 0.2107280176604783,
"partEligibles": 0.973718791064389,
"partPopTotale": 0.08744828606868951,
"potentielFinancierMoyenParHabitant": 947.405572604316
},
{
"dotationMoyenneParHab": 291.8742430935292,
"eligibles": 951,
"habitants": 3500,
"partDotationTotale": 0.1143871729782963,
"partEligibles": 0.9557788944723619,
"partPopTotale": 0.060544230519498726,
"potentielFinancierMoyenParHabitant": 1037.1700621596808
},
{
"dotationMoyenneParHab": 229.48146192024637,
"eligibles": 752,
"habitants": 5000,
"partDotationTotale": 0.10528966626204744,
"partEligibles": 0.9411764705882353,
"partPopTotale": 0.07088092068659947,
"potentielFinancierMoyenParHabitant": 1051.8454563707317
},
{
"dotationMoyenneParHab": 157.52738149580216,
"eligibles": 368,
"habitants": 7500,
"partDotationTotale": 0.05248553170916034,
"partEligibles": 0.8997555012224939,
"partPopTotale": 0.0514724400060859,
"potentielFinancierMoyenParHabitant": 1122.9557653379306
},
{
"dotationMoyenneParHab": 27.7130815097763,
"eligibles": 119,
"habitants": 10000,
"partDotationTotale": 0.012201315986420418,
"partEligibles": 0.30749354005167956,
"partPopTotale": 0.0680163095668415,
"potentielFinancierMoyenParHabitant": 1138.9942133322938
},
{
"dotationMoyenneParHab": 17.086290517865347,
"eligibles": 52,
"habitants": 15000,
"partDotationTotale": 0.004850097430481,
"partEligibles": 0.29714285714285715,
"partPopTotale": 0.04385245235996443,
"potentielFinancierMoyenParHabitant": 1187.8121563478142
},
{
"dotationMoyenneParHab": 6.645310641947872,
"eligibles": 45,
"habitants": 20000,
"partDotationTotale": 0.004242738259705677,
"partEligibles": 0.17307692307692307,
"partPopTotale": 0.09863298165104539,
"potentielFinancierMoyenParHabitant": 1185.6980646277973
},
{
"dotationMoyenneParHab": 2.1233650148580496,
"eligibles": 9,
"habitants": 35000,
"partDotationTotale": 0.0007762258288945495,
"partEligibles": 0.0967741935483871,
"partPopTotale": 0.05647479213736301,
"potentielFinancierMoyenParHabitant": 1294.6643953363186
},
{
"dotationMoyenneParHab": 1.04903250215751,
"eligibles": 4,
"habitants": 50000,
"partDotationTotale": 0.00039633843303007776,
"partEligibles": 0.05970149253731343,
"partPopTotale": 0.05836714529630918,
"potentielFinancierMoyenParHabitant": 1311.1803548548592
},
{
"dotationMoyenneParHab": 0.45546297301283817,
"eligibles": 1,
"habitants": 75000,
"partDotationTotale": 9.25869044686453e-05,
"partEligibles": 0.04,
"partPopTotale": 0.03140419724516229,
"potentielFinancierMoyenParHabitant": 1367.7082351151298
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 100000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.06160112005002731,
"potentielFinancierMoyenParHabitant": 1253.8345214932885
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 200000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.08777027933006465,
"potentielFinancierMoyenParHabitant": 1653.1995112749637
}
]
},
"dsu": {
"communes": [
{
"code": "76384",
"dotationParHab": 153.90386634976787,
"eligible": true
},
{
"code": "76214",
"dotationParHab": 0.0,
"eligible": false
},
{
"code": "77186",
"dotationParHab": 0.0,
"eligible": false
}
],
"eligibles": 818,
"strates": [
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 0,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.06007980567659335,
"potentielFinancierMoyenParHabitant": 785.8454228127517
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 500,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.06914158898029957,
"potentielFinancierMoyenParHabitant": 806.3467400384064
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 1000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.09431345042545572,
"potentielFinancierMoyenParHabitant": 872.0326152731276
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 2000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.08744828606868951,
"potentielFinancierMoyenParHabitant": 947.405572604316
},
{
"dotationMoyenneParHab": 0.706722320705073,
"eligibles": 2,
"habitants": 3500,
"partDotationTotale": 0.0006277680657733953,
"partEligibles": 0.0020100502512562816,
"partPopTotale": 0.060544230519498726,
"potentielFinancierMoyenParHabitant": 1037.1700621596808
},
{
"dotationMoyenneParHab": 42.54985140806299,
"eligibles": 85,
"habitants": 5000,
"partDotationTotale": 0.04424916150146061,
"partEligibles": 0.10638297872340426,
"partPopTotale": 0.07088092068659947,
"potentielFinancierMoyenParHabitant": 1051.8454563707317
},
{
"dotationMoyenneParHab": 53.16011392318731,
"eligibles": 54,
"habitants": 7500,
"partDotationTotale": 0.04014563268524017,
"partEligibles": 0.13202933985330073,
"partPopTotale": 0.0514724400060859,
"potentielFinancierMoyenParHabitant": 1122.9557653379306
},
{
"dotationMoyenneParHab": 181.09461480110525,
"eligibles": 224,
"habitants": 10000,
"partDotationTotale": 0.18071585125057144,
"partEligibles": 0.5788113695090439,
"partPopTotale": 0.0680163095668415,
"potentielFinancierMoyenParHabitant": 1138.9942133322938
},
{
"dotationMoyenneParHab": 162.06004066443603,
"eligibles": 111,
"habitants": 15000,
"partDotationTotale": 0.10426714369273282,
"partEligibles": 0.6342857142857142,
"partPopTotale": 0.04385245235996443,
"potentielFinancierMoyenParHabitant": 1187.8121563478142
},
{
"dotationMoyenneParHab": 156.4622696347651,
"eligibles": 174,
"habitants": 20000,
"partDotationTotale": 0.22641721042731752,
"partEligibles": 0.6692307692307692,
"partPopTotale": 0.09863298165104539,
"potentielFinancierMoyenParHabitant": 1185.6980646277973
},
{
"dotationMoyenneParHab": 152.1703335265228,
"eligibles": 72,
"habitants": 35000,
"partDotationTotale": 0.12608466858763057,
"partEligibles": 0.7741935483870968,
"partPopTotale": 0.05647479213736301,
"potentielFinancierMoyenParHabitant": 1294.6643953363186
},
{
"dotationMoyenneParHab": 116.01044639118089,
"eligibles": 46,
"habitants": 50000,
"partDotationTotale": 0.0993443558746888,
"partEligibles": 0.6865671641791045,
"partPopTotale": 0.05836714529630918,
"potentielFinancierMoyenParHabitant": 1311.1803548548592
},
{
"dotationMoyenneParHab": 110.9496686788063,
"eligibles": 16,
"habitants": 75000,
"partDotationTotale": 0.05112005986278852,
"partEligibles": 0.64,
"partPopTotale": 0.03140419724516229,
"potentielFinancierMoyenParHabitant": 1367.7082351151298
},
{
"dotationMoyenneParHab": 88.80630123614667,
"eligibles": 26,
"habitants": 100000,
"partDotationTotale": 0.08026201128009293,
"partEligibles": 0.8387096774193549,
"partPopTotale": 0.06160112005002731,
"potentielFinancierMoyenParHabitant": 1253.8345214932885
},
{
"dotationMoyenneParHab": 36.316699067990335,
"eligibles": 8,
"habitants": 200000,
"partDotationTotale": 0.04676613677170324,
"partEligibles": 0.7272727272727273,
"partPopTotale": 0.08777027933006465,
"potentielFinancierMoyenParHabitant": 1653.1995112749637
}
]
}
}
},
"base": {
"communes": {
"dsr": {
"communes": [
{
"code": "76384",
"dotationParHab": 7.010937154543445,
"dotationParHabAnneeSuivante": 7.010937154543445,
"dureeAvantTerme": 1,
"eligible": true
},
{
"code": "76214",
"dotationParHab": 16.827398978815545,
"dotationParHabAnneeSuivante": 16.827398978815545,
"dureeAvantTerme": 1,
"eligible": true
},
{
"code": "77186",
"dotationParHab": 21.93862371924558,
"dotationParHabAnneeSuivante": 21.93862371924558,
"dureeAvantTerme": 1,
"eligible": true
}
],
"eligibles": 33159,
"strates": [
{
"dotationMoyenneParHab": 47.006695342403184,
"eligibles": 17731,
"habitants": 0,
"partDotationTotale": 0.12312041385327653,
"partEligibles": 0.9762153829213236,
"partPopTotale": 0.06007980567659335,
"potentielFinancierMoyenParHabitant": 785.8454228127517
},
{
"dotationMoyenneParHab": 46.21875256104099,
"eligibles": 6580,
"habitants": 500,
"partDotationTotale": 0.13931548865907942,
"partEligibles": 0.9782931906036277,
"partPopTotale": 0.06914158898029957,
"potentielFinancierMoyenParHabitant": 806.3467400384064
},
{
"dotationMoyenneParHab": 48.90737916056211,
"eligibles": 4533,
"habitants": 1000,
"partDotationTotale": 0.20108971148230162,
"partEligibles": 0.979049676025918,
"partPopTotale": 0.09431345042545572,
"potentielFinancierMoyenParHabitant": 872.0326152731276
},
{
"dotationMoyenneParHab": 49.53714989033658,
"eligibles": 2222,
"habitants": 2000,
"partDotationTotale": 0.1888531115673434,
"partEligibles": 0.9732807709154621,
"partPopTotale": 0.08744828606868951,
"potentielFinancierMoyenParHabitant": 947.405572604316
},
{
"dotationMoyenneParHab": 48.01564217234563,
"eligibles": 944,
"habitants": 3500,
"partDotationTotale": 0.12673522270398727,
"partEligibles": 0.9487437185929648,
"partPopTotale": 0.060544230519498726,
"potentielFinancierMoyenParHabitant": 1037.1700621596808
},
{
"dotationMoyenneParHab": 43.15130113762587,
"eligibles": 746,
"habitants": 5000,
"partDotationTotale": 0.13334141894561388,
"partEligibles": 0.9336670838548186,
"partPopTotale": 0.07088092068659947,
"potentielFinancierMoyenParHabitant": 1051.8454563707317
},
{
"dotationMoyenneParHab": 32.768853316821414,
"eligibles": 348,
"habitants": 7500,
"partDotationTotale": 0.07353224528433197,
"partEligibles": 0.8508557457212714,
"partPopTotale": 0.0514724400060859,
"potentielFinancierMoyenParHabitant": 1122.9557653379306
},
{
"dotationMoyenneParHab": 2.854809037824076,
"eligibles": 32,
"habitants": 10000,
"partDotationTotale": 0.008465097293513024,
"partEligibles": 0.082687338501292,
"partPopTotale": 0.0680163095668415,
"potentielFinancierMoyenParHabitant": 1138.9942133322938
},
{
"dotationMoyenneParHab": 2.9016509920468176,
"eligibles": 23,
"habitants": 15000,
"partDotationTotale": 0.005547290210552863,
"partEligibles": 0.13142857142857142,
"partPopTotale": 0.04385245235996443,
"potentielFinancierMoyenParHabitant": 1187.8121563478142
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 20000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.09863298165104539,
"potentielFinancierMoyenParHabitant": 1185.6980646277973
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 35000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.05647479213736301,
"potentielFinancierMoyenParHabitant": 1294.6643953363186
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 50000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.05836714529630918,
"potentielFinancierMoyenParHabitant": 1311.1803548548592
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 75000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.03140419724516229,
"potentielFinancierMoyenParHabitant": 1367.7082351151298
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 100000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.06160112005002731,
"potentielFinancierMoyenParHabitant": 1253.8345214932885
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 200000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.08777027933006465,
"potentielFinancierMoyenParHabitant": 1653.1995112749637
}
]
},
"dsu": {
"communes": [
{
"code": "76384",
"dotationParHab": 28.58125138182622,
"eligible": true
},
{
"code": "76214",
"dotationParHab": 0.0,
"eligible": false
},
{
"code": "77186",
"dotationParHab": 0.0,
"eligible": false
}
],
"eligibles": 818,
"strates": [
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 0,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.06007980567659335,
"potentielFinancierMoyenParHabitant": 785.8454228127517
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 500,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.06914158898029957,
"potentielFinancierMoyenParHabitant": 806.3467400384064
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 1000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.09431345042545572,
"potentielFinancierMoyenParHabitant": 872.0326152731276
},
{
"dotationMoyenneParHab": 0.0,
"eligibles": 0,
"habitants": 2000,
"partDotationTotale": 0.0,
"partEligibles": 0.0,
"partPopTotale": 0.08744828606868951,
"potentielFinancierMoyenParHabitant": 947.405572604316
},
{
"dotationMoyenneParHab": 0.468009754614098,
"eligibles": 2,
"habitants": 3500,
"partDotationTotale": 0.0008681958526680736,
"partEligibles": 0.0020100502512562816,
"partPopTotale": 0.060544230519498726,
"potentielFinancierMoyenParHabitant": 1037.1700621596808
},
{
"dotationMoyenneParHab": 11.89579534448237,
"eligibles": 85,
"habitants": 5000,
"partDotationTotale": 0.02583526210426159,
"partEligibles": 0.10638297872340426,
"partPopTotale": 0.07088092068659947,
"potentielFinancierMoyenParHabitant": 1051.8454563707317
},
{
"dotationMoyenneParHab": 13.894711610707354,
"eligibles": 54,
"habitants": 7500,
"partDotationTotale": 0.021913630339165022,
"partEligibles": 0.13202933985330073,
"partPopTotale": 0.0514724400060859,
"potentielFinancierMoyenParHabitant": 1122.9557653379306
},
{
"dotationMoyenneParHab": 57.711893551013695,
"eligibles": 224,
"habitants": 10000,
"partDotationTotale": 0.12027307816679554,
"partEligibles": 0.5788113695090439,
"partPopTotale": 0.0680163095668415,
"potentielFinancierMoyenParHabitant": 1138.9942133322938
},
{
"dotationMoyenneParHab": 52.90709428655041,
"eligibles": 111,
"habitants": 15000,
"partDotationTotale": 0.07108825170013022,
"partEligibles": 0.6342857142857142,
"partPopTotale": 0.04385245235996443,
"potentielFinancierMoyenParHabitant": 1187.8121563478142
},
{
"dotationMoyenneParHab": 69.57991488662873,
"eligibles": 174,
"habitants": 20000,
"partDotationTotale": 0.2102790919800178,
"partEligibles": 0.6692307692307692,
"partPopTotale": 0.09863298165104539,
"potentielFinancierMoyenParHabitant": 1185.6980646277973
},
{
"dotationMoyenneParHab": 81.58166201232234,
"eligibles": 72,
"habitants": 35000,
"partDotationTotale": 0.14116831393884052,
"partEligibles": 0.7741935483870968,
"partPopTotale": 0.05647479213736301,
"potentielFinancierMoyenParHabitant": 1294.6643953363186
},
{
"dotationMoyenneParHab": 70.34016133033387,
"eligibles": 46,
"habitants": 50000,
"partDotationTotale": 0.12579455718906465,
"partEligibles": 0.6865671641791045,
"partPopTotale": 0.05836714529630918,
"potentielFinancierMoyenParHabitant": 1311.1803548548592
},
{
"dotationMoyenneParHab": 81.26388343876425,
"eligibles": 16,
"habitants": 75000,
"partDotationTotale": 0.07819433793849444,
"partEligibles": 0.64,
"partPopTotale": 0.03140419724516229,
"potentielFinancierMoyenParHabitant": 1367.7082351151298
},
{
"dotationMoyenneParHab": 64.21389693134084,
"eligibles": 26,
"habitants": 100000,
"partDotationTotale": 0.12120141027714228,
"partEligibles": 0.8387096774193549,
"partPopTotale": 0.06160112005002731,
"potentielFinancierMoyenParHabitant": 1253.8345214932885
},
{
"dotationMoyenneParHab": 31.005913559663522,
"eligibles": 8,
"habitants": 200000,
"partDotationTotale": 0.0833838705134199,
"partEligibles": 0.7272727272727273,
"partPopTotale": 0.08777027933006465,
"potentielFinancierMoyenParHabitant": 1653.1995112749637
}
]
}
}
},
"baseToAmendement": {
"communes": {
"dsr": {
"nouvellementEligibles": 209,
"plusEligibles": 0,
"toujoursEligibles": 33159
},
"dsu": {
"nouvellementEligibles": 0,
"plusEligibles": 0,
"toujoursEligibles": 818
}
}
}
}
Voici la propale, avec des conventions de nommage qui visent à être cohérentes avec l'existant. J'ai mis des décimales sur les nombres qui ont à mon sens vocation à être des float au cas où ça intéresse.
Deux remarques :