tr
TryGhost
GitHub
Ghost
Workspace
GitHub
CI Pipeline Executions
Current execution
Succeeded
feat/ber-3864-member-account-projection
Runs and Agents
Configuration
Self-Healing CI
Project Graph
Circular Dependencies
Enterprise
Resource Usage
Analysis
Conformance
Enterprise
Runs
Current run
Succeeded
Tasks
Resource Usage
Insights
Compare tasks
Analytics
Sign in
Toggle sidebar
Changed the account projection to decode as one nested parse ref https://linear.app/ghost/issue/BER-3864/differentiate-public-and-private-member-projections The service was wiring the projection together by hand: group the rows, decode each kind, then walk the result three more times attaching offers, then payments, then attributions. Every one of those steps had to run, in that order, and the knowledge of what a member's payload contains was spread across the service rather than stated anywhere. Schemas nest, so the decode nests with them. A newsletter, a tier and each kind of subscription are now schemas that parse their own rows and return their own part of the payload, and the member schema simply says it has some of each. Reading a member is a query and a parse: `queries.read` gathers the rows that make one, and `MemberAccount` turns them into what a member receives. What a decode needs and a row cannot carry — what the next payment comes to, where an unsubscribe link points, whether the site shows gravatars — is passed in rather than reached for, so nothing in the schemas does any IO and all of them can be exercised with plain objects. The one ordering rule that is real, that a payment cannot be worked out before the offer it depends on, now sits inside the schema that needs it instead of being a comment on a method a caller had to remember. Offers and attributions still come from the domains that own them, but they are gathered once alongside the rows and travel with the subscription they describe, rather than being attached afterwards by walking the result again.
nx run ghost-monorepo:lint:boundaries
⌘K
Succeeded
nx run ghost-monorepo:lint:boundaries
Click to copy
Linux
4 CPU cores
read-write
access token used
f40b47f8
30436