Skip to content

Commit

Permalink
feat(api): [Budget] populate period field and add weekly type (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkdev98 committed Jul 19, 2024
1 parent e4f2af0 commit f0c75d8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "BudgetPeriodType" ADD VALUE 'WEEKLY';
1 change: 1 addition & 0 deletions apps/api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ model BudgetPeriodConfig {
}

enum BudgetPeriodType {
WEEKLY
MONTHLY
QUARTERLY
YEARLY
Expand Down
3 changes: 3 additions & 0 deletions apps/api/v1/services/budget.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ export async function findBudgetsOfUser({
},
},
},
include: {
periodConfig: true,
},
})
}

Expand Down
2 changes: 1 addition & 1 deletion packages/validation/src/prisma/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const BudgetTypeSchema = z.enum(['SPENDING','SAVING','INVESTING','DEBT'])

export type BudgetTypeType = `${z.infer<typeof BudgetTypeSchema>}`

export const BudgetPeriodTypeSchema = z.enum(['MONTHLY','QUARTERLY','YEARLY','CUSTOM']);
export const BudgetPeriodTypeSchema = z.enum(['WEEKLY','MONTHLY','QUARTERLY','YEARLY','CUSTOM']);

export type BudgetPeriodTypeType = `${z.infer<typeof BudgetPeriodTypeSchema>}`

Expand Down

0 comments on commit f0c75d8

Please sign in to comment.