Provides guidance on the CrestApps Orchard Core Assets module and Fleet feature, covering asset types, categories, meters, vehicles, warranties, meter readings, and extending asset editors. Use when working with equipment, fleet, or inventory in Orchard Core.
Ships in crestapps-orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Generate accurate setup, recipes and extension code for the CrestApps Assets module, which keeps a business's own vehicles, equipment and tools and the units installed at its customers. It references no vertical module, so field service, CRM and others build on it.
CrestApps.OrchardCore.Assets (or the CrestApps.OrchardCore.Cms.Core.Targets bundle, which includes it) in the web/startup project.CrestApps.OrchardCore.Assets.Abstractions (models, AssetsConstants, AssetsPermissions, AssetOwners, IAssetUsage and AddAssetUsage in namespace CrestApps.OrchardCore.Assets.Services); services in CrestApps.OrchardCore.Assets.Core (AssetService, AssetManager, AssetStore, AssetTypeManager, AssetOwnerDirectory, namespace CrestApps.OrchardCore.Assets.Core.Services).AssetManager (a CatalogManager<Asset>) so AssetHandler numbers, validates and stamps them, and Fleet handlers run. Record readings through AssetService.RecordReadingAsync.OwnerKind Customer holds a user id (party kind User), not a Customers record id. Account holds an Accounts content item id, Contact a CRM contact content item id.CrestApps.OrchardCore.Calendars.Resources; van stock also needs CrestApps.OrchardCore.Inventory.orchardcore-work-orders; equipment booked for visits in orchardcore-dispatch; geocoding in orchardcore-geo; drivers and technicians are staff members (see orchardcore-staff).{ "steps": [...] }.sealed modifier, except View Models.| Feature | ID | Depends on |
|---|---|---|
| Assets | CrestApps.OrchardCore.Assets | CrestApps.OrchardCore.Resources |
| Fleet | CrestApps.OrchardCore.Assets.Fleet | CrestApps.OrchardCore.Assets, CrestApps.OrchardCore.Calendars.Resources |
{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.Assets",
"CrestApps.OrchardCore.Assets.Fleet",
"CrestApps.OrchardCore.Inventory"
],
"disable": []
}
]
}
| Feature on | What Assets adds |
|---|---|
OrchardCore.Users | The Customer owner kind (UserPartySource, search by user name or email). |
CrestApps.OrchardCore.Accounts | The Account owner kind (Accounts registers AccountPartySource) and an Assets card on the account page. |
CrestApps.OrchardCore.Omnichannel.Managements | The Contact owner kind (the CRM's ContactPartySource, in CrestApps.OrchardCore.Omnichannel.Core) and an Assets card on CRM contacts. |
CrestApps.OrchardCore.Staff with Fleet | A Drives it by default staff picker (AssetFleetDriver_Edit, Content:7, in the Fleet card) for Fleet.DefaultDriverWorkerId on assets that have Fleet details; the technician app shows that vehicle and its stock as the driver's own. |
CrestApps.OrchardCore.Inventory with Fleet | A stock location per asset that carries stock (FleetStockLocationHandler). |
CrestApps.OrchardCore.Dispatch.Api | api/assets/v1 endpoints (see orchardcore-dispatch). |
All records live in the Assets YesSql collection.
| Record | Key properties |
|---|---|
AssetType | Name, Category (Equipment, Vehicle, Tool, CustomerUnit, Component, Facility), Description, Attributes (Name, Kind Text/Number/Date/YesNo), Meters (Name, Unit, Cumulative true by default). Names are unique within a type. |
Asset | Number (next A-00042 when empty, unique), Name, AssetTypeId, ProductId, SerialNumber, Manufacturer, Model, OwnerKind (Internal, Customer, Account, Contact), OwnerId (required unless internal), Location (an Address, coordinates once geocoded), ParentAssetId, Status (Active, InService, OutOfService, Retired), InstallDate, Warranty (StartDate, EndDate, Provider, Terms, Covers(date)), Attributes (name to value), Documents (media paths), Fleet |
AssetMeterReading | AssetId, Meter, Value, Utc, Source (Manual, WorkOrder, Api), SourceId, RecordedBy. Only ever added. |
AssetFleet | Schedulable, CalendarId, Plate, Vin, Capacity, FuelType, HomeBase, DefaultDriverWorkerId (a staff member id), CarriesStock, StockLocationId. Plate and Vin of an internal vehicle are edited in the Vehicle card with or without Fleet (with Fleet on, also for equipment and tools); the rest is Fleet's. |
AssetService:
RecordReadingAsync(reading) refuses a meter the type doesn't have and a cumulative reading lower than the last one before it; returns the errors.ReadingsAsync(assetId, take), ChildrenAsync(assetId) and AncestorsAsync(asset) read history and hierarchy. An asset can't be inside itself, directly or further up.AssetStore (the DocumentCatalog<Asset, AssetIndex> behind AssetManager):
ListByCategoryAsync(category, statuses, cancellationToken) lists the assets whose type is of an AssetCategory, ordered by name, in the database; statuses (AssetStatus values) is optional. The static ListTypeIdsAsync(session, category) returns the type ids of a category. The asset list filters the same way with category (assets?category=Vehicle); a chosen type wins over the category.GetUsageReasonsAsync(asset) returns why other modules' records point to an asset (see below).// Every active vehicle, for a module that books or logs trips. _assetStore is the injected AssetStore.
var vehicles = await _assetStore.ListByCategoryAsync(AssetCategory.Vehicle, [AssetStatus.Active]);
An asset that other records point to, such as ledger postings for its purchase or trips driven in it, can't be deleted; it is retired instead. A module tells Assets that its records point to an asset with IAssetUsage: GetUsageAsync(asset, cancellationToken) returns why, as a whole sentence such as "Its purchase is posted to the ledger.", or null. AssetStore checks every registered usage before it deletes and throws an InvalidOperationException with the reasons, so neither the admin page nor code (AssetManager.DeleteAsync) deletes an asset in use; the admin Delete action shows a warning with the reasons and suggests setting the state to Retired. The admin action also refuses an asset that other assets are inside.
using CrestApps.OrchardCore.Assets.Models;
using CrestApps.OrchardCore.Assets.Services;
using Microsoft.Extensions.Localization;
namespace MyModule.Assets;
public sealed class TripAssetUsage : IAssetUsage
{
private readonly ITripStore _trips; // your module's own store
internal readonly IStringLocalizer S;
public TripAssetUsage(ITripStore trips, IStringLocalizer<TripAssetUsage> stringLocalizer)
{
_trips = trips;
S = stringLocalizer;
}
public async Task<string> GetUsageAsync(Asset asset, CancellationToken cancellationToken = default)
{
var count = await _trips.CountByVehicleAsync(asset.ItemId, cancellationToken);
return count == 0 ? null : S["{0} trips were driven in it.", count].Value;
}
}
// In a startup marked [RequireFeatures(AssetsConstants.Features.Assets)]: services.AddAssetUsage<TripAssetUsage>();
AddAssetUsage<TUsage>() registers the usage as a scoped IAssetUsage with TryAddEnumerable.
Assets registers AssetRecordSource (services.AddRecordSource<AssetRecordSource>()), the shared IRecordSource for record kind Asset (AssetsConstants.RecordKind). Any module can search assets by name, number or serial number (AssetStore.SearchAsync), show their titles (number, type and serial as the description) and link to assets/view/{id} without referencing Assets; CanSearchAsync requires ViewAssets.
Each owner kind maps to a party kind (AssetOwners.ToPartyKind) and asset.ToParty() returns a PartyRef. Only kinds that have a registered IPartySource can be chosen. AssetOwnerDirectory names owners for the list, page and editor (an unknown owner shows its id). The pickers call Admin/api/crestapps/assets/owners/search?kind=&query= (ViewAssets), which returns up to 50 { value, text } items. The asset list filters with ownerKind and ownerId.
Add another kind of party in the module that keeps the records:
public sealed class VendorPartySource : IPartySource
{
private readonly VendorStore _vendors; // your module's store
public VendorPartySource(VendorStore vendors)
{
_vendors = vendors;
}
public string Kind => "Vendor";
public async Task<IReadOnlyList<PartyOption>> SearchAsync(string query, int count, CancellationToken cancellationToken = default)
=> [.. (await _vendors.SearchAsync(query, count, cancellationToken)).Select(vendor => new PartyOption(vendor.Id, vendor.Name))];
public async Task<IReadOnlyDictionary<string, string>> GetNamesAsync(IReadOnlyCollection<string> ids, CancellationToken cancellationToken = default)
=> (await _vendors.GetManyAsync(ids, cancellationToken)).ToDictionary(vendor => vendor.Id, vendor => vendor.Name);
}
// Startup: services.AddPartySource<VendorPartySource>();
Asset owner kinds themselves are a fixed enum; a new party kind is useful to other party consumers (IPartyDirectory) such as work order pickers.
Fleet.Schedulable, FleetCalendarHandler creates (or finds by source Asset and the asset id) a calendar of the Calendars Equipment type, which allows one booking at a time, and keeps its name. Dispatch books required equipment there with a Reservation.Fleet.CarriesStock gets its own Inventory StockLocation (OwnerKind Asset, OwnerId the asset id), stored in Fleet.StockLocationId. Parts used on a job come off it with IInventoryService.ConsumeAsync(stockItemId, locationId, quantity, referenceType, referenceId, reason, actor), which refuses more than is available and records a Consumed movement with the reference. A van's location never fulfills orders.StockLocation store (ItemId, Name, Address, Position, OwnerKind, OwnerId); a migration moves locations kept in the old settings into it, keeping ids and order. See orchardcore-inventory.| Menu | Route | Permission |
|---|---|---|
| Assets > Assets | assets (filters q, category, typeId, status, ownerKind, ownerId), assets/view/{id}, assets/edit/{id?}, assets/delete/{id} (POST) | ViewAssets (list, page), ManageAssets (edit, delete, readings) |
| Assets > Asset Types | assets/types, assets/types/edit/{id?} | ManageAssets |
The asset list offers a Category filter once types of more than one category exist. The asset type editor is built with IDisplayManager<AssetTypeEditViewModel> (AssetTypeEditDisplayDriver) in the Details, Attributes and Meters cards; the asset editor's cards are listed under Extending the asset editor, page and list.
| Permission | Display name | Implied by | Default role |
|---|---|---|---|
ManageAssets | Manage assets | none | Administrator |
ViewAssets | View assets | ManageAssets | Administrator |
The Assets step (needs OrchardCore.Recipes.Core) creates or updates Types then Assets (parents first) by ItemId, with the editor's checks. Property names are the model names and enums are names.
{
"steps": [
{
"name": "Assets",
"Types": [
{
"ItemId": "4f50djz4d49v2hdqg8ynxj481n",
"Name": "Boiler",
"Category": "CustomerUnit",
"Description": "A customer's gas boiler.",
"Attributes": [ { "Name": "Fuel", "Kind": "Text" }, { "Name": "Output (kW)", "Kind": "Number" } ],
"Meters": [ { "Name": "Run hours", "Unit": "h", "Cumulative": true } ]
},
{ "ItemId": "4frxjzg9rc0mtph04y78qk38dy", "Name": "Service van", "Category": "Vehicle" }
],
"Assets": [
{
"ItemId": "4fs9svm62gjxb5tzqxya3q8q20",
"Name": "Training boiler",
"AssetTypeId": "4f50djz4d49v2hdqg8ynxj481n",
"SerialNumber": "BX200-0451",
"Manufacturer": "Northwind Heating",
"Model": "BX200",
"Status": "Active",
"OwnerKind": "Internal",
"InstallDate": "2026-04-01",
"Warranty": { "StartDate": "2026-04-01", "EndDate": "2031-03-31", "Provider": "Northwind Heating" },
"Location": { "AddressLine1": "1 Depot Way", "City": "Boston", "Region": "MA", "PostalCode": "02118", "Country": "US" },
"Attributes": { "Fuel": "Natural gas", "Output (kW)": "24" }
},
{
"ItemId": "4fvne1bd88btzjbfsx0fjs17gp",
"Name": "Van 1",
"AssetTypeId": "4frxjzg9rc0mtph04y78qk38dy",
"Status": "Active",
"OwnerKind": "Internal",
"Fleet": { "Schedulable": true, "Plate": "FS-1001", "CarriesStock": true }
}
]
}
]
}
ItemId so AssetTypeId and ParentAssetId references survive reruns.AssetsDeploymentStep, IncludeAssets true by default) exports types and, unless unticked, assets parents first. Meter readings are never exported.The editor (assets/edit/{id?}) is built with IDisplayManager<Asset> and groups its fields in cards declared by AssetDisplayDriver: Details (AssetFields_Edit, Content:1, card position 10), Owner and place (20), Installation and warranty (30), Type details (40), Documents (50), Vehicle (55) and Fleet (60). The asset's own rules (AssetHandler validation through AssetManager) run after every section and report under the Asset prefix. When anything fails the asset isn't saved and the editor cancels the session, so records a section wrote are discarded too.
Keep your section's data in your own records keyed by the asset id. Don't write to Asset.Attributes: the built-in driver rebuilds it from the type's attribute definitions on every save. Declare your card in the placement location; the view renders only its rows, never card markup.
using CrestApps.OrchardCore.Assets.Models;
using Microsoft.Extensions.Localization;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.Views;
namespace MyModule.Assets;
// Your module's own storage for the extra data.
public interface ICalibrationStore
{
Task<DateOnly?> GetAsync(string assetId);
Task SaveAsync(string assetId, DateOnly? calibratedOn);
}
public sealed class AssetCalibrationDisplayDriver : DisplayDriver<Asset>
{
private readonly ICalibrationStore _calibrations;
internal readonly IStringLocalizer S;
public AssetCalibrationDisplayDriver(ICalibrationStore calibrations, IStringLocalizer<AssetCalibrationDisplayDriver> stringLocalizer)
{
_calibrations = calibrations;
S = stringLocalizer;
}
public override IDisplayResult Edit(Asset asset, BuildEditorContext context)
=> Initialize<AssetCalibrationViewModel>("AssetCalibration_Edit", async model =>
{
model.CalibratedOn = await _calibrations.GetAsync(asset.ItemId);
}).Location(l => l.Zone("Content", "8").Card(S["Calibration"], "70"));
public override async Task<IDisplayResult> UpdateAsync(Asset asset, UpdateEditorContext context)
{
var model = new AssetCalibrationViewModel();
await context.Updater.TryUpdateModelAsync(model, Prefix);
if (model.CalibratedOn > DateOnly.FromDateTime(DateTime.UtcNow))
{
context.Updater.ModelState.AddModelError($"{Prefix}.{nameof(model.CalibratedOn)}", S["The calibration date can't be in the future."]);
}
else
{
await _calibrations.SaveAsync(asset.ItemId, model.CalibratedOn);
}
return Edit(asset, context);
}
}
public class AssetCalibrationViewModel
{
public DateOnly? CalibratedOn { get; set; }
}
// Startup: services.AddDisplayDriver<Asset, AssetCalibrationDisplayDriver>();
@* Views/AssetCalibration.Edit.cshtml: rows only; the Calibration card comes from the placement. *@
@model MyModule.Assets.AssetCalibrationViewModel
<div class="ocat-wrapper">
<label asp-for="CalibratedOn" class="ocat-label">@T["Calibrated on"]</label>
<div class="ocat-end">
<input asp-for="CalibratedOn" type="date" class="form-control" />
<span asp-validation-for="CalibratedOn"></span>
</div>
</div>
The asset page. The page (assets/view/{id}) also builds IDisplayManager<Asset>.BuildDisplayAsync(asset, updater, "DetailAdmin") and renders it below the asset's details, above its parts and meter readings. The built-in drivers show nothing there, so a module adds a card with a Display override for the DetailAdmin display type:
using CrestApps.OrchardCore.Assets.Models;
using OrchardCore;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.Views;
namespace MyModule.Assets;
public sealed class AssetCalibrationDetailDisplayDriver : DisplayDriver<Asset>
{
private readonly ICalibrationStore _calibrations;
public AssetCalibrationDetailDisplayDriver(ICalibrationStore calibrations)
{
_calibrations = calibrations;
}
public override IDisplayResult Display(Asset asset, BuildDisplayContext context)
{
if (context.DisplayType != OrchardCoreConstants.DisplayType.DetailAdmin)
{
return null;
}
return Initialize<AssetCalibrationViewModel>("AssetCalibration_DetailAdmin", async model =>
{
model.CalibratedOn = await _calibrations.GetAsync(asset.ItemId);
}).Location(OrchardCoreConstants.DisplayType.DetailAdmin, "Content:5");
}
}
Its view (AssetCalibration.DetailAdmin.cshtml) writes the same <div class="card mb-3"><div class="card-body"> markup as the page's own cards, since a display page is not an admin form.
The asset list. A DisplayDriver<AssetRow> (AssetRow in namespace CrestApps.OrchardCore.Assets.ViewModels of the module, with Asset, TypeName, ParentName, OwnerName and Today) adds to a list row for SummaryAdmin and SummaryAdminGrid: zones Content, Tags and Actions, grid columns Name and Details (see orchardcore-admin-lists).
To react whenever an asset is saved (from the editor, a recipe or code), add an ICatalogEntryHandler<Asset> deriving from CatalogEntryHandlerBase<Asset> (CrestApps.Core.Handlers) and override CreatingAsync, UpdatingAsync or ValidatingAsync, as Fleet does; register it with services.TryAddEnumerable(ServiceDescriptor.Scoped<ICatalogEntryHandler<Asset>, THandler>()).
| Symptom | Check |
|---|---|
| Owner kind missing in the editor | Its party source isn't registered: enable OrchardCore.Users, Accounts, or Omnichannel Management. |
| No driver picker in the Fleet card | Enable CrestApps.OrchardCore.Staff with Fleet; the picker shows only for assets with Fleet details. |
| No Vehicle card | The type's category isn't Vehicle (equipment and tools need Fleet), or the owner isn't Internal; plate and VIN are kept only for the business's own assets. |
| "... can't be deleted: ... Set its state to Retired instead." | A module's IAssetUsage says records point to the asset; set Status to Retired. Deleting it from code throws InvalidOperationException. |
| "... can't be deleted: other assets are inside it." | Move or delete its child assets first. |
| Asset page throws "The shape type 'Asset_DetailAdmin' is not found" | The page renders the DetailAdmin display of the asset, and the Assets module ships no Asset.DetailAdmin.cshtml; add one to your module that renders Model.Content (@if (Model.Content != null) { @await DisplayAsync(Model.Content) }). |
| "Choose who owns the asset." | Non-internal owners need an OwnerId. |
| Reading refused | The meter isn't on the type, or a cumulative value is lower than the previous reading. |
| No Equipment calendar | Enable Fleet (and Calendars Resources) and set Fleet.Schedulable. |
| No van stock location | Enable Inventory with Fleet and set Fleet.CarriesStock. |
| Coordinates vanished | A changed address drops its old coordinates until it is geocoded again. |
Related skills: orchardcore-work-orders, orchardcore-dispatch, orchardcore-staff, orchardcore-geo, orchardcore-inventory, orchardcore-calendars, orchardcore-accounts, orchardcore-addresses, orchardcore-report-builder.
What SKILL.md sets; muted values are Claude Code's defaults
/crestapps-orchardcore:orchardcore-assetsfrom crestapps-orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-orchardcore137 skills in this plugin
/orchardcore-accountsSkill for the CrestApps Orchard Core Accounts module (CrestApps.OrchardCore.Accounts) with its Account Members, Account Team, Account E-mail Domains and Account Locations features. Covers the Account type and AccountPart, the account picker and search, IAccountChildTypeRule, account page sections (AccountPageTabs, AddPageSection, Notes), members and IAccountMemberService, account invitations, the account owner and team picked from staff, e-mail domains, locations with a billing location, the account's billing profile and party members, the Accounts recipe and deployment steps, and the admin menu. Use this skill when requests mention accounts, the businesses or households records belong to, an account page tab, members, invitations, owners, domains or locations. Strong matches include AccountPart, AccountPageTabs, IAccountMemberService, IAccountInvitationService, AccountInvitation, AccountTeamPart, AccountEmailDomainsPart, IAccountEmailDomains, AccountLocationsPart and ManageAccountMembers./orchardcore-accounts-b2bSkill for the CrestApps Orchard Core Accounts B2B module (CrestApps.OrchardCore.Accounts.B2B), business selling on an Account content item. Covers B2BAccountPart and B2BAccount, buyers as account members and ship-to addresses as account locations, terms (deposit, net days, credit limit) through the account-terms tender billed to the account, the account's billing profile, purchase order numbers, quotes, price lists through IBuyerPriceProvider, order limits, approvals and budgets, OCI punchout, the account/business page and API, the PriceLists recipe and deployment steps, the B2BAccounts report source, and the move from the removed Companies module. Use this skill when requests mention B2B, wholesale or business buyers, net terms, purchase orders, price lists, order approvals or punchout. Strong matches include B2BAccountPart, B2BAccount, AccountTerms, AccountTermsTenderProvider, B2BAccountBillingProfileSource, IB2BAccountStore, PriceList, B2BPriceProvider, B2BApprovalService and ManageB2BAccounts.Other plugins' skills for the same job