Skip to content
This repository was archived by the owner on Jul 14, 2024. It is now read-only.

Commit 79b831e

Browse files
fix: add fields in resolver
1 parent 22b3b8a commit 79b831e

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

src/app/useCases/LegalClientUseCases/LegalClientUseCase.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ export class LegalClientUseCases {
6161
'IS NECESSARY IN CNPJ, CORPORATENAME, FANTASYNAME, ID OR LEGALPERSONID',
6262
{ extensions: { code: HttpStatus.BAD_REQUEST } },
6363
);
64+
65+
console.log('INICIO');
66+
console.log(request);
67+
console.log('FIM');
6468
const client = await this.legalClientRepository.findLegalClient(request);
69+
6570
if (client) return client;
6671

6772
throw new GraphQLError('Client Not Found', {

src/infra/graphql/entities/LegalClientOrderGraphql/LegalClientOrder.input.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ export class LegalClientOrderUpdateInput extends PartialType(
7373
@IsOptional()
7474
@Type(() => FreightExpenseUpdateOrderInput)
7575
expenses?: FreightExpenseUpdateOrderInput[];
76+
@Field(() => [String], { nullable: true })
77+
@IsOptional()
78+
@Allow()
79+
deleted_expenses?: string[];
7680
}
7781

7882
@InputType()

src/infra/graphql/entities/LegalPersonGraphql/Args/GetLegalPersonArgs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export class GetLegalPersonArgs {
77
@Field({ nullable: true })
88
cnpj?: string;
99
@Field({ nullable: true })
10+
id?: string;
11+
@Field({ nullable: true })
1012
corporateName?: string;
1113
@Field({ nullable: true })
1214
fantasyName?: string;

src/infra/graphql/entities/PhysicalCustomerOrderGraphql/PhysicalCustomerOrder.input.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ export class PhysicalCustomerOrderUpdateInput extends PartialType(
6464
@Type(() => FreightExpenseUpdateOrderInput)
6565
expenses?: FreightExpenseUpdateOrderInput[];
6666
@Field(() => [String], { nullable: true })
67+
@IsOptional()
6768
@Allow()
68-
deleted_expenses: string[];
69+
deleted_expenses?: string[];
6970
}
7071
@InputType()
7172
export class PhysicalCustomerOrderUpdateManyInput extends PartialType(

src/infra/graphql/generated/schema.gql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ input LegalClientOrderOrderByWithRelationInput {
911911

912912
input LegalClientOrderUpdateInput {
913913
carrier_id: String
914+
deleted_expenses: [String!]
914915
expenses: [FreightExpenseUpdateOrderInput!]
915916
legal_contract_id: String
916917
quote_table_id: String
@@ -3065,15 +3066,15 @@ type Query {
30653066
getAllVehicleModel(limit: Int! = 25, offset: Int! = 0, sort: VehicleModelOrderByWithRelationInput, where: VehicleModelWhereInput): [VehicleModelGraphql!]
30663067
getAllVehicleTypes(limit: Int! = 25, offset: Int! = 0, sort: VehicleTypeOrderByWithRelationInput, where: VehicleTypeWhereInput): [VehicleTypeModel!]
30673068
getAllVehicles(limit: Int! = 25, offset: Int! = 0, sort: VehicleOrderByWithRelationInput, where: VehicleWhereInput): [VehicleCarModel!]
3068-
getCarrierCompanyModel(cnpj: String, corporateName: String, fantasyName: String, legalClientId: String, legalPersonId: String): CarrierCompanyModel!
3069+
getCarrierCompanyModel(cnpj: String, corporateName: String, fantasyName: String, id: String, legalClientId: String, legalPersonId: String): CarrierCompanyModel!
30693070
getCiotForLegalClientModel(ciot: String, id: String): CiotForLegalClientModel!
30703071
getCompanyVehicle(id: String, plate: String, vehicleId: String): CompanyVehicleIModel!
30713072
getContractOutsourcedDriver(contractNumber: String, id: String): ContractOutsourcedDriverModel!
30723073
getFreightExpense(id: String): FreightExpenseModel!
30733074
getICMS(StateRelation: StateRelationIcmsArgs, id: String): IcmsModel!
30743075
getIncident(id: String): IncidentModel!
30753076
getLegalClientCte(acessKey: String, cteNumber: String, id: String): LegalClientCteModel
3076-
getLegalClientModel(cnpj: String, corporateName: String, fantasyName: String, legalClientId: String, legalPersonId: String): LegalClientModel!
3077+
getLegalClientModel(cnpj: String, corporateName: String, fantasyName: String, id: String, legalClientId: String, legalPersonId: String): LegalClientModel!
30773078
getLegalClientOrderModel(id: String, order: String): LegalClientOrderModel
30783079
getLegalClientQuoteTable(cod_quote: String, id: String): LegalClientQuoteTableModel
30793080
getLegalContractModel(contractNumber: String, id: String): LegalContractModel!

0 commit comments

Comments
 (0)