Open caiocampoos opened 3 months ago
The idempotency key is a control information to prevent that twice or more transactions will be created. That is why I believe that information has to be sent in Headers.
The idea is to front-end generate a valid UUID every time an user access the create transaction page and that UUID will be passed to backend in header as known.
By the way, I am opened to receive another suggests!! \o/
But where is this key on the code? I can see the header but i can't find where you are generating the key. The most important part of a idempotency Key is its composition, where is generated is debatable, but how you compose the key will dictate if it is really idempotent.
I haven't done it yet. First, I have to reorganize the frontend structure where I made the relay calls to backend. I aim to do it tonight, because now I have to attend some demands at work. When I finished it, I'll make a PR specific to this issue.
https://github.com/joelbrs/bank.com.br/blob/main/apps/server/src/get-context.ts#L19