Skip to content

Instantly share code, notes, and snippets.

@gabrielbmoro
Created September 6, 2022 21:00
Show Gist options
  • Save gabrielbmoro/6099c073e22610c07eded0270326bd2b to your computer and use it in GitHub Desktop.
Save gabrielbmoro/6099c073e22610c07eded0270326bd2b to your computer and use it in GitHub Desktop.
An API Project - Gists Part 4
@injectable()
class CreateNewHistoricEntryUseCase {
constructor(
@inject("ISisOrgRepository")
private sisOrgRepository: ISisOrgRepository
) {
}
async execute(request: IRequest): Promise<IHistoricEntry[]> {
const historicEntries: IHistoricEntry[] = [];
...
await this.sisOrgRepository.createHistoricEntry(historicEntries);
return historicEntries;
}
}
export { CreateNewHistoricEntryUseCase };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment