Code Monkey home page Code Monkey logo

alerts's People

Contributors

docky37 avatar

Watchers

 avatar  avatar  avatar

alerts's Issues

Refactor

  • remove id in CoveredPerson class used in OPS#1 (done)
  • rename birthDate as birthdate (done)
  • extract service interfaces (done)
  • use a PersonDTO class for OPS#1 et 2 (done)
  • rename model DTO classes and move them in alerts/DTO (done)

Prepare Project

  • Install Spring Boot Starter MVC (2.2.5)
  • Add JaCoCo, Findbugs
  • Add Surfire report, JaCoCo report and FindBugs report

Add MedicalRecords endpoint

  • add MedicalRecords (model)
  • add MedicalReportController & unit tests
  • add MedicalReportService & unit tests

Data input validation

  • Need to avoid duplicates in address (PB with POST request because omnipotent)
  • Need to avoid duplicate persons (PB with POST request because omnipotent)
  • Verify Put request: same FirstName + LastName in URI than in Content
  • Verify mails format
  • Verify phone format

Create Controllers class and unit tests

  • Create PersonControllerTest class with first test on Get request.
  • Create PersonService class mocked in PersonControllerTest.
  • Create PersonController with Get request.

After that same process test + feat for

  • Get Person/lastName/firstName
  • Push Person
  • Put Person/lastName/firstName
  • Delete

Fix Bug in update methods

  • In PersonService & MedicalRecordsService update method do not check if firstName & lastName are the same in content than in parameters !!! So it is possible to rename a Person !

OPS#5: Flood (List of all addresses covered by a given station)

Cette liste doit regrouper les personnes par adresse. Elle doit aussi inclure le nom, le numéro de téléphone et l'âge des habitants, etfaire figurer leurs antécédents médicaux (médicaments, posologie et allergies) à côté de chaque nom.
List of Person (names, phone, age, medical data)
Group by Address

Create OPS#6 person info

  • Written to return a List instead of one PersonInfoDTO so method is able to deal with namesake, and return more than one PersonInfoDTO.
  • The mapping method for OPS#6 is a part of OPS#4 one.

BugFix: The http PUT requests that are not correct (it does not use path variable)

Norme HTTP. D’après la RFC 2616 (HTTP methods), PUT sert à
Créer une entité :
L’URI doit être celle de l’entité à créer . Si l’entité dans la requête est acceptée et créée côté serveur, le serveur doit renvoyer un code 201 (created).
Si l’entité peut avoir plusieurs URIs (exemple : /script/v1.2 ou /script/current), le serveur peut donc définir ces URIs alternatives comme pointant sur la nouvelle entité

Modifier une entité :
Si une entité avec la même URI que celle de la requête existe déjà, l’entité de la requête devrait la remplacer. Ce n’est pas une création, le code retourné par le serveur en cas de succès doit être 200 (OK) ou 204 (No content). En effet, en pratique un PUT va très rarement générer une réponse avec un contenu.

BugFix : FindBugs issues

EI: May expose internal representation by returning reference to mutable object

La méthode com.safetynet.alerts.DTO.PersonInfoDTO.getAllergies() risque d'exposer sa représentation interne en renvoyant com.safetynet.alerts.DTO.PersonInfoDTO.allergies
La méthode com.safetynet.alerts.DTO.PersonInfoDTO.getMedications() risque d'exposer sa représentation interne en renvoyant com.safetynet.alerts.DTO.PersonInfoDTO.medications
La méthode new com.safetynet.alerts.DTO.PersonInfoDTO(String, String, String, String[], String[], String) risque d'exposer sa représentation interne en stockant un objet externe modifiable dans com.safetynet.alerts.DTO.PersonInfoDTO.allergies
La méthode new com.safetynet.alerts.DTO.PersonInfoDTO(String, String, String, String[], String[], String) risque d'exposer sa représentation interne en stockant un objet externe modifiable dans com.safetynet.alerts.DTO.PersonInfoDTO.medications
La méthode com.safetynet.alerts.DTO.PersonInfoDTO.setAllergies(String[]) risque d'exposer sa représentation interne en stockant un objet externe modifiable dans com.safetynet.alerts.DTO.PersonInfoDTO.allergies
La méthode com.safetynet.alerts.DTO.PersonInfoDTO.setMedications(String[]) risque d'exposer sa représentation interne en stockant un objet externe modifiable dans com.safetynet.alerts.DTO.PersonInfoDTO.medications

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.