Skip to content

chore(release): promote dev to main for release - #81

Merged
seifmaazouz merged 9 commits into
mainfrom
dev
Apr 7, 2026
Merged

seifmaazouz merged 9 commits into
mainfrom
dev

Conversation

@seifmaazouz

@seifmaazouz seifmaazouz commented Apr 6, 2026 •

Copy link
Copy Markdown
Owner

Description

Promote the dev integration branch to main for a release. This PR contains the accumulated, verified changes on dev and will trigger the repository release pipeline (semantic-release) when merged to main.

## Description
This PR fixes issues with semantic-release version detection and ensures
that new releases are correctly published and tagged.

- Updated GitHub Actions release workflow to handle versioning reliably
- Ensures proper Docker image tagging for backend and frontend
- No functional changes to application code

## Type of Change
- [ ] feat - New feature or functionality for users
- [ ] fix - Bug fix that resolves an issue
- [ ] refactor - Code restructuring without changing functionality
- [ ] docs - Documentation changes only
- [x] chore - Maintenance tasks, dependencies, config changes
- [ ] test - Adding/updating tests
- [ ] perf - Performance improvements

## Scope (optional)
- [ ] backend
- [ ] frontend
- [ ] database
- [ ] docs
- [x] misc

## Checklist
- [x] PR title follows conventional commit format
- [x] This PR is squash-merged into `dev`
- [x] No breaking changes (or marked with `!`)
## Description
Removes the tracked Vite cache directory and updates .gitignore to
prevent committing build artifacts.

Closes #67

## Type of Change
- [x] chore

## Scope
- [x] frontend

## Checklist
- [x] PR title follows conventional commit format
- [x] This PR is squash-merged into dev
- [x] No breaking changes
…le.dev) (#74)

## Description
Replace the development Dockerfile with a production-ready multi-stage
build and preserve the original as Dockerfile.dev.

Closes #69

## Type of Change
- [x] chore

## Scope
- [x] frontend

## Checklist
- [x] PR title follows conventional commit format
- [x] This PR is squash-merged into dev
- [x] No breaking changes
## Description
Apply missing commit that removes build artifacts and updates
.gitignore.

## Type of Change
- [x] chore

## Scope
- [x] frontend
…cient-stock responses (#76)

## Description
Fix shopping-cart stock display and checkout behavior so the cart shows
authoritative stock and auto-adjusts when the server reports
insufficient stock.

### Backend
- Return a structured "Insufficient stock" JSON response with `isbn`,
`title`, and `available` for every affected item.
- Aggregate insufficiencies across all cart items and throw a single
`InsufficientStockException` carrying all affected items.
- Lock book rows during updates (SELECT ... FOR UPDATE) and validate all
items before applying changes to avoid negative stock and race
conditions.
- Map the domain exception to HTTP 400 with a typed DTO so the frontend
can act on it.

### Frontend
- Centralize optimistic cart updates in `CartContext` and normalize cart
API responses.
- Add `adjustCartItems` to apply batch adjustments returned by the
server and update local cart state.
- Render add-to-cart toasts via a portal into `document.body` and center
them reliably.
- Prevent double-decrement when adding from search and ensure
`cartCount` becomes `0` when the cart is empty.
- Close the checkout modal when the server reports insufficient stock
and show short toasts for each adjusted item.

### Key backend changes included
- `InsufficientStockResponse` DTO and middleware mapping to return typed
JSON on insufficient stock.
- `InsufficientStockException` updated to support aggregated
insufficiency items.
- `BookRepository` now locks rows and validates all adjustments before
applying updates.
- `ShoppingCartService` pre-checks cart items and throws aggregated
exception when needed.

### Key frontend changes included
- `CartContext.jsx`: centralized optimistic updates, `adjustCartItems`,
and authoritative `loadCart()` reconciliation.
- `ResultsGrid.jsx`: portal-rendered, centered add-to-cart toast.
- `Cart.jsx` / `Dashboard.jsx`: use centralized adjustments and avoid
duplicate optimistic dispatches.

## Type of Change
- [ ] feat
- [x] fix
- [ ] refactor
- [ ] docs
- [ ] chore
- [ ] test
- [ ] perf

## Scope (optional)
- [x] backend
- [x] frontend

## Checklist
- [x] PR title follows conventional commit format
- [x] This PR is squash-merged into `dev`
…Title on CustomerOrderItem (#77)

Also fix ordering to sort by OrderDate then OrderID and update database
sample data

## Type of Change
- [x] refactor - Code restructuring without changing functionality
- [ ] docs - Documentation changes only
- [ ] chore - Maintenance tasks, dependencies, config changes
- [ ] test - Adding/updating tests
- [ ] perf - Performance improvements

## Scope (optional)
- [x] backend
- [ ] frontend
- [ ] database
- [ ] docs
- [ ] misc

## Checklist
- [x] PR title follows conventional commit format
- [x] This PR is squash-merged into `dev`
- [x] No breaking changes (or marked with `!`)
…services (#78)

## Description
- Introduce `CartItemReadModel` and update cart mappings, repository and
service to use read-models.
- Update shopping cart tests to expect `InsufficientStockException`
instead of `BusinessRuleViolationException`.

## Type of Change
- [ ] feat - New feature or functionality for users
- [ ] fix - Bug fix that resolves an issue
- [x] refactor - Code restructuring without changing functionality
- [ ] docs - Documentation changes only
- [ ] chore - Maintenance tasks, dependencies, config changes
- [ ] test - Adding/updating tests
- [ ] perf - Performance improvements

## Scope (optional)
- [x] backend
- [ ] frontend
- [ ] database
- [ ] docs
- [ ] misc

## Checklist
- [x] PR title follows conventional commit format
- [x] This PR is squash-merged into `dev`
- [x] No breaking changes (or marked with `!`)
## Description
Include `Title` when creating `CustomerOrderItem` so order items carry
book titles.

## Related Issue
Closes #<issue_number>

## Type of Change
- [ ] feat - New feature or functionality for users
- [x] fix - Bug fix that resolves an issue
- [ ] refactor - Code restructuring without changing functionality
- [ ] docs - Documentation changes only
- [ ] chore - Maintenance tasks, dependencies, config changes
- [ ] test - Adding/updating tests
- [ ] perf - Performance improvements

## Scope (optional)
- [x] backend
- [ ] frontend
- [ ] database
- [ ] docs
- [ ] misc

## Checklist
- [x] PR title follows conventional commit format
- [x] This PR is squash-merged into `dev`
- [x] No breaking changes (or marked with `!`)
…exhausted (#80)

## Description
Fix cart stock display and prevent unnecessary backend calls by
disabling the increment button when available stock is exhausted.

## Related Issue
Closes #<issue_number>

## Type of Change
- [ ] feat - New feature or functionality for users
- [x] fix - Bug fix that resolves an issue
- [ ] refactor - Code restructuring without changing functionality
- [ ] docs - Documentation changes only
- [ ] chore - Maintenance tasks, dependencies, config changes
- [ ] test - Adding/updating tests
- [ ] perf - Performance improvements

## Scope (optional)
- [ ] backend
- [x] frontend
- [ ] database
- [ ] docs
- [ ] misc

## Checklist
- [x] PR title follows conventional commit format
- [x] This PR is squash-merged into `dev`
- [x] No breaking changes (or marked with `!`)

## Notes
- Fixes: compute `available = stock - quantity` for authoritative
display; remove misleading optimistic UI updates; disable `+` when
`available <= 0` or cart is loading to avoid useless backend calls.

@m-shalll m-shalll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

@seifmaazouz
seifmaazouz merged commit df242ed into main Apr 7, 2026
2 checks passed
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants