Application Layering
Service layers, repositories and the transport/application/domain/infrastructure split — including when each is genuine structure and when it is ceremony that adds indirection without behaviour.
A use case expressed as a plain function that knows nothing about HTTP — which is what lets a job, a CLI and an endpoint share it.
A named place for the queries your domain asks, so the definition of "active subscription" lives once instead of in eleven call sites.
A repository whose methods are one-line passthroughs to the ORM adds a file, a name and a hop, and removes no decision from anyone.
Four layers, one rule that matters — dependencies point inward — and a scale at which the whole thing is overhead.
Vertical slices, transaction scripts and hexagonal are not lesser versions of layering — they optimise for different changes, and one of them probably matches yours.
The 300-line handler is a real production problem for a specific reason: it puts a payment call inside a database transaction and nobody can see it.
Passing a dependency in instead of importing it is the whole idea; a container is one way to do the wiring and is not the idea.