Skip to content

Conversation

@stolarczykt
Copy link
Contributor

No description provided.

lukaszreszke and others added 30 commits August 6, 2024 18:12
mhm

future prices work
Moving this logic to model gives us false feeling about
correct design, as we "encapsulate" the order logic.
It is a trap
Co-authored-by: Tomasz Stolarczyk <[email protected]>
Expiring an order should increase product stock level. The reason is
that the order haven't been paid and the stock will not be send.

Co-authored-by: Tomasz Stolarczyk <[email protected]>
Co-authored-by: Tomasz Stolarczyk <[email protected]>
Before changing this part of the code it is good to know that we are not
going to break anything.

In order to make testing easier I decided to add `id` of product to each
table row
lukaszreszke and others added 19 commits November 14, 2024 14:55
This model will be used as a source of truth for the Stock Level. It'll
replace current Product Active Record stock level.
The idea for plugging in a new write model is that we want to begin its
stream with migration event, that's why we check whether migration event
is already in the stream

We also use an advisory lock to avoid race conditions when adding the
migration event.

New tests were added to check whether the logic of
Inventory::ProductService works correctly for all 3 cases.
From now on the Stock Level column of product will be updated by
UpdateProductStockLevel. The reason is that the source of truth lays
somewhere else now. Currently it is synchronous update, but it might be
possible to move to async later.
Checkpoint will be used to store last processed event id to ensure
idempotency
@netlify
Copy link

netlify bot commented Apr 14, 2025

Deploy Preview for ecommerce-events failed.

Name Link
🔨 Latest commit 7bd8459
🔍 Latest deploy log https://app.netlify.com/sites/ecommerce-events/deploys/67fd233313580a0008f7d336

@mostlyobvious mostlyobvious deleted the experiment_4 branch July 9, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants