Skip to content

Commit

Permalink
fix(merge): Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dembA7 committed May 11, 2024
2 parents b36b913 + 8038653 commit db85ab3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "project" ADD COLUMN "is_archived" BOOLEAN NOT NULL DEFAULT false;
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ model project {
total_hours Decimal? @db.Decimal(8, 2)
periodicity String? @db.VarChar(256)
is_chargeable Boolean?
is_archived Boolean @default(false)
payed Boolean @default(false)
created_at DateTime @default(now()) @db.Timestamp(6)
updated_at DateTime? @updatedAt @db.Timestamp(6)
Expand Down
1 change: 1 addition & 0 deletions src/core/app/interfaces/project.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface UpdateProjectBody {
periodicity?: string | null;
area?: string | null;
isChargeable?: boolean | null;
isArchived?: boolean | null;
status: string;
totalHours?: Decimal | null;
payed?: boolean;
Expand Down
4 changes: 4 additions & 0 deletions src/core/app/services/__tests__/project.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('ProjectService', () => {
endDate: new Date('2023-12-01T00:00:00.000Z'),
periodicity: '1 week',
isChargeable: true,
isArchived: false,
area: 'Client',
createdAt: new Date('2024-04-19T01:23:49.555Z'),
idCompany: clientId,
Expand Down Expand Up @@ -111,6 +112,7 @@ describe('ProjectService', () => {
endDate: new Date('2023-12-01T00:00:00.000Z'),
periodicity: ProjectPeriodicity.ONE_WEEK,
isChargeable: true,
isArchived: false,
area: SupportedDepartments.ACCOUNTING,
createdAt: new Date('2024-04-19T01:23:49.555Z'),
idCompany: clientUuid,
Expand Down Expand Up @@ -155,6 +157,7 @@ describe('ProjectService', () => {
endDate: new Date('2023-12-01T00:00:00.000Z'),
periodicity: '1 week',
isChargeable: true,
isArchived: false,
area: SupportedDepartments.ACCOUNTING,
createdAt: new Date('2024-04-19T01:23:49.555Z'),
idCompany: randomUUID(),
Expand All @@ -171,6 +174,7 @@ describe('ProjectService', () => {
endDate: new Date('2023-12-01T00:00:00.000Z'),
periodicity: '1 week',
isChargeable: true,
isArchived: false,
area: SupportedDepartments.ACCOUNTING,
createdAt: new Date('2024-04-19T01:23:49.555Z'),
idCompany: randomUUID(),
Expand Down
1 change: 1 addition & 0 deletions src/core/app/services/project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ async function updateProject(body: UpdateProjectBody): Promise<ProjectEntity> {
area: body.area ?? project.area,
payed: body.payed,
isChargeable: body.isChargeable ?? project.isChargeable,
isArchived: body.isArchived ?? project.isArchived,
status: body.status ?? project.status,
createdAt: project.createdAt,
});
Expand Down
5 changes: 5 additions & 0 deletions src/core/domain/entities/project.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Task } from './task.entity';
* @param totalHours?: Decimal - Project total hours (optional)
* @param periodicity?: string - Project periodicity (optional)
* @param isChargeable?: boolean - Determines whether the project is chargeable or not (optional)
* @param isArchived?: boolean - Determines whether the project can be archived or not (optional)
* @param area?: string - Project area (optional)
* @param createdAt: Date - Project creation date
* @param updatedAt?: Date - Project update date (optional)
Expand Down Expand Up @@ -70,6 +71,10 @@ export interface ProjectEntity {
* @param isChargeable: boolean - Determines whether the project is chargeable or not
*/
isChargeable?: boolean | null;
/**
* @param isArchived: boolean - Determines whether the project is chargeable or not
*/
isArchived?: boolean | null;
/**
* @param area: string - Project area
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function mapProjectEntityFromDbModel(model: project): ProjectEntity {
totalHours: model.total_hours ? model.total_hours : undefined,
periodicity: model.periodicity,
isChargeable: model.is_chargeable,
isArchived: model.is_archived,
area: model.area ? model.area : undefined,
createdAt: model.created_at,
updatedAt: model.updated_at ? model.updated_at : undefined,
Expand Down
1 change: 1 addition & 0 deletions src/core/infra/repositories/project.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ async function updateProject(project: ProjectEntity): Promise<ProjectEntity> {
periodicity: project.periodicity,
area: project.area,
is_chargeable: project.isChargeable,
is_archived: project.isArchived ? project.isArchived : false,
status: project.status,
created_at: project.createdAt,
payed: project.payed,
Expand Down

0 comments on commit db85ab3

Please sign in to comment.