Skip to content

Commit

Permalink
Merge branch 'integrationTesting' into B-21966-Add-Rejected-Admin-INT
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstanceH committed Feb 4, 2025
2 parents 418c4b5 + 79c7b4b commit dfc6a9a
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 9 deletions.
1 change: 1 addition & 0 deletions migrations/app/migrations_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,7 @@
20250103130619_revert_data_change_for_gbloc_for_ak.up.sql
20250103142533_update_postal_codes_and_gblocs_for_ak.up.sql
20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql
20250106202424_update_duty_locs.up.sql
20250109194140_create_audit_history_table_for_payment_service_items.up.sql
20250110001339_update_nts_release_enum_name.up.sql
20250110153428_add_shipment_address_updates_to_move_history.up.sql
Expand Down
31 changes: 31 additions & 0 deletions migrations/app/schema/20250106202424_update_duty_locs.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--update duty location for NAS Meridian, MS to use zip 39309
update duty_locations set name = 'NAS Meridian, MS 39309', address_id = '691551c2-71fe-4a15-871f-0c46dff98230' where id = '334fecaf-abeb-49ce-99b5-81d69c8beae5';

--remove 39302 duty location
delete from duty_locations where id = 'e55be32c-bf89-4927-8893-4454a26bfd55';

--update duty location for Minneapolis, MN 55460 to use 55467
update orders set new_duty_location_id = 'fc4d669f-594a-4784-9831-bf2eb9f8948b' where new_duty_location_id = '4c960096-1fbc-4b9d-b7d9-5979a3ba7344';

--remove 55460 duty location
delete from duty_locations where id = '4c960096-1fbc-4b9d-b7d9-5979a3ba7344';

--add 92135 duty location
INSERT INTO addresses
(id, street_address_1, street_address_2, city, state, postal_code, created_at, updated_at, street_address_3, county, is_oconus, country_id, us_post_region_cities_id)
VALUES('3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid, 'n/a', NULL, 'NAS N ISLAND', 'CA', '39125', now(), now(), NULL, 'SAN DIEGO', false, '791899e6-cd77-46f2-981b-176ecb8d7098'::uuid, 'ce42858c-85af-4566-bbef-6b9aaf75c18a'::uuid);

INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) VALUES
('56255626-bbbe-4834-8324-1c08f011f2f6'::uuid,'NAS N Island, CA 92135',NULL,'3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid,now(),now(),null,true),
('7156098f-13cf-4455-bcd5-eb829d57c714'::uuid,'NAS North Island, CA 92135',NULL,'8d613f71-b80e-4ad4-95e7-00781b084c7c'::uuid,now(),now(),null,true);

--add Cannon AFB 88101 duty location
INSERT INTO addresses
(id, street_address_1, street_address_2, city, state, postal_code, created_at, updated_at, street_address_3, county, is_oconus, country_id, us_post_region_cities_id)
VALUES('fb90a7df-6494-4974-a0ce-4bdbcaff80c0'::uuid, 'n/a', NULL, 'CANNON AFB', 'NM', '88101', now(), now(), NULL, 'CURRY', false, '791899e6-cd77-46f2-981b-176ecb8d7098'::uuid, '68393e10-1aed-4a51-85a0-559a0a5b0e3f'::uuid);

INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) VALUES
('98beab3c-f8ce-4e3c-b78e-8db614721621'::uuid, 'Cannon AFB, NM 88101',null, 'fb90a7df-6494-4974-a0ce-4bdbcaff80c0'::uuid,now(),now(),'80796bc4-e494-4b19-bb16-cdcdba187829',true);

--associate New London, CT duty location to New London transportation office
update duty_locations set transportation_office_id = '5eb485ae-fb9c-4c90-80e4-6231158797df' where id = '3a2a84cd-0991-4f40-9a19-f977608d08f0';
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab
// Find the weight restriction input and reset its value to 0
const weightRestrictionInput = document.getElementById('weightRestrictionId');
if (weightRestrictionInput) {
weightRestrictionInput.value = '0';
weightRestrictionInput.value = '';
}
}
}, [isAdminWeightLocationChecked]);
Expand All @@ -50,7 +50,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab
setIsAdminWeightLocationChecked(isChecked);

if (!isChecked) {
setFieldValue('weightRestriction', '0');
setFieldValue('weightRestriction', '');
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Office/MoveAllowances/MoveAllowances.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const validationSchema = Yup.object({
.transform((value) => (Number.isNaN(value) ? 0 : value))
.notRequired(),
weightRestriction: Yup.number()
.min(0, 'Weight restriction must be greater than or equal to 0')
.min(1, 'Weight restriction must be greater than 0')
.max(18000, 'Weight restriction cannot exceed 18,000 lbs')
.transform((value) => (Number.isNaN(value) ? 0 : value))
.notRequired(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,29 @@ const validationSchema = Yup.object({
.min(0, 'Storage in transit (days) must be greater than or equal to 0')
.transform((value) => (Number.isNaN(value) ? 0 : value))
.notRequired(),
weightRestriction: Yup.number()
.min(0, 'Weight restriction must be greater than or equal to 0')
.max(18000, 'Weight restriction cannot exceed 18,000 lbs')
.transform((value) => (Number.isNaN(value) ? 0 : value))
.notRequired(),
adminRestrictedWeightLocation: Yup.bool(),
weightRestriction: Yup.number().when('adminRestrictedWeightLocation', {
is: (value) => {
return value === true;
},
then: (schema) => {
return schema
.required('Weight restriction is required when location is restricted')
.min(1, 'Weight restriction must be greater than 0')
.max(18000, 'Weight restriction cannot exceed 18,000 lbs')
.transform((value) => {
return Number.isNaN(value) ? 0 : value;
});
},
otherwise: (schema) => {
return schema
.transform((value) => {
return Number.isNaN(value) ? 0 : value;
})
.notRequired();
},
}),
});

const ServicesCounselingMoveAllowances = () => {
const { moveCode } = useParams();
const navigate = useNavigate();
Expand Down Expand Up @@ -149,6 +165,7 @@ const ServicesCounselingMoveAllowances = () => {
accompaniedTour,
dependentsUnderTwelve: `${dependentsUnderTwelve}`,
dependentsTwelveAndOver: `${dependentsTwelveAndOver}`,
adminRestrictedWeightLocation: false,
};

return (
Expand Down

0 comments on commit dfc6a9a

Please sign in to comment.