Giter Site home page Giter Site logo

biomercs-api's Introduction

biomercs-api's People

Contributors

dependabot[bot] avatar guistl avatar karinamelo26 avatar stlmpp avatar

Watchers

 avatar

biomercs-api's Issues

Do not expose the entity model, create a ViewModel

Score world record timing problem

in ScoreService.approvalAdmin it's possible to check for world record before the approval is done.

// These two actions needs to finish before we check for world record
const promises: Promise<ScoreApproval | UpdateResult | void>[] = [
  this.scoreApprovalService.addAdmin({ ...dto, idUser: user.id, action, actionDate: approvalDate, idScore }),
  this.scoreRepository.update(idScore, {
    status: action === ScoreApprovalActionEnum.Approve ? ScoreStatusEnum.Approved : ScoreStatusEnum.RejectedByAdmin,
    approvalDate,
  }),
];
if (action === ScoreApprovalActionEnum.Approve) {
  promises.push(
    this.scoreWorldRecordService.checkForWorldRecord({
      idPlatformGameMiniGameModeStage: score.idPlatformGameMiniGameModeStage,
      fromDate: addSeconds(approvalDate, -5),
      idPlatformGameMiniGameModeCharacterCostumes: orderBy(
        score.scorePlayers.map(scorePlayer => scorePlayer.idPlatformGameMiniGameModeCharacterCostume)
      ),
    })
  );
}
await Promise.all(promises);

Forum - notifications

  • new entity TopicPlayerSettings (idTopic, idPlayer, notifications) 1169ed9
  • send notifications according to this table

Cancel score

Add option to cancel score in the change request

  • New status "Cancelled" in the ScoreStatus
  • New end-point to cancel the score

Front-end: stLmpp/biomercs#71

Add info about controller and mk to score player

Front-end: stLmpp/biomercs#50

  • new entity Controller, columns: id, name
  • new column idController in the ScorePLayer entity
  • new properties idController and controllerName in the ScorePlayerViewModel
  • new column idController in the Player entity, this will be the default in the ScorePlayerViewModel, if the player does not set it and submiting a score

Feature: ban user

  • Add bannedDate column to User
  • Banned user approvals goes straight to admin

Notifications

  • Table to hold the notifications
  • Socket to send new notifications

E-mail queue

Create a queue for the e-mail

  • new table EmailQueue
  • the action of sending will be handled by rxjs (auditTime)

Clear todo itens

  • Better error message on MapperService.map when there's no MapProfile
  • Remove PlatformGameMiniGameModeStageService.findRandom
  • Remove PlayerService.findRandom
  • Remove ScorePlayerService.addManyRandom
  • Remove ScoreController.insertRandom
  • Remove ScoreController.insertManyRandom
  • Remove ScoreService.insert
  • Better error handling for SQL errors in HandleErrorFilter.catch (maybe create a issue for this only alone)

Create structure to begin the forum

Tables:

  • Category (name)
  • SubCategory (name, description, idCategory)
  • Moderator (idPlayer)
  • SubCategoryModerator (idModerator, idSubCategory)
  • Topic (name, idSubCategory, idScore, views, pinned, lockedDate)
  • TopicTransfer (idTopic, idSubCategoryFrom, idSubCategoryTo)
  • Post (post, idTopic, idPlayer, deletedDate)
  • TopicPlayerLastRead (idPlayer, idTopic, readDate)
  • New column (type) in the Rule entity to separate rules from the Forum and the Site

Improvements MapService

  • Add a way to map multiple properties at once, eg.
mapperService.create(Score, ScoreViewModel)
  .for(
    dest => [dest.idScoreStatus, dest.scoreStatusDescription],
    from => [from.scoreStatus.id, from.scoreStatus.description]
  );

This will be useful to need repeat code when multiple properties needs a slightly complex logic
https://github.com/stLmpp/biomercs-v2-api/blob/32d285a04a6f3fa3d1ad85a0027d0aaa47145aa7/src/score/score.module.ts#L182-L188
https://github.com/stLmpp/biomercs-v2-api/blob/32d285a04a6f3fa3d1ad85a0027d0aaa47145aa7/src/score/score.module.ts#L189-L195

In the example above, we're doing 2 lookups in the from.scoreWorldRecords array, and could be only one

Add Rate limit to some routes

  • Login
  • Register
  • Steam register

Login will not have a rate limit, instead it will block the user when tried to login with wrong password more than 3 times. See #20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.