You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/billing/SKILL.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,16 @@ The adapter's `diffInvoiceLines` then compares each line's current state against
72
72
73
73
`DetailedLine` and `GatheringLine` carry `ChildUniqueReferenceID string` for idempotent upserts. When recalculating pricing, new detailed lines (without IDs) are matched to existing DB rows via this field through `StandardLine.DetailedLinesWithIDReuse()`, avoiding unnecessary delete/re-create cycles.
74
74
75
+
### Shared Detailed-Line Base
76
+
77
+
The invoice-agnostic detailed-line domain shape lives in `openmeter/billing/models/stddetailedline`.
78
+
79
+
Rules:
80
+
- keep shared detailed-line fields on `stddetailedline.Base`
81
+
- keep invoice-only fields such as `InvoiceID` on `billing.DetailedLineBase`
82
+
- when adding charge-owned detailed-line wrappers, embed `stddetailedline.Base` instead of copying the common fields again
83
+
- when shared detailed-line mapping helpers exist, reuse them from billing and charges adapters instead of rebuilding the common base-field mapping inline
84
+
75
85
### InvoiceAt vs Period vs CollectionAt
76
86
77
87
-`Period`: when the service was actually rendered (usage window)
Copy file name to clipboardExpand all lines: .agents/skills/charges/SKILL.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,8 @@ Primary packages:
35
35
36
36
`openmeter/billing/charges` is the root facade for charge operations.
37
37
38
+
For charge-owned detailed lines, the shared invoice-agnostic base belongs in `openmeter/billing/models/stddetailedline`. Keep charge wrappers thin by adding only `charge_id` / `run_id`-style ownership fields around `stddetailedline.Base`, and reuse shared detailed-line base mapping helpers instead of duplicating the common field assembly in charge adapters.
39
+
38
40
Charge-backed invoicing no longer relies on a charges-side `InvoicePendingLines(...)` wrapper. Billing owns invoice creation and dispatches gathering lines by `billing.LineEngineType`, while charge packages provide charge-specific line engines where needed.
0 commit comments