You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74Lines changed: 74 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -123,6 +123,80 @@ export class UserRepository extends DefaultTransactionSoftCrudRepository<
123
123
}
124
124
```
125
125
126
+
The package also provides the following mixins which can be used for soft delete functionality:
127
+
128
+
-**SoftDeleteEntityMixin**: This mixin adds the soft delete properties to your model. The properties added are represented by the IBaseEntity interface:
129
+
130
+
```ts
131
+
interfaceIBaseEntity {
132
+
deleted?:boolean;
133
+
deletedOn?:Date;
134
+
deletedBy?:string;
135
+
}
136
+
```
137
+
138
+
There is also an option to provide config for the @property decorator for all these properties.
-**SoftCrudRepositoryMixin**: You can make use of this mixin to get the soft delete functionality for DefaultCrudRepository or any respository that extends the DefaultCrudRepository. You need to extend your repository with this mixin and provide DefaultCrudRepository (or any repository that extends DefaultCrudRepository) as input. This means that this same mixin can also be used to provide soft delete functionality for DefaultTransactionSoftCrudRepository ( as DefaultTransactionSoftCrudRepository extends DefaultCrudRepository).You will have to inject the getter for IAuthUser in the contructor of your repository.
0 commit comments