Skip to content

Commit

Permalink
Merge pull request #45 from fga-eps-mds/fix/find-os
Browse files Browse the repository at this point in the history
FIX: Correção do Filtro de OS
  • Loading branch information
AlineLermen authored Jul 10, 2023
2 parents 5eececd + 2e2eb95 commit cdb772d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/repository/order-service/list-order-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class ListOrderServiceRepository
equipment: {
unit: unit ? { id: unit } : undefined,
brand: brand ? { id: brand } : undefined,
type,
type: type ? { id: type } : undefined,
model
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/repository/protocol/equipmentRepositoryProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export type Query = {
tippingNumber?: string
serialNumber?: string
acquisition?: string
type?: string
type?: number
unit?: string
situation?: string
updatedAt?: Date
brand?: string
brand?: number
search?: string
model?: string
searchTipping?: string
Expand Down
4 changes: 2 additions & 2 deletions src/repository/protocol/orderServiceRepositoryProtocol.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { OrderService } from '../../domain/entities/order-service'

export type FindOrderServiceUseCaseDataQuery = {
type?: string
type?: number
unit?: string
date?: string
brand?: string
brand?: number
search?: string
model?: string
status?: string
Expand Down
4 changes: 2 additions & 2 deletions src/useCases/find-order-service/find-order-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export class NotOSFoundError extends Error {
}

export interface FindOrderServiceUseCaseData {
type?: string
type?: number
unit?: string
date?: string
brand?: string
brand?: number
search?: string
model?: string
status?: string
Expand Down
4 changes: 2 additions & 2 deletions src/useCases/getEquipment/getEquipmentUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export interface GetEquipmentInput {

acquisition?: string

type?: string
type?: number

situacao?: string

model?: string

unit?: string

brand?: string
brand?: number

screenSize?: string

Expand Down
2 changes: 1 addition & 1 deletion tests/find-order-service-usecase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('FindOrderService', () => {
expectedData
)

const query = { type: 'type1', unit: 'unit1' }
const query = { type: 2, unit: 'unit1' }
const result = await findOrderServiceUseCase.execute(query)

expect(
Expand Down
4 changes: 2 additions & 2 deletions tests/find-orders-service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ const orderService: OrderService = {
}

const request: FindOrderServiceUseCaseData = {
type: '',
type: 0,
unit: '',
date: '',
brand: '',
brand: 0,
search: '',
model: '',
status: ''
Expand Down
4 changes: 2 additions & 2 deletions tests/getEquipmentUseCase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('Should test get equipment', () => {

it('should find equipmentswith genetic attributes', async () => {
const queryRequest = {
type: 'CPU',
type: datatype.number(),
ram_size: datatype.number().toString(),
processor: 'i7'
}
Expand All @@ -86,7 +86,7 @@ describe('Should test get equipment', () => {

it('should not find equipment with generic attributes', async () => {
const queryRequest = {
type: datatype.string(),
type: datatype.number(),
ram_size: datatype.number().toString(),
processor: datatype.string()
}
Expand Down

0 comments on commit cdb772d

Please sign in to comment.