Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): [Budget] populate period field and add weekly type #141

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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