Skip to content

Individual Plan #9

Description

@Toby-Leeder

Plans

Issue #1

FINISH BY FRIDAY, MAY 24

  • Create unified data object (each type [catagorical/quantitative] should be inherited by this)
  • Associate StappletData to user using detailsService file
  • Finish functional api controllers
  • Integrate api to frontend

Issue #2

FINISH BY MONDAY, MAY 27

  • Use a DetailSservice file to associate this with user
  • update frontend to allow searching through existing qr codes

Issue #3

LOW PRIORITY

  • Update frontend to use custom url
  • Update backend to use custom subdomain

What I'll Show

  • Auto issues pulling (integration into project) --> transition into our scrum board as a whole
  • Statistics
  • QR Code
  • Teamwork
  • Custom domain (if applicable)

Issues Pulling

Screenshot 2024-05-21 at 12 13 47 PM

Statistics:

Quantitative Data

Screenshot 2024-05-21 at 11 50 18 AM

Categorical Data

Screenshot 2024-05-21 at 11 51 47 AM

Basic API Controller

    @GetMapping("/twoQuantitative")
    @Transactional
    public ResponseEntity<List<TwoQuantitative>> getTwoQuantitatives() {
        List<TwoQuantitative> twoQuantitatives = twoQRepository.findAll();
        twoQuantitatives.forEach(quantitative -> Hibernate.initialize(quantitative.getLsrl()));
        return new ResponseEntity<>(twoQuantitatives, HttpStatus.OK);
    }   

    @GetMapping("/quantitative")
    public ResponseEntity<List<Quantitative>> getQuantitatives() {
        List<Quantitative> quantitative = qRepository.findAll();
        return new ResponseEntity<>(quantitative, HttpStatus.OK);
    }   

    @PostMapping("/newQuantitative")
    public ResponseEntity<Quantitative> newQuantitative(@RequestBody QuantitativeRequest quantitativeRequest) {
        List<Double> data = quantitativeRequest.getData();
        String name = quantitativeRequest.getName(); 

        Quantitative quantitative = new Quantitative(data, name);
                
        qRepository.save(quantitative);

        return new ResponseEntity<>(quantitative, HttpStatus.OK);
    }

    @PostMapping("/newTwoQuantitative")
    public ResponseEntity<TwoQuantitative> newCode(@RequestBody TwoQuantitativeRequest twoQuantitativeRequest) {
        List<Double> explanatory = twoQuantitativeRequest.getExplanatory();
        List<Double> response = twoQuantitativeRequest.getResponse();
        String explanatoryName = twoQuantitativeRequest.getExplanatoryName(); 
        String responseName = twoQuantitativeRequest.getResponseName(); 

        Quantitative quantitative1 = new Quantitative(explanatory, explanatoryName);
        Quantitative quantitative2 = new Quantitative(response, responseName);
                
        qRepository.save(quantitative1);
        qRepository.save(quantitative2);

        List<List<Double>> inputs = new ArrayList<>();

        inputs.add(explanatory);
        inputs.add(response);

        TwoQuantitative twoQuantitative = new TwoQuantitative(inputs, quantitative1.getId(), quantitative2.getId());

        twoQRepository.save(twoQuantitative);

        return new ResponseEntity<>(twoQuantitative, HttpStatus.OK);
    }    

    /* GET Specific of any type of data 
     * @GetMapping annotation is used for mapping HTTP GET requests onto specific handler methods.
     */
    @GetMapping("/getQuantitative{id}")
    public ResponseEntity<Quantitative> getQuantitative(@PathVariable long id) {
        Optional<Quantitative> optional = qRepository.findById(id);
        if (optional.isPresent()) {  // Good ID
            Quantitative quantitative = optional.get();  // value from findByID
            return new ResponseEntity<>(quantitative, HttpStatus.OK);  // OK HTTP response: status code, headers, and body
        }
        // Bad ID
        return new ResponseEntity<>(HttpStatus.BAD_REQUEST);       
    }

    @GetMapping("/getTwoQuantitative{id}")
    @Transactional
    public ResponseEntity<TwoQuantitative> getTwoQuantitative(@PathVariable long id) {
        Optional<TwoQuantitative> optional = twoQRepository.findById(id);
        if (optional.isPresent()) {  // Good ID
            TwoQuantitative twoQuantitative = optional.get();  // value from findByID
            Hibernate.initialize(twoQuantitative.getLsrl());
            return new ResponseEntity<>(twoQuantitative, HttpStatus.OK);  // OK HTTP response: status code, headers, and body
        }
        // Bad ID
        return new ResponseEntity<>(HttpStatus.BAD_REQUEST);       
    }

QR Code

QR Code Current Page

Screenshot 2024-05-21 at 11 53 31 AM

QR Code Wireframe

Screenshot 2024-05-21 at 11 54 09 AM

Teamwork/Integration

Commits/Pull Requests

Screenshot 2024-05-21 at 12 09 28 PM Screenshot 2024-05-21 at 12 10 23 PM

Custom Domain

A Records:

  • 185.199.108.153
  • 185.199.109.153
  • 185.199.110.153
  • 185.199.111.153

CNAME:

  • john-scc.github.io

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions