Skip to content

Commit

Permalink
Release (#444)
Browse files Browse the repository at this point in the history
* Development (#235)

* update github workflow yaml file

* rename the frontend folder

* Development (#237)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* Development (#239)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* Development (#241)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Development (#242)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* Development (#244)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* Development (#246)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* Development (#248)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* Development (#250)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* Development (#252)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* Development (#254)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* Development (#256)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* Development (#257)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* Development (#259)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* Development (#261)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* Development (#262)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* Development (#264)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* Development (#266)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* merge conflicts

* Development (#267)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* Development (#269)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* Development (#271)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* Development (#273)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* Development (#274)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* Development (#276)

* Development (#277)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* Development (#279)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Development (#287)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* Development (#290)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Development (#292)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Development (#295)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Development (#297)

* Development (#298)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Create the summary modal and include error boundary in applocation

* update error boundary url

* add the edit and update button to the order summary page

* Development (#300)

* Development (#301)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Create the summary modal and include error boundary in applocation

* update error boundary url

* add the edit and update button to the order summary page

* add the call to action to clear cart

* generate Ids for ordersummary

* generate ordersummary ids

* update the cart UI

* Development (#303)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Create the summary modal and include error boundary in applocation

* update error boundary url

* add the edit and update button to the order summary page

* add the call to action to clear cart

* generate Ids for ordersummary

* generate ordersummary ids

* update the cart UI

* create the localstorage utility functions

* remove uuid package

* remove crypto declaration

* save state in local storage

* persist cart state in local storage

* Development (#306)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Create the summary modal and include error boundary in applocation

* update error boundary url

* add the edit and update button to the order summary page

* add the call to action to clear cart

* generate Ids for ordersummary

* generate ordersummary ids

* update the cart UI

* create the localstorage utility functions

* remove uuid package

* remove crypto declaration

* save state in local storage

* persist cart state in local storage

* Display list of car items

* Development (#308)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Create the summary modal and include error boundary in applocation

* update error boundary url

* add the edit and update button to the order summary page

* add the call to action to clear cart

* generate Ids for ordersummary

* generate ordersummary ids

* update the cart UI

* create the localstorage utility functions

* remove uuid package

* remove crypto declaration

* save state in local storage

* persist cart state in local storage

* Display list of car items

* implement remove item from cart

* Development (#310)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Create the summary modal and include error boundary in applocation

* update error boundary url

* add the edit and update button to the order summary page

* add the call to action to clear cart

* generate Ids for ordersummary

* generate ordersummary ids

* update the cart UI

* create the localstorage utility functions

* remove uuid package

* remove crypto declaration

* save state in local storage

* persist cart state in local storage

* Display list of car items

* implement remove item from cart

* refactor shopping cart context component, move type definition to a new folder

* Development (#312)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Create the summary modal and include error boundary in applocation

* update error boundary url

* add the edit and update button to the order summary page

* add the call to action to clear cart

* generate Ids for ordersummary

* generate ordersummary ids

* update the cart UI

* create the localstorage utility functions

* remove uuid package

* remove crypto declaration

* save state in local storage

* persist cart state in local storage

* Display list of car items

* implement remove item from cart

* refactor shopping cart context component, move type definition to a new folder

* make shopping cart details child to offcanvas

* Development (#315)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Create the summary modal and include error boundary in applocation

* update error boundary url

* add the edit and update button to the order summary page

* add the call to action to clear cart

* generate Ids for ordersummary

* generate ordersummary ids

* update the cart UI

* create the localstorage utility functions

* remove uuid package

* remove crypto declaration

* save state in local storage

* persist cart state in local storage

* Display list of car items

* implement remove item from cart

* refactor shopping cart context component, move type definition to a new folder

* make shopping cart details child to offcanvas

* create the update cart item modal

* move the shopping cart component into cart folder

* upgrade menu items on edit

* fix build error

* fix code smell

* Development (#317)

* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout

* Calculate cart total

* disable add to cart buttons on page load

* add development branch to github workflow, in order to track and build branches created from issues

* fix code smells

* enable the add to cart button on click none and addons

* Incrementing cart quantity without addons

* Fix: Add to Cart without incrementing the cart quantity throws an error

* Create the summary modal and include error boundary in applocation

* update error boundary url

* add the edit and update button to the order summary page

* add the call to action to clear cart

* generate Ids for ordersummary

* generate ordersummary ids

* update the cart UI

* create the localstorage utility functions

* remove uuid package

* remove crypto declaration

* save state in local storage

* persist cart state in local storage

* Display list of car items

* implement remove item from cart

* refactor shopping cart context component, move type definition to a new folder

* make shopping cart details child to offcanvas

* create the update ca…
  • Loading branch information
3 people committed Nov 20, 2023
1 parent e67b4be commit 0e587fe
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { GenericDocumentRepository } from 'src/infrastructure/database';
import { CartItemMapper } from './../../../cart/cart-item.mapper';
import { ICartItemRepository } from './interfaces/cart-item-repository.interface';
import { CartItemDataModel, CartItemDocument } from './schemas/cartItem.schema';
import { Result } from 'src/domain';

@Injectable()
export class CartItemRepository
Expand Down
11 changes: 9 additions & 2 deletions backend/src/order/interface/order-service.interface.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Result } from 'src/domain';
import { CreateOrderDTO } from '../dto/create-order.dto';
import { Audit, Result } from 'src/domain';
import { CreateCartItemsDTO, CreateOrderDTO } from '../dto/create-order.dto';
import { IOrderResponseDTO } from '../order-response.dto';
import { Order } from '../order';
import { Types } from 'mongoose';
import { IOrderNoteResponseDTO } from 'src/order_notes/dto/order-note-response';

export interface IOrderService {
createOrder(orderSummary: CreateOrderDTO): Promise<Result<IOrderResponseDTO>>;
getOrders(): Promise<Result<Order[]>>;
createOrderNotes(
cartItems: CreateCartItemsDTO[],
orderId: Types.ObjectId,
audit: Audit,
): Promise<IOrderNoteResponseDTO[]>;
}
2 changes: 2 additions & 0 deletions backend/src/order/order-response.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Types } from 'mongoose';
import { IAudit } from 'src/infrastructure';
import { IOrderNoteResponseDTO } from 'src/order_notes/dto/order-note-response';
import { OrderStatus } from 'src/order_statuses/order_status';

export interface IOrderResponseDTO extends IAudit {
Expand All @@ -10,5 +11,6 @@ export interface IOrderResponseDTO extends IAudit {
customerId?: Types.ObjectId;
total: number;
discount?: number;
notes?: IOrderNoteResponseDTO[];
orderManagerId?: Types.ObjectId;
}
6 changes: 6 additions & 0 deletions backend/src/order/order.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import {
OrderStatusSchema,
} from 'src/infrastructure/data_access/repositories/schemas/order-status.schema';
import { OrderStatusMapper } from 'src/order_statuses/order_status.mapper';
import { OrderNoteMapper } from 'src/order_notes/order_note.mapper';
import { OrderNoteRepository } from 'src/infrastructure/data_access/repositories/order-note.repository';
import { OrderNoteModel, OrderNoteSchema } from 'src/infrastructure/data_access/repositories/schemas/order-note.schema';

@Module({
imports: [
Expand All @@ -44,6 +47,7 @@ import { OrderStatusMapper } from 'src/order_statuses/order_status.mapper';
{ name: CartItemDataModel.name, schema: CartItemSchema },
{ name: SelectedCartItemDataModel.name, schema: SelectedCartItemSchema },
{ name: OrderStatusModel.name, schema: OrderStatusSchema },
{ name: OrderNoteModel.name, schema: OrderNoteSchema },
]),
],
controllers: [OrderController],
Expand All @@ -55,6 +59,7 @@ import { OrderStatusMapper } from 'src/order_statuses/order_status.mapper';
{ provide: TYPES.IContextService, useClass: ContextService },
{ provide: TYPES.IValidateUser, useClass: ValidateUser },
{ provide: TYPES.IOrderStatusRepository, useClass: OrderStatusRepository },
{ provide: TYPES.IOrderNoteRepository, useClass: OrderNoteRepository },
MerchantRepository,
CartItemRepository,
SelectedCartItemRepository,
Expand All @@ -65,6 +70,7 @@ import { OrderStatusMapper } from 'src/order_statuses/order_status.mapper';
MerchantMapper,
AuditMapper,
OrderStatusMapper,
OrderNoteMapper,
],
})
export class OrderModule implements NestModule {
Expand Down
4 changes: 3 additions & 1 deletion backend/src/order/order.parser.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { IOrderNoteResponseDTO } from 'src/order_notes/dto/order-note-response';
import { AuditParser } from './../audit/audit.parser';
import { Order } from './order';
import { IOrderResponseDTO } from './order-response.dto';

export class OrderParser {
static createOrderResponse(order: Order): IOrderResponseDTO {
static createOrderResponse(order: Order, notes?: IOrderNoteResponseDTO[]): IOrderResponseDTO {
const { id, state, type, merchantId, customerId, total, discount, orderManagerId, audit } = order;
return {
id,
Expand All @@ -14,6 +15,7 @@ export class OrderParser {
total,
discount,
orderManagerId,
notes,
...AuditParser.createAuditResponse(audit),
};
}
Expand Down
44 changes: 39 additions & 5 deletions backend/src/order/order.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { OrderNoteMapper } from 'src/order_notes/order_note.mapper';
import { HttpStatus, Inject } from '@nestjs/common';
import { TYPES } from 'src/application';
import { CartItem } from 'src/cart/cart-item';
Expand All @@ -13,13 +14,18 @@ import { throwApplicationError } from 'src/infrastructure/utilities/exception-in
import { IMerchantService, Merchant } from 'src/merchant';
import { CartItemMapper } from './../cart/cart-item.mapper';
import { SelectedCartItemMapper } from './../cart/selectedItems/selected-cart-item.mapper';
import { CreateOrderDTO } from './dto/create-order.dto';
import { CreateCartItemsDTO, CreateOrderDTO } from './dto/create-order.dto';
import { IOrderService } from './interface/order-service.interface';
import { Order } from './order';
import { IOrderResponseDTO } from './order-response.dto';
import { OrderMapper } from './order.mapper';
import { OrderParser } from './order.parser';
import { IOrderStatusRespository } from 'src/infrastructure/data_access/repositories/interfaces/order-status.repository';
import { OrderNote } from 'src/order_notes/order_note';
import { IOrderNoteRespository } from 'src/infrastructure/data_access/repositories/interfaces/order-note.repository';
import { OrderNoteParser } from 'src/order_notes/order_note_parser';
import { IOrderNoteResponseDTO } from 'src/order_notes/dto/order-note-response';
import { Types } from 'mongoose';

export class OrderService implements IOrderService {
private context: Context;
Expand All @@ -33,8 +39,10 @@ export class OrderService implements IOrderService {
private readonly orderMapper: OrderMapper,
private readonly selectedItemMapper: SelectedCartItemMapper,
private readonly cartItemMapper: CartItemMapper,
private readonly orderNoteMapper: OrderNoteMapper,
@Inject(TYPES.ICartItemRepository) private readonly cartItemRepository: ICartItemRepository,
@Inject(TYPES.IOrderStatusRepository) private readonly orderStatusRespository: IOrderStatusRespository,
@Inject(TYPES.IOrderNoteRepository) private readonly orderNoteRepository: IOrderNoteRespository,
) {
this.context = this.contextService.getContext();
}
Expand All @@ -54,7 +62,7 @@ export class OrderService implements IOrderService {
session.startTransaction();
try {
const audit: Audit = Audit.createInsertContext(this.context);
const merchantObjId = await this.orderRepository.stringToObjectId(merchantId);
const merchantObjId = this.orderRepository.stringToObjectId(merchantId);
const getOrderStatus = await this.orderStatusRespository.findOne({ code: state.toUpperCase() });
if (!getOrderStatus) {
throwApplicationError(HttpStatus.INTERNAL_SERVER_ERROR, `Order status not found`);
Expand Down Expand Up @@ -88,8 +96,7 @@ export class OrderService implements IOrderService {
return map;
}, new Map<string, string>());

const cartSelectedItems = cartItems.map((item) => item.selectedItems);
const flattenedSelectedItems = cartSelectedItems.flat();
const flattenedSelectedItems = cartItems.flatMap((item) => item.selectedItems);
flattenedSelectedItems.forEach((item) => {
if (cartItemMap.has(item.menuId)) {
const cartItemId = cartItemMap.get(item.menuId);
Expand All @@ -110,8 +117,9 @@ export class OrderService implements IOrderService {
selectedCartItemsDataModel,
);
let response: IOrderResponseDTO | undefined;
const notes = await this.createOrderNotes(cartItems, orderId, audit);
if (insertedItems.isSuccess) {
response = OrderParser.createOrderResponse(savedOrder);
response = OrderParser.createOrderResponse(savedOrder, notes);
} else {
throwApplicationError(HttpStatus.INTERNAL_SERVER_ERROR, `Could not create an order`);
}
Expand Down Expand Up @@ -141,4 +149,30 @@ export class OrderService implements IOrderService {
async getOrders(): Promise<Result<Order[]>> {
return await this.orderRepository.find({});
}

async createOrderNotes(
cartItems: CreateCartItemsDTO[],
orderId: Types.ObjectId,
audit: Audit,
): Promise<IOrderNoteResponseDTO[]> {
try {
const orderNotes = cartItems.map((item) => {
return {
menuId: item.menuId,
note: item.note ? item.note : '',
orderId: orderId,
};
});
const createOrderNotes: OrderNote[] = orderNotes.map((note) => OrderNote.create({ ...note, audit }));
const notesToBeSaved = createOrderNotes.map((note) => this.orderNoteMapper.toPersistence(note));
const result: Result<OrderNote[]> = await this.orderNoteRepository.insertMany(notesToBeSaved);
let response: IOrderNoteResponseDTO[] | undefined;
if (result.isSuccess) {
response = OrderNoteParser.createOrderStatusResponses(result.getValue());
}
return response;
} catch (error) {
console.error(error);
}
}
}
4 changes: 2 additions & 2 deletions backend/src/order_notes/order_note_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export class OrderNoteParser {
return { id, note, orderId, ...AuditParser.createAuditResponse(audit) };
}

static createOrderStatusResponses(orderNote: OrderNote[]) {
static createOrderStatusResponses(orderNote: OrderNote[]): IOrderNoteResponseDTO[] {
return orderNote.map((note) => {
this.createResponse(note);
return this.createResponse(note);
});
}
}

0 comments on commit 0e587fe

Please sign in to comment.