domain-objects
Version:
A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.
26 lines (25 loc) • 849 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DomainEntityPrimaryKeysMustBeDefinedError = void 0;
class DomainEntityPrimaryKeysMustBeDefinedError extends Error {
constructor({ entityName, nameOfFunctionNeededFor, }) {
const message = `
\`${entityName}.primary\` must be defined, to be able to \`${nameOfFunctionNeededFor}\`.
Example:
\`\`\`
interface RocketShip {
uuid?: string;
serialNumber: string;
fuelQuantity: number;
passengers: number;
}
class RocketShip extends DomainEntity<RocketShip> implements RocketShip {
public static primary = ['uuid'];
}
\`\`\`
`;
super(message);
}
}
exports.DomainEntityPrimaryKeysMustBeDefinedError = DomainEntityPrimaryKeysMustBeDefinedError;
//# sourceMappingURL=DomainEntityPrimaryKeysMustBeDefinedError.js.map