BE-610: Add migration for generic supply chain ontology#8872
BE-610: Add migration for generic supply chain ontology#8872thehabbos007 wants to merge 10 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8872 +/- ##
==========================================
- Coverage 59.76% 59.24% -0.53%
==========================================
Files 1348 1349 +1
Lines 131817 130165 -1652
Branches 5944 5898 -46
==========================================
- Hits 78784 77115 -1669
- Misses 52125 52142 +17
Partials 908 908
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
05cc294 to
8d10978
Compare
8d10978 to
318fc4a
Compare
89b5da0 to
c79ded4
Compare
3a9e96d to
b4951b0
Compare
PR SummaryMedium Risk Overview Migration 025 introduces a shared Migration 026 is a large additive seed: measure data types (mass/volume/area/duration with conversions), quantity and currency-backed property types, ~19 link types, and entity types spanning Company/Customer/Vendor, Material, Site, Batch, orders (sales/purchase/production), BOM, Delivery, Shipment, Material Document, valuations, site material planning, and reservations—with links wiring fulfillment, movement, and logistics flows. It requires migration 025’s currency types (fails fast if a currency data type is missing). Frontend adds SVG icons under Reviewed by Cursor Bugbot for commit bedc578. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f3d0a8a. Configure here.
There was a problem hiding this comment.
Pull request overview
Adds system ontology migrations to seed a generic supply-chain ontology (entity + link types) along with currency data types, and introduces new frontend SVG icons used by those types.
Changes:
- Added
025migration to seed aCurrencyabstract data type plus one data type per ISO 4217 currency code. - Added
026migration to create supply-chain entity/link types and supporting property/data types. - Added multiple new SVG icons for the new ontology types, and removed the older dev-only currency seeding migration.
Reviewed changes
Copilot reviewed 4 out of 25 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/hash-frontend/public/icons/types/warehouse.svg | New icon for Site / warehouse-related types |
| apps/hash-frontend/public/icons/types/user-tag.svg | New icon for Customer-related types |
| apps/hash-frontend/public/icons/types/truck.svg | New icon for Delivery-related types |
| apps/hash-frontend/public/icons/types/truck-ramp-box.svg | New icon for Delivery Item / handling-related types |
| apps/hash-frontend/public/icons/types/truck-container.svg | New icon for Shipment / transport-related types |
| apps/hash-frontend/public/icons/types/receipt.svg | New icon for Sales Order Item |
| apps/hash-frontend/public/icons/types/list-tree.svg | New icon for Bill of Materials |
| apps/hash-frontend/public/icons/types/list-ol.svg | New icon for Bill of Materials Item |
| apps/hash-frontend/public/icons/types/industry.svg | New icon for production/industry concepts |
| apps/hash-frontend/public/icons/types/handshake.svg | New icon for Vendor-related types |
| apps/hash-frontend/public/icons/types/file-invoice.svg | New icon for Purchase Order |
| apps/hash-frontend/public/icons/types/file-invoice-dollar.svg | New icon for Sales Order |
| apps/hash-frontend/public/icons/types/coins.svg | New icon for Material Valuation |
| apps/hash-frontend/public/icons/types/clipboard-list.svg | New icon for record/list concepts |
| apps/hash-frontend/public/icons/types/clipboard-check.svg | New icon for posting/check concepts |
| apps/hash-frontend/public/icons/types/calendar-days.svg | New icon for schedule-line concepts |
| apps/hash-frontend/public/icons/types/building.svg | New icon for Company |
| apps/hash-frontend/public/icons/types/boxes-stacked.svg | New icon for Batch |
| apps/hash-frontend/public/icons/types/boxes-packing.svg | New icon for yield/packing concepts |
| apps/hash-frontend/public/icons/types/box.svg | New icon for Material |
| apps/hash-frontend/public/icons/types/arrows-rotate.svg | New icon for Material Document / movement concepts |
| apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/087-add-initial-currency-data-types.dev.migration.ts | Removed dev-only currency seeding migration (superseded by 025) |
| apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/026-add-supply-chain-types.migration.ts | Adds supply-chain ontology types (entity/link/property/data types) |
| apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/025-add-initial-currency-data-types.migration.ts | Adds currency data types seeded from activeCurrencies |
| apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/currencies.ts | New ISO 4217 currency list used by migration(s) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for (const { code, name } of activeCurrencies) { | ||
| const symbol = currencySymbols[code]; | ||
| await createSystemDataTypeIfNotExists(context, authentication, { | ||
| dataTypeDefinition: { | ||
| allOf: [{ $ref: currencyDataType.schema.$id }], | ||
| title: code, | ||
| description: `An amount denominated in ${name} (ISO 4217 ${code}).`, | ||
| type: "number", | ||
| ...(symbol ? { label: { left: symbol } } : {}), | ||
| }, | ||
| conversions: {}, | ||
| webShortname: "h", | ||
| migrationState, | ||
| }); | ||
| } |
| "Has Line Item", | ||
| "Line Item Of", | ||
| "A line item that something has.", | ||
| "/icons/types/list-ul.svg", | ||
| ); |
| "Fulfills", | ||
| "Fulfilled By", | ||
| "Something that something fulfills.", | ||
| "/icons/types/check-double.svg", | ||
| ); |
| "Located At", | ||
| "Location For", | ||
| "The site where something is located or takes place.", | ||
| "/icons/types/location-dot.svg", | ||
| ); |
| "Consumes", | ||
| "Consumed By", | ||
| "Something consumed by something.", | ||
| "/icons/types/arrow-down-to-bracket.svg", | ||
| ); |
| "Procures", | ||
| "Procured By", | ||
| "Something procured by something.", | ||
| "/icons/types/cart-shopping.svg", | ||
| ); |
| "Moves", | ||
| "Moved By", | ||
| "Something moved by something.", | ||
| "/icons/types/arrows-turn-to-dots.svg", | ||
| ); |
| "Departs From", | ||
| "Departure For", | ||
| "Something from which something departs.", | ||
| "/icons/types/arrow-right-from-bracket.svg", | ||
| ); |
| "Arrives At", | ||
| "Arrival For", | ||
| "Something at which something arrives.", | ||
| "/icons/types/arrow-right-to-bracket.svg", | ||
| ); |
a6385fa to
bedc578
Compare
| const postedAgainstLink = await link( | ||
| "Posted Against", | ||
| "Has Posting", | ||
| "Something a posting or movement is recorded against, such as the order or document it fulfils.", | ||
| "/icons/types/clipboard-check.svg", | ||
| ); |
| "A good or material that can be produced, stored, sold, or procured, including raw materials, intermediates, and finished goods.", | ||
| labelProperty: blockProtocolPropertyTypes.name.propertyTypeBaseUrl, | ||
| properties: [ | ||
| { propertyType: blockProtocolPropertyTypes.name.propertyTypeId }, |
| "A physical site, such as a plant, warehouse, or distribution hub, where goods are produced, stored, or shipped.", | ||
| labelProperty: blockProtocolPropertyTypes.name.propertyTypeBaseUrl, | ||
| properties: [ | ||
| { propertyType: blockProtocolPropertyTypes.name.propertyTypeId }, |

🌟 What is the purpose of this PR?
This PR adds new ontology types for supply chains. I have moved some ontology types that were in the aviation migration, as they are now useful for concepts of the ontology here. A rundown:
🔗 Related links
🚫 Blocked by
🔍 What does this change?
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
turbo.json's have been updated to reflect this🐾 Next steps
🛡 What tests cover this?
❓ How to test this?
📹 Demo