Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

59
Visualizações
Storing action mapping for an Angular app

I have an Angular application that manipulates data in sets. My users can perform actions on each record. They also want to be able to perform actions on the entire set. But the business rules state that some actions cannot be performed on certain data.

I want to create a generic method that will loop through the data and perform the action only if the data meets the criteria for that action. I can do this easily enough. My issue is where to store this action-to-criteria mapping. I can create a table and have it retrieved through a web service. I can store it in the web app in a JSON file. But these seem more complicated than necessary when we consider that retrieving this data will be asynchronous and will need to be stored somewhere in memory. But I obviously don't want to hard-code it either. The business rules would almost never change, and if they did, it would be adding new actions.

This table shows a very simplified version of what I need to accomplish. If the user is working on a list of 100 records and clicks on the "Archive All" button, I want to scan the records and only archive the records that are in the completed phase. I want to be able to reuse this method for the other buttons as well. What is the best practice for storing something like this?

Phase Save All Send All Archive All
New Y N N
In Progress Y Y N
Completed Y Y Y
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda