Skip to content

Commit

Permalink
#148 FIX: Adiciona novo status de OS
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasgbezerra committed Jul 4, 2023
1 parent 2b22d6d commit d167b2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/db/migrations/1685132702026-default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class default1674611694082 implements MigrationInterface {
`CREATE TABLE "unit" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, "localization" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_4252c4be609041e559f0c80f58a" PRIMARY KEY ("id"))`
)
await queryRunner.query(
`CREATE TYPE "public"."order_service_type_enum" AS ENUM('MAINTENANCE', 'WARRANTY', 'CONCLUDED', 'CANCELED')`
`CREATE TYPE "public"."order_service_type_enum" AS ENUM('MAINTENANCE', 'WARRANTY', 'CONCLUDED', 'FINISHED','CANCELED')`
)
await queryRunner.query(
`CREATE TABLE "order_service" (
Expand Down
1 change: 1 addition & 0 deletions src/domain/entities/serviceOrderEnum/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export enum Status {
MAINTENANCE = 'Em manuntenção',
WARRANTY = 'Garantia',
CONCLUDED = 'Concluido',
FINESHED = 'Finalizado',
CANCELED = 'Cancelado'
}
5 changes: 4 additions & 1 deletion src/useCases/update-order-service/update-order-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class UpdateOrderServiceUseCase
})

if (
this.handleOSStatus(data.status) === OSStatus.CONCLUDED ||
this.handleOSStatus(data.status) === OSStatus.FINESHED ||
this.handleOSStatus(data.status) === OSStatus.CANCELED
) {
await this.updateEquipmentRepository.updateEquipment(equipment.id, {
Expand Down Expand Up @@ -106,6 +106,9 @@ export class UpdateOrderServiceUseCase
case 'CONCLUDED': {
return OSStatus.CONCLUDED
}
case 'FINISHED': {
return OSStatus.FINESHED
}
case 'CANCELED': {
return OSStatus.CANCELED
}
Expand Down

0 comments on commit d167b2d

Please sign in to comment.