Skip to content

Commit

Permalink
Be able to send email and notification after user's role and status u…
Browse files Browse the repository at this point in the history
…pdated (#99)

* 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]>

* fix bug in clear cart (#96)

---------

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 Jul 24, 2024
1 parent a5f99e7 commit 866e8a2
Show file tree
Hide file tree
Showing 16 changed files with 122 additions and 99 deletions.
1 change: 1 addition & 0 deletions .cache_ggshield
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"last_found_secrets": [{"name": "Generic Password - commit://0cbbdbe0df3f54cb50564c36d5c914bb5312767e/.nyc_output/processinfo/index.json", "match": "41f5bf8c1338a7627ebaee49b1effa761aecfdd07a78ce4472f3f3328262b901"}]}
18 changes: 0 additions & 18 deletions .github/workflows/blank.yml

This file was deleted.

37 changes: 7 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
# Build and Release Folders
bin-debug/
bin-release/
[Oo]bj/
[Bb]in/

# Other files and folders
.settings/

# Executables
*.swf
*.air
*.ipa
*.apk

# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.

#node modules folder
node_modules/

#environment variables
.env
coverage
.nyc_output
.vscode
.cache_ggshield
dist

node_modules
.env
.cache__ggshield
coverage
.vscode
dist
.nyc_output
1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

22 changes: 0 additions & 22 deletions README.Docker.md

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"src/helpers/notifications.ts",
"src/services/stripe.ts",
"src/services/cronJob.ts",
"src/services/emailTemplate.ts",
"src/helpers/passwordExpiryNotifications.ts"
],
"reporter": [
Expand Down
26 changes: 13 additions & 13 deletions src/databases/seeders/20240520202759-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const userOne = {
passwordUpdatedAt: new Date(),
firstName: "F Admin",
lastName: "L Admin",
email: "admin@gmail.com",
email: "ecommerceninjas45@gmail.com",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "female",
birthDate: "2-2-2014",
language: "english",
Expand All @@ -47,7 +47,7 @@ const userTwo = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 1234567890,
profilePicture: "http://example.com/profile.jpg",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "male",
birthDate: "1990-01-01",
language: "English",
Expand All @@ -68,7 +68,7 @@ const userThree = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "female",
birthDate: "2-2-2014",
language: "english",
Expand All @@ -89,7 +89,7 @@ const userFour = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 25089767099,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "male",
birthDate: "2-2-2014",
language: "english",
Expand All @@ -110,7 +110,7 @@ const userFive = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "female",
birthDate: "2014-02-02",
language: "english",
Expand All @@ -131,7 +131,7 @@ const userSix = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "female",
birthDate: "2014-02-02",
language: "english",
Expand All @@ -152,7 +152,7 @@ const userSeven = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "female",
birthDate: "2014-02-02",
language: "english",
Expand All @@ -173,7 +173,7 @@ const userEight = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 25089767809,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "male",
birthDate: "2-2-2014",
language: "english",
Expand All @@ -193,7 +193,7 @@ const userNine = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 25089767809,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "male",
birthDate: "2-2-2014",
language: "english",
Expand All @@ -214,7 +214,7 @@ const userTen = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "female",
birthDate: "2-2-2014",
language: "english",
Expand All @@ -234,7 +234,7 @@ const userEleven = {
email: "[email protected]",
password: hashPassword("Password@123"),
phone: 25089767899,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "female",
birthDate: "2-2-2014",
language: "english",
Expand All @@ -255,7 +255,7 @@ const userTwelve = {
email: "[email protected]",
password: hashPassword("AdminPassword@123"),
phone: 25089767999,
profilePicture: "",
profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg",
gender: "male",
birthDate: "1-1-1980",
language: "english",
Expand Down
33 changes: 31 additions & 2 deletions src/helpers/notifications.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { sendEmailNotification, sendEmailOrderStatus } from "../services/sendEmail";
import { sendEmail, sendEmailNotification, sendEmailOrderStatus } from "../services/sendEmail";
import userRepositories from "../modules/user/repository/userRepositories";
import { EventEmitter } from "events";
import cron from "node-cron";
import productRepository from "../modules/product/repositories/productRepositories";
import Products from "../databases/models/products";
import Shops from "../databases/models/shops";
import Users from "../databases/models/users";
import Users, { usersAttributes } from "../databases/models/users";
import { IProductsWithShop, IOrderWithCart } from "../types/index";
import { io } from "../index";
import Orders from "../databases/models/orders";
import Carts from "../databases/models/carts";
import { userChangeRole, userChangeStatus, welcomeEmail } from "../services/emailTemplate";

export const eventEmitter = new EventEmitter();

Expand All @@ -26,6 +27,11 @@ const saveAndEmitNotification = async (userId: string, message: string, event: s
await sendEmailNotification(userId, message);
};

const emitNotification = async (userId:string, message:string, event:string) => {
await userRepositories.addNotification(userId,message)
io.to(userId).emit(event, message);
}

const fetchOrderWithCarts = async (orderId: string): Promise<IOrderWithCart> => {
return (await Orders.findOne({
where: { id: orderId },
Expand Down Expand Up @@ -83,6 +89,29 @@ eventEmitter.on("passwordExpiry", async ({ userId, message }) => {
await saveAndEmitNotification(userId, message, "passwordExpiry");
});

eventEmitter.on("UserChangeRole", async (user:usersAttributes) => {
const message = `Hi ${user.firstName}, your role has been updated to ${user.role}. Enjoy your new privileges!`;
await emitNotification(user.id, message, "UserChangeRole");
await sendEmail(
user.email,
"Your Role Has Been Updated",
await userChangeRole(user))
})
eventEmitter.on("UserChangeStatus", async (user:usersAttributes) => {
const message = `Hi ${user.firstName}, Your Account Has Been re-enabled.`;
await emitNotification(user.id, message, "UserChangeStatus");
await sendEmail(
user.email,
user.status === "disabled" ? "Your Account Has Been Suspended" : "Your Account Has Been re-enabled",
await userChangeStatus(user))
})
eventEmitter.on("accountVerified", async (user:usersAttributes) => {
const message = `Welcome to E-commerce Ninjas, ${user.firstName}! Your account has been successfully created. We're excited to have you on board. Explore our features and enjoy your experience. If you have any questions, feel free to reach out to us. Happy shopping!
`
await emitNotification(user.id, message, "accountVerified");
await sendEmail(user.email, "Welcome to E-commerce Ninjas!",await welcomeEmail(user))
})

eventEmitter.on("orderStatusUpdated", async (order) => {
const orderStatus = await fetchOrderWithCarts(order.id)
const userId = orderStatus.carts.userId
Expand Down
1 change: 1 addition & 0 deletions src/modules/auth/controller/authControllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const verifyEmail = async (req: any, res: Response) => {
req.session.token
);
await authRepositories.updateUserByAttributes("isVerified", true, "id", req.user.id);
eventEmitter.emit("accountVerified", req.user);
res.status(httpStatus.OK).json({ status: httpStatus.OK, message: "Account verified successfully, now login." });
} catch (error) {
return res.status(httpStatus.INTERNAL_SERVER_ERROR).json({ status: httpStatus.INTERNAL_SERVER_ERROR, message: error.message });
Expand Down
18 changes: 9 additions & 9 deletions src/modules/auth/test/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("Authentication Test Cases", () => {
router()
.post("/api/auth/register")
.send({
email: "ecommerceninjas45@gmail.com",
email: "ecommerceninjas8@gmail.com",
password: "userPassword@123"
})
.end((error, response) => {
Expand All @@ -73,7 +73,7 @@ describe("Authentication Test Cases", () => {
router()
.post("/api/auth/login")
.send({
email: "ecommerceninjas45@gmail.com",
email: "ecommerceninjas8@gmail.com",
password: "userPassword@123"
})
.end((error, response) => {
Expand All @@ -88,7 +88,7 @@ describe("Authentication Test Cases", () => {
router()
.post("/api/auth/login")
.send({
email: "ecommerceninjas45@gmail.com",
email: "ecommerceninjas8@gmail.com",
password: "userPassword@123"
})
.end((error, response) => {
Expand All @@ -103,7 +103,7 @@ describe("Authentication Test Cases", () => {
router()
.post("/api/auth/login")
.send({
email: "ecommerceninjas45@gmail.com",
email: "ecommerceninjas8@gmail.com",
password: "userPassword@123"
})
.end((error, response) => {
Expand Down Expand Up @@ -152,7 +152,7 @@ describe("Authentication Test Cases", () => {
router()
.post("/api/auth/login")
.send({
email: "ecommerceninjas45@gmail.com",
email: "ecommerceninjas8@gmail.com",
password: "userPassword@123"
})
.end((error, response) => {
Expand Down Expand Up @@ -182,7 +182,7 @@ describe("Authentication Test Cases", () => {
router()
.post("/api/auth/login")
.send({
email: "ecommerceninjas45@gmail.com",
email: "ecommerceninjas8@gmail.com",
password: "userPassword@123"
})
.end((error, response) => {
Expand Down Expand Up @@ -217,7 +217,7 @@ describe("Authentication Test Cases", () => {
router()
.post("/api/auth/login")
.send({
email: "ecommerceninjas45@gmail.com",
email: "ecommerceninjas8@gmail.com",
password: "userPassword@123"
})
.end((err, res) => {
Expand Down Expand Up @@ -640,7 +640,7 @@ describe("Google Authentication", () => {
describe("Forget password", () => {
let resetToken: string = null
afterEach(async () => {
const user = await Users.findOne({ where: { email: "admin@gmail.com" } });
const user = await Users.findOne({ where: { email: "ecommerceninjas45@gmail.com" } });
if (user) {
const tokenRecord = await Session.findOne({ where: { userId: user.dataValues.id } })
if (tokenRecord) {
Expand All @@ -651,7 +651,7 @@ describe("Forget password", () => {
it("should return send email for reset password", (done) => {
router()
.post("/api/auth/forget-password")
.send({ email: "admin@gmail.com" })
.send({ email: "ecommerceninjas45@gmail.com" })
.end((err, res) => {
expect(res.status).to.be.equal(httpStatus.OK);
expect(res.body.message).to.be.equal("Check email for reset password.");
Expand Down
1 change: 1 addition & 0 deletions src/modules/cart/test/cart.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ describe(" Cart Controller Tests ", () => {
const carts = await db.Carts.findAll();
cartId2 = carts[1].id;
const product = await db.CartProducts.findOne({ where: { cartId: cartId2 } });
console.log(product)
productId = product.productId;

});
Expand Down
2 changes: 1 addition & 1 deletion src/modules/product/test/product.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ describe("Change Password Test Cases", () => {
router()
.post("/api/auth/login")
.send({
email: "admin@gmail.com",
email: "ecommerceninjas45@gmail.com",
password: "Newpassword#12",
})
.end((error, response) => {
Expand Down
4 changes: 3 additions & 1 deletion src/modules/user/controller/userControllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const updateUserRole = async (req: Request, res: Response) => {
"id",
req.params.id
);
return res.status(httpStatus.OK).json({
eventEmitter.emit("UserChangeRole",user);
return res.status(httpStatus.OK).json({
status: httpStatus.OK,
message: "User role updated successfully",
data: { user }
Expand All @@ -74,6 +75,7 @@ const updateUserStatus = async (req: Request, res: Response): Promise<void> => {
"id",
userId
);
eventEmitter.emit("UserChangeStatus", user);
res
.status(httpStatus.OK)
.json({ status: httpStatus.OK, message: "Status updated successfully.", data: { user } });
Expand Down
Loading

0 comments on commit 866e8a2

Please sign in to comment.