Skip to content

Commit

Permalink
Merge pull request #11932 from transcom/B-18181
Browse files Browse the repository at this point in the history
B-18181 Deprecate Front End PPM Code
  • Loading branch information
pambecker authored Feb 7, 2024
2 parents e4dc0af + f7a2117 commit 5ada414
Show file tree
Hide file tree
Showing 74 changed files with 5 additions and 6,665 deletions.
2 changes: 0 additions & 2 deletions src/appReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { swaggerReducerPublic, swaggerReducerInternal } from 'shared/Swagger/duc
import { requestsReducer } from 'shared/Swagger/requestsReducer';
import { entitiesReducer } from 'shared/Entities/reducer';
import { officeFlashMessagesReducer } from 'scenes/Office/ducks';
import officePpmReducer from 'scenes/Office/Ppm/ducks';

const authPersistConfig = {
key: 'auth',
Expand All @@ -35,7 +34,6 @@ export const appReducer = () =>
swaggerInternal: swaggerReducerInternal,
flashMessages: officeFlashMessagesReducer,
interceptor: interceptorReducer,
ppmIncentive: officePpmReducer,
});

export default appReducer;
32 changes: 0 additions & 32 deletions src/sagas/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import {
UPDATE_MTO_SHIPMENT,
UPDATE_MTO_SHIPMENTS,
UPDATE_ORDERS,
UPDATE_PPMS,
UPDATE_PPM,
UPDATE_PPM_ESTIMATE,
UPDATE_PPM_SIT_ESTIMATE,
} from 'store/entities/actions';
import { normalizeResponse } from 'services/swaggerRequest';
import { addEntities, updateMTOShipmentsEntity, setOktaUser } from 'shared/Entities/actions';
Expand Down Expand Up @@ -60,30 +56,6 @@ export function* updateMTOShipments(action) {
yield put(updateMTOShipmentsEntity(payload));
}

export function* updatePPMs(action) {
const { payload } = action;
const normalizedData = yield call(normalizeResponse, payload, 'personallyProcuredMoves');
yield put(addEntities(normalizedData));
}

export function* updatePPM(action) {
const { payload } = action;
const normalizedData = yield call(normalizeResponse, payload, 'personallyProcuredMove');
yield put(addEntities(normalizedData));
}

export function* updatePPMEstimate(action) {
const { payload } = action;
const normalizedData = yield call(normalizeResponse, payload, 'ppmEstimateRange');
yield put(addEntities(normalizedData));
}

export function* updatePPMSitEstimate(action) {
const { payload } = action;
const normalizedData = yield call(normalizeResponse, payload, 'ppmSitEstimate');
yield put(addEntities(normalizedData));
}

export function* watchUpdateEntities() {
yield all([
takeLatest(UPDATE_SERVICE_MEMBER, updateServiceMember),
Expand All @@ -92,9 +64,5 @@ export function* watchUpdateEntities() {
takeLatest(UPDATE_MOVE, updateMove),
takeLatest(UPDATE_MTO_SHIPMENT, updateMTOShipment),
takeLatest(UPDATE_MTO_SHIPMENTS, updateMTOShipments),
takeLatest(UPDATE_PPMS, updatePPMs),
takeLatest(UPDATE_PPM, updatePPM),
takeLatest(UPDATE_PPM_ESTIMATE, updatePPMEstimate),
takeLatest(UPDATE_PPM_SIT_ESTIMATE, updatePPMSitEstimate),
]);
}
98 changes: 0 additions & 98 deletions src/sagas/entities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import {
updateMTOShipment,
updateMTOShipments,
updateOrders,
updatePPMs,
updatePPM,
updatePPMEstimate,
updatePPMSitEstimate,
} from './entities';

import {
Expand All @@ -20,10 +16,6 @@ import {
UPDATE_MOVE,
UPDATE_MTO_SHIPMENT,
UPDATE_ORDERS,
UPDATE_PPMS,
UPDATE_PPM,
UPDATE_PPM_ESTIMATE,
UPDATE_PPM_SIT_ESTIMATE,
UPDATE_MTO_SHIPMENTS,
} from 'store/entities/actions';
import { normalizeResponse } from 'services/swaggerRequest';
Expand All @@ -41,10 +33,6 @@ describe('watchUpdateEntities', () => {
takeLatest(UPDATE_MOVE, updateMove),
takeLatest(UPDATE_MTO_SHIPMENT, updateMTOShipment),
takeLatest(UPDATE_MTO_SHIPMENTS, updateMTOShipments),
takeLatest(UPDATE_PPMS, updatePPMs),
takeLatest(UPDATE_PPM, updatePPM),
takeLatest(UPDATE_PPM_ESTIMATE, updatePPMEstimate),
takeLatest(UPDATE_PPM_SIT_ESTIMATE, updatePPMSitEstimate),
]),
);
});
Expand Down Expand Up @@ -248,89 +236,3 @@ describe('updateOrders', () => {
expect(generator.next().done).toEqual(true);
});
});

describe('updatePPM', () => {
const testAction = {
payload: {
actual_move_date: '2020-12-18',
advance_worksheet: {
id: '00000000-0000-0000-0000-000000000000',
service_member_id: '00000000-0000-0000-0000-000000000000',
uploads: [],
},
approve_date: '2020-12-21T22:45:52.000Z',
created_at: '2020-12-21T22:43:48.278Z',
destination_postal_code: '99619',
has_additional_postal_code: false,
has_requested_advance: false,
has_sit: false,
id: 'd9488eac-eef8-430e-8c4b-05884c3cc6fa',
move_id: '2b8198ca-e70a-40b7-822e-be5527bf0606',
original_move_date: '2020-12-19',
pickup_postal_code: '10002',
status: 'PAYMENT_REQUESTED',
submit_date: '2020-12-21T22:45:12.100Z',
updated_at: '2020-12-21T22:46:50.805Z',
},
};

const normalizedPPM = normalizeResponse(testAction.payload, 'personallyProcuredMove');

const generator = updatePPM(testAction);

it('normalizes the payload', () => {
expect(generator.next().value).toEqual(call(normalizeResponse, testAction.payload, 'personallyProcuredMove'));
});

it('stores the normalized data in entities', () => {
expect(generator.next(normalizedPPM).value).toEqual(put(addEntities(normalizedPPM)));
});

it('is done', () => {
expect(generator.next().done).toEqual(true);
});
});

describe('updatePPMs', () => {
const testAction = {
payload: [
{
actual_move_date: '2020-12-18',
advance_worksheet: {
id: '00000000-0000-0000-0000-000000000000',
service_member_id: '00000000-0000-0000-0000-000000000000',
uploads: [],
},
approve_date: '2020-12-21T22:45:52.000Z',
created_at: '2020-12-21T22:43:48.278Z',
destination_postal_code: '99619',
has_additional_postal_code: false,
has_requested_advance: false,
has_sit: false,
id: 'd9488eac-eef8-430e-8c4b-05884c3cc6fa',
move_id: '2b8198ca-e70a-40b7-822e-be5527bf0606',
original_move_date: '2020-12-19',
pickup_postal_code: '10002',
status: 'PAYMENT_REQUESTED',
submit_date: '2020-12-21T22:45:12.100Z',
updated_at: '2020-12-21T22:46:50.805Z',
},
],
};

const normalizedPPM = normalizeResponse(testAction.payload, 'personallyProcuredMoves');

const generator = updatePPMs(testAction);

it('normalizes the payload', () => {
expect(generator.next().value).toEqual(call(normalizeResponse, testAction.payload, 'personallyProcuredMoves'));
});

it('stores the normalized data in entities', () => {
expect(generator.next(normalizedPPM).value).toEqual(put(addEntities(normalizedPPM)));
});

it('is done', () => {
expect(generator.next().done).toEqual(true);
});
});
139 changes: 0 additions & 139 deletions src/scenes/Moves/Ppm/AllowableExpenses.jsx

This file was deleted.

57 changes: 0 additions & 57 deletions src/scenes/Moves/Ppm/CustomerAgreementLegalese.js

This file was deleted.

Loading

0 comments on commit 5ada414

Please sign in to comment.