Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bff): harmonize missionId type #181 #182

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions backend/src/main/resources/graphql/action.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Action {

input ActionStatusInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String
status: ActionStatusType!
reason: ActionStatusReason
Expand All @@ -51,7 +51,7 @@ input ActionStatusInput {

input ActionControlInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String
endDateTimeUtc: String
controlMethod: ControlMethod!
Expand All @@ -66,14 +66,14 @@ input ActionControlInput {

input ActionFreeNoteInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String!
observations: String
}

input ActionRescueInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
longitude: Float
Expand All @@ -95,23 +95,23 @@ input ActionRescueInput {

input ActionNauticalEventInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

input ActionVigimerInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

input ActionAntiPollutionInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
Expand All @@ -124,31 +124,31 @@ input ActionAntiPollutionInput {

input ActionBAAEMPermanenceInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

input ActionPublicOrderInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

input ActionRepresentationInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

input ActionIllegalImmigrationInput {
id: String
missionId: Int!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
Expand Down Expand Up @@ -198,7 +198,7 @@ type NavActionFreeNote {

type NavActionRescue {
id: String!
missionId: String
missionId: ID
startDateTimeUtc: String!
endDateTimeUtc: String
longitude: Float
Expand All @@ -221,23 +221,23 @@ type NavActionRescue {

type NavActionNauticalEvent {
id: String!
missionId: String!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

type NavActionVigimer {
id: String!
missionId: String!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

type NavActionAntiPollution {
id: String!
missionId: String!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
Expand All @@ -250,31 +250,31 @@ type NavActionAntiPollution {

type NavActionBAAEMPermanence {
id: String!
missionId: String!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

type NavActionPublicOrder {
id: String!
missionId: String!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

type NavActionRepresentation {
id: String!
missionId: String!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
}

type NavActionIllegalImmigration {
id: String!
missionId: String!
missionId: ID!
startDateTimeUtc: String!
endDateTimeUtc: String
observations: String
Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/resources/graphql/controls.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type ControlGensDeMer {

input ControlNavigationInput {
id: String
missionId: String!
missionId: ID!
actionControlId: String!
amountOfControls: Int!
unitShouldConfirm: Boolean
Expand All @@ -83,7 +83,7 @@ input ControlNavigationInput {

input ControlSecurityInput {
id: String
missionId: String!
missionId: ID!
actionControlId: String!
amountOfControls: Int!
unitShouldConfirm: Boolean
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/graphql/crew.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type MissionCrew {
input MissionCrewInput {
id: ID
agent: AgentInput
missionId: Int!
missionId: ID!
comment: String
role: AgentRoleInput
}
Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/resources/graphql/infraction.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ enum FishInfractionType {

input InfractionInput {
id: String
missionId: String!
missionId: ID!
actionId: String!
controlId: String
controlType: String!
Expand All @@ -71,7 +71,7 @@ input InfractionInput {

input InfractionWithNewTargetInput {
id: String
missionId: String!
missionId: ID!
actionId: String!
controlId: String
controlType: String!
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/graphql/mission.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type MissionGeneralInfo {

input MissionGeneralInfoInput {
id: String
missionId: String!
missionId: ID!
distanceInNauticalMiles: Float
consumedGOInLiters: Float
consumedFuelInLiters: Float
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pam/mission/crew/mission-crew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const MissionCrew: React.FC<MissionCrewProps> = () => {

const handleSubmitForm = async (data: AddOrUpdateMissionCrewInput) => {
if (!missionId) return
const crew = { ...data, missionId: Number(missionId) }
const crew = { ...data, missionId: missionId }
await addOrUpdateCrew({ variables: { crew } })
setOpenCrewForm(false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('MissionDistanceAndConsumption', () => {
it('should be called when changing distanceInNauticalMiles', async () => {
render(<MissionDistanceAndConsumption {...props(mock)} />)
const field = screen.getByRole('distanceInNauticalMiles')
const value = '2'
const value = 2
fireEvent.change(field, { target: { value } })
fireEvent.blur(field)
expect(mutateMock).toHaveBeenCalledWith({
Expand All @@ -58,7 +58,7 @@ describe('MissionDistanceAndConsumption', () => {
it('should be called when changing consumedGOInLiters', async () => {
render(<MissionDistanceAndConsumption {...props(mock)} />)
const field = screen.getByRole('consumedGOInLiters')
const value = '2'
const value = 2
fireEvent.change(field, { target: { value } })
fireEvent.blur(field)
expect(mutateMock).toHaveBeenCalledWith({
Expand All @@ -76,7 +76,7 @@ describe('MissionDistanceAndConsumption', () => {
it('should be called when changing consumedFuelInLiters', async () => {
render(<MissionDistanceAndConsumption {...props(mock)} />)
const field = screen.getByRole('consumedFuelInLiters')
const value = '2'
const value = 2
fireEvent.change(field, { target: { value } })
fireEvent.blur(field)
expect(mutateMock).toHaveBeenCalledWith({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const MissionDistanceAndConsumption: React.FC<MissionDistanceAndConsumptionProps
const [mutate] = useAddOrUpdateDistanceConsumption()

const onChange = async (field: string, value?: number) => {
const updatedValue = value !== undefined && value !== null ? value?.toString() : undefined
const updatedValue = value !== undefined && value !== null ? value : undefined
setFormData({
...formData,
[field]: updatedValue
Expand Down
Loading