export interface ModelEntity<ID extends string | number | unknown> extends Identifiable<ID> {
readonly createdAt: ZonedDateTime;
modifiedAt: ZonedDateTime;
}
export interface AggregateRoot<ID extends string | number | unknown, STATUS>
extends ModelEntity<ID> {
readonly status: STATUS;
}
export type AggregateOptsExcept<T extends AggregateRoot<unknown, unknown>> = Except<
T,
'id' | 'createdAt' | 'modifiedAt'
>;
type PartialAggregateOpts<T extends AggregateRoot<unknown, unknown>> = Partial<
AggregateOptsExcept<T>
>;
export type AggregateOpts<T extends AggregateRoot<unknown, unknown>> = SetRequired<
PartialAggregateOpts<T>, 'status' // compile error here, it doesn't recognize status
>;
app-lib/graph/packages/app/src/shared/model.ts:59:3 - error TS2344: Type 'string' does not satisfy the constraint 'Exclude<keyof T, "id" | "createdAt" | "modifiedAt">'.
59 'status'
~~~~~~~~
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too