/** * Existing-entity STUB — a relation target this package does NOT define: an * entity owned by another application, or created outside this package. * * FILE NAME: __kebab-case__.stub.entity.ts (e.g. accounts.stub.entity.ts) * * The name is load-bearing, not decoration. It is the only thing in the code * that says "this class stands in for a table another application owns", and it * is what lets the gate hold the stub to an empty body (E117). It still ends in * `.entity.ts`, so discovery and `entitiesPath` autoload are unchanged. * * Four things are required, and the platform infers none of them: * 1. @Entity({ name, key }) — the platform resolves the relation by this name. * 2. extends SystemBaseEntity — relation properties typed with the stub carry * id/createdAt/…, and the relation-typing rules can run. * 3. An EMPTY body. A stub declares NO fields: each one would be a column the * migration creates or alters on a real table you do not own. * 4. Registered in EntityModule.forFeature() with the entities you create, * and exported from the entities barrel — an unregistered class is * invisible to the platform (E301), and the empty body, not the missing * registration, is what keeps the migration off the real table. * * BEFORE YOU WRITE ONE: confirm the entity is actually on the tenant. * A stub is a declaration like any other, so for an entity that is NOT * there the platform CREATES it — an empty table, stamped with YOUR * application as its owner, because it came from your migrations. * suppa_describe_entity("") answers in one call and reports the * owning application (absent means nobody owns it). * * One stub per file (W616). Platform system entities need no stub at all — * import UsersEntity/FilesEntity/IconsEntity from '@suppa/sdk' instead. */ import { Entity, SystemBaseEntity } from '@suppa/sdk'; @Entity({ name: '__ExistingEntityName__', key: '__ExistingEntityName__' }) export class __ExistingEntityName__ extends SystemBaseEntity {}