Skip to content

Commit

Permalink
Register as an seller and upgrade to seller (#119)
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 21, 2024
1 parent 88c7093 commit ac63cf4
Show file tree
Hide file tree
Showing 37 changed files with 1,961 additions and 561 deletions.
8 changes: 4 additions & 4 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"check-coverage": true,
"lines": 80,
"statements": 80,
"functions": 70,
"branches": 70
"lines": 60,
"statements": 60,
"functions": 60,
"branches": 60
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "e-commerce-ninjas",
"version": "1.0.0",
"description": "Backend repo for team projecct",
"description": "Backend repo for team project",
"main": "index.js",
"lint-staged": {
"*.{js,ts,tsx}": "eslint --fix"
Expand Down Expand Up @@ -30,10 +30,10 @@
"postinstall": "husky install"
},
"nyc": {
"lines": 70,
"statements": 70,
"functions": 70,
"branches": 70,
"lines": 60,
"statements": 60,
"functions": 60,
"branches": 60,
"extends": "@istanbuljs/nyc-config-typescript",
"include": [
"src/**/!(*.test.*).[tj]s?(x)"
Expand Down
57 changes: 57 additions & 0 deletions src/databases/migrations/20240704115207-create-paymentMethods.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { QueryInterface, DataTypes } from "sequelize";

export default {
up: async (queryInterface: QueryInterface) => {
await queryInterface.createTable("paymentMethods", {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
userId: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: "users",
key: "id"
},
onUpdate: "CASCADE",
onDelete: "CASCADE"
},
bankPayment: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
mobilePayment: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
bankAccount: {
type: DataTypes.STRING(128),
allowNull: true
},
bankName: {
type: DataTypes.STRING(128),
allowNull: true
},
mobileNumber: {
type: DataTypes.STRING(20),
allowNull: true
},
createdAt: {
allowNull: false,
type: DataTypes.DATE,
defaultValue: DataTypes.NOW
},
updatedAt: {
allowNull: false,
type: DataTypes.DATE,
defaultValue: DataTypes.NOW
}
});
},

down: async (queryInterface: QueryInterface) => {
await queryInterface.dropTable("paymentMethods");
}
};
82 changes: 82 additions & 0 deletions src/databases/migrations/20240704115208-create-sellerProfiles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/* eslint-disable comma-dangle */
import { QueryInterface, DataTypes } from "sequelize";

export = {
up: async (queryInterface: QueryInterface) => {
await queryInterface.createTable("sellerProfiles", {
id: {
type: DataTypes.UUID,
allowNull: false,
primaryKey: true,
defaultValue: DataTypes.UUIDV4,
},
userId: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: "users",
key: "id",
},
onUpdate: "CASCADE",
onDelete: "CASCADE",
},
shopsId: {
allowNull: false,
type: DataTypes.UUID,

references: {
model: "shops",
key: "id"
},
onDelete: "CASCADE",
onUpdate: "CASCADE"
},
paymentMethodId:{
type: DataTypes.UUID,
allowNull: false,
references:{
model: "paymentMethods",
key: "id"
},
onUpdate: "CASCADE",
onDelete: "CASCADE"
},
businessName: {
type: DataTypes.STRING(128),
allowNull: false,
},
tin: {
type: DataTypes.INTEGER,
allowNull: false,
},
rdbDocument:{
type: DataTypes.STRING(255),
allowNull: true,
},
terms:{
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
requestStatus: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: "Pending",
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
});
},

down: async (queryInterface: QueryInterface) => {
await queryInterface.dropTable("sellerProfiles");
},
};
44 changes: 0 additions & 44 deletions src/databases/migrations/20240704115208-create-sellerRequests.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { QueryInterface, DataTypes } from "sequelize";

export default {
up: async (queryInterface: QueryInterface) => {
await queryInterface.createTable("termsAndConditions", {

id: {
type: DataTypes.UUID,
allowNull: false,
primaryKey: true,
defaultValue: DataTypes.UUIDV4
},
content: {
allowNull: false,
type: DataTypes.STRING
},
type: {
type: DataTypes.STRING,
allowNull: true
},
createdAt: {
allowNull: false,
type: DataTypes.DATE,
defaultValue: DataTypes.NOW
},
updatedAt: {
allowNull: false,
type: DataTypes.DATE,
defaultValue: DataTypes.NOW
}
});
},

down: async (queryInterface: QueryInterface) => {
await queryInterface.dropTable("termsAndConditions");
}
};
10 changes: 7 additions & 3 deletions src/databases/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import wishLists from "./wishLists";
import Notifications from "./notifications";
import ProductReviews from "./productReviews";
import wishListProducts from "./wishListProducts";
import SellerRequest from "./sellerRequests";
import SellerProfile from "./sellerProfile";
import Addresses from "./addresses";
import Settings from "./settings";
import PaymentMethods from "./paymentMethods";
import TermsAndConditions from "./termsAndCodition";

const db = {
CartProducts,
Expand All @@ -27,9 +29,11 @@ const db = {
Notifications,
ProductReviews,
wishListProducts,
SellerRequest,
SellerProfile,
Addresses,
Settings
Settings,
PaymentMethods,
TermsAndConditions
};

Object.values(db).forEach(model => {
Expand Down
92 changes: 92 additions & 0 deletions src/databases/models/paymentMethods.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* eslint-disable */
import { Model, DataTypes, Optional } from "sequelize";
import sequelizeConnection from "../config/db.config";
import Users from "./users";
import SellerProfile from "./sellerProfile";

interface IPaymentMethods {
id: string;
userId: string;
bankPayment: boolean;
mobilePayment: boolean;
bankAccount: string;
bankName: string;
mobileNumber: string;
createdAt?: Date;
updatedAt?: Date;
}
class PaymentMethods extends Model<IPaymentMethods> implements IPaymentMethods {
declare id: string;
declare userId: string;
declare bankPayment: boolean;
declare mobilePayment: boolean;
declare bankAccount: string;
declare bankName: string;
declare mobileNumber: string;
declare createdAt?: Date;
declare updatedAt?: Date;

static associate() {
PaymentMethods.belongsTo(Users, { foreignKey: "userId", as: "user",onDelete: "CASCADE" });
PaymentMethods.hasMany(SellerProfile, { foreignKey: "paymentMethodId", as: "SellerProfile", onDelete: "CASCADE"});
}

}
PaymentMethods.init(
{
id: {
type: DataTypes.UUIDV4,
defaultValue: DataTypes.UUIDV4,
allowNull: false,
primaryKey: true,
},
userId: {
type: DataTypes.UUIDV4,
allowNull: false,
references: {
model: "Users",
key: "id",
},
},
bankPayment: {
type: DataTypes.BOOLEAN,
defaultValue: false,
allowNull: true,
},
mobilePayment: {
type: DataTypes.BOOLEAN,
defaultValue: false,
allowNull:true,
},
bankAccount: {
type: DataTypes.STRING,
allowNull: true,
},
bankName: {
type: DataTypes.STRING,
allowNull: true,
},
mobileNumber: {
type: DataTypes.STRING,
allowNull: true,
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
}
},
{
sequelize: sequelizeConnection,
tableName: "paymentMethods",
timestamps: true,
modelName: "PaymentMethods",
}
);

export default PaymentMethods;
Loading

0 comments on commit ac63cf4

Please sign in to comment.