-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor extendable service to be repository based
- Loading branch information
1 parent
b2ad415
commit 2748a2a
Showing
38 changed files
with
977 additions
and
887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './orm.controller.method'; | ||
export * from './orm.injection.token'; | ||
export * from './orm.query.order'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
export * from './orm.create.options'; | ||
export * from './orm.delete.options'; | ||
export * from './orm.module.options'; | ||
export * from './orm.pagination'; | ||
export * from './orm.read.arguments'; | ||
export * from './orm.read.options'; | ||
export * from './orm.read.params'; | ||
export * from './orm.request.validation'; | ||
export * from './orm.service.options'; | ||
export * from './orm.repository.options'; | ||
export * from './orm.subscriber'; | ||
export * from './orm.update.options'; | ||
export * from './orm.update.params'; | ||
export * from './orm.upsert.options'; | ||
export * from './orm.validation.data'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { OrmReadOptions } from './orm.read.options'; | ||
|
||
export interface OrmCreateOptions<Entity> extends OrmReadOptions<Entity> { | ||
disableFlush?: boolean; | ||
disableReload?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface OrmDeleteOptions { | ||
disableFlush?: boolean; | ||
} |
2 changes: 1 addition & 1 deletion
2
.../orm/orm.interface/orm.service.options.ts → ...m/orm.interface/orm.repository.options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { EventArgs, EventSubscriber } from '@mikro-orm/core'; | ||
|
||
export type OrmSubscriber<Entity> = EventSubscriber<Entity>; | ||
|
||
export type OrmSubscriberParams<Entity> = EventArgs<Entity>; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { EntityManager, EntityName } from '@mikro-orm/core'; | ||
|
||
import { OrmRepositoryOptions } from './orm.interface'; | ||
import { OrmDeleteRepository } from './orm.repository/orm.repository.delete'; | ||
|
||
export abstract class OrmRepository<T> extends OrmDeleteRepository<T> { | ||
|
||
public constructor( | ||
protected readonly entityManager: EntityManager, | ||
protected readonly entityName: EntityName<T>, | ||
protected readonly repositoryOptions: OrmRepositoryOptions<T> = { }, | ||
) { | ||
super(entityManager, entityName, repositoryOptions); | ||
this.repositoryOptions.entityName ??= 'entity'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './orm.repository.base'; | ||
export * from './orm.repository.create'; | ||
export * from './orm.repository.delete'; | ||
export * from './orm.repository.read'; | ||
export * from './orm.repository.update'; |
Oops, something went wrong.