Deletable
Defined in: types/Deletable.ts:19
Represents an entity that can be soft-deleted. Extends Id and adds properties for managing deletion state.
Remarks
Useful for collections where items can be marked as deleted (e.g. deleted, revoked, hidden).
Example
const item = new Deletable<number>(1, new Date());
console.log(item.deleted); // true
console.log(item.deletedAt); // Date instance
Extends
Id<T>
Extended by
Type Parameters
T
T
The type of the unique identifier.
Constructors
Constructor
new Deletable<T>(id?, deletedAt?): Deletable<T>;
Defined in: types/Deletable.ts:30
Creates a new Deletable instance.
Parameters
id?
T
The unique identifier.
deletedAt?
The date the entity was deleted (if applicable).
null | Date
Returns
Deletable<T>
Overrides
Properties
deleted
deleted: boolean;
Defined in: types/Deletable.ts:21
Indicates whether the entity is deleted.
deletedAt
deletedAt: null | Date;
Defined in: types/Deletable.ts:23
The date the entity was deleted, or null if not deleted.
id?
optional id: T;
Defined in: types/Id.ts:15
The unique identifier for the entity.