/
routes.php
134 lines (104 loc) · 3.58 KB
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
//COSTSHEETMANAGMENT
$app->get('/', function(){
});
/*
* CREATE
*/
//CREATE A COST SHEET
$app->get('/create/costsheet/:idVisitor/:month', function($idVisitor,$month){
echo createCostSheet($idVisitor, $month);
});
//CREATE DE PACKAGELINE
$app->get('/create/packageLine/:month/:quantity/:packageCostId/:costSheetId', function($month,$quantity,$packageCostId,$costSheetId){
echo createPackageLine($month,$quantity,$packageCostId,$costSheetId);
});
//CREATE AN OUTPACKAGE LINE
$app->get('/create/outPackageLine/:month/:cost/:label/:costSheetId', function($month, $cost,$label,$costSheetId){
echo createOutPackageLine($month, $cost, $label, $costSheetId);
});
//CREATE A PACKAGECOST
$app->get('/create/packageCost/:label/:cost', function($label, $cost){
echo createPackageCost($label, $cost);
});
/*
* READ
*/
//VISITOR BY MATRICULE @TODO appel a l'API RH
$app->get('/visitor/:id', function($id){
});
//ALL COST SHEET BY MONTH
$app->get('/costSheet/month/:month', function($month){
echo readCostSheetsByMonth($month);
});
//COST SHEET BY VISITOR & BY MONTH
$app->get('/costSheet/visitor/:matricule/month/:month', function($matricule,$month){
echo readCostSheetsByMonthVisitor($month,$matricule);
});
//ALL COST SHEET FOR ONE VISITOR
$app->get('/costSheet/visitor/:matricule', function($matricule){
echo readCostSheetsByVisitor($matricule);
});
//ALL PACKAGE COST
$app->get('/costSheet/packageCost', function(){
echo readPackageCost();
});
//ALL COST SHEET BY STATUS
$app->get('/costSheet/Status/:status', function($status){
echo readCostSheetByStatus($status);
});
//ALL PACKAGE LINE FROM A COST SHEET
$app->get('/packageLine/:costSheetId', function($costSheetId){
echo readPackageLineByCostSheet($costSheetId);
});
//ALL OUT PACKAGE LINE FROM A COST SHEET
$app->get('/outPackageLine/:costSheetId', function($costSheetId){
echo readOutPackageLineByCostSheet($costSheetId);
});
/*
* UPDATE
*/
//UPDATE COST SHEET STATUS
$app->get('/update/costSheet/status/:status/idCostSheet/:idCostSheet', function($status,$idCostSheet){
echo updateCostSheetStatus($status,$idCostSheet);
});
//UPDATE A COST SHEET
$app->get('/update/costsheet/:id/:justificationNumber/:validCost', function($id,$justificationNumber,$validCost){
echo updateCostSheet($id,$justificationNumber,$validCost);
});
//UPDATE AN OUTPACKAGE LINE
$app->get('/update/outpackageLine/:id/:cost/:label', function($id,$cost,$label){
echo updateOutPackageLine($id,$cost,$label);
});
//UPDATE A PACKAGE LINE
$app->get('/update/packageLine/:id/:quantity/:packageCostId', function($id,$quantity,$packageCostId){
echo updatePackageLine($id,$quantity,$packageCostId);
});
//UPDATE A PACKAGE COST
$app->get('/update/packageCost/:id/:cost/:label', function($id,$cost,$label){
echo updatePackageCost($id,$cost,$label);
});
/*
* DELETE
*/
//DELETE ALL COSTSHEET OLDER THAN A YEAR
$app->get('/delete/costSheet/month/:month', function($month){
deleteCostSheetYear($month);
});
//DELETE OUTPACKAGE LINE FROM A COSTSHEET
$app->get('/delete/outpackageLine/costSheetId/:costSheetId', function($costSheetId){
deleteOutPackageLine($costSheetId);
});
//DELETE PACKAGE LINE FROM A COSTSHEET
$app->get('/delete/packageLine/costSheetId/:costSheetId', function($costSheetId){
deletePackageLine($costSheetId);
});
//DELETE ALL LINES FROM A COSTSHEET
$app->get('/delete/Line/costSheetId/:costSheetId', function($costSheetId){
deleteOutPackageLine($costSheetId);
deletePackageLine($costSheetId);
});
//DELETE A PACKAGE COST
$app->get('/delete/packageCost/:id', function($id){
deletePackageCost($id);
});