Skip to content

Commit

Permalink
Add explicit type for CreateBudgetUseCase
Browse files Browse the repository at this point in the history
  • Loading branch information
ungaralex committed Oct 10, 2023
1 parent 600c8d4 commit ea7dc7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/usecase/budget/budgetService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import type BudgetRepository from "../../repository/budget/budgetRepository";
import { type Budget, type BudgetSummary } from "../../domain/budget";
import UUID from "../../domain/uuid";

export const createBudget: (
type CreateBudgetUseCase = (
insertBudgetSummary: BudgetSummaryRepository["insert"],
) => BudgetUseCases["createBudget"] =
) => BudgetUseCases["createBudget"];

export const createBudget: CreateBudgetUseCase =
(insertBudgetSummary) => async (newBudget) => {
// We could also create a class for our domain objects and put functionalities s.a.
// Budget.createFrom(newBudget) and BudgetSummary.getBudget() there
Expand Down

0 comments on commit ea7dc7a

Please sign in to comment.