# Changelog — magento-shippingfields

All notable changes to this project are documented here.
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
Versions follow [Semantic Versioning](https://semver.org/) with a `v` prefix.

---

## [v1.0.19] — 2026-02-26

### Fixed
- **F1 (HIGH):** Replaced `async: false` in `place-order-mixin.js` with a proper async Promise chain using `$.Deferred()`. Resolves browser deprecation warning and main-thread blocking during order placement.

### Removed
- **F3/F4:** Removed `QuoteToOrderPlugin`, `ShippingInformationManagementPlugin`, and `PaymentInformationManagementPlugin` from `di.xml`.
  - `QuoteToOrderPlugin` was dead code — `aroundConvert` received a `Quote\Item`, not a `Quote`, so `instanceof Quote` never matched.
  - `ShippingInformationManagementPlugin` was a redundant save path with garbled code and ObjectManager anti-pattern; the REST API path via `ShippingFieldsManagement` is authoritative.
  - `PaymentInformationManagementPlugin` performed debug logging only.
- **F7:** Deleted backup and stray files: `sales_order_edit_index.xml.bak`, `place-order-mixin.js.bak`, `Untitled-1.html`.

### Changed
- **F8:** Replaced emoji-prefixed log messages across all PHP classes with standard `[ShippingFields]`-prefixed text for log aggregation compatibility.
- **F6:** Aligned `module.xml` `setup_version` to `1.0.18` (was `1.0.0`).

### Added
- **F2:** Added `suggest` block in `composer.json` for `portalpeople/magento-disableddates`.

### Docs
- **F5:** Resolved ACL UNKNOWN in `docs/API.md` and `docs/SECURITY.md` — confirmed `Magento_Sales::actions_edit` from source.
- AI-assisted discovery documentation added across `docs/` (architecture, API, audit, boundaries, integrations, GDPR, observability, security, system map, TODO, workflow, ADR-000).

---

## [v1.0.18] — 2026-02-25

### Changed
- Moved inline validation error to display below the shipping date field rather than as a top-level message.
- Moved the checkout "Next" button to render below the Shipping Information block.

---

## [v1.0.17] — 2026-02-25

### Changed
- Shipping date validation (required field check) moved to the shipping step "Next" button click (`set-shipping-information-mixin.js`) rather than at order placement.

---

## [v1.0.16] — 2026-02-25

### Fixed
- Reverted `required-entry` validation class in layout XML — caused a spinning wheel / deadlock on the checkout step.
- Date enforcement now handled exclusively via `place-order-mixin.js`.

---

## [v1.0.15] — 2026-02-25

### Added
- Preferred Shipping Date field marked as mandatory on the checkout frontend.

---

## [v1.0.14] — 2026-02-25

### Added
- Shipping date and message fields are now editable on the admin order view page, with a POST save controller (`Adminhtml/Order/Update`).

---

## [v1.0.13] — 2026-02-24

### Changed
- Shipping date display format changed to `dd/MM/yyyy`.

---

## [v1.0.12] — 2026-02-24

### Changed
- Today's date added to the set of disabled dates in the shipping date calendar (in addition to the next 2 working days lead time).

---

## [v1.0.11] — 2026-02-24

### Added
- Lead time enforced in date picker: next 2 working days (Mon–Fri) disabled from selection in addition to configured weekday blocks.

---

## [v1.0.10] — 2026-02-24

### Fixed
- Shipping fields save in `place-order-mixin.js` made synchronous (`async: false`) to ensure fields are persisted before the order placement request fires. _(Note: reverted in v1.0.19 — replaced with async Promise chain.)_

---

## [v1.0.9] — 2026-02-24

### Changed
- Version bump.

---

## [v1.0.8] — 2026-02-24

### Fixed
- Shipping fields now read from `checkoutProvider` at order placement time rather than at the shipping step, ensuring latest values are captured.

---

## [v1.0.7] — 2026-02-24

### Fixed
- Shipping fields read from `uiRegistry` `checkoutProvider` instead of direct DOM access.
- Save request URL built via Magento URL builder.

---

## [v1.0.6] — 2026-02-24

### Changed
- Version bump.

---

## [v1.0.5] — 2026-02-24

### Added
- Specific disabled dates (from `portalpeople/magento-disableddates` DB collection) now excluded from the shipping calendar in addition to weekday blocks.

---

## [v1.0.4] — 2026-02-24

### Added
- Weekly disabled weekdays configurable via `portalpeople_disableddates/weekly_block/*` Magento config, surfaced to the frontend date picker via `DeliveryDateConfigProvider`.

---

## [v1.0.3] — 2026-02-24

### Changed
- Updated `composer.json` dependency constraints: `magento/module-sales >=101.0.0`, `magento/module-quote >=101.0.0`.

---

## [v1.0.2] — 2026-02-24

### Fixed
- Composer version format corrected (removed `v` prefix from composer version string).

---

## [v1.0.1] — 2026-02-24

### Changed
- Package name updated to `portalpeople/magento-shippingfields`.

---

## [v1.0.0] — 2026-02-24

### Added
- Initial release.
- Custom `shipping_date` (date picker) and `shipping_message` (textarea, max 255 chars) fields added to Magento 2 checkout shipping step.
- Fields stored in `quote` and `sales_order` tables via `InstallSchema`.
- REST API endpoint `POST /V1/carts/mine/save-shipping-fields`.
- Extension attributes on `CartInterface` and `OrderInterface`.
- `QuoteSubmitBefore` observer copies fields from quote to order on submission.
- Admin order view block renders shipping fields.
- Composer package files and vendor extension registration.

---

[v1.0.19]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.19
[v1.0.18]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.18
[v1.0.17]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.17
[v1.0.16]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.16
[v1.0.15]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.15
[v1.0.14]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.14
[v1.0.13]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.13
[v1.0.12]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.12
[v1.0.11]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.11
[v1.0.10]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.10
[v1.0.9]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.9
[v1.0.8]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.8
[v1.0.7]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.7
[v1.0.6]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.6
[v1.0.5]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.5
[v1.0.4]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.4
[v1.0.3]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.3
[v1.0.2]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.2
[v1.0.1]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.1
[v1.0.0]: https://dev.azure.com/PortalPeopleUK/ngauge_modules/_git/magento-shippingfields?version=GTv1.0.0
