Update Server authored by Achraf Aissy's avatar Achraf Aissy
......@@ -9,17 +9,21 @@ this action triggers the ressource demand to send a package i.e the URL will be
> why do we have an [id] :question: well it's simple when you create a demand you either confirm or cancel it , so we will need an id to identify the specific demand , one thig we didn't mention is that when you create a demand the request add a collection demand in mongodb doing so we have automatically have an id that will allow us to fetch and confirm/cancel a specific demand
**2. Controllers**
- in the [Controllers]() package we have what we will need to schedule `scheduler` and to interact with the supervisor using the robotAPI.
- in the [Controllers]() package we have what we will need to schedule `scheduler` and to interact with the `robot server` using the robotAPI.
> We call the controllers using [CRON](https://www.digitalocean.com/community/tutorials/nodejs-cron-jobs-by-examples) tasks.
- The management of the schedulers wasn't processed in this project if you want to know more about schedulers go [here](https://svn.ensisa.uha.fr/redmine/projects/colis/wiki/Server_Scheduler),
- The [robotAPI.js](https://gitlab.cluster.ensisa.uha.fr/devcolis/colis/-/blob/dev/server/controllers/vehicle/robotAPI.js) file contains the functions of HTTP requests to the various supervisors.
- The [robotAPI.js](https://gitlab.cluster.ensisa.uha.fr/devcolis/colis/-/blob/dev/server/controllers/vehicle/robotAPI.js) file contains the functions of HTTP requests to the robot sever.
- The source file: [robotControllers.js](https://gitlab.cluster.ensisa.uha.fr/devcolis/colis/-/blob/dev/server/controllers/vehicle/robotController.js) contains vehicle management. it Updates the vehicle with supervisor information
- The source file: [robotControllers.js](https://gitlab.cluster.ensisa.uha.fr/devcolis/colis/-/blob/dev/server/controllers/vehicle/robotController.js) manages the robot vehicle’s workflow and status by:
1. Updating Planning: It adds new activities, verifies the vehicle’s state, notifies about each activity’s status, removes completed activities from the queue, and moves to the next one.
2. Status Synchronization: Updates the vehicle status received from the robot server and saves any changes.
3. Error Handling: Catches and logs any errors to keep the process stable.
**3. Schema**
- Here we the Schema that we will use to question our Mongodb. In the root of our folder we will find the main entities. You will see two other folders:
......@@ -57,3 +61,13 @@ you will have to do the same thig to the `ROI.json` and `paths.json` files (whil
**5. Utils**
In this folder you will find some tools ( a Mailer to send some email `ParamsManager` stores some parameters necessary to establish connections
**6. RobotServerApi**
- Here we have the api that allows the `robot server` to interact with the `server`.
- The [RobotServerApi.js]
(https://gitlab.cluster.ensisa.uha.fr/devcolis/colis/-/blob/dev/server/robotServerApi/RobotServerApi.js) provides HTTP request functions that allow the robot server to communicate with the colis server `server`, sending requests to update and retrieve vehicle information as needed using the `robotController.js`.
- The [RobotServerApiEntity.js]
provides HTTP request functions enabling the robot server to communicate with the colis server, specifically to retrieve vehicle planning and the demands associated with it.
\ No newline at end of file