I wrote a function that activates a batch of cards based on there pan number
The way it works:
→ A user inserts an excel file with a list of card pans that are already in the system plus user details, the system validates the details and update the card with the user details
When the user makes a list of a more than 500 excel entires, the app takes more the 4 minutes to update the cards.
This is the way I’m updating the cards after its extracted
|> Enum.map(fn x ->
|> case do
nil -> # flag fail
Ecards.update(card, firstName: x.firstName, lastName: x.lastName, cardStatus: "activate")
# flag success
# count success and failed then display to user
Is there a faster way of updating the cards from the list that meet the criteria?