Skip to content

Commit

Permalink
Revert "Fix(expenses): Added missing fields in db (Prisma migration &…
Browse files Browse the repository at this point in the history
… endpoint change)"
  • Loading branch information
dembA7 authored May 24, 2024
1 parent adbdca5 commit 09a6def
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 24 deletions.

This file was deleted.

2 changes: 0 additions & 2 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ model expense {
id String @id @db.Uuid
title String @db.VarChar(70)
justification String @db.VarChar(255)
supplier String? @db.VarChar(70)
total_amount Decimal @db.Decimal(18, 2)
status String? @db.VarChar(256)
category String? @db.VarChar(70)
Expand All @@ -120,7 +119,6 @@ model expense_report {
created_at DateTime @default(now()) @db.Timestamp(6)
updated_at DateTime? @updatedAt @db.Timestamp(6)
id_employee String @db.Uuid
url_voucher String? @db.VarChar(512)
expense expense[]
employee employee @relation(fields: [id_employee], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
Expand Down
15 changes: 0 additions & 15 deletions src/core/domain/entities/expense.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Decimal } from '@prisma/client/runtime/library';
* @param id: string - Unique identifier of the expense
* @param title: string - Expense title
* @param justification: string - Expense justification
~ @param supplier: string - Expense supplier
* @param totalAmount: Decimal - Expense amount
+ @param status?: string - Expense status (optional)
* @param category?: string - Expense category (optional)
Expand Down Expand Up @@ -35,10 +34,6 @@ export interface ExpenseEntity {
* @param justification: string - Expense justification
*/
justification: string;
/**
* @param supplier: string - Expense supplier
*/
supplier: string;
/**
* @param totalAmount: Decimal - Expense amount
*/
Expand Down Expand Up @@ -84,7 +79,6 @@ export interface ExpenseEntity {
+ @param status?: string - Expense Report status (optional)
* @param createdAt?: Date - Expense Report creation date (optional)
* @param updatedAt?: Date - Expense Report update date (optional)
* @param url_voucher?: string - URL of the voucher associated with the expense report (optional)
* @param idEmployee: string - Unique identifier of the employee associated
* @param employeeFirstName?: string - Employee first name (optional)
* @param employeeLastName?: string - Employee last name (optional)
Expand Down Expand Up @@ -129,10 +123,6 @@ export interface ExpenseReport {
* @param updatedAt: Date - Expense report update date
*/
updatedAt?: Date | null;
/**
* @param urlVoucher: string - URL of the voucher associated with the expense report
*/
urlVoucher?: string | null;
/**
* @param idEmployee: string - Employee id
*/
Expand Down Expand Up @@ -167,7 +157,6 @@ export interface ExpenseReport {
+ @param status?: string - Expense Report status (optional)
* @param createdAt: Date - Expense Report creation date
* @param updatedAt?: Date - Expense Report update date (optional)
* @param url_voucher?: string - URL of the voucher associated with the expense report (optional)
* @param id_employee: string - Unique identifier of the employee associated
* @param employee?: employee - Employee information associated with the report (optional)
* @param expense?: expense[] - Array of expenses associated with the report (optional)
Expand Down Expand Up @@ -211,10 +200,6 @@ export interface RawExpenseReport {
* @param updatedAt: Date - Expense report update date
*/
updatedAt?: Date | null;
/**
* @param url_voucher: string - URL of the voucher associated with the expense report
*/
url_voucher?: string | null;
/**
* @param idEmployee: string - Employee id
*/
Expand Down
2 changes: 0 additions & 2 deletions src/core/infra/mappers/expense-entity-from-db-model.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export function mapExpenseEntityFromDbModel(model: expense): ExpenseEntity {
id: model.id,
title: model.title,
justification: model.justification,
supplier: model.supplier ? model.supplier : '',
totalAmount: model.total_amount,
status: model.status ? model.status : '',
category: model.category ? model.category : '',
Expand All @@ -26,7 +25,6 @@ export function mapExpenseReportEntityFromDbModel(model: RawExpenseReport): Expe
startDate: model.start_date,
endDate: model.end_date ? model.end_date : undefined,
status: model.status ? model.status : undefined,
urlVoucher: model.url_voucher ? model.url_voucher : '',
idEmployee: model.id_employee,
employeeFirstName: model.employee?.first_name ? model.employee.first_name : '',
employeeLastName: model.employee?.last_name ? model.employee.last_name : '',
Expand Down

0 comments on commit 09a6def

Please sign in to comment.