monkeytype/backend
typermonkeyuser b08c194c3d
Implement streaks (#3385) typermonkeyuser, bruception, miodec
* Implement streaks

* Improve code

* Update package.json

* Store streak on the user

* Pretty-fix

* Ensure that streak is up to date

* Fix issue in streak calculation

* Revert prettier changes

* Update polish.json

* Update db.ts

* Remove initial calculation

* Write mandatory test

* using strict equality

* moved functions to the utils file

* importing utils

* adding streak to breakdown,
rounding and parsing streak modifier

* renamed variable

* renamed fields

* using correct field name

* added streaks to configuration

* showing streak during xp breakdown

* incrementing streak earlier
checking configuration before applying modifier

* returning streak to the client

* setting local streak with the number returned from the backedn

* only reading streak when updating profile instead of updating

* sending streak information in profile

* only showing streak if greater than 0

* setting to empty if no streak

* renamed config property

* updated streak calculation

* refactored isYesterday

* refactored streak update

* only displaying if streak larger than 1

* merged configuration properties into 1

* added configuration for max streak bonus

* added isToday check back (derp)

* reverted streaks back to multiplier approach

* using better maprange functin

* removed import

* moved test to dal spec

* clamping

* removed imports

* fixed test

* increased coverage

* removed angry console log

* typo

* using date now instead of dates

* mocking date now
awaiting expect

* not using date

Co-authored-by: Anonymous <110769200+fasttyperdog@users.noreply.github.com>
Co-authored-by: Rizwan Mustafa <rizwanmustafa0000@gmail.com>
Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-09-05 12:13:55 +02:00
..
__tests__ Implement streaks (#3385) typermonkeyuser, bruception, miodec 2022-09-05 12:13:55 +02:00
private Add new rate limiting flow (#3230) Bruception 2022-06-28 13:45:57 +02:00
redis-scripts Add daily leaderboards (#3023) bruception 2022-05-26 16:30:11 +02:00
src Implement streaks (#3385) typermonkeyuser, bruception, miodec 2022-09-05 12:13:55 +02:00
.gitignore fixed ignore 2022-03-07 14:39:09 +01:00
docker-compose.yml Add docker-compose and instructions to README (#2939) sondrekje 2022-05-05 01:52:17 +02:00
example.env Add docker-compose and instructions to README (#2939) sondrekje 2022-05-05 01:52:17 +02:00
jest-mongodb-config.js Feature/backend test (#2937) sondrekje 2022-05-05 15:19:31 +02:00
jest.config.ts Implement streaks (#3385) typermonkeyuser, bruception, miodec 2022-09-05 12:13:55 +02:00
package-lock.json Add new rate limiting flow (#3230) Bruception 2022-06-28 13:45:57 +02:00
package.json running tests sequentially 2022-06-30 01:33:23 +02:00
setup-tests.ts Add daily leaderboards (#3023) bruception 2022-05-26 16:30:11 +02:00
tsconfig.json Move backend source files into src folder (#2943) 2022-05-05 19:27:00 +02:00