{"id":13339566,"url":"https://github.com/andylvua/FlowerStore","last_synced_at":"2025-03-11T14:31:48.441Z","repository":{"id":61370541,"uuid":"551067277","full_name":"andylvua/FlowerStore","owner":"andylvua","description":"Lab 5, 7, 8  and 9 assignment of OOP course","archived":false,"fork":false,"pushed_at":"2022-11-20T13:37:15.000Z","size":63,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T22:37:17.230Z","etag":null,"topics":["ci-cd","java","maven","oop","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andylvua.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-13T19:37:13.000Z","updated_at":"2022-11-23T21:29:28.000Z","dependencies_parsed_at":"2023-01-22T01:50:13.480Z","dependency_job_id":null,"html_url":"https://github.com/andylvua/FlowerStore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andylvua%2FFlowerStore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andylvua%2FFlowerStore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andylvua%2FFlowerStore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andylvua%2FFlowerStore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andylvua","download_url":"https://codeload.github.com/andylvua/FlowerStore/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243051918,"owners_count":20228290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-cd","java","maven","oop","unit-testing"],"created_at":"2024-07-29T19:20:21.888Z","updated_at":"2025-03-11T14:31:48.038Z","avatar_url":"https://github.com/andylvua.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flower Store\n\n[![Java CI](https://github.com/andylvua/FlowerStore/actions/workflows/ci.yaml/badge.svg)](https://github.com/andylvua/FlowerStore/actions/workflows/ci.yaml)\n![Heroku](https://img.shields.io/static/v1?message=deployed\u0026logo=Heroku\u0026color=32CD32\u0026label=Heroku)\n\n## Description\n\nSimple flower store application for Labs 5-8 assignment of OOP course.\n\n## Lab 5 Task\n\n- [x] Implement a class Flower or system of classes that implement the essence of Rose, Chamomile, and Tulip in a flower store. The class or classes should have attributes sepalLength, color, and price.\n- [x] Submit a project to GitHub.\n- [x] Add SuperLinter to the project and fix all issues.\n- [x] Propose an approach to represent flower color (explore the proposed tests).\n- [x] Add all next changes in a separate branch flower-bucket and merge them into the main branch with Pull Request.\n- [x] Implement FlowerPack class with attributes flower and amount. Implement method getPrice in it.\n- [x] Implement FlowerBucket class that will aggregate several FlowerPack. Implement method price in it.\n- [x] Implement class Store and method search in it.\n- [x] Add tests to the project.\n- [x] Setup GitHub Actions for this project that would run your tests.\n- [x] Send a link to your GitHub here.\n\n## Lab 7 Task\n\n- [x] Initialize simple web\n- [x] Add `@RestController` to a `DemoApplication.java` and implement methods with `@GetMapping` to return a list of objects.\n- [x] Migrate `Flower` to this project and implement an endpoint that will return `List.of(Flower)`.\n- [x] Refactor `FlowerController`: move to separate package and add `@RequestMapping`.\n- [x] Implement `Order` that will implement client order.\n- [x] Implement `Item` that will represent the basic element of `Order`.\n- [x] Implement different payment strategies with an interface `Payment` and several implementations of it `CreditCardPaymentStrategy`, `PayPalPaymentStrategy`. Use Strategy pattern.\n- [x] Implement several `Delivery` strategies: `PostDeliveryStrategy`, `DHLDeliveryStrategy`.\n- [x] Cover delivery and payment packages with tests and endpoints for them.\n- [x] Set up GitHub Actions for this project that would run your tests.\n- [x] Send a link to your GitHub here.\n\n### Results of Lab 7\n\n#### api/flowerstore\n\nHere we can see welcoming message with simple usage instructions.\n\n\u003cimg width=\"1440\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201205024-30aa7b64-a126-47ce-a11f-8a327a5cc4a3.png\"\u003e\n\n#### api/flowerstore/help\n\nThis endpoint returns a list of all available endpoints.\n\n\u003cimg width=\"1440\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201205115-4295dac2-5585-437a-ab54-f8be296ced30.png\"\u003e\n\n#### api/flowerstore/all\n\nWe can go to the endpoint `api/flowerstore/all` to see all flowers in the store. Flower store is being automatically initialized with random flower objects.\n\n\u003cimg width=\"1440\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201205228-b93995f4-0f38-4cad-9556-a064deae3d3e.png\"\u003e\n\n\n### Lab 8 Task\n\n- [x] Refactor business logic of `getFlowers` to `FlowerService`\n- [x] Use `@Autowired` and `@Servic`e for Dependency Injection.\n- [x] Setup DB with Docker `docker run --name oop-course -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 postgres`\n- [x] Add flowers DB via Database viewer (Intellj IDEA Ultimate or DBViewer)\n- [x] Add JPA config. See application.properties attached.\n- [x] Add `FlowerRepository` interface and inject it instance in `FlowerService`. Inject several record in DB. Check whether the endpoint will return all the records from DB.\n- [x] Add `addFlower` method to API and Service layers. Implement `@PostMapping` with `@RequestBody` extraction.\n- [x] Test GET and POST with test.http.\n- [x] Implement `AbstractDecorator` that will implement basic decorator behavior.\n- [x] Implement decorators based on attached diagram. This implementation should follow `Decorator Pattern`.\n- [x] Cover decorators with tests.\n- [x] Set up GitHub Actions for this project that would run your tests.\n- [x] Send a link to your GitHub here.\n\n### Results of Lab 8\n\n#### GET request\nWe can add a several flower instances to the database using IntelliJ IDEA Database Viewer.\n\n\u003cimg width=\"826\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201207104-d1047913-0576-45c2-a36c-29d97b44099d.png\"\u003e\n\nNow, let's send a GET request to the endpoint `api/flowerstore/database/view` to see all flowers in the store's database.\n\n\u003cimg width=\"827\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201207119-212868dc-e35e-4664-ab6e-9ead1283a6c5.png\"\u003e\n\nWe can see that all flower instances were successfully added to the database and returned by the endpoint.\n\n\u003cimg width=\"1396\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201207129-dd322a40-daa0-4503-9eed-15d426dc991e.png\"\u003e\n\n#### POST request\nNow, let's send a several POST requests to the endpoint `api/flowerstore/database/add` to add a new flower instance to the store's database.\n\n\u003cimg width=\"826\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201209162-8eeb038f-aa49-4867-a0c0-1e9b15792844.png\"\u003e\n\nAs we can see, the server responded with a status code 200 and the flower instances were successfully added to the database:\n\n\u003cimg width=\"620\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201209248-3b2094b7-7a16-462c-b320-70e854154dcb.png\"\u003e\n\u003cimg width=\"620\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201209259-408456ad-a515-4172-a842-ed670ed5a6b5.png\"\u003e\n\u003cimg width=\"620\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201209265-671fbd1c-ef61-48ba-84e2-b951dcf3a27d.png\"\u003e\n\nNow, sending a GET request to the endpoint `api/flowerstore/database/view` yields the following result:\n\n\u003cimg width=\"1397\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93153950/201209272-dd62795f-9136-48f6-a02c-660dc7935f0e.png\"\u003e\n\n## License\n\nThe [MIT](https://choosealicense.com/licenses/mit/) License (MIT)\n\nCopyright © 2022. Andrii Yaroshevych","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandylvua%2FFlowerStore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandylvua%2FFlowerStore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandylvua%2FFlowerStore/lists"}