Skip to content

Commit

Permalink
Fixes (#120)
Browse files Browse the repository at this point in the history
* Ft login v google 187584916 (#47)

* login via google

* Ft-login via google

* login via google

* ft login via google

* ft  login with  google

* Logout feature (#26) (#46)

* Logout feature (#26)

* [#187584914]added logout feature

* [starts #187584914] added logout feature

* [finishes#187584914] logout feature

* [delivers##187584914] updated readme & swagger.json

* [delivers##187584914] updated readme & swagger.json

* [deliveres #187584914] logout features completed

* [deliveres #187584914] logout features completed

* [delivers #187584914] finished logout feature

* fixing bugs

* rebased

---------

Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>

* [Finishes #187584924] Seller Create/Add a product (#48)

* [Delivers #187584924] Seller Create/Add a product

* updated ReaderMe file

* Rebased on develop

* Logout feature (#26)

* [#187584914]added logout feature

* [starts #187584914] added logout feature

* [finishes#187584914] logout feature

* [delivers##187584914] updated readme & swagger.json

* [delivers##187584914] updated readme & swagger.json

* [deliveres #187584914] logout features completed

* [deliveres #187584914] logout features completed

* [delivers #187584914] finished logout feature

* Fixed login fetaure (#59)

* Ft delete items seller #187584926 (#52)

* rebase

* rebase

* [delivers #187584926] seller delete item

* [Delivers #187584924] Seller Create/Add a product

* [start #187584926] seller delete item

---------

Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: AimePazzo <[email protected]>

* [starts #187584911] Seller statistics per timeframe (#54)

* [starts #187584911] Seller statistics per timeframe

* [finishes #187584911] Seller statistics per timeframe

* Seller-statistics updated

* Ft update password 187584920 (#56)

* update user password

* update password validation

* change success email for reset password

* update route and functionalities

* update route

* feat: Add endpoints for password reset and update

* ft-reset-password

* chore: Refactor validation middleware to handle password reset and update

* feat: Update reset password endpoint to return user data

* chore: Update updateUserRole to return user data in response

* reduce image size

* refactor: Update authRouter to include password update endpoint

* feat: Add Session model and update user.spec.ts to include session handling

* add tests for password routes

* route for resetting password

* update route and functionalities

* update route

* feat: Add endpoints for password reset and update

* update function name

* add new routes

* update user password

* update user password

* update route and functionalities

* update route

* feat: Add endpoints for password reset and update

* chore: Update updateUserRole to return user data in response

* refactor: Update authRouter to include password update endpoint

* route for resetting password

* update route

* feat: Add endpoints for password reset and update

* add new routes

---------

Co-authored-by: AimePazzo <[email protected]>

* Ft seller available products 187584925 (#49)

* [Delivers #187584924] Seller Create/Add a product

* some changes before rebase

* rebase

* Finished rebase

* Finished rebase

---------

Co-authored-by: AimePazzo <[email protected]>

* Ft seller update items 187584929 (#51)

* [Delivers #187584924] Seller Create/Add a product

* [Delivers #187584929] Seller Update/Modify a product

* [Delivers #187584929] Seller update product

---------

Co-authored-by: AimePazzo <[email protected]>

* Ft 2 fa v2 187584919 (#60)

* Ft login v google 187584916 (#47)

* login via google

* Ft-login via google

* login via google

* ft login via google

* ft  login with  google

* Logout feature (#26) (#46)

* Logout feature (#26)

* [#187584914]added logout feature

* [starts #187584914] added logout feature

* [finishes#187584914] logout feature

* [delivers##187584914] updated readme & swagger.json

* [delivers##187584914] updated readme & swagger.json

* [deliveres #187584914] logout features completed

* [deliveres #187584914] logout features completed

* [delivers #187584914] finished logout feature

* fixing bugs

* rebased

---------

Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>

* [Finishes #187584924] Seller Create/Add a product (#48)

* [Delivers #187584924] Seller Create/Add a product

* updated ReaderMe file

* Rebased on develop

* Fixed login fetaure (#59)

* Ft delete items seller #187584926 (#52)

* rebase

* rebase

* [delivers #187584926] seller delete item

* [Delivers #187584924] Seller Create/Add a product

* [start #187584926] seller delete item

---------

Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: AimePazzo <[email protected]>

* [starts #187584911] Seller statistics per timeframe (#54)

* [starts #187584911] Seller statistics per timeframe

* [finishes #187584911] Seller statistics per timeframe

* Seller-statistics updated

* rebase1

* rebasing

* rebasing

* resolving circle CI issues

---------

Co-authored-by: AimePazzo <[email protected]>
Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
Co-authored-by: MANISHIMWESalton <[email protected]>
Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>
Co-authored-by: Mr. David <[email protected]>
Co-authored-by: Solangeihirwe <[email protected]>

* The Seller and User -  list products (#58)

* Ft login v google 187584916 (#47)

* login via google

* Ft-login via google

* login via google

* ft login via google

* ft  login with  google

* Logout feature (#26) (#46)

* Logout feature (#26)

* [#187584914]added logout feature

* [starts #187584914] added logout feature

* [finishes#187584914] logout feature

* [delivers##187584914] updated readme & swagger.json

* [delivers##187584914] updated readme & swagger.json

* [deliveres #187584914] logout features completed

* [deliveres #187584914] logout features completed

* [delivers #187584914] finished logout feature

* fixing bugs

* rebased

---------

Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>

* [Finishes #187584924] Seller Create/Add a product (#48)

* [Delivers #187584924] Seller Create/Add a product

* updated ReaderMe file

* Rebased on develop

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Fixed login fetaure (#59)

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* Ft delete items seller #187584926 (#52)

* rebase

* rebase

* [delivers #187584926] seller delete item

* [Delivers #187584924] Seller Create/Add a product

* [start #187584926] seller delete item

---------

Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: AimePazzo <[email protected]>

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* [starts #187584911] Seller statistics per timeframe (#54)

* [starts #187584911] Seller statistics per timeframe

* [finishes #187584911] Seller statistics per timeframe

* Seller-statistics updated

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* AA

* pre commit tests

* Initial

* [Delivers #187584928] Version 1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* AA

* pre commit tests

* Initial

* [Delivers #187584928] Version 1

* Swagger

* Rebase

* Reviews

* M

* end

* end

* end

* end

---------

Co-authored-by: AimePazzo <[email protected]>
Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
Co-authored-by: MANISHIMWESalton <[email protected]>
Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>
Co-authored-by: Mr. David <[email protected]>
Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: SaddockAime <[email protected]>

* Ft buyer view cart 187584934 (#64)

* [starts #187584934]

* [starts #187584934] Buyer get cart

* [finishes #187584934] Buyer view cart

* Change models to adopt relationships

* User Search Products by FIlters (#65)

* [delivers #187584936] User filter products

* mend

* mend

* mend

* [delivers #187584936] Update the search logic

* Re-test

* mend

* mend

* mend

* ft-view-specific-item (#63)

* [starts #187584933] Add & Update cart (#70)

* [starts #187584933] Add & Update cart

* Buyer add Cart & Update Cart & view Carts & view single Cart

* Combine update and create cart

* Users should be able to chat on the App to ask some information publicly (#67)

* Ft login v google 187584916 (#47)

* login via google

* Ft-login via google

* login via google

* ft login via google

* ft  login with  google

* Logout feature (#26) (#46)

* Logout feature (#26)

* [#187584914]added logout feature

* [starts #187584914] added logout feature

* [finishes#187584914] logout feature

* [delivers##187584914] updated readme & swagger.json

* [delivers##187584914] updated readme & swagger.json

* [deliveres #187584914] logout features completed

* [deliveres #187584914] logout features completed

* [delivers #187584914] finished logout feature

* fixing bugs

* rebased

---------

Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>

* [Finishes #187584924] Seller Create/Add a product (#48)

* [Delivers #187584924] Seller Create/Add a product

* updated ReaderMe file

* Rebased on develop

* Fixed login fetaure (#59)

* Ft delete items seller #187584926 (#52)

* rebase

* rebase

* [delivers #187584926] seller delete item

* [Delivers #187584924] Seller Create/Add a product

* [start #187584926] seller delete item

---------

Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: AimePazzo <[email protected]>

* [starts #187584911] Seller statistics per timeframe (#54)

* [starts #187584911] Seller statistics per timeframe

* [finishes #187584911] Seller statistics per timeframe

* Seller-statistics updated

* rebase1

* rebasing

* rebasing

* resolving circle CI issues

---------

Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
Co-authored-by: MANISHIMWESalton <[email protected]>
Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>
Co-authored-by: Mr. David <[email protected]>
Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: Elvis MUGISHA <[email protected]>

* User Search Products by FIlters (#65) (#71)

* [delivers #187584936] User filter products

* mend

* mend

* mend

* [delivers #187584936] Update the search logic

* Re-test

* mend

* mend

* mend

Co-authored-by: Ndahimana Bonheur <[email protected]>

* ft clear wishList (#75)

* adding cron job to products (#76)

* ft clear wishList (#75)

* adding cron job to products

* adding cron job to products

* adding cron job to products

* resolving conflicts

---------

Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>

* Ft buyer clear cart 187584935 (#66)

* [starts #187584934]

* [starts #187584934] Buyer get cart

* [Delivers 187584935] Buyer clear cart

---------

Co-authored-by: ProgrammerDATCH <[email protected]>

* ft buyer view products from wishList (#79)

* ft: password-expiry-check-#187584942 (#72)

* initial commit

* add tests for middleware

* add new passwordUpdatedAt colum and its migration

* add cron jobs

* update password column timestamp whenever password changed

* update password middleware in login

* update notifications

* ft: password expiry check- #187584942

* ft: password expiry check- #187584942

* ft: password expiry check- #187584942

* ft: password expiry check- #187584942

* fix tests

* fix tests

* ft: password-expiry-check-#187584942

* initial commit

* add new passwordUpdatedAt colum and its migration

* add cron jobs

* update password middleware in login

* update notifications

* ft: password expiry check- #187584942

* ft: password expiry check- #187584942

* fix tests

* fix tests

* middlewares: use minutes for demo

* updare test cases and seeders

* change cronjob lifecycle

* initial commit

* add new passwordUpdatedAt colum and its migration

* add cron jobs

* update password middleware in login

* update notifications

* ft: password expiry check- #187584942

* ft: password expiry check- #187584942

* fix tests

* fix tests

* ft: password-expiry-check-#187584942

* middlewares: use minutes for demo

* updare test cases and seeders

* change cronjob lifecycle

* initial commit

* add new passwordUpdatedAt colum and its migration

* add cron jobs

* update password middleware in login

* update notifications

* ft: password expiry check- #187584942

* ft: password expiry check- #187584942

* fix tests

* fix tests

* ft: password-expiry-check-#187584942

* initial commit

* add new passwordUpdatedAt colum and its migration

* add cron jobs

* update password middleware in login

* update notifications

* ft: password expiry check- #187584942

* ft: password expiry check- #187584942

* fix tests

* middlewares: use minutes for demo

* updare test cases and seeders

* change cronjob lifecycle

* initial commit

* add new passwordUpdatedAt colum and its migration

* add cron jobs

* update password middleware in login

* update notifications

* ft: password expiry check- #187584942

* ft: password expiry check- #187584942

* fix tests

* fix tests

* ft: password-expiry-check-#187584942

* middlewares: use minutes for demo

* updare test cases and seeders

* change cronjob lifecycle

* fix tests errors

* Deliver[ft-password-expiry-check-#187584942]

* [Deliver-#187584942] - ft: password-expiry-check

* [Delivers-18758493] ft-buyer-checkout (#77)

* [Delivers-18758493] ft-buyer-checkout

* [Delivers-18758493] ft-buyer-checkout

* Fixed calculation of cart (#80)

* [Deliver-18758493] ft-fix-checkout (#82)

* [Fixes #187584929] (#84)

* [Delivers #187584943] ft-notifications (#68)

* Ft mark one or all notification as read (#69)

* [Delivers #187584943] ft-notifications

* [Delivers #187584943] ft-notifications

* [Delivers #187584943] ft-notifications

* [Delivers #187584943] ft-notifications

* [Delivers #187584940] ft-mark-one-or-all-Notification

* merged

* Ft add product reviews #187584931 (#73)

* The Seller and User -  list products (#58)

* Ft login v google 187584916 (#47)

* login via google

* Ft-login via google

* login via google

* ft login via google

* ft  login with  google

* Logout feature (#26) (#46)

* Logout feature (#26)

* [#187584914]added logout feature

* [starts #187584914] added logout feature

* [finishes#187584914] logout feature

* [delivers##187584914] updated readme & swagger.json

* [delivers##187584914] updated readme & swagger.json

* [deliveres #187584914] logout features completed

* [deliveres #187584914] logout features completed

* [delivers #187584914] finished logout feature

* fixing bugs

* rebased

---------

Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>

* [Finishes #187584924] Seller Create/Add a product (#48)

* [Delivers #187584924] Seller Create/Add a product

* updated ReaderMe file

* Rebased on develop

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Fixed login fetaure (#59)

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* Ft delete items seller #187584926 (#52)

* rebase

* rebase

* [delivers #187584926] seller delete item

* [Delivers #187584924] Seller Create/Add a product

* [start #187584926] seller delete item

---------

Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: AimePazzo <[email protected]>

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* [starts #187584911] Seller statistics per timeframe (#54)

* [starts #187584911] Seller statistics per timeframe

* [finishes #187584911] Seller statistics per timeframe

* Seller-statistics updated

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* AA

* pre commit tests

* Initial

* [Delivers #187584928] Version 1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* AA

* pre commit tests

* Initial

* [Delivers #187584928] Version 1

* Swagger

* Rebase

* Reviews

* M

* end

* end

* end

* end

---------

Co-authored-by: AimePazzo <[email protected]>
Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
Co-authored-by: MANISHIMWESalton <[email protected]>
Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>
Co-authored-by: Mr. David <[email protected]>
Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: SaddockAime <[email protected]>

* [start #187584931] buyer add product review

* [finished #187584931] buyer add product review

* [deliver #187584931] add product review

---------

Co-authored-by: Ndahimana Bonheur <[email protected]>
Co-authored-by: AimePazzo <[email protected]>
Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
Co-authored-by: MANISHIMWESalton <[email protected]>
Co-authored-by: Mr. David <[email protected]>
Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: SaddockAime <[email protected]>

* [Delivers #187584943] ft-notifications (#68) (#85)

Co-authored-by: Saddock Kabandana <[email protected]>

* [Delivers-18758498] ft-buyer-stripe-payment (#78)

* [Delivers-18758498] ft-buyer-stripe-payment

* [Delivers-18758498] ft-buyer-stripe-payment

* --ammend

* [Delivers-18758498] ft-buyer-stripe-payment

* fix bugs in test

* fix test

* removing bugs

* merge to develop and fix code base

* merge to develop and fix codebase

* Fixes DB double calling

* Fixes DB double calling

* Fixes DB double calling

---------

Co-authored-by: AimePazzo <[email protected]>
Co-authored-by: Ndahimana Bonheur <[email protected]>

* fx-product-seeders (#88)

* Ft submit seller request 187904713 (#87)

* initial commit

* Delivers-[ft-submit-seller-request-#187904713]

* Delivers[ft-admin-get-seller-requests-#187904754]

* Fix product response (#91)

* Fx notification route (#93)

* fx notification route

* fx notification route

* fix password expiry check (#92)

* Fix passsword expiration check for google login accounts (#95)

* Fix codebase structure (#90)

* Finishes validation format

* Finished doing structure, remaining to work on tests

* FInihed product tests

* Finished testing

* Re-running tests

* Retest

* Retest 2

* Retest 3

* Retest 4

* Raising test

* --ammend

* --ammend

* --ammend

* Restructure

* --ammend

* --ammend

* --ammend

* --ammend

* --ammend

* m

* --ammend

* Ft buyer track order status #187584937 (#74)

* The Seller and User -  list products (#58)

* Ft login v google 187584916 (#47)

* login via google

* Ft-login via google

* login via google

* ft login via google

* ft  login with  google

* Logout feature (#26) (#46)

* Logout feature (#26)

* [#187584914]added logout feature

* [starts #187584914] added logout feature

* [finishes#187584914] logout feature

* [delivers##187584914] updated readme & swagger.json

* [delivers##187584914] updated readme & swagger.json

* [deliveres #187584914] logout features completed

* [deliveres #187584914] logout features completed

* [delivers #187584914] finished logout feature

* fixing bugs

* rebased

---------

Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>

* [Finishes #187584924] Seller Create/Add a product (#48)

* [Delivers #187584924] Seller Create/Add a product

* updated ReaderMe file

* Rebased on develop

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Fixed login fetaure (#59)

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* Ft delete items seller #187584926 (#52)

* rebase

* rebase

* [delivers #187584926] seller delete item

* [Delivers #187584924] Seller Create/Add a product

* [start #187584926] seller delete item

---------

Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: AimePazzo <[email protected]>

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* [starts #187584911] Seller statistics per timeframe (#54)

* [starts #187584911] Seller statistics per timeframe

* [finishes #187584911] Seller statistics per timeframe

* Seller-statistics updated

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* AA

* pre commit tests

* Initial

* [Delivers #187584928] Version 1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* AA

* pre commit tests

* Initial

* [Delivers #187584928] Version 1

* Swagger

* Rebase

* Reviews

* M

* end

* end

* end

* end

---------

Co-authored-by: AimePazzo <[email protected]>
Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
Co-authored-by: MANISHIMWESalton <[email protected]>
Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>
Co-authored-by: Mr. David <[email protected]>
Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: SaddockAime <[email protected]>

* [start #187584937] buyer track order status

* [finishes #187584937] buyer track order status

* The Seller and User -  list products (#58)

* Ft login v google 187584916 (#47)

* login via google

* Ft-login via google

* login via google

* ft login via google

* ft  login with  google

* Logout feature (#26) (#46)

* Logout feature (#26)

* [#187584914]added logout feature

* [starts #187584914] added logout feature

* [finishes#187584914] logout feature

* [delivers##187584914] updated readme & swagger.json

* [delivers##187584914] updated readme & swagger.json

* [deliveres #187584914] logout features completed

* [deliveres #187584914] logout features completed

* [delivers #187584914] finished logout feature

* fixing bugs

* rebased

---------

Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>

* [Finishes #187584924] Seller Create/Add a product (#48)

* [Delivers #187584924] Seller Create/Add a product

* updated ReaderMe file

* Rebased on develop

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Fixed login fetaure (#59)

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* Ft delete items seller #187584926 (#52)

* rebase

* rebase

* [delivers #187584926] seller delete item

* [Delivers #187584924] Seller Create/Add a product

* [start #187584926] seller delete item

---------

Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: AimePazzo <[email protected]>

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* [starts #187584911] Seller statistics per timeframe (#54)

* [starts #187584911] Seller statistics per timeframe

* [finishes #187584911] Seller statistics per timeframe

* Seller-statistics updated

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* AA

* pre commit tests

* Initial

* [Delivers #187584928] Version 1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [Delivers #187584928] Delivers test 92.53%

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Add .gitguardian file

* [Delivers #187584928] Add .gitguardian file

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* Solve eerrors

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [delivers #187584928] Delivers the Seller and User list products

* [delivers #187584928] Delivers the Seller and User list products

* [Delivers #ft-seller-and-buyer-list-items-187584928] Tests version 1

* Deliver testing v1

* [Delivers #187584928] Delivers test 92.53%

* [Delivers #187584928] Handle gitguardian issues.

* [Delivers #187584928] Handle gitguardian issues.

* AA

* pre commit tests

* Initial

* [Delivers #187584928] Version 1

* Swagger

* Rebase

* Reviews

* M

* end

* end

* end

* end

---------

Co-authored-by: AimePazzo <[email protected]>
Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
Co-authored-by: MANISHIMWESalton <[email protected]>
Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>
Co-authored-by: Mr. David <[email protected]>
Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: SaddockAime <[email protected]>

* [start #187584937] buyer track order status

* [finishes #187584937] buyer track order status

* [deliver #187584937] buyer track order status

* [deliver #187584937] buyer track order status

---------

Co-authored-by: Ndahimana Bonheur <[email protected]>
Co-authored-by: AimePazzo <[email protected]>
Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
Co-authored-by: MANISHIMWESalton <[email protected]>
Co-authored-by: Mr. David <[email protected]>
Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: SaddockAime <[email protected]>

---------

Co-authored-by: AimePazzo <[email protected]>
Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
Co-authored-by: MANISHIMWESalton <[email protected]>
Co-authored-by: Solange Duhimbaze Ihirwe <[email protected]>
Co-authored-by: Mr. David <[email protected]>
Co-authored-by: Solangeihirwe <[email protected]>
Co-authored-by: ISHIMWE Jean Baptiste <[email protected]>
Co-authored-by: Saddock Kabandana <[email protected]>
Co-authored-by: Fabrice-Dush <[email protected]>
Co-authored-by: Elvis MUGISHA <[email protected]>
Co-authored-by: Ndahimana Bonheur <[email protected]>
Co-authored-by: ProgrammerDATCH <[email protected]>
  • Loading branch information
13 people authored Aug 26, 2024
1 parent ac63cf4 commit 89781e4
Show file tree
Hide file tree
Showing 21 changed files with 266 additions and 111 deletions.
31 changes: 31 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"chai-http": "^4.4.0",
"cloudinary": "^2.2.0",
"compression": "^1.7.4",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"coverage": "^0.4.1",
"coveralls": "^3.1.1",
Expand Down Expand Up @@ -122,6 +123,7 @@
"devDependencies": {
"@types/bcrypt": "^5.0.2",
"@types/compression": "^1.7.5",
"@types/cookie-parser": "^1.4.7",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/jsonwebtoken": "^9.0.6",
Expand Down
32 changes: 20 additions & 12 deletions src/databases/migrations/20240704115209-create-termsAndCondition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@ export default {
up: async (queryInterface: QueryInterface) => {
await queryInterface.createTable("termsAndConditions", {

id: {
type: DataTypes.UUID,
allowNull: false,
primaryKey: true,
defaultValue: DataTypes.UUIDV4
},
content: {
id: {
type: DataTypes.UUID,
allowNull: false,
type: DataTypes.STRING
},
type: {
primaryKey: true,
defaultValue: DataTypes.UUIDV4
},
content: {
allowNull: true,
type: DataTypes.TEXT
},
type: {
type: DataTypes.STRING,
allowNull: true
},
allowNull: false
},
pdfUrl: {
type: DataTypes.STRING,
allowNull: true,
unique: true,
validate: {
isUrl: true
}
},
createdAt: {
allowNull: false,
type: DataTypes.DATE,
Expand Down
16 changes: 13 additions & 3 deletions src/databases/models/termsAndCodition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ export interface ITermsAndConditions {
id: string;
content:string;
type: string;
pdfUrl: string;
}
class TermsAndConditions extends Model<ITermsAndConditions> implements ITermsAndConditions {
declare id: string;
declare content: string;
declare type: string;
declare pdfUrl: string;

static associate() {

Expand All @@ -29,12 +31,20 @@ TermsAndConditions.init(
defaultValue: DataTypes.UUIDV4
},
content: {
allowNull: false,
type: DataTypes.STRING,
allowNull: true,
type: DataTypes.TEXT,
},
type: {
type: DataTypes.STRING,
allowNull: true
allowNull: false
},
pdfUrl:{
type: DataTypes.STRING,
allowNull: true,
unique: true,
validate:{
isUrl: true
}
}
},
{
Expand Down
8 changes: 4 additions & 4 deletions src/databases/seeders/20240520202759-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const userFour = {
passwordUpdatedAt: new Date(),
firstName: "F Seller",
lastName: "L Seller",
email: "seller@gmail.com",
email: "aimegetz@gmail.com",
password: hashPassword("Password@123"),
phone: 25089767099,
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
Expand All @@ -109,7 +109,7 @@ const userFive = {
passwordUpdatedAt: new Date(),
firstName: "dj5090",
lastName: "dj2090",
email: "dj@gmail.com",
email: "jadowacu@gmail.com",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
Expand All @@ -130,7 +130,7 @@ const userSix = {
passwordUpdatedAt: new Date(),
firstName: "F Seller3",
lastName: "L Seller3",
email: "seller3@gmail.com",
email: "ndahimana154@gmail.com",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
Expand All @@ -151,7 +151,7 @@ const userSeven = {
passwordUpdatedAt: new Date(),
firstName: "F Seller4",
lastName: "L Seller4",
email: "seller4@gmail.com",
email: "ijbapte@gmail.com",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
Expand Down
30 changes: 16 additions & 14 deletions src/databases/seeders/20240601224834-shops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,60 @@ import { shopFiveId, shopFourId, shopOneId, shopSixId, shopThreeId, shopTwoId, u

const shopOne = {
id: shopOneId,
name: "Paccy Shop 250",
name: "GadgetHub 250",
userId: userFourId,
description: "Selling",
description: "Your one-stop shop for the latest gadgets and electronics.",
createdAt: new Date(),
updatedAt: new Date()
}

const shopTwo = {
id: shopTwoId,
name: "Paccy Shop 509",
name: "UrbanStyle Boutique",
userId: userSevenId,
description: "Selling",
description: "Bringing you the trendiest fashion and accessories in town.",
createdAt: new Date(),
updatedAt: new Date()
}

const shopThree = {
id: shopThreeId,
name: "Shoes Shop 509",
name: "SoleMates",
userId: userFourTeenId,
description: "Selling",
description: "Premium footwear for every step of your journey.",
createdAt: new Date(),
updatedAt: new Date()
}

const shopFour = {
id: shopFourId,
name: "electronic Shop 509",
name: "TechNest",
userId: userSixId,
description: "Selling",
description: "Explore a world of cutting-edge electronics and accessories.",
createdAt: new Date(),
updatedAt: new Date()
}

const shopFive = {
id: shopFiveId,
name: "Shop 509",
name: "HomeEssentials",
userId: userFiveId,
description: "Selling",
description: "Everything you need to make your house a home.",
createdAt: new Date(),
updatedAt: new Date()
}

const shopSix = {
id: shopSixId,
name: "electronics Shop 509",
name: "ElectroMart",
userId: userFiveTeenId,
description: "Selling",
description: "Your trusted source for all things electronic.",
createdAt: new Date(),
updatedAt: new Date()
}


export const up = async (queryInterface: QueryInterface) => {
await queryInterface.bulkInsert("shops", [shopOne, shopTwo,shopThree,shopFour, shopFive, shopSix]);
await queryInterface.bulkInsert("shops", [shopOne, shopTwo, shopThree, shopFour, shopFive, shopSix]);
};

export const down = async (queryInterface: QueryInterface) => {
Expand Down
2 changes: 1 addition & 1 deletion src/databases/seeders/20240601224835-products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const productTwo = {
description: "A women's bag is a fashionable and functional accessory designed to carry personal belongings. Available in various styles, sizes, and materials, women's bags cater to diverse needs and preferences. From elegant clutches and chic handbags to spacious totes and practical backpacks, each type serves a unique purpose. High-quality women's bags offer a blend of style, durability, and convenience, making them essential for everyday use, special occasions, and professional settings.",
price: 19.99,
discount: "13%",
category: "Handbags:",
category: "Handbags",
expiryDate: new Date("2050-12-31"),
expired: false,
bonus: "Bonus 1",
Expand Down
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import express, { Express, Request, Response, NextFunction } from "express";
import cookieParser from "cookie-parser";
import dotenv from "dotenv";
import morgan from "morgan";
import compression from "compression";
Expand All @@ -19,7 +20,7 @@ const app: Express = express();
const PORT = process.env.PORT;
const server = createServer(app);

const allowedOrigins = ["http://localhost:5000" , "https://e-commerce-ninja-fn-staging.netlify.app"];
const allowedOrigins = ["http://localhost:5000" , "https://e-commerce-ninjas.netlify.app"];

export const io = new Server(server, {
cors: {
Expand All @@ -42,7 +43,11 @@ app.use((req: Request, res: Response, next: NextFunction) => {

app.use(morgan(process.env.NODE_EN));
app.use(compression());
app.use(cors());
app.use(cookieParser());
app.use(cors({
origin:allowedOrigins,
credentials:true
}));

app.use("/api-docs", SwaggerUi.serve, SwaggerUi.setup(Document));
app.use("/api", router);
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ export const socketAuthMiddleware = async (socket: Socket, next: NextFunction) =
err.data = { message: "Internal server error" };
return next(err);
}
};
};
29 changes: 17 additions & 12 deletions src/middlewares/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1049,33 +1049,37 @@ const isSellerRequestExist = async (
const role = req.user.role;
let existingRequest = null;
let user = null;
if(req.params.userId){
user = await userRepositories.findUserById(req.params.userId)
}

switch (role) {
case "admin":
const requestCount = await db.SellerProfile.count();

if (requestCount === 0) {
return res.status(httpStatus.NOT_FOUND).json({
status: httpStatus.NOT_FOUND,
message: "No seller requests found",
});
}
if(req.params.userId){
existingRequest = await userRepositories.findSellerRequestByUserId(req.params.userId);
if (!existingRequest) {
return res.status(httpStatus.NOT_FOUND).json({
status: httpStatus.NOT_FOUND,
message: "No seller requests found for the provided user ID",
});

if (req.params.userId) {
existingRequest = await userRepositories.findSellerRequestByUserId(req.params.userId);
user = await userRepositories.findUserById(req.params.userId);

if (!existingRequest) {
return res.status(httpStatus.NOT_FOUND).json({
status: httpStatus.NOT_FOUND,
message: "No seller requests found for the provided user ID",
});
}

req.user = user;
}
}
break;

case "buyer":
const userId = req.user.id || req.params.userId;
existingRequest = await userRepositories.findSellerRequestByUserId(userId);

if (existingRequest) {
return res.status(httpStatus.BAD_REQUEST).json({
status: httpStatus.BAD_REQUEST,
Expand All @@ -1090,7 +1094,7 @@ const isSellerRequestExist = async (
message: "Invalid role or request",
});
}
req.user = user

next();
} catch (error) {
return res.status(httpStatus.INTERNAL_SERVER_ERROR).json({
Expand All @@ -1100,6 +1104,7 @@ const isSellerRequestExist = async (
}
};


const isRequestAcceptedOrRejected = (req: any, res: Response, next: NextFunction) => {
try {
const { requestStatus } = req.body;
Expand Down
3 changes: 1 addition & 2 deletions src/modules/auth/controller/authControllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const registerSeller = async (req: Request, res: Response): Promise<void> => {
const { firstName, lastName, email, password, phone, businessName, businessDescription, Tin, mobileNumber, mobilePayment, bankPayment, bankAccount, bankName,terms } = req.body;
if (req.file) {
const result = await uploadImages(req.file);
console.log(result)

req.body.rdbDocument = result.secure_url;
}

Expand All @@ -59,7 +59,6 @@ const registerSeller = async (req: Request, res: Response): Promise<void> => {
phone,
role: "seller",
}
console.log(userInfo)

const sellerData = {
businessName,
Expand Down
1 change: 0 additions & 1 deletion src/modules/auth/repository/authRepositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Op } from "sequelize";
import db from "../../../databases/models";

const createUser = async (body: any) => {
console.log("body" + JSON.stringify(body))
return await db.Users.create(body);
};

Expand Down
Loading

0 comments on commit 89781e4

Please sign in to comment.