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

B-20472 customer cancel move #13850

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4ec32e8
cancel move for SC and TOO
pambecker Oct 1, 2024
29c0032
moved button to the right and to align with SC button
KonstanceH Oct 2, 2024
78bb677
accidentally removed boat from options
KonstanceH Oct 2, 2024
3b236ef
added a couple tests
KonstanceH Oct 3, 2024
249bdb7
updates to button and modal
pambecker Oct 4, 2024
31fcb59
connect cancel to backend call
pambecker Oct 4, 2024
520f3c6
Merge branch 'main' into B-21077-Move-Shipment-Button-MAIN
KonstanceH Oct 7, 2024
f2624a7
cancels move
loganwc Oct 7, 2024
ffcf1d9
Merge branch 'main' into B-20472
loganwc Oct 7, 2024
903e2ae
cleanup
pambecker Oct 7, 2024
3a9fd3d
tests pass
loganwc Oct 8, 2024
d0a9458
added test to movehome
loganwc Oct 8, 2024
ba496eb
end to flex-end
loganwc Oct 8, 2024
c6f50cb
add test to mutli move container
loganwc Oct 8, 2024
504da56
removed unnecessary code
loganwc Oct 8, 2024
65d6e3c
fix issue with PPM only not canceling
pambecker Oct 8, 2024
29804ed
Fix MTO Canceled label for PPM
pambecker Oct 8, 2024
b14f06b
Merge branch 'main' into B-20472
loganwc Oct 9, 2024
43d53af
Merge branch 'main' into B-20472
loganwc Oct 9, 2024
b9b93fa
garbage test garbage code
loganwc Oct 9, 2024
ba45a1a
Merge branch 'main' into B-21077-Move-Shipment-Button-MAIN
KonstanceH Oct 9, 2024
bf5634f
button placement
pambecker Oct 9, 2024
9fc955c
Merge branch 'main' into B-20473-Office-user-cancel-move
pambecker Oct 9, 2024
e29b55e
added in review change and tests
KonstanceH Oct 9, 2024
aef1c6d
updated tests
loganwc Oct 10, 2024
edac3cb
fixed office_test.go
loganwc Oct 10, 2024
5710bc5
update tests
pambecker Oct 10, 2024
b22805b
Merge branch 'main' into B-20472
loganwc Oct 10, 2024
7d26b29
added ppm test
loganwc Oct 10, 2024
abca4eb
updates to refresh page
pambecker Oct 10, 2024
dc08742
update shipment labels on cards
pambecker Oct 11, 2024
d305f72
Merge branch 'main' into B-20473-Office-user-cancel-move
pambecker Oct 11, 2024
6dd1149
update
pambecker Oct 11, 2024
8adc26f
removed accidental paste
loganwc Oct 14, 2024
3d3788e
Merge branch 'main' into B-20472
loganwc Oct 14, 2024
b126499
Merge branch 'main' into B-21077-Move-Shipment-Button-MAIN
KonstanceH Oct 15, 2024
71165cd
Merge branch 'main' into B-20473-Office-user-cancel-move
pambecker Oct 15, 2024
c77fa33
Merge branch 'main' into B-20472
loganwc Oct 15, 2024
5a76996
moved cancel move button
loganwc Oct 15, 2024
9c119fe
remove comment
loganwc Oct 15, 2024
b054016
add a new shipment aligned with title
KonstanceH Oct 16, 2024
0a97346
Merge branch 'main' into B-21077-Move-Shipment-Button-MAIN
KonstanceH Oct 16, 2024
6e243da
now navigates to home when canceling a move
loganwc Oct 16, 2024
81e6332
Merge remote-tracking branch 'origin/B-21077-Move-Shipment-Button-MAI…
pambecker Oct 17, 2024
60497f8
Merge branch 'main' into B-21077-Move-Shipment-Button-MAIN
KonstanceH Oct 17, 2024
af0386e
adding in right mobile home dimensions line back in
KonstanceH Oct 17, 2024
a24b005
removing added description change, will be added in correct story 20653
KonstanceH Oct 17, 2024
0e1c81c
Merge branch 'main' into B-21077-Move-Shipment-Button-MAIN
KonstanceH Oct 17, 2024
b65c621
button alignment, css changes
pambecker Oct 17, 2024
519cd06
merge in latest main and fix conflict
KonstanceH Oct 17, 2024
82ba4ea
Merge branch 'B-21077-Move-Shipment-Button-MAIN' into B-20473-Office-…
pambecker Oct 18, 2024
d2dceda
Merge branch 'main' into B-21077-Move-Shipment-Button-MAIN
WeatherfordAaron Oct 18, 2024
8798f41
Merge branch 'B-21077-Move-Shipment-Button-MAIN' into B-20473-Office-…
pambecker Oct 18, 2024
7e5ab75
spelling updates, happo changes
pambecker Oct 18, 2024
dfa6ff9
Merge branch 'B-20473-Office-user-cancel-move' into B-20472
pambecker Oct 18, 2024
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
24 changes: 16 additions & 8 deletions pkg/gen/ghcapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/gen/ghcapi/ghcoperations/move/search_moves.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/gen/ghcmessages/p_p_m_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions pkg/gen/internalapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/handlers/authentication/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var TOO = RolePermissions{
"update.closeoutOffice",
"update.MTOPage",
"create.TXOShipment",
"update.cancelMoveFlag",
},
}

Expand Down Expand Up @@ -86,6 +87,7 @@ var ServicesCounselor = RolePermissions{
"update.customer",
"update.closeoutOffice",
"view.closeoutOffice",
"update.cancelMoveFlag",
},
}

Expand Down
15 changes: 5 additions & 10 deletions pkg/handlers/internalapi/office.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ type CancelMoveHandler struct {
func (h CancelMoveHandler) Handle(params officeop.CancelMoveParams) middleware.Responder {
return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest,
func(appCtx appcontext.AppContext) (middleware.Responder, error) {

if !appCtx.Session().IsOfficeUser() {
sessionErr := apperror.NewSessionError(
"user is not authorized NewCancelMoveForbidden",
)
appCtx.Logger().Error(sessionErr.Error())
return officeop.NewCancelMoveForbidden(), sessionErr
}

moveID, err := uuid.FromString(params.MoveID.String())
if err != nil {
return handlers.ResponseForError(appCtx.Logger(), err), err
Expand All @@ -98,9 +89,13 @@ func (h CancelMoveHandler) Handle(params officeop.CancelMoveParams) middleware.R
return handlers.ResponseForError(appCtx.Logger(), err), err
}

if move.Status != models.MoveStatusDRAFT {
return officeop.NewApproveMoveConflict(), apperror.NewConflictError(move.ID, "move must be in draft status")
}

logger := appCtx.Logger().With(zap.String("moveLocator", move.Locator))
// Canceling move will result in canceled associated PPMs
err = h.MoveRouter.Cancel(appCtx, *params.CancelMove.CancelReason, move)
err = h.MoveRouter.Cancel(appCtx, move)
if err != nil {
logger.Error("Attempted to cancel move, got invalid transition", zap.Error(err), zap.String("move_status", string(move.Status)))
return handlers.ResponseForError(logger, err), err
Expand Down
Loading
Loading