Skip to content

Commit 3ab4e1d

Browse files
Merge pull request #133 from diffo-dev/128-basecharacteristic-typed-ash-resource-fragment-for-characteristics
128 basecharacteristic typed ash resource fragment for characteristics
2 parents d678402 + a8a04c5 commit 3ab4e1d

44 files changed

Lines changed: 896 additions & 357 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ lib/diffo/provider/
4040
base_party.ex # Ash Fragment for Party resources
4141
base_place.ex # Ash Fragment for Place resources
4242
components/
43+
base_characteristic.ex # Ash Fragment for typed characteristic resources
44+
calculations/
45+
characteristic_value.ex # Calculation: builds .Value TypedStruct from record fields
4346
instance/extension.ex # Thin marker (sections: []) — kind identification
4447
party/extension.ex # Thin marker
4548
place/extension.ex # Thin marker
@@ -82,8 +85,8 @@ provider do
8285
end
8386

8487
characteristics do
85-
characteristic :slot_value, MyApp.SlotValue
86-
characteristic :ports, {:array, MyApp.Port}
88+
characteristic :slot_value, MyApp.SlotCharacteristic
89+
characteristic :ports, {:array, MyApp.PortCharacteristic}
8790
end
8891

8992
features do
@@ -144,6 +147,7 @@ mix test --max-failures 5 # stop early
144147

145148
- Using old `structure do` / top-level `instances do` — use `provider do` only.
146149
- Using `party :role, Type, reference: true` — use `party_ref :role, Type`.
150+
- Using a plain `Ash.TypedStruct` as a `characteristic` DSL target — use a `BaseCharacteristic`-derived resource instead; the TypedStruct belongs in `<Module>.Value`.
147151
- Calling `build_before/1` or `build_after/2` in actions — these run automatically.
148152
- Declaring `:specified_by`, `:features`, `:characteristics` as action arguments.
149153
- Editing `documentation/dsls/DSL-Diffo.Provider.Extension.md` — it is Spark-generated;

0 commit comments

Comments
 (0)