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

INT B-21986 #14316

Merged
merged 68 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
901989c
maintenance page
loganwc Oct 31, 2024
3a19c5e
added header
loganwc Nov 5, 2024
69cd2fc
maintenance flag implemented and WORKING
loganwc Nov 8, 2024
34c38e3
added tests, admin now redirects to maintenance page, and clean up
loganwc Nov 9, 2024
62509c9
Merge branch 'main' into B-21137
loganwc Nov 9, 2024
a05b70a
fixed auth test
loganwc Nov 11, 2024
65a5dc1
Merge branch 'main' into B-21137
loganwc Nov 13, 2024
f70af1b
enforce font size
loganwc Nov 14, 2024
1311c4f
deleted shipments longer affect ApproveOrRequestApproval func
loganwc Nov 14, 2024
491424e
Merge branch 'main' into B-21137
loganwc Nov 20, 2024
53bc4a7
deploy to exp
loganwc Nov 20, 2024
096b086
test commit to deploy
loganwc Nov 20, 2024
06f93f5
removed whitespace
loganwc Nov 21, 2024
c0d51ca
deploy to demo
loganwc Nov 21, 2024
c1a78c9
reset config.yml
loganwc Nov 21, 2024
1fad666
Merge branch 'main' into B-21637-TOO-Queue-Defect
loganwc Nov 25, 2024
8ead8a1
Merge branch 'main' into B-21637-TOO-Queue-Defect
pambecker Nov 26, 2024
b8d3cca
merging in latest main and fixing conflicts
KonstanceH Nov 26, 2024
3bc0c10
adding in kickback int comment changes
KonstanceH Nov 26, 2024
3a5d0c3
Merge branch 'main' into B-21580-Unlock-Gov-Search-Queues
KonstanceH Nov 26, 2024
529e504
adding missing from test
KonstanceH Nov 26, 2024
2174fe7
Merge branch 'main' into B-21137
loganwc Nov 26, 2024
156137b
Merge branch 'main' into MAIN-B-20496-safety-move-auth
brooklyn-welsh Nov 26, 2024
abfd0fa
Merge branch 'main' into MAIN-B-21114-Office-Address-Language
brooklyn-welsh Nov 26, 2024
a29369c
Merge branch 'main' into B-21542-main
JonSpight Nov 27, 2024
31e369a
Merge branch main into B-21538-MAIN
paulstonebraker Nov 27, 2024
7bea9dc
Merge pull request #14286 from transcom/MAIN-B-20496-safety-move-auth
WeatherfordAaron Nov 27, 2024
55ba7f2
Merge branch 'main' into MAIN-B-21114-Office-Address-Language
WeatherfordAaron Nov 27, 2024
d5cc1d2
Merge branch 'main' into B-20990-main
pambecker Nov 27, 2024
61ce603
Merge pull request #14133 from transcom/B-20990-main
pambecker Nov 27, 2024
0f74a72
Merge branch 'main' into B-21580-Unlock-Gov-Search-Queues
WeatherfordAaron Nov 27, 2024
b83118d
Merge branch 'main' into MAIN-B-21114-Office-Address-Language
WeatherfordAaron Nov 27, 2024
7e6c4e4
fixed imports
JonSpight Nov 27, 2024
378a687
Merge branch 'main' into B-20991-main
JonSpight Nov 27, 2024
2d48dd7
Merge branch 'main' into B-21542-main
JonSpight Nov 27, 2024
106c2a2
Merge branch 'main' into B-21637-TOO-Queue-Defect
pambecker Nov 27, 2024
5486e68
Merge branch 'main' into B-21538-MAIN
paulstonebraker Nov 27, 2024
7de1b8a
Merge pull request #14282 from transcom/B-21580-Unlock-Gov-Search-Queues
WeatherfordAaron Nov 29, 2024
83af5b6
Merge branch 'main' into MAIN-B-21114-Office-Address-Language
WeatherfordAaron Nov 29, 2024
4dc3fe6
Merge pull request #14287 from transcom/MAIN-B-21114-Office-Address-L…
WeatherfordAaron Nov 29, 2024
c6f68ec
name="counseling_office_id"
JonSpight Nov 29, 2024
673baf9
Merge branch 'main' into B-20991-main
JonSpight Nov 29, 2024
087eaa5
fixed file
JonSpight Nov 29, 2024
090ddf3
Merge branch 'main' into B-21542-main
JonSpight Nov 29, 2024
5e98a37
Bump google.golang.org/grpc from 1.65.0 to 1.68.0
dependabot[bot] Dec 2, 2024
68ef36b
Merge pull request #14305 from transcom/dependabot/go_modules/google.…
deandreJones Dec 2, 2024
1715a40
Merge branch 'main' into B-21137
pambecker Dec 2, 2024
47263a6
Merge pull request #14150 from transcom/B-21137
pambecker Dec 2, 2024
9da11ad
Merge branch 'main' into B-21542-main
pambecker Dec 2, 2024
e92c0b3
Merge pull request #14132 from transcom/B-21542-main
pambecker Dec 2, 2024
9154a0e
Merge branch 'main' into B-21538-MAIN
pambecker Dec 2, 2024
6e07015
missing DOD ID changes
JonSpight Dec 2, 2024
483ac87
Merge branch 'main' into B-20991-main
JonSpight Dec 2, 2024
8aae9b8
Merge pull request #14200 from transcom/B-21538-MAIN
pambecker Dec 2, 2024
aa9d104
Merge branch 'main' into B-21637-TOO-Queue-Defect
pambecker Dec 2, 2024
268a0f5
Merge branch 'main' into B-20991-main
danieljordan-caci Dec 2, 2024
1946cc6
Merge pull request #14196 from transcom/B-21637-TOO-Queue-Defect
pambecker Dec 2, 2024
2c1fada
Merge branch 'main' into B-20991-main
pambecker Dec 2, 2024
92ffffb
fixed merge conflicts
JonSpight Dec 2, 2024
4be6b93
Merge branch 'B-20991-main' of https://github.com/transcom/mymove int…
JonSpight Dec 2, 2024
189bf4c
Merge pull request #14182 from transcom/B-20991-main
pambecker Dec 2, 2024
7f9b28d
the hottest of fixes
danieljordan-caci Dec 2, 2024
c162cf0
Merge remote-tracking branch 'origin/MAIN-B-21986' into INT-B-21986
danieljordan-caci Dec 2, 2024
e378ffb
updating fake pricing data
danieljordan-caci Dec 2, 2024
cb21f27
revert
danieljordan-caci Dec 2, 2024
2c38b11
revert
danieljordan-caci Dec 2, 2024
2d6780e
Revert "revert"
danieljordan-caci Dec 2, 2024
d5b18e0
forgotten test
danieljordan-caci Dec 2, 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
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.28.0
go.opentelemetry.io/otel/trace v1.31.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.26.0
golang.org/x/net v0.28.0
golang.org/x/oauth2 v0.22.0
golang.org/x/crypto v0.27.0
golang.org/x/net v0.29.0
golang.org/x/oauth2 v0.23.0
golang.org/x/text v0.18.0
golang.org/x/tools v0.24.0
google.golang.org/grpc v1.65.0
google.golang.org/grpc v1.68.0
gopkg.in/dnaeon/go-vcr.v3 v3.2.0
gotest.tools/gotestsum v1.12.0
pault.ag/go/pksigner v1.0.2
Expand Down Expand Up @@ -262,11 +262,11 @@ require (
golang.org/x/image v0.18.0 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df // indirect
Expand Down
32 changes: 16 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
Expand Down Expand Up @@ -773,12 +773,12 @@ golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -831,8 +831,8 @@ golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand All @@ -849,8 +849,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down Expand Up @@ -900,17 +900,17 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda h1:wu/KJm9KJwpfHWhkkZGohVC6KRrc1oJNr4jwtQMOQXw=
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda/go.mod h1:g2LLCvCeCSir/JJSWosk19BR4NVxGqHUC6rxIRsd7Aw=
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0=
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc=
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=
google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
Expand Down
7 changes: 6 additions & 1 deletion pkg/services/ppmshipment/ppm_estimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,12 @@ func MapPPMShipmentEstimatedFields(appCtx appcontext.AppContext, ppmShipment mod
ppmShipment.Shipment.RequestedPickupDate = &ppmShipment.ExpectedDepartureDate
ppmShipment.Shipment.PickupAddress = &models.Address{PostalCode: ppmShipment.PickupAddress.PostalCode}
ppmShipment.Shipment.DestinationAddress = &models.Address{PostalCode: ppmShipment.DestinationAddress.PostalCode}
ppmShipment.Shipment.PrimeActualWeight = (*unit.Pound)(orders.Entitlement.DBAuthorizedWeight)
// checking for status because PPM closeout uses the entitlement weight and the estimated incentive uses the estimated weight
if ppmShipment.Status == models.PPMShipmentStatusDraft || ppmShipment.Status == models.PPMShipmentStatusSubmitted {
ppmShipment.Shipment.PrimeActualWeight = ppmShipment.EstimatedWeight
} else {
ppmShipment.Shipment.PrimeActualWeight = (*unit.Pound)(orders.Entitlement.DBAuthorizedWeight)
}

return ppmShipment.Shipment, nil
}
Expand Down
51 changes: 47 additions & 4 deletions pkg/services/ppmshipment/ppm_estimator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,52 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() {
})

suite.Run("Estimated Incentive", func() {
suite.Run("Estimated Incentive - Success", func() {
oldPPMShipment := factory.BuildMinimalPPMShipment(suite.DB(), nil, nil)
suite.Run("Estimated Incentive - Success using estimated weight and not db authorized weight", func() {
// when the PPM shipment is in draft, we use the estimated weight and not the db authorized weight
oldPPMShipment := factory.BuildPPMShipment(suite.DB(), []factory.Customization{
{
Model: models.PPMShipment{
Status: models.PPMShipmentStatusDraft,
},
},
}, nil)
setupPricerData()

// shipment has locations and date but is now updating the estimated weight for the first time
estimatedWeight := unit.Pound(5000)
newPPM := oldPPMShipment
newPPM.EstimatedWeight = &estimatedWeight

mockedPaymentRequestHelper.On(
"FetchServiceParamsForServiceItems",
mock.AnythingOfType("*appcontext.appContext"),
mock.AnythingOfType("[]models.MTOServiceItem")).Return(serviceParams, nil)

// DTOD distance is going to be less than the HHG Rand McNally distance of 2361 miles
mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"),
"50309", "30813").Return(2294, nil)

ppmEstimate, _, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM)
suite.NilOrNoVerrs(err)

mockedPlanner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"),
"50309", "30813")
mockedPaymentRequestHelper.AssertCalled(suite.T(), "FetchServiceParamsForServiceItems", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]models.MTOServiceItem"))

suite.Equal(oldPPMShipment.PickupAddress.PostalCode, newPPM.PickupAddress.PostalCode)
suite.Equal(unit.Pound(5000), *newPPM.EstimatedWeight)
suite.Equal(unit.Cents(70064364), *ppmEstimate)
})

suite.Run("Estimated Incentive - Success using db authorize weight and not estimated incentive", func() {
// when the PPM shipment is NOT in draft, we use the db authorized weight and not the estimated weight
oldPPMShipment := factory.BuildPPMShipment(suite.DB(), []factory.Customization{
{
Model: models.PPMShipment{
Status: models.PPMShipmentStatusNeedsCloseout,
},
},
}, nil)
setupPricerData()

// shipment has locations and date but is now updating the estimated weight for the first time
Expand All @@ -542,7 +585,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() {

suite.Equal(oldPPMShipment.PickupAddress.PostalCode, newPPM.PickupAddress.PostalCode)
suite.Equal(unit.Pound(5000), *newPPM.EstimatedWeight)
suite.Equal(unit.Cents(112102682), *ppmEstimate)
suite.Equal(unit.Cents(1000000), *ppmEstimate)
})

suite.Run("Estimated Incentive - Success when old Estimated Incentive is zero", func() {
Expand Down Expand Up @@ -607,7 +650,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() {
suite.NilOrNoVerrs(err)
suite.Nil(newPPM.HasRequestedAdvance)
suite.Nil(newPPM.AdvanceAmountRequested)
suite.Equal(unit.Cents(112102682), *ppmEstimate)
suite.Equal(unit.Cents(38213948), *ppmEstimate)
})

suite.Run("Estimated Incentive - does not change when required fields are the same", func() {
Expand Down
Loading