KamoCRM

The first FulfillmentPolicy implementation

Featurekamo-shared-library
Shipped
26 ஆகஸ்ட், 2026 அன்று 7:57 AM UTC
Author
Kamo
Commit
2e71c35

FulfillmentPolicy has declared supports/createFromCommitment since it was written and a repo-wide grep returned exactly one line: the declaration. Its work was inlined unconditionally in processOrderPaid, which builds a shipment-shaped FulfillmentOrder for every line with an offering regardless of what was sold. A Spring @Service with constructor injection — a NEW pattern for this policy family, not a copied one: RetailInventoryPolicy is never instantiated or injected either, so every member of the family was dead code. supports() matches EngagementType.SERVICE directly, never the vocabulary: PROCUREMENT also maps to EngagementVocabulary.SERVICE but is the buyer's side of a vendor order and must never raise a ServiceJob. It is conservative because the order path stops at the first policy that says yes. Commitment cannot navigate to its Order — the FK is on Order.commitment with no inverse — so OrderRepository gains findByCommitmentUid to reach the address snapshot. The returned FulfillmentOrder is left unsaved; the caller already saves it. Also widens the query guard from one package to the whole library. Three per-package guards left ~50 files of @Query covered by nothing, including every commerce repository — which is how the new query above came to be believed validated when it was not. All 746 parse today.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing