diff --git a/go.mod b/go.mod index ca2c6c46f14..a9ae90ac162 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/DATA-DOG/go-txdb v0.1.7 github.com/XSAM/otelsql v0.23.0 github.com/alexedwards/scs/redisstore v0.0.0-20221223131519-238b052508b6 - github.com/alexedwards/scs/v2 v2.5.1 + github.com/alexedwards/scs/v2 v2.8.0 github.com/aws/aws-sdk-go-v2 v1.27.2 github.com/aws/aws-sdk-go-v2/config v1.27.14 github.com/aws/aws-sdk-go-v2/credentials v1.17.14 @@ -91,19 +91,20 @@ require ( go.opentelemetry.io/otel/sdk/metric v0.40.0 go.opentelemetry.io/otel/trace v1.18.0 go.uber.org/zap v1.26.0 - golang.org/x/crypto v0.21.0 - golang.org/x/net v0.23.0 + golang.org/x/crypto v0.23.0 + golang.org/x/net v0.25.0 golang.org/x/oauth2 v0.20.0 - golang.org/x/text v0.14.0 - golang.org/x/tools v0.13.0 + golang.org/x/text v0.16.0 + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d google.golang.org/grpc v1.62.0 gopkg.in/dnaeon/go-vcr.v3 v3.2.0 - gotest.tools/gotestsum v1.10.1 + gotest.tools/gotestsum v1.12.0 pault.ag/go/pksigner v1.0.2 ) require ( filippo.io/edwards25519 v1.1.0 // indirect + github.com/bitfield/gotestdox v0.2.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/goccy/go-json v0.10.2 // indirect @@ -154,7 +155,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dnephin/pflag v1.0.7 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/fatih/color v1.15.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/frankban/quicktest v1.14.6 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -216,7 +217,7 @@ require ( github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect @@ -255,11 +256,11 @@ require ( go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/image v0.14.0 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/image v0.18.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.20.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect diff --git a/go.sum b/go.sum index 6e568a4cb19..c623c951c15 100644 --- a/go.sum +++ b/go.sum @@ -36,8 +36,8 @@ github.com/XSAM/otelsql v0.23.0 h1:NsJQS9YhI1+RDsFqE9mW5XIQmPmdF/qa8qQOLZN8XEA= github.com/XSAM/otelsql v0.23.0/go.mod h1:oX4LXMsb+9lAZhvHjUS61oQP/hbcJRadWHnBKNL+LuM= github.com/alexedwards/scs/redisstore v0.0.0-20221223131519-238b052508b6 h1:75FM2L3Hup1DEpcsz+A+sdwoLdxR5yM+ecGYWkgVzW0= github.com/alexedwards/scs/redisstore v0.0.0-20221223131519-238b052508b6/go.mod h1:ceKFatoD+hfHWWeHOAYue1J+XgOJjE7dw8l3JtIRTGY= -github.com/alexedwards/scs/v2 v2.5.1 h1:EhAz3Kb3OSQzD8T+Ub23fKsiuvE0GzbF5Lgn0uTwM3Y= -github.com/alexedwards/scs/v2 v2.5.1/go.mod h1:ToaROZxyKukJKT/xLcVQAChi5k6+Pn1Gvmdl7h3RRj8= +github.com/alexedwards/scs/v2 v2.8.0 h1:h31yUYoycPuL0zt14c0gd+oqxfRwIj6SOjHdKRZxhEw= +github.com/alexedwards/scs/v2 v2.8.0/go.mod h1:ToaROZxyKukJKT/xLcVQAChi5k6+Pn1Gvmdl7h3RRj8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= @@ -96,6 +96,8 @@ github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuP github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE= +github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/brunoscheufler/aws-ecs-metadata-go v0.0.0-20221221133751-67e37ae746cd h1:C0dfBzAdNMqxokqWUysk2KTJSMmqvh9cNW1opdy5+0Q= github.com/brunoscheufler/aws-ecs-metadata-go v0.0.0-20221221133751-67e37ae746cd/go.mod h1:CeKhh8xSs3WZAc50xABMxu+FlfAAd5PNumo7NfOv7EE= @@ -145,8 +147,9 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -154,7 +157,6 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= @@ -277,8 +279,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -470,8 +470,10 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= @@ -554,6 +556,7 @@ github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= @@ -598,7 +601,6 @@ github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cA github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= @@ -650,7 +652,6 @@ github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 h1:qhbILQo1K3mphbwKh1vNm4 github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.flipt.io/flipt/errors v1.19.3 h1:mgQrT3XdambAdu4UykYZ3gm1NG7Ilri5Gt+nLafbJHY= @@ -727,16 +728,19 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= 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= golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4= -golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= +golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ= +golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -746,9 +750,14 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -761,7 +770,6 @@ golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= @@ -770,9 +778,12 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +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.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= 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.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= @@ -783,13 +794,13 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -804,7 +815,6 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -813,9 +823,7 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -823,26 +831,34 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.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.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.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= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= 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= @@ -853,8 +869,11 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -869,12 +888,14 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20210114065538-d78b04bdf963/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -929,10 +950,10 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/gotestsum v1.10.1 h1:TOV5xZVd5HDscBLSrPXpc4/MQm6QQr/YSI9iDC62d7E= -gotest.tools/gotestsum v1.10.1/go.mod h1:6JHCiN6TEjA7Kaz23q1bH0e2Dc3YJjDUZ0DmctFZf+w= -gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= -gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/gotestsum v1.12.0 h1:CmwtaGDkHxrZm4Ib0Vob89MTfpc3GrEFMJKovliPwGk= +gotest.tools/gotestsum v1.12.0/go.mod h1:fAvqkSptospfSbQw26CTYzNwnsE/ztqLeyhP0h67ARY= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index 3ce3f70871a..229d91d2eae 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -942,6 +942,7 @@ 20240521184834_add_standalone_field_to_service_items.up.sql 20240522124339_add_csr_to_roles.up.sql 20240524214247_add_sit_location_moving_expenses.up.sql +20240528154043_drop_not_null_from_ppm_postal_codes.up.sql 20240529181303_add_additional_documents_id_col_to_moves.up.sql 20240530020648_adding_standalone_crate_service_param.up.sql 20240530084720_rename_qae_csr_to_just_qae.up.sql diff --git a/migrations/app/schema/20240528154043_drop_not_null_from_ppm_postal_codes.up.sql b/migrations/app/schema/20240528154043_drop_not_null_from_ppm_postal_codes.up.sql new file mode 100644 index 00000000000..49f7c68b7f2 --- /dev/null +++ b/migrations/app/schema/20240528154043_drop_not_null_from_ppm_postal_codes.up.sql @@ -0,0 +1,3 @@ +ALTER TABLE ppm_shipments +ALTER COLUMN pickup_postal_code DROP NOT NULL, +ALTER COLUMN destination_postal_code DROP NOT NULL; \ No newline at end of file diff --git a/package.json b/package.json index 2f989da612e..dd62ac38317 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@fortawesome/fontawesome-svg-core": "^6.5.1", + "@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/free-regular-svg-icons": "^6.4.0", "@fortawesome/free-solid-svg-icons": "^6.4.0", "@fortawesome/react-fontawesome": "^0.2.0", @@ -16,7 +16,7 @@ "bytes": "^3.1.2", "classnames": "^2.5.1", "connected-react-router": "^6.9.3", - "core-js": "^3.37.0", + "core-js": "^3.37.1", "customize-cra": "^1.0.0", "deep-object-diff": "^1.1.9", "eslint-plugin-react": "^7.34", @@ -128,7 +128,7 @@ "version": "0.1.0", "devDependencies": { "@babel/core": "~7.22.8", - "@babel/helper-builder-react-jsx": "^7.22.5", + "@babel/helper-builder-react-jsx": "^7.24.7", "@babel/helper-builder-react-jsx-experimental": "^7.12.11", "@faker-js/faker": "^8.4.1", "@jackfranklin/test-data-bot": "^2.1.0", diff --git a/pkg/factory/ppm_shipment_factory.go b/pkg/factory/ppm_shipment_factory.go index 9b9078e9dea..11e44a1da7f 100644 --- a/pkg/factory/ppm_shipment_factory.go +++ b/pkg/factory/ppm_shipment_factory.go @@ -61,15 +61,11 @@ func buildPPMShipmentWithBuildType(db *pop.Connection, customs []Customization, Shipment: shipment, Status: models.PPMShipmentStatusDraft, ExpectedDepartureDate: time.Date(GHCTestYear, time.March, 15, 0, 0, 0, 0, time.UTC), - PickupPostalCode: serviceMember.ResidentialAddress.PostalCode, - DestinationPostalCode: shipment.MoveTaskOrder.Orders.NewDutyLocation.Address.PostalCode, SITExpected: models.BoolPointer(false), } if buildType == ppmBuildStandard { ppmShipment.Status = models.PPMShipmentStatusSubmitted - ppmShipment.SecondaryPickupPostalCode = models.StringPointer("90211") - ppmShipment.SecondaryDestinationPostalCode = models.StringPointer("30814") ppmShipment.EstimatedWeight = models.PoundPointer(unit.Pound(4000)) ppmShipment.HasProGear = models.BoolPointer(true) ppmShipment.ProGearWeight = models.PoundPointer(unit.Pound(1987)) @@ -141,12 +137,10 @@ func buildPPMShipmentWithBuildType(db *pop.Connection, customs []Customization, }, nil) ppmShipment.SecondaryPickupAddressID = &secondaryPickupAddress.ID ppmShipment.SecondaryPickupAddress = &secondaryPickupAddress - ppmShipment.SecondaryPickupPostalCode = &secondaryPickupAddress.PostalCode ppmShipment.HasSecondaryPickupAddress = models.BoolPointer(true) ppmShipment.SecondaryDestinationAddressID = &secondaryDestinationAddress.ID ppmShipment.SecondaryDestinationAddress = &secondaryDestinationAddress - ppmShipment.SecondaryDestinationPostalCode = &secondaryDestinationAddress.PostalCode ppmShipment.HasSecondaryDestinationAddress = models.BoolPointer(true) } @@ -238,8 +232,8 @@ func buildApprovedPPMShipmentWithActualInfo(db *pop.Connection, userUploader *up ppmShipment := buildApprovedPPMShipmentWaitingOnCustomer(db, userUploader, customs) ppmShipment.ActualMoveDate = models.TimePointer(ppmShipment.ExpectedDepartureDate.AddDate(0, 0, 1)) - ppmShipment.ActualPickupPostalCode = &ppmShipment.PickupPostalCode - ppmShipment.ActualDestinationPostalCode = &ppmShipment.DestinationPostalCode + ppmShipment.ActualPickupPostalCode = &ppmShipment.PickupAddress.PostalCode + ppmShipment.ActualDestinationPostalCode = &ppmShipment.DestinationAddress.PostalCode if ppmShipment.HasRequestedAdvance != nil && *ppmShipment.HasRequestedAdvance { ppmShipment.HasReceivedAdvance = models.BoolPointer(true) @@ -786,11 +780,11 @@ func BuildPPMShipmentWithAllDocTypesApproved(db *pop.Connection, userUploader *u // // This function does not accept customizations to reduce the // complexity of supporting different variations for tests -func BuildPPMShipmentThatNeedsToBeResubmitted(db *pop.Connection, userUploader *uploader.UserUploader) models.PPMShipment { +func BuildPPMShipmentThatNeedsToBeResubmitted(db *pop.Connection, userUploader *uploader.UserUploader, customs []Customization) models.PPMShipment { // It's easier to use some of the data from other downstream // functions if we have them go first and then make our changes on // top of those changes. - ppmShipment := BuildPPMShipmentThatNeedsCloseout(db, userUploader, nil) + ppmShipment := BuildPPMShipmentThatNeedsCloseout(db, userUploader, customs) // Document that got rejected. This would normally already exist // and would just need to be updated to change the status, but for diff --git a/pkg/factory/ppm_shipment_factory_test.go b/pkg/factory/ppm_shipment_factory_test.go index 0dff96de000..738b73bf9e4 100644 --- a/pkg/factory/ppm_shipment_factory_test.go +++ b/pkg/factory/ppm_shipment_factory_test.go @@ -16,33 +16,57 @@ func (suite *FactorySuite) TestBuildPPMShipment() { // Set up: Create a PPM shipment with no customizations or traits // Expected outcome:PPMShipment should be created with default values defaultPPM := models.PPMShipment{ - ExpectedDepartureDate: time.Date(GHCTestYear, time.March, 15, 0, 0, 0, 0, time.UTC), - PickupPostalCode: "90210", - DestinationPostalCode: "30813", - SITExpected: models.BoolPointer(false), - Status: models.PPMShipmentStatusSubmitted, - SecondaryPickupPostalCode: models.StringPointer("90211"), - SecondaryDestinationPostalCode: models.StringPointer("30814"), - EstimatedWeight: models.PoundPointer(unit.Pound(4000)), - HasProGear: models.BoolPointer(true), - ProGearWeight: models.PoundPointer(unit.Pound(1987)), - SpouseProGearWeight: models.PoundPointer(unit.Pound(498)), - EstimatedIncentive: models.CentPointer(unit.Cents(1000000)), - HasRequestedAdvance: models.BoolPointer(true), - AdvanceAmountRequested: models.CentPointer(unit.Cents(598700)), + ExpectedDepartureDate: time.Date(GHCTestYear, time.March, 15, 0, 0, 0, 0, time.UTC), + SITExpected: models.BoolPointer(false), + Status: models.PPMShipmentStatusSubmitted, + EstimatedWeight: models.PoundPointer(unit.Pound(4000)), + HasProGear: models.BoolPointer(true), + ProGearWeight: models.PoundPointer(unit.Pound(1987)), + SpouseProGearWeight: models.PoundPointer(unit.Pound(498)), + EstimatedIncentive: models.CentPointer(unit.Cents(1000000)), + HasRequestedAdvance: models.BoolPointer(true), + AdvanceAmountRequested: models.CentPointer(unit.Cents(598700)), + PickupAddress: &models.Address{ + StreetAddress1: "987 New Street", + City: "Des Moines", + State: "IA", + PostalCode: "50309", + }, + SecondaryPickupAddress: &models.Address{ + StreetAddress1: "123 Main Street", + City: "Des Moines", + State: "IA", + PostalCode: "50309", + }, + DestinationAddress: &models.Address{ + StreetAddress1: "123 New Street", + City: "Fort Eisenhower", + State: "GA", + PostalCode: "30813", + }, + SecondaryDestinationAddress: &models.Address{ + StreetAddress1: "1234 Main Street", + City: "Fort Eisenhower", + State: "GA", + PostalCode: "30813", + }, } // SETUP ppmShipment := BuildPPMShipment(suite.DB(), nil, nil) // VALIDATE RESULTS + suite.Equal(defaultPPM.PickupAddress.StreetAddress1, ppmShipment.PickupAddress.StreetAddress1) + suite.Equal(defaultPPM.DestinationAddress.StreetAddress1, ppmShipment.DestinationAddress.StreetAddress1) + suite.Equal(defaultPPM.PickupAddress.City, ppmShipment.PickupAddress.City) + suite.Equal(defaultPPM.DestinationAddress.City, ppmShipment.DestinationAddress.City) + suite.Equal(defaultPPM.PickupAddress.State, ppmShipment.PickupAddress.State) + suite.Equal(defaultPPM.DestinationAddress.State, ppmShipment.DestinationAddress.State) + suite.Equal(defaultPPM.PickupAddress.PostalCode, ppmShipment.PickupAddress.PostalCode) + suite.Equal(defaultPPM.DestinationAddress.PostalCode, ppmShipment.DestinationAddress.PostalCode) suite.Equal(defaultPPM.ExpectedDepartureDate, ppmShipment.ExpectedDepartureDate) - suite.Equal(defaultPPM.PickupPostalCode, ppmShipment.PickupPostalCode) - suite.Equal(defaultPPM.DestinationPostalCode, ppmShipment.DestinationPostalCode) suite.Equal(defaultPPM.SITExpected, ppmShipment.SITExpected) suite.Equal(defaultPPM.Status, ppmShipment.Status) - suite.Equal(defaultPPM.SecondaryPickupPostalCode, ppmShipment.SecondaryPickupPostalCode) - suite.Equal(defaultPPM.SecondaryDestinationPostalCode, ppmShipment.SecondaryDestinationPostalCode) suite.Equal(defaultPPM.EstimatedWeight, ppmShipment.EstimatedWeight) suite.Equal(defaultPPM.HasProGear, ppmShipment.HasProGear) suite.Equal(defaultPPM.ProGearWeight, ppmShipment.ProGearWeight) @@ -60,8 +84,6 @@ func (suite *FactorySuite) TestBuildPPMShipment() { defaultPPM := models.PPMShipment{ Status: models.PPMShipmentStatusDraft, ExpectedDepartureDate: time.Date(GHCTestYear, time.March, 15, 0, 0, 0, 0, time.UTC), - PickupPostalCode: "90210", - DestinationPostalCode: "30813", SITExpected: models.BoolPointer(false), } @@ -71,10 +93,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() { // VALIDATE RESULTS suite.Equal(defaultPPM.Status, ppmShipment.Status) suite.Equal(defaultPPM.ExpectedDepartureDate, ppmShipment.ExpectedDepartureDate) - suite.Equal(defaultPPM.PickupPostalCode, ppmShipment.PickupPostalCode) - suite.Equal(defaultPPM.DestinationPostalCode, ppmShipment.DestinationPostalCode) suite.Equal(defaultPPM.SITExpected, ppmShipment.SITExpected) - suite.Nil(ppmShipment.SecondaryDestinationPostalCode) suite.Nil(ppmShipment.EstimatedWeight) suite.Nil(ppmShipment.HasProGear) suite.Nil(ppmShipment.ProGearWeight) @@ -91,23 +110,19 @@ func (suite *FactorySuite) TestBuildPPMShipment() { // SETUP sitLocation := models.SITLocationTypeDestination customPPM := models.PPMShipment{ - ID: uuid.Must(uuid.NewV4()), - Status: models.PPMShipmentStatusWaitingOnCustomer, - ExpectedDepartureDate: time.Now(), - PickupPostalCode: "79329", - SecondaryPickupPostalCode: models.StringPointer("80238"), - DestinationPostalCode: "90210", - SecondaryDestinationPostalCode: models.StringPointer("83126"), - HasProGear: models.BoolPointer(true), - ProGearWeight: models.PoundPointer(unit.Pound(1989)), - EstimatedWeight: models.PoundPointer(unit.Pound(3000)), - SpouseProGearWeight: models.PoundPointer(unit.Pound(123)), - EstimatedIncentive: models.CentPointer(unit.Cents(1005000)), - HasRequestedAdvance: models.BoolPointer(true), - AdvanceAmountRequested: models.CentPointer(unit.Cents(600000)), - SITExpected: models.BoolPointer(true), - SITLocation: &sitLocation, - SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), + ID: uuid.Must(uuid.NewV4()), + Status: models.PPMShipmentStatusWaitingOnCustomer, + ExpectedDepartureDate: time.Now(), + HasProGear: models.BoolPointer(true), + ProGearWeight: models.PoundPointer(unit.Pound(1989)), + EstimatedWeight: models.PoundPointer(unit.Pound(3000)), + SpouseProGearWeight: models.PoundPointer(unit.Pound(123)), + EstimatedIncentive: models.CentPointer(unit.Cents(1005000)), + HasRequestedAdvance: models.BoolPointer(true), + AdvanceAmountRequested: models.CentPointer(unit.Cents(600000)), + SITExpected: models.BoolPointer(true), + SITLocation: &sitLocation, + SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), } customAddress := models.Address{ StreetAddress1: "123 Any Street", @@ -124,12 +139,8 @@ func (suite *FactorySuite) TestBuildPPMShipment() { // VALIDATE RESULTS suite.Equal(customPPM.ExpectedDepartureDate, ppmShipment.ExpectedDepartureDate) - suite.Equal(customPPM.PickupPostalCode, ppmShipment.PickupPostalCode) - suite.Equal(customPPM.DestinationPostalCode, ppmShipment.DestinationPostalCode) suite.Equal(customPPM.SITExpected, ppmShipment.SITExpected) suite.Equal(customPPM.Status, ppmShipment.Status) - suite.Equal(customPPM.SecondaryPickupPostalCode, ppmShipment.SecondaryPickupPostalCode) - suite.Equal(customPPM.SecondaryDestinationPostalCode, ppmShipment.SecondaryDestinationPostalCode) suite.Equal(customPPM.EstimatedWeight, ppmShipment.EstimatedWeight) suite.Equal(customPPM.HasProGear, ppmShipment.HasProGear) suite.Equal(customPPM.ProGearWeight, ppmShipment.ProGearWeight) @@ -235,10 +246,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() { ppmShipment := BuildPPMShipmentReadyForFinalCustomerCloseOut(suite.DB(), nil, nil) suite.NotNil(ppmShipment.ActualPickupPostalCode) - suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode) suite.NotNil(ppmShipment.ActualDestinationPostalCode) - suite.Equal(ppmShipment.DestinationPostalCode, - *ppmShipment.ActualDestinationPostalCode) suite.NotNil(ppmShipment.AOAPacket) suite.NotNil(ppmShipment.AOAPacketID) suite.Equal(models.PPMShipmentStatusWaitingOnCustomer, ppmShipment.Status) @@ -259,10 +267,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() { suite.False(ppmShipment.ID.IsNil()) suite.NotNil(ppmShipment.ActualPickupPostalCode) - suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode) suite.NotNil(ppmShipment.ActualDestinationPostalCode) - suite.Equal(ppmShipment.DestinationPostalCode, - *ppmShipment.ActualDestinationPostalCode) suite.NotNil(ppmShipment.AOAPacket) suite.NotNil(ppmShipment.AOAPacketID) suite.Equal(models.PPMShipmentStatusWaitingOnCustomer, ppmShipment.Status) @@ -281,10 +286,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() { ppmShipment := BuildPPMShipmentReadyForFinalCustomerCloseOutWithAllDocTypes(suite.DB(), nil) suite.NotNil(ppmShipment.ActualPickupPostalCode) - suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode) suite.NotNil(ppmShipment.ActualDestinationPostalCode) - suite.Equal(ppmShipment.DestinationPostalCode, - *ppmShipment.ActualDestinationPostalCode) suite.NotNil(ppmShipment.AOAPacket) suite.NotNil(ppmShipment.AOAPacketID) suite.Equal(models.PPMShipmentStatusWaitingOnCustomer, ppmShipment.Status) @@ -314,10 +316,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() { ppmShipment := BuildPPMShipmentThatNeedsCloseoutWithAllDocTypes(suite.DB(), nil) suite.NotNil(ppmShipment.ActualPickupPostalCode) - suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode) suite.NotNil(ppmShipment.ActualDestinationPostalCode) - suite.Equal(ppmShipment.DestinationPostalCode, - *ppmShipment.ActualDestinationPostalCode) suite.NotNil(ppmShipment.AOAPacket) suite.NotNil(ppmShipment.AOAPacketID) suite.Equal(models.PPMShipmentStatusNeedsCloseout, ppmShipment.Status) @@ -347,10 +346,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() { ppmShipment := BuildPPMShipmentWithApprovedDocumentsMissingPaymentPacket(suite.DB(), nil, nil) suite.NotNil(ppmShipment.ActualPickupPostalCode) - suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode) suite.NotNil(ppmShipment.ActualDestinationPostalCode) - suite.Equal(ppmShipment.DestinationPostalCode, - *ppmShipment.ActualDestinationPostalCode) suite.NotNil(ppmShipment.AOAPacket) suite.NotNil(ppmShipment.AOAPacketID) suite.Equal(models.PPMShipmentStatusCloseoutComplete, ppmShipment.Status) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 63d154640b3..9713a05d4c8 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -5449,6 +5449,8 @@ func init() { "AIR_FORCE", "COAST_GUARD", "SPACE_FORCE", + "NAVY_AND_MARINES", + "AIR_AND_SPACE_FORCE", "OTHER" ], "x-display-value": { @@ -9329,8 +9331,6 @@ func init() { "createdAt", "status", "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "eTag" ], @@ -9395,14 +9395,6 @@ func init() { "destinationAddress": { "$ref": "#/definitions/Address" }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "eTag": { "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", "type": "string", @@ -9480,14 +9472,6 @@ func init() { "pickupAddress": { "$ref": "#/definitions/Address" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member.", "type": "integer", @@ -9521,16 +9505,6 @@ func init() { } ] }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "secondaryPickupAddress": { "allOf": [ { @@ -9544,15 +9518,6 @@ func init() { } ] }, - "secondaryPickupPostalCode": { - "type": "string", - "format": "An optional secondary pickup location near the origin where additional goods exist.", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "shipmentId": { "description": "The id of the parent MTOShipment object", "type": "string", @@ -19149,6 +19114,8 @@ func init() { "AIR_FORCE", "COAST_GUARD", "SPACE_FORCE", + "NAVY_AND_MARINES", + "AIR_AND_SPACE_FORCE", "OTHER" ], "x-display-value": { @@ -23034,8 +23001,6 @@ func init() { "createdAt", "status", "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "eTag" ], @@ -23100,14 +23065,6 @@ func init() { "destinationAddress": { "$ref": "#/definitions/Address" }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "eTag": { "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", "type": "string", @@ -23185,14 +23142,6 @@ func init() { "pickupAddress": { "$ref": "#/definitions/Address" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member.", "type": "integer", @@ -23226,16 +23175,6 @@ func init() { } ] }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "secondaryPickupAddress": { "allOf": [ { @@ -23249,15 +23188,6 @@ func init() { } ] }, - "secondaryPickupPostalCode": { - "type": "string", - "format": "An optional secondary pickup location near the origin where additional goods exist.", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "shipmentId": { "description": "The id of the parent MTOShipment object", "type": "string", diff --git a/pkg/gen/ghcmessages/affiliation.go b/pkg/gen/ghcmessages/affiliation.go index 718d45a4303..38e828b5074 100644 --- a/pkg/gen/ghcmessages/affiliation.go +++ b/pkg/gen/ghcmessages/affiliation.go @@ -50,6 +50,12 @@ const ( // AffiliationSPACEFORCE captures enum value "SPACE_FORCE" AffiliationSPACEFORCE Affiliation = "SPACE_FORCE" + // AffiliationNAVYANDMARINES captures enum value "NAVY_AND_MARINES" + AffiliationNAVYANDMARINES Affiliation = "NAVY_AND_MARINES" + + // AffiliationAIRANDSPACEFORCE captures enum value "AIR_AND_SPACE_FORCE" + AffiliationAIRANDSPACEFORCE Affiliation = "AIR_AND_SPACE_FORCE" + // AffiliationOTHER captures enum value "OTHER" AffiliationOTHER Affiliation = "OTHER" ) @@ -59,7 +65,7 @@ var affiliationEnum []interface{} func init() { var res []Affiliation - if err := json.Unmarshal([]byte(`["ARMY","NAVY","MARINES","AIR_FORCE","COAST_GUARD","SPACE_FORCE","OTHER"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ARMY","NAVY","MARINES","AIR_FORCE","COAST_GUARD","SPACE_FORCE","NAVY_AND_MARINES","AIR_AND_SPACE_FORCE","OTHER"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/gen/ghcmessages/p_p_m_shipment.go b/pkg/gen/ghcmessages/p_p_m_shipment.go index aa979dd4024..a063c464c2f 100644 --- a/pkg/gen/ghcmessages/p_p_m_shipment.go +++ b/pkg/gen/ghcmessages/p_p_m_shipment.go @@ -64,14 +64,6 @@ type PPMShipment struct { // destination address DestinationAddress *Address `json:"destinationAddress,omitempty"` - // ZIP - // - // The postal code of the destination location where goods are being delivered to. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode"` - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. // Required: true // Read Only: true @@ -126,14 +118,6 @@ type PPMShipment struct { // pickup address PickupAddress *Address `json:"pickupAddress,omitempty"` - // ZIP - // - // The postal code of the origin location where goods are being moved from. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode"` - // The estimated weight of the pro-gear being moved belonging to the service member. ProGearWeight *int64 `json:"proGearWeight"` @@ -147,21 +131,9 @@ type PPMShipment struct { // secondary destination address SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` - // ZIP - // - // An optional secondary location near the destination where goods will be dropped off. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode"` - // secondary pickup address SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - // ZIP - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode"` - // The id of the parent MTOShipment object // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 // Required: true @@ -252,10 +224,6 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateETag(formats); err != nil { res = append(res, err) } @@ -276,10 +244,6 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateProGearWeightTickets(formats); err != nil { res = append(res, err) } @@ -292,18 +256,10 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateSecondaryPickupAddress(formats); err != nil { res = append(res, err) } - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateShipmentID(formats); err != nil { res = append(res, err) } @@ -453,19 +409,6 @@ func (m *PPMShipment) validateDestinationAddress(formats strfmt.Registry) error return nil } -func (m *PPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("destinationPostalCode", "body", m.DestinationPostalCode); err != nil { - return err - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateETag(formats strfmt.Registry) error { if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { @@ -546,19 +489,6 @@ func (m *PPMShipment) validatePickupAddress(formats strfmt.Registry) error { return nil } -func (m *PPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("pickupPostalCode", "body", m.PickupPostalCode); err != nil { - return err - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateProGearWeightTickets(formats strfmt.Registry) error { if swag.IsZero(m.ProGearWeightTickets) { // not required return nil @@ -616,18 +546,6 @@ func (m *PPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registr return nil } -func (m *PPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { if swag.IsZero(m.SecondaryPickupAddress) { // not required return nil @@ -647,18 +565,6 @@ func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) er return nil } -func (m *PPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index 3cb95fc1eac..4aa8b3c5bb1 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -3400,6 +3400,8 @@ func init() { "AIR_FORCE", "COAST_GUARD", "SPACE_FORCE", + "NAVY_AND_MARINES", + "AIR_AND_SPACE_FORCE", "OTHER" ], "x-display-value": { @@ -3543,9 +3545,7 @@ func init() { "description": "A personally procured move is a type of shipment that a service members moves themselves.", "required": [ "expectedDepartureDate", - "pickupPostalCode", "pickupAddress", - "destinationPostalCode", "destinationAddress", "sitExpected" ], @@ -3553,13 +3553,6 @@ func init() { "destinationAddress": { "$ref": "#/definitions/Address" }, - "destinationPostalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "expectedDepartureDate": { "description": "Date the customer expects to move.\n", "type": "string", @@ -3568,34 +3561,12 @@ func init() { "pickupAddress": { "$ref": "#/definitions/Address" }, - "pickupPostalCode": { - "description": "zip code", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "secondaryDestinationAddress": { "$ref": "#/definitions/Address" }, - "secondaryDestinationPostalCode": { - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "$ref": "#/definitions/NullableString", - "example": "90210" - }, "secondaryPickupAddress": { "$ref": "#/definitions/Address" }, - "secondaryPickupPostalCode": { - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "$ref": "#/definitions/NullableString", - "example": "90210" - }, "sitExpected": { "type": "boolean" } @@ -5152,15 +5123,6 @@ func init() { ], "x-nullable": true }, - "NullableString": { - "type": "string", - "x-go-type": { - "import": { - "package": "github.com/transcom/mymove/pkg/swagger/nullable" - }, - "type": "String" - } - }, "OfficeUser": { "type": "object", "properties": { @@ -5602,8 +5564,6 @@ func init() { "createdAt", "status", "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "eTag" ], @@ -5668,14 +5628,6 @@ func init() { "destinationAddress": { "$ref": "#/definitions/Address" }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "eTag": { "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", "type": "string", @@ -5753,14 +5705,6 @@ func init() { "pickupAddress": { "$ref": "#/definitions/Address" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member.", "type": "integer", @@ -5794,16 +5738,6 @@ func init() { } ] }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "secondaryPickupAddress": { "allOf": [ { @@ -5817,15 +5751,6 @@ func init() { } ] }, - "secondaryPickupPostalCode": { - "type": "string", - "format": "An optional secondary pickup location near the origin where additional goods exist.", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "shipmentId": { "description": "The id of the parent MTOShipment object", "type": "string", @@ -6886,14 +6811,6 @@ func init() { "destinationAddress": { "$ref": "#/definitions/Address" }, - "destinationPostalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "estimatedWeight": { "type": "integer", "x-nullable": true, @@ -6941,15 +6858,6 @@ func init() { "pickupAddress": { "$ref": "#/definitions/Address" }, - "pickupPostalCode": { - "description": "zip code", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "proGearWeight": { "type": "integer", "x-nullable": true @@ -6957,23 +6865,9 @@ func init() { "secondaryDestinationAddress": { "$ref": "#/definitions/Address" }, - "secondaryDestinationPostalCode": { - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "$ref": "#/definitions/NullableString", - "example": "90210" - }, "secondaryPickupAddress": { "$ref": "#/definitions/Address" }, - "secondaryPickupPostalCode": { - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "$ref": "#/definitions/NullableString", - "example": "90210" - }, "sitExpected": { "type": "boolean", "x-nullable": true @@ -11457,6 +11351,8 @@ func init() { "AIR_FORCE", "COAST_GUARD", "SPACE_FORCE", + "NAVY_AND_MARINES", + "AIR_AND_SPACE_FORCE", "OTHER" ], "x-display-value": { @@ -11600,9 +11496,7 @@ func init() { "description": "A personally procured move is a type of shipment that a service members moves themselves.", "required": [ "expectedDepartureDate", - "pickupPostalCode", "pickupAddress", - "destinationPostalCode", "destinationAddress", "sitExpected" ], @@ -11610,13 +11504,6 @@ func init() { "destinationAddress": { "$ref": "#/definitions/Address" }, - "destinationPostalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "expectedDepartureDate": { "description": "Date the customer expects to move.\n", "type": "string", @@ -11625,34 +11512,12 @@ func init() { "pickupAddress": { "$ref": "#/definitions/Address" }, - "pickupPostalCode": { - "description": "zip code", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "secondaryDestinationAddress": { "$ref": "#/definitions/Address" }, - "secondaryDestinationPostalCode": { - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "$ref": "#/definitions/NullableString", - "example": "90210" - }, "secondaryPickupAddress": { "$ref": "#/definitions/Address" }, - "secondaryPickupPostalCode": { - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "$ref": "#/definitions/NullableString", - "example": "90210" - }, "sitExpected": { "type": "boolean" } @@ -13213,15 +13078,6 @@ func init() { ], "x-nullable": true }, - "NullableString": { - "type": "string", - "x-go-type": { - "import": { - "package": "github.com/transcom/mymove/pkg/swagger/nullable" - }, - "type": "String" - } - }, "OfficeUser": { "type": "object", "properties": { @@ -13663,8 +13519,6 @@ func init() { "createdAt", "status", "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "eTag" ], @@ -13729,14 +13583,6 @@ func init() { "destinationAddress": { "$ref": "#/definitions/Address" }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "eTag": { "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", "type": "string", @@ -13814,14 +13660,6 @@ func init() { "pickupAddress": { "$ref": "#/definitions/Address" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member.", "type": "integer", @@ -13855,16 +13693,6 @@ func init() { } ] }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "secondaryPickupAddress": { "allOf": [ { @@ -13878,15 +13706,6 @@ func init() { } ] }, - "secondaryPickupPostalCode": { - "type": "string", - "format": "An optional secondary pickup location near the origin where additional goods exist.", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "shipmentId": { "description": "The id of the parent MTOShipment object", "type": "string", @@ -14949,14 +14768,6 @@ func init() { "destinationAddress": { "$ref": "#/definitions/Address" }, - "destinationPostalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "estimatedWeight": { "type": "integer", "x-nullable": true, @@ -15004,15 +14815,6 @@ func init() { "pickupAddress": { "$ref": "#/definitions/Address" }, - "pickupPostalCode": { - "description": "zip code", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "proGearWeight": { "type": "integer", "x-nullable": true @@ -15020,23 +14822,9 @@ func init() { "secondaryDestinationAddress": { "$ref": "#/definitions/Address" }, - "secondaryDestinationPostalCode": { - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "$ref": "#/definitions/NullableString", - "example": "90210" - }, "secondaryPickupAddress": { "$ref": "#/definitions/Address" }, - "secondaryPickupPostalCode": { - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "$ref": "#/definitions/NullableString", - "example": "90210" - }, "sitExpected": { "type": "boolean", "x-nullable": true diff --git a/pkg/gen/internalmessages/affiliation.go b/pkg/gen/internalmessages/affiliation.go index e11eb358927..b690b577a51 100644 --- a/pkg/gen/internalmessages/affiliation.go +++ b/pkg/gen/internalmessages/affiliation.go @@ -50,6 +50,12 @@ const ( // AffiliationSPACEFORCE captures enum value "SPACE_FORCE" AffiliationSPACEFORCE Affiliation = "SPACE_FORCE" + // AffiliationNAVYANDMARINES captures enum value "NAVY_AND_MARINES" + AffiliationNAVYANDMARINES Affiliation = "NAVY_AND_MARINES" + + // AffiliationAIRANDSPACEFORCE captures enum value "AIR_AND_SPACE_FORCE" + AffiliationAIRANDSPACEFORCE Affiliation = "AIR_AND_SPACE_FORCE" + // AffiliationOTHER captures enum value "OTHER" AffiliationOTHER Affiliation = "OTHER" ) @@ -59,7 +65,7 @@ var affiliationEnum []interface{} func init() { var res []Affiliation - if err := json.Unmarshal([]byte(`["ARMY","NAVY","MARINES","AIR_FORCE","COAST_GUARD","SPACE_FORCE","OTHER"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ARMY","NAVY","MARINES","AIR_FORCE","COAST_GUARD","SPACE_FORCE","NAVY_AND_MARINES","AIR_AND_SPACE_FORCE","OTHER"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/gen/internalmessages/create_p_p_m_shipment.go b/pkg/gen/internalmessages/create_p_p_m_shipment.go index 14f08a9e275..811ad0c10bc 100644 --- a/pkg/gen/internalmessages/create_p_p_m_shipment.go +++ b/pkg/gen/internalmessages/create_p_p_m_shipment.go @@ -12,7 +12,6 @@ import ( "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" - "github.com/transcom/mymove/pkg/swagger/nullable" ) // CreatePPMShipment A personally procured move is a type of shipment that a service members moves themselves. @@ -24,12 +23,6 @@ type CreatePPMShipment struct { // Required: true DestinationAddress *Address `json:"destinationAddress"` - // ZIP - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode"` - // Date the customer expects to move. // // Required: true @@ -40,28 +33,12 @@ type CreatePPMShipment struct { // Required: true PickupAddress *Address `json:"pickupAddress"` - // ZIP - // - // zip code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode"` - // secondary destination address SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` - // ZIP - // Example: 90210 - SecondaryDestinationPostalCode nullable.String `json:"secondaryDestinationPostalCode,omitempty"` - // secondary pickup address SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - // ZIP - // Example: 90210 - SecondaryPickupPostalCode nullable.String `json:"secondaryPickupPostalCode,omitempty"` - // sit expected // Required: true SitExpected *bool `json:"sitExpected"` @@ -75,10 +52,6 @@ func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateExpectedDepartureDate(formats); err != nil { res = append(res, err) } @@ -87,26 +60,14 @@ func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateSecondaryDestinationAddress(formats); err != nil { res = append(res, err) } - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateSecondaryPickupAddress(formats); err != nil { res = append(res, err) } - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateSitExpected(formats); err != nil { res = append(res, err) } @@ -137,19 +98,6 @@ func (m *CreatePPMShipment) validateDestinationAddress(formats strfmt.Registry) return nil } -func (m *CreatePPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("destinationPostalCode", "body", m.DestinationPostalCode); err != nil { - return err - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *CreatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { @@ -183,19 +131,6 @@ func (m *CreatePPMShipment) validatePickupAddress(formats strfmt.Registry) error return nil } -func (m *CreatePPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("pickupPostalCode", "body", m.PickupPostalCode); err != nil { - return err - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *CreatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { if swag.IsZero(m.SecondaryDestinationAddress) { // not required return nil @@ -215,23 +150,6 @@ func (m *CreatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.R return nil } -func (m *CreatePPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := m.SecondaryDestinationPostalCode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationPostalCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationPostalCode") - } - return err - } - - return nil -} - func (m *CreatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { if swag.IsZero(m.SecondaryPickupAddress) { // not required return nil @@ -251,23 +169,6 @@ func (m *CreatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Regist return nil } -func (m *CreatePPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := m.SecondaryPickupPostalCode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupPostalCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupPostalCode") - } - return err - } - - return nil -} - func (m *CreatePPMShipment) validateSitExpected(formats strfmt.Registry) error { if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { @@ -293,18 +194,10 @@ func (m *CreatePPMShipment) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } - if err := m.contextValidateSecondaryDestinationPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateSecondaryPickupPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -366,24 +259,6 @@ func (m *CreatePPMShipment) contextValidateSecondaryDestinationAddress(ctx conte return nil } -func (m *CreatePPMShipment) contextValidateSecondaryDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := m.SecondaryDestinationPostalCode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationPostalCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationPostalCode") - } - return err - } - - return nil -} - func (m *CreatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { if m.SecondaryPickupAddress != nil { @@ -405,24 +280,6 @@ func (m *CreatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Co return nil } -func (m *CreatePPMShipment) contextValidateSecondaryPickupPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := m.SecondaryPickupPostalCode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupPostalCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupPostalCode") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *CreatePPMShipment) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/gen/internalmessages/p_p_m_shipment.go b/pkg/gen/internalmessages/p_p_m_shipment.go index 692a9e3c5ac..13f857d1724 100644 --- a/pkg/gen/internalmessages/p_p_m_shipment.go +++ b/pkg/gen/internalmessages/p_p_m_shipment.go @@ -64,14 +64,6 @@ type PPMShipment struct { // destination address DestinationAddress *Address `json:"destinationAddress,omitempty"` - // ZIP - // - // The postal code of the destination location where goods are being delivered to. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode"` - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. // Required: true // Read Only: true @@ -126,14 +118,6 @@ type PPMShipment struct { // pickup address PickupAddress *Address `json:"pickupAddress,omitempty"` - // ZIP - // - // The postal code of the origin location where goods are being moved from. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode"` - // The estimated weight of the pro-gear being moved belonging to the service member. ProGearWeight *int64 `json:"proGearWeight"` @@ -147,21 +131,9 @@ type PPMShipment struct { // secondary destination address SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` - // ZIP - // - // An optional secondary location near the destination where goods will be dropped off. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode"` - // secondary pickup address SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - // ZIP - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode"` - // The id of the parent MTOShipment object // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 // Required: true @@ -252,10 +224,6 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateETag(formats); err != nil { res = append(res, err) } @@ -276,10 +244,6 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateProGearWeightTickets(formats); err != nil { res = append(res, err) } @@ -292,18 +256,10 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateSecondaryPickupAddress(formats); err != nil { res = append(res, err) } - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateShipmentID(formats); err != nil { res = append(res, err) } @@ -453,19 +409,6 @@ func (m *PPMShipment) validateDestinationAddress(formats strfmt.Registry) error return nil } -func (m *PPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("destinationPostalCode", "body", m.DestinationPostalCode); err != nil { - return err - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateETag(formats strfmt.Registry) error { if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { @@ -546,19 +489,6 @@ func (m *PPMShipment) validatePickupAddress(formats strfmt.Registry) error { return nil } -func (m *PPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("pickupPostalCode", "body", m.PickupPostalCode); err != nil { - return err - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateProGearWeightTickets(formats strfmt.Registry) error { if swag.IsZero(m.ProGearWeightTickets) { // not required return nil @@ -616,18 +546,6 @@ func (m *PPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registr return nil } -func (m *PPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { if swag.IsZero(m.SecondaryPickupAddress) { // not required return nil @@ -647,18 +565,6 @@ func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) er return nil } -func (m *PPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { diff --git a/pkg/gen/internalmessages/update_p_p_m_shipment.go b/pkg/gen/internalmessages/update_p_p_m_shipment.go index 065e99f219a..b829fc767e6 100644 --- a/pkg/gen/internalmessages/update_p_p_m_shipment.go +++ b/pkg/gen/internalmessages/update_p_p_m_shipment.go @@ -12,7 +12,6 @@ import ( "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" - "github.com/transcom/mymove/pkg/swagger/nullable" ) // UpdatePPMShipment update p p m shipment @@ -51,11 +50,6 @@ type UpdatePPMShipment struct { // destination address DestinationAddress *Address `json:"destinationAddress,omitempty"` - // ZIP - // Example: 90210 - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode,omitempty"` - // estimated weight // Example: 4200 EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` @@ -91,30 +85,15 @@ type UpdatePPMShipment struct { // pickup address PickupAddress *Address `json:"pickupAddress,omitempty"` - // ZIP - // - // zip code - // Example: 90210 - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode,omitempty"` - // pro gear weight ProGearWeight *int64 `json:"proGearWeight,omitempty"` // secondary destination address SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` - // ZIP - // Example: 90210 - SecondaryDestinationPostalCode nullable.String `json:"secondaryDestinationPostalCode,omitempty"` - // secondary pickup address SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - // ZIP - // Example: 90210 - SecondaryPickupPostalCode nullable.String `json:"secondaryPickupPostalCode,omitempty"` - // sit expected SitExpected *bool `json:"sitExpected,omitempty"` @@ -145,10 +124,6 @@ func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateExpectedDepartureDate(formats); err != nil { res = append(res, err) } @@ -157,26 +132,14 @@ func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateSecondaryDestinationAddress(formats); err != nil { res = append(res, err) } - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateSecondaryPickupAddress(formats); err != nil { res = append(res, err) } - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateW2Address(formats); err != nil { res = append(res, err) } @@ -242,18 +205,6 @@ func (m *UpdatePPMShipment) validateDestinationAddress(formats strfmt.Registry) return nil } -func (m *UpdatePPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { if swag.IsZero(m.ExpectedDepartureDate) { // not required return nil @@ -285,18 +236,6 @@ func (m *UpdatePPMShipment) validatePickupAddress(formats strfmt.Registry) error return nil } -func (m *UpdatePPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.PickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *UpdatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { if swag.IsZero(m.SecondaryDestinationAddress) { // not required return nil @@ -316,23 +255,6 @@ func (m *UpdatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.R return nil } -func (m *UpdatePPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := m.SecondaryDestinationPostalCode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationPostalCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationPostalCode") - } - return err - } - - return nil -} - func (m *UpdatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { if swag.IsZero(m.SecondaryPickupAddress) { // not required return nil @@ -352,23 +274,6 @@ func (m *UpdatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Regist return nil } -func (m *UpdatePPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := m.SecondaryPickupPostalCode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupPostalCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupPostalCode") - } - return err - } - - return nil -} - func (m *UpdatePPMShipment) validateW2Address(formats strfmt.Registry) error { if swag.IsZero(m.W2Address) { // not required return nil @@ -408,18 +313,10 @@ func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } - if err := m.contextValidateSecondaryDestinationPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateSecondaryPickupPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateW2Address(ctx, formats); err != nil { res = append(res, err) } @@ -502,24 +399,6 @@ func (m *UpdatePPMShipment) contextValidateSecondaryDestinationAddress(ctx conte return nil } -func (m *UpdatePPMShipment) contextValidateSecondaryDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := m.SecondaryDestinationPostalCode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationPostalCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationPostalCode") - } - return err - } - - return nil -} - func (m *UpdatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { if m.SecondaryPickupAddress != nil { @@ -541,24 +420,6 @@ func (m *UpdatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Co return nil } -func (m *UpdatePPMShipment) contextValidateSecondaryPickupPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := m.SecondaryPickupPostalCode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupPostalCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupPostalCode") - } - return err - } - - return nil -} - func (m *UpdatePPMShipment) contextValidateW2Address(ctx context.Context, formats strfmt.Registry) error { if m.W2Address != nil { diff --git a/pkg/gen/ordersapi/embedded_spec.go b/pkg/gen/ordersapi/embedded_spec.go index 150039d2a4e..534e49ef2ac 100644 --- a/pkg/gen/ordersapi/embedded_spec.go +++ b/pkg/gen/ordersapi/embedded_spec.go @@ -338,6 +338,8 @@ func init() { "AIR_FORCE", "COAST_GUARD", "SPACE_FORCE", + "NAVY_AND_MARINES", + "AIR_AND_SPACE_FORCE", "OTHER" ], "x-display-value": { @@ -1019,6 +1021,8 @@ func init() { "AIR_FORCE", "COAST_GUARD", "SPACE_FORCE", + "NAVY_AND_MARINES", + "AIR_AND_SPACE_FORCE", "OTHER" ], "x-display-value": { diff --git a/pkg/gen/ordersmessages/affiliation.go b/pkg/gen/ordersmessages/affiliation.go index ef3b6d46e03..b0a1230d255 100644 --- a/pkg/gen/ordersmessages/affiliation.go +++ b/pkg/gen/ordersmessages/affiliation.go @@ -50,6 +50,12 @@ const ( // AffiliationSPACEFORCE captures enum value "SPACE_FORCE" AffiliationSPACEFORCE Affiliation = "SPACE_FORCE" + // AffiliationNAVYANDMARINES captures enum value "NAVY_AND_MARINES" + AffiliationNAVYANDMARINES Affiliation = "NAVY_AND_MARINES" + + // AffiliationAIRANDSPACEFORCE captures enum value "AIR_AND_SPACE_FORCE" + AffiliationAIRANDSPACEFORCE Affiliation = "AIR_AND_SPACE_FORCE" + // AffiliationOTHER captures enum value "OTHER" AffiliationOTHER Affiliation = "OTHER" ) @@ -59,7 +65,7 @@ var affiliationEnum []interface{} func init() { var res []Affiliation - if err := json.Unmarshal([]byte(`["ARMY","NAVY","MARINES","AIR_FORCE","COAST_GUARD","SPACE_FORCE","OTHER"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ARMY","NAVY","MARINES","AIR_FORCE","COAST_GUARD","SPACE_FORCE","NAVY_AND_MARINES","AIR_AND_SPACE_FORCE","OTHER"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index 027ed86d4f5..6ebb26b7469 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -555,11 +555,9 @@ func init() { "value": { "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", "ppmShipment": { - "destinationPostalCode": "10001", "estimatedWeight": 4999, "expectedDepartureDate": "2022-10-01", "hasProGear": false, - "pickupPostalCode": "90210", "sitExpected": false }, "shipmentType": "PPM" @@ -1736,20 +1734,18 @@ func init() { "type": "object", "required": [ "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "estimatedWeight", "hasProGear" ], "properties": { - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "estimatedWeight": { "description": "The estimated weight of the PPM shipment goods being moved in pounds.", @@ -1765,36 +1761,19 @@ func init() { "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", "type": "boolean" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "example": "90210" + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", "x-nullable": true }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "sitEstimatedDepartureDate": { "description": "The date that goods will exit the storage location.", "type": "string", @@ -3160,8 +3139,6 @@ func init() { "createdAt", "status", "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "eTag" ], @@ -3220,13 +3197,6 @@ func init() { "format": "date-time", "readOnly": true }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "eTag": { "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", "type": "string", @@ -3276,14 +3246,6 @@ func init() { "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", @@ -3297,24 +3259,6 @@ func init() { "x-nullable": true, "x-omitempty": false }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "shipmentId": { "description": "The id of the parent MTOShipment record", "type": "string", @@ -4468,15 +4412,6 @@ func init() { "description": "The PPM specific fields of the shipment with values being changed", "type": "object", "properties": { - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "estimatedWeight": { "description": "The estimated weight of the PPM shipment goods being moved.", "type": "integer", @@ -4494,35 +4429,11 @@ func init() { "type": "boolean", "x-nullable": true }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member.", "type": "integer", "x-nullable": true }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "sitEstimatedDepartureDate": { "description": "The date that goods will exit the storage location.", "type": "string", @@ -5455,11 +5366,9 @@ func init() { "value": { "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", "ppmShipment": { - "destinationPostalCode": "10001", "estimatedWeight": 4999, "expectedDepartureDate": "2022-10-01", "hasProGear": false, - "pickupPostalCode": "90210", "sitExpected": false }, "shipmentType": "PPM" @@ -6923,20 +6832,18 @@ func init() { "type": "object", "required": [ "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "estimatedWeight", "hasProGear" ], "properties": { - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "estimatedWeight": { "description": "The estimated weight of the PPM shipment goods being moved in pounds.", @@ -6952,36 +6859,19 @@ func init() { "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", "type": "boolean" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "example": "90210" + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", "x-nullable": true }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "sitEstimatedDepartureDate": { "description": "The date that goods will exit the storage location.", "type": "string", @@ -8347,8 +8237,6 @@ func init() { "createdAt", "status", "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "eTag" ], @@ -8407,13 +8295,6 @@ func init() { "format": "date-time", "readOnly": true }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "eTag": { "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", "type": "string", @@ -8463,14 +8344,6 @@ func init() { "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", @@ -8484,24 +8357,6 @@ func init() { "x-nullable": true, "x-omitempty": false }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "shipmentId": { "description": "The id of the parent MTOShipment record", "type": "string", @@ -9660,15 +9515,6 @@ func init() { "description": "The PPM specific fields of the shipment with values being changed", "type": "object", "properties": { - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "estimatedWeight": { "description": "The estimated weight of the PPM shipment goods being moved.", "type": "integer", @@ -9686,35 +9532,11 @@ func init() { "type": "boolean", "x-nullable": true }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member.", "type": "integer", "x-nullable": true }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "sitEstimatedDepartureDate": { "description": "The date that goods will exit the storage location.", "type": "string", diff --git a/pkg/gen/primemessages/create_p_p_m_shipment.go b/pkg/gen/primemessages/create_p_p_m_shipment.go index 177ddfe4f63..2a9ea5931f0 100644 --- a/pkg/gen/primemessages/create_p_p_m_shipment.go +++ b/pkg/gen/primemessages/create_p_p_m_shipment.go @@ -19,13 +19,10 @@ import ( // swagger:model CreatePPMShipment type CreatePPMShipment struct { - // ZIP - // - // The postal code of the destination location where goods are being delivered to. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode"` + // The address of the destination location where goods are being delivered to. + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` // The estimated weight of the PPM shipment goods being moved in pounds. // Example: 4200 @@ -43,29 +40,14 @@ type CreatePPMShipment struct { // Required: true HasProGear *bool `json:"hasProGear"` - // The postal code of the origin location where goods are being moved from. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode"` + // The address of the origin location where goods are being moved from. + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` // The estimated weight of the pro-gear being moved belonging to the service member in pounds. ProGearWeight *int64 `json:"proGearWeight,omitempty"` - // ZIP - // - // An optional secondary location near the destination where goods will be dropped off. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode,omitempty"` - - // ZIP - // - // An optional secondary pickup location near the origin where additional goods exist. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode,omitempty"` - // The date that goods will exit the storage location. // Format: date SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` @@ -96,7 +78,7 @@ type CreatePPMShipment struct { func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateDestinationPostalCode(formats); err != nil { + if err := m.validateDestinationAddress(formats); err != nil { res = append(res, err) } @@ -112,15 +94,7 @@ func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { + if err := m.validatePickupAddress(formats); err != nil { res = append(res, err) } @@ -146,14 +120,9 @@ func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { return nil } -func (m *CreatePPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("destinationPostalCode", "body", m.DestinationPostalCode); err != nil { - return err - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err +func (m *CreatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil } return nil @@ -190,40 +159,11 @@ func (m *CreatePPMShipment) validateHasProGear(formats strfmt.Registry) error { return nil } -func (m *CreatePPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("pickupPostalCode", "body", m.PickupPostalCode); err != nil { - return err - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required +func (m *CreatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required return nil } - if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - return nil } @@ -283,6 +223,14 @@ func (m *CreatePPMShipment) validateSitLocation(formats strfmt.Registry) error { func (m *CreatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateSitLocation(ctx, formats); err != nil { res = append(res, err) } @@ -293,6 +241,16 @@ func (m *CreatePPMShipment) ContextValidate(ctx context.Context, formats strfmt. return nil } +func (m *CreatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + func (m *CreatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { if m.SitLocation != nil { diff --git a/pkg/gen/primemessages/p_p_m_shipment.go b/pkg/gen/primemessages/p_p_m_shipment.go index d570894e213..81d9c66bbac 100644 --- a/pkg/gen/primemessages/p_p_m_shipment.go +++ b/pkg/gen/primemessages/p_p_m_shipment.go @@ -57,12 +57,6 @@ type PPMShipment struct { // Format: date-time CreatedAt strfmt.DateTime `json:"createdAt"` - // The postal code of the destination location where goods are being delivered to. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode"` - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. // Required: true // Read Only: true @@ -100,14 +94,6 @@ type PPMShipment struct { // Format: uuid ID strfmt.UUID `json:"id"` - // ZIP - // - // The postal code of the origin location where goods are being moved from. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode"` - // The estimated weight of the pro-gear being moved belonging to the service member in pounds. ProGearWeight *int64 `json:"proGearWeight"` @@ -115,16 +101,6 @@ type PPMShipment struct { // Format: date-time ReviewedAt *strfmt.DateTime `json:"reviewedAt"` - // An optional secondary location near the destination where goods will be dropped off. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode"` - - // An optional secondary pickup location near the origin where additional goods exist. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode"` - // The id of the parent MTOShipment record // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 // Required: true @@ -198,10 +174,6 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateETag(formats); err != nil { res = append(res, err) } @@ -214,22 +186,10 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateReviewedAt(formats); err != nil { res = append(res, err) } - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateShipmentID(formats); err != nil { res = append(res, err) } @@ -329,19 +289,6 @@ func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { return nil } -func (m *PPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("destinationPostalCode", "body", m.DestinationPostalCode); err != nil { - return err - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateETag(formats strfmt.Registry) error { if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { @@ -377,19 +324,6 @@ func (m *PPMShipment) validateID(formats strfmt.Registry) error { return nil } -func (m *PPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("pickupPostalCode", "body", m.PickupPostalCode); err != nil { - return err - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { if swag.IsZero(m.ReviewedAt) { // not required return nil @@ -402,30 +336,6 @@ func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { return nil } -func (m *PPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { diff --git a/pkg/gen/primemessages/update_p_p_m_shipment.go b/pkg/gen/primemessages/update_p_p_m_shipment.go index 7bbf4565e6f..4bd3bb16544 100644 --- a/pkg/gen/primemessages/update_p_p_m_shipment.go +++ b/pkg/gen/primemessages/update_p_p_m_shipment.go @@ -19,13 +19,6 @@ import ( // swagger:model UpdatePPMShipment type UpdatePPMShipment struct { - // ZIP - // - // The postal code of the destination location where goods are being delivered to. - // Example: 90210 - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode,omitempty"` - // The estimated weight of the PPM shipment goods being moved. // Example: 4200 EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` @@ -39,24 +32,9 @@ type UpdatePPMShipment struct { // HasProGear *bool `json:"hasProGear,omitempty"` - // The postal code of the origin location where goods are being moved from. - // Example: 90210 - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode,omitempty"` - // The estimated weight of the pro-gear being moved belonging to the service member. ProGearWeight *int64 `json:"proGearWeight,omitempty"` - // An optional secondary location near the destination where goods will be dropped off. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode,omitempty"` - - // An optional secondary pickup location near the origin where additional goods exist. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode,omitempty"` - // The date that goods will exit the storage location. // Format: date SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` @@ -86,26 +64,10 @@ type UpdatePPMShipment struct { func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateExpectedDepartureDate(formats); err != nil { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { res = append(res, err) } @@ -124,18 +86,6 @@ func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { return nil } -func (m *UpdatePPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { if swag.IsZero(m.ExpectedDepartureDate) { // not required return nil @@ -148,42 +98,6 @@ func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registr return nil } -func (m *UpdatePPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.PickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { if swag.IsZero(m.SitEstimatedDepartureDate) { // not required return nil diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index fd7198f9eac..f673e2db80f 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -154,11 +154,9 @@ func init() { "value": { "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", "ppmShipment": { - "destinationPostalCode": "10001", "estimatedWeight": 4999, "expectedDepartureDate": "2022-10-01", "hasProGear": false, - "pickupPostalCode": "90210", "sitExpected": false }, "shipmentType": "PPM" @@ -614,20 +612,18 @@ func init() { "type": "object", "required": [ "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "estimatedWeight", "hasProGear" ], "properties": { - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "estimatedWeight": { "description": "The estimated weight of the PPM shipment goods being moved in pounds.", @@ -643,36 +639,19 @@ func init() { "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", "type": "boolean" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "example": "90210" + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", "x-nullable": true }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "sitEstimatedDepartureDate": { "description": "The date that goods will exit the storage location.", "type": "string", @@ -1930,8 +1909,6 @@ func init() { "createdAt", "status", "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "eTag" ], @@ -1990,13 +1967,6 @@ func init() { "format": "date-time", "readOnly": true }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "eTag": { "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", "type": "string", @@ -2046,14 +2016,6 @@ func init() { "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", @@ -2067,24 +2029,6 @@ func init() { "x-nullable": true, "x-omitempty": false }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "shipmentId": { "description": "The id of the parent MTOShipment record", "type": "string", @@ -3202,15 +3146,6 @@ func init() { "description": "The PPM specific fields of the shipment with values being changed", "type": "object", "properties": { - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "estimatedWeight": { "description": "The estimated weight of the PPM shipment goods being moved.", "type": "integer", @@ -3228,35 +3163,11 @@ func init() { "type": "boolean", "x-nullable": true }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member.", "type": "integer", "x-nullable": true }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "sitEstimatedDepartureDate": { "description": "The date that goods will exit the storage location.", "type": "string", @@ -3630,11 +3541,9 @@ func init() { "value": { "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", "ppmShipment": { - "destinationPostalCode": "10001", "estimatedWeight": 4999, "expectedDepartureDate": "2022-10-01", "hasProGear": false, - "pickupPostalCode": "90210", "sitExpected": false }, "shipmentType": "PPM" @@ -4127,20 +4036,18 @@ func init() { "type": "object", "required": [ "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "estimatedWeight", "hasProGear" ], "properties": { - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "estimatedWeight": { "description": "The estimated weight of the PPM shipment goods being moved in pounds.", @@ -4156,36 +4063,19 @@ func init() { "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", "type": "boolean" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "example": "90210" + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", "x-nullable": true }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "sitEstimatedDepartureDate": { "description": "The date that goods will exit the storage location.", "type": "string", @@ -5443,8 +5333,6 @@ func init() { "createdAt", "status", "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", "sitExpected", "eTag" ], @@ -5503,13 +5391,6 @@ func init() { "format": "date-time", "readOnly": true }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "eTag": { "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", "type": "string", @@ -5559,14 +5440,6 @@ func init() { "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", @@ -5580,24 +5453,6 @@ func init() { "x-nullable": true, "x-omitempty": false }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, "shipmentId": { "description": "The id of the parent MTOShipment record", "type": "string", @@ -6717,15 +6572,6 @@ func init() { "description": "The PPM specific fields of the shipment with values being changed", "type": "object", "properties": { - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "estimatedWeight": { "description": "The estimated weight of the PPM shipment goods being moved.", "type": "integer", @@ -6743,35 +6589,11 @@ func init() { "type": "boolean", "x-nullable": true }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "proGearWeight": { "description": "The estimated weight of the pro-gear being moved belonging to the service member.", "type": "integer", "x-nullable": true }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, "sitEstimatedDepartureDate": { "description": "The date that goods will exit the storage location.", "type": "string", diff --git a/pkg/gen/primev2messages/create_p_p_m_shipment.go b/pkg/gen/primev2messages/create_p_p_m_shipment.go index 83dcda2af1c..4d7546f7d8d 100644 --- a/pkg/gen/primev2messages/create_p_p_m_shipment.go +++ b/pkg/gen/primev2messages/create_p_p_m_shipment.go @@ -19,13 +19,10 @@ import ( // swagger:model CreatePPMShipment type CreatePPMShipment struct { - // ZIP - // - // The postal code of the destination location where goods are being delivered to. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode"` + // The address of the destination location where goods are being delivered to. + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` // The estimated weight of the PPM shipment goods being moved in pounds. // Example: 4200 @@ -43,29 +40,14 @@ type CreatePPMShipment struct { // Required: true HasProGear *bool `json:"hasProGear"` - // The postal code of the origin location where goods are being moved from. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode"` + // The address of the origin location where goods are being moved from. + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` // The estimated weight of the pro-gear being moved belonging to the service member in pounds. ProGearWeight *int64 `json:"proGearWeight,omitempty"` - // ZIP - // - // An optional secondary location near the destination where goods will be dropped off. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode,omitempty"` - - // ZIP - // - // An optional secondary pickup location near the origin where additional goods exist. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode,omitempty"` - // The date that goods will exit the storage location. // Format: date SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` @@ -96,7 +78,7 @@ type CreatePPMShipment struct { func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateDestinationPostalCode(formats); err != nil { + if err := m.validateDestinationAddress(formats); err != nil { res = append(res, err) } @@ -112,15 +94,7 @@ func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { + if err := m.validatePickupAddress(formats); err != nil { res = append(res, err) } @@ -146,14 +120,9 @@ func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { return nil } -func (m *CreatePPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("destinationPostalCode", "body", m.DestinationPostalCode); err != nil { - return err - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err +func (m *CreatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil } return nil @@ -190,40 +159,11 @@ func (m *CreatePPMShipment) validateHasProGear(formats strfmt.Registry) error { return nil } -func (m *CreatePPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("pickupPostalCode", "body", m.PickupPostalCode); err != nil { - return err - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required +func (m *CreatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required return nil } - if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - return nil } @@ -283,6 +223,14 @@ func (m *CreatePPMShipment) validateSitLocation(formats strfmt.Registry) error { func (m *CreatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateSitLocation(ctx, formats); err != nil { res = append(res, err) } @@ -293,6 +241,16 @@ func (m *CreatePPMShipment) ContextValidate(ctx context.Context, formats strfmt. return nil } +func (m *CreatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + func (m *CreatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { if m.SitLocation != nil { diff --git a/pkg/gen/primev2messages/p_p_m_shipment.go b/pkg/gen/primev2messages/p_p_m_shipment.go index 6ae1047655b..4f6e73fb841 100644 --- a/pkg/gen/primev2messages/p_p_m_shipment.go +++ b/pkg/gen/primev2messages/p_p_m_shipment.go @@ -57,12 +57,6 @@ type PPMShipment struct { // Format: date-time CreatedAt strfmt.DateTime `json:"createdAt"` - // The postal code of the destination location where goods are being delivered to. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode"` - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. // Required: true // Read Only: true @@ -100,14 +94,6 @@ type PPMShipment struct { // Format: uuid ID strfmt.UUID `json:"id"` - // ZIP - // - // The postal code of the origin location where goods are being moved from. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode"` - // The estimated weight of the pro-gear being moved belonging to the service member in pounds. ProGearWeight *int64 `json:"proGearWeight"` @@ -115,16 +101,6 @@ type PPMShipment struct { // Format: date-time ReviewedAt *strfmt.DateTime `json:"reviewedAt"` - // An optional secondary location near the destination where goods will be dropped off. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode"` - - // An optional secondary pickup location near the origin where additional goods exist. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode"` - // The id of the parent MTOShipment record // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 // Required: true @@ -198,10 +174,6 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateETag(formats); err != nil { res = append(res, err) } @@ -214,22 +186,10 @@ func (m *PPMShipment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateReviewedAt(formats); err != nil { res = append(res, err) } - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateShipmentID(formats); err != nil { res = append(res, err) } @@ -329,19 +289,6 @@ func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { return nil } -func (m *PPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("destinationPostalCode", "body", m.DestinationPostalCode); err != nil { - return err - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateETag(formats strfmt.Registry) error { if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { @@ -377,19 +324,6 @@ func (m *PPMShipment) validateID(formats strfmt.Registry) error { return nil } -func (m *PPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("pickupPostalCode", "body", m.PickupPostalCode); err != nil { - return err - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { if swag.IsZero(m.ReviewedAt) { // not required return nil @@ -402,30 +336,6 @@ func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { return nil } -func (m *PPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { diff --git a/pkg/gen/primev2messages/update_p_p_m_shipment.go b/pkg/gen/primev2messages/update_p_p_m_shipment.go index 9f141499060..f29a82a0502 100644 --- a/pkg/gen/primev2messages/update_p_p_m_shipment.go +++ b/pkg/gen/primev2messages/update_p_p_m_shipment.go @@ -19,13 +19,6 @@ import ( // swagger:model UpdatePPMShipment type UpdatePPMShipment struct { - // ZIP - // - // The postal code of the destination location where goods are being delivered to. - // Example: 90210 - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode,omitempty"` - // The estimated weight of the PPM shipment goods being moved. // Example: 4200 EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` @@ -39,24 +32,9 @@ type UpdatePPMShipment struct { // HasProGear *bool `json:"hasProGear,omitempty"` - // The postal code of the origin location where goods are being moved from. - // Example: 90210 - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode,omitempty"` - // The estimated weight of the pro-gear being moved belonging to the service member. ProGearWeight *int64 `json:"proGearWeight,omitempty"` - // An optional secondary location near the destination where goods will be dropped off. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode,omitempty"` - - // An optional secondary pickup location near the origin where additional goods exist. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode,omitempty"` - // The date that goods will exit the storage location. // Format: date SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` @@ -86,26 +64,10 @@ type UpdatePPMShipment struct { func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateExpectedDepartureDate(formats); err != nil { res = append(res, err) } - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { - res = append(res, err) - } - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { res = append(res, err) } @@ -124,18 +86,6 @@ func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { return nil } -func (m *UpdatePPMShipment) validateDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { if swag.IsZero(m.ExpectedDepartureDate) { // not required return nil @@ -148,42 +98,6 @@ func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registr return nil } -func (m *UpdatePPMShipment) validatePickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.PickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { if swag.IsZero(m.SitEstimatedDepartureDate) { // not required return nil diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 335da67d964..a092e25147e 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -838,15 +838,11 @@ func PPMShipment(_ storage.FileStorer, ppmShipment *models.PPMShipment) *ghcmess SubmittedAt: handlers.FmtDateTimePtr(ppmShipment.SubmittedAt), ReviewedAt: handlers.FmtDateTimePtr(ppmShipment.ReviewedAt), ApprovedAt: handlers.FmtDateTimePtr(ppmShipment.ApprovedAt), - PickupPostalCode: &ppmShipment.PickupPostalCode, - SecondaryPickupPostalCode: ppmShipment.SecondaryPickupPostalCode, + PickupAddress: Address(ppmShipment.PickupAddress), + DestinationAddress: Address(ppmShipment.DestinationAddress), ActualPickupPostalCode: ppmShipment.ActualPickupPostalCode, - DestinationPostalCode: &ppmShipment.DestinationPostalCode, - SecondaryDestinationPostalCode: ppmShipment.SecondaryDestinationPostalCode, ActualDestinationPostalCode: ppmShipment.ActualDestinationPostalCode, SitExpected: ppmShipment.SITExpected, - PickupAddress: Address(ppmShipment.PickupAddress), - DestinationAddress: Address(ppmShipment.DestinationAddress), HasSecondaryPickupAddress: ppmShipment.HasSecondaryPickupAddress, HasSecondaryDestinationAddress: ppmShipment.HasSecondaryDestinationAddress, EstimatedWeight: handlers.FmtPoundPtr(ppmShipment.EstimatedWeight), diff --git a/pkg/handlers/ghcapi/internal/payloads/payload_to_model.go b/pkg/handlers/ghcapi/internal/payloads/payload_to_model.go index 3c6270f1b06..e41881794fd 100644 --- a/pkg/handlers/ghcapi/internal/payloads/payload_to_model.go +++ b/pkg/handlers/ghcapi/internal/payloads/payload_to_model.go @@ -268,34 +268,22 @@ func PPMShipmentModelFromCreate(ppmShipment *ghcmessages.CreatePPMShipment) *mod addressModel = AddressModel(&ppmShipment.PickupAddress.Address) if addressModel != nil { model.PickupAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow. Eventually postalCode column will be dropped. - model.PickupPostalCode = addressModel.PostalCode } addressModel = AddressModel(&ppmShipment.SecondaryPickupAddress.Address) if addressModel != nil { model.SecondaryPickupAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow. Eventually postalCode column will be dropped. - model.SecondaryPickupPostalCode = &addressModel.PostalCode model.HasSecondaryPickupAddress = handlers.FmtBool(true) } addressModel = AddressModel(&ppmShipment.DestinationAddress.Address) if addressModel != nil { model.DestinationAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow. Eventually postalCode column will be dropped. - model.DestinationPostalCode = addressModel.PostalCode } addressModel = AddressModel(&ppmShipment.SecondaryDestinationAddress.Address) if addressModel != nil { model.SecondaryDestinationAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow. Eventually postalCode column will be dropped. - model.SecondaryDestinationPostalCode = &addressModel.PostalCode model.HasSecondaryDestinationAddress = handlers.FmtBool(true) } @@ -468,9 +456,6 @@ func PPMShipmentModelFromUpdate(ppmShipment *ghcmessages.UpdatePPMShipment) *mod addressModel = AddressModel(&ppmShipment.PickupAddress.Address) if addressModel != nil { model.PickupAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.PickupPostalCode = addressModel.PostalCode } addressModel = AddressModel(&ppmShipment.SecondaryPickupAddress.Address) @@ -478,17 +463,11 @@ func PPMShipmentModelFromUpdate(ppmShipment *ghcmessages.UpdatePPMShipment) *mod model.SecondaryPickupAddress = addressModel secondaryPickupAddressID := uuid.FromStringOrNil(addressModel.ID.String()) model.SecondaryPickupAddressID = &secondaryPickupAddressID - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.SecondaryPickupPostalCode = &addressModel.PostalCode } addressModel = AddressModel(&ppmShipment.DestinationAddress.Address) if addressModel != nil { model.DestinationAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.DestinationPostalCode = addressModel.PostalCode } addressModel = AddressModel(&ppmShipment.SecondaryDestinationAddress.Address) @@ -496,9 +475,6 @@ func PPMShipmentModelFromUpdate(ppmShipment *ghcmessages.UpdatePPMShipment) *mod model.SecondaryDestinationAddress = addressModel secondaryDestinationAddressID := uuid.FromStringOrNil(addressModel.ID.String()) model.SecondaryDestinationAddressID = &secondaryDestinationAddressID - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.SecondaryDestinationPostalCode = &addressModel.PostalCode } if ppmShipment.W2Address != nil { diff --git a/pkg/handlers/ghcapi/lines_of_accounting.go b/pkg/handlers/ghcapi/lines_of_accounting.go index d3fb80ea0d7..f1dc7928c04 100644 --- a/pkg/handlers/ghcapi/lines_of_accounting.go +++ b/pkg/handlers/ghcapi/lines_of_accounting.go @@ -10,6 +10,7 @@ import ( "github.com/transcom/mymove/pkg/appcontext" "github.com/transcom/mymove/pkg/apperror" linesofaccountingop "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/lines_of_accounting" + "github.com/transcom/mymove/pkg/gen/ghcmessages" "github.com/transcom/mymove/pkg/handlers" "github.com/transcom/mymove/pkg/handlers/ghcapi/internal/payloads" "github.com/transcom/mymove/pkg/models" @@ -40,6 +41,12 @@ func (h LinesOfAccountingRequestLineOfAccountingHandler) Handle(params linesofac err := apperror.NewBadDataError("Invalid request for lines of accounting: service member affiliation is nil") appCtx.Logger().Error(err.Error()) return linesofaccountingop.NewRequestLineOfAccountingBadRequest(), err + } else if *payload.ServiceMemberAffiliation == ghcmessages.AffiliationNAVYANDMARINES { + // translate the combined affiliation from the frontend into one affiliation to fetch LOA + *payload.ServiceMemberAffiliation = ghcmessages.AffiliationNAVY + } else if *payload.ServiceMemberAffiliation == ghcmessages.AffiliationAIRANDSPACEFORCE { + // translate the combined affiliation from the frontend into one affiliation to fetch LOA + *payload.ServiceMemberAffiliation = ghcmessages.AffiliationAIRFORCE } loas, err := h.LineOfAccountingFetcher.FetchLongLinesOfAccounting(models.ServiceMemberAffiliation(*payload.ServiceMemberAffiliation), time.Time(payload.OrdersIssueDate), payload.TacCode, appCtx) diff --git a/pkg/handlers/ghcapi/mto_shipment_test.go b/pkg/handlers/ghcapi/mto_shipment_test.go index dafbb4d43ee..b4558fe49c2 100644 --- a/pkg/handlers/ghcapi/mto_shipment_test.go +++ b/pkg/handlers/ghcapi/mto_shipment_test.go @@ -3614,10 +3614,10 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerUsingPPM() { suite.NotZero(ppmPayload.ID) suite.NotEqual(uuid.Nil.String(), ppmPayload.ID.String()) suite.EqualDatePtr(expectedDepartureDate, ppmPayload.ExpectedDepartureDate) - suite.Equal(expectedPickupAddress.PostalCode, *ppmPayload.PickupPostalCode) - suite.Equal(&expectedSecondaryPickupAddress.PostalCode, ppmPayload.SecondaryPickupPostalCode) - suite.Equal(expectedDestinationAddress.PostalCode, *ppmPayload.DestinationPostalCode) - suite.Equal(&expectedSecondaryDestinationAddress.PostalCode, ppmPayload.SecondaryDestinationPostalCode) + suite.Equal(expectedPickupAddress.PostalCode, *ppmPayload.PickupAddress.PostalCode) + suite.Equal(&expectedSecondaryPickupAddress.PostalCode, ppmPayload.SecondaryPickupAddress.PostalCode) + suite.Equal(expectedDestinationAddress.PostalCode, *ppmPayload.DestinationAddress.PostalCode) + suite.Equal(&expectedSecondaryDestinationAddress.PostalCode, ppmPayload.SecondaryDestinationAddress.PostalCode) suite.NotNil(ppmPayload.PickupAddress) suite.NotNil(ppmPayload.DestinationAddress) suite.NotNil(ppmPayload.SecondaryPickupAddress) @@ -3766,8 +3766,8 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerUsingPPM() { suite.NotZero(ppmPayload.ID) suite.NotEqual(uuid.Nil.String(), ppmPayload.ID.String()) suite.EqualDatePtr(expectedDepartureDate, ppmPayload.ExpectedDepartureDate) - suite.Equal(expectedPickupAddress.PostalCode, *ppmPayload.PickupPostalCode) - suite.Equal(expectedDestinationAddress.PostalCode, *ppmPayload.DestinationPostalCode) + suite.Equal(expectedPickupAddress.PostalCode, *ppmPayload.PickupAddress.PostalCode) + suite.Equal(expectedDestinationAddress.PostalCode, *ppmPayload.DestinationAddress.PostalCode) suite.Nil(ppmPayload.SecondaryPickupAddress) suite.Nil(ppmPayload.SecondaryDestinationAddress) suite.Equal(sitExpected, *ppmPayload.SitExpected) @@ -3908,8 +3908,8 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerUsingPPM() { suite.NotZero(ppmPayload.ID) suite.NotEqual(uuid.Nil.String(), ppmPayload.ID.String()) suite.EqualDatePtr(expectedDepartureDate, ppmPayload.ExpectedDepartureDate) - suite.Equal(expectedPickupAddress.PostalCode, *ppmPayload.PickupPostalCode) - suite.Equal(expectedDestinationAddress.PostalCode, *ppmPayload.DestinationPostalCode) + suite.Equal(expectedPickupAddress.PostalCode, *ppmPayload.PickupAddress.PostalCode) + suite.Equal(expectedDestinationAddress.PostalCode, *ppmPayload.DestinationAddress.PostalCode) suite.Nil(ppmPayload.SecondaryPickupAddress) suite.Nil(ppmPayload.SecondaryDestinationAddress) suite.Equal(sitExpected, *ppmPayload.SitExpected) @@ -4241,10 +4241,10 @@ func (suite *HandlerSuite) TestUpdateShipmentHandler() { suite.Equal(expectedSecondaryPickupAddressStreet3, *updatedShipment.PpmShipment.SecondaryPickupAddress.StreetAddress3) suite.Equal(expectedDestinationAddressStreet3, *updatedShipment.PpmShipment.DestinationAddress.StreetAddress3) suite.Equal(expectedSecondaryDestinationAddressStreet3, *updatedShipment.PpmShipment.SecondaryDestinationAddress.StreetAddress3) - suite.Equal(pickupAddress.PostalCode, updatedShipment.PpmShipment.PickupPostalCode) - suite.Equal(secondaryPickupAddress.PostalCode, updatedShipment.PpmShipment.SecondaryPickupPostalCode) - suite.Equal(destinationAddress.PostalCode, updatedShipment.PpmShipment.DestinationPostalCode) - suite.Equal(secondaryDestinationAddress.PostalCode, updatedShipment.PpmShipment.SecondaryDestinationPostalCode) + suite.Equal(pickupAddress.PostalCode, updatedShipment.PpmShipment.PickupAddress.PostalCode) + suite.Equal(secondaryPickupAddress.PostalCode, updatedShipment.PpmShipment.SecondaryPickupAddress.PostalCode) + suite.Equal(destinationAddress.PostalCode, updatedShipment.PpmShipment.DestinationAddress.PostalCode) + suite.Equal(secondaryDestinationAddress.PostalCode, updatedShipment.PpmShipment.SecondaryDestinationAddress.PostalCode) suite.Equal(sitExpected, *updatedShipment.PpmShipment.SitExpected) suite.Equal(&sitLocation, updatedShipment.PpmShipment.SitLocation) @@ -4287,8 +4287,6 @@ func (suite *HandlerSuite) TestUpdateShipmentHandler() { // we expect initial setup data to have no secondary addresses suite.NotNil(ppmShipment.SecondaryPickupAddress) suite.NotNil(ppmShipment.SecondaryDestinationAddress) - suite.NotNil(ppmShipment.SecondaryPickupPostalCode) - suite.NotNil(ppmShipment.SecondaryDestinationPostalCode) estimatedIncentive := 654321 sitEstimatedCost := 67500 @@ -4328,8 +4326,6 @@ func (suite *HandlerSuite) TestUpdateShipmentHandler() { // expect secondary addresses to be deleted suite.Nil(updatedShipment.PpmShipment.SecondaryPickupAddress) suite.Nil(updatedShipment.PpmShipment.SecondaryDestinationAddress) - suite.Nil(updatedShipment.PpmShipment.SecondaryPickupPostalCode) - suite.Nil(updatedShipment.PpmShipment.SecondaryDestinationPostalCode) suite.False(*updatedShipment.PpmShipment.HasSecondaryPickupAddress) suite.False(*updatedShipment.PpmShipment.HasSecondaryDestinationAddress) @@ -4363,8 +4359,6 @@ func (suite *HandlerSuite) TestUpdateShipmentHandler() { // we expect initial setup data to have no secondary addresses suite.NotNil(ppmShipment.SecondaryPickupAddress) suite.NotNil(ppmShipment.SecondaryDestinationAddress) - suite.NotNil(ppmShipment.SecondaryPickupPostalCode) - suite.NotNil(ppmShipment.SecondaryDestinationPostalCode) estimatedIncentive := 654321 sitEstimatedCost := 67500 @@ -4403,8 +4397,8 @@ func (suite *HandlerSuite) TestUpdateShipmentHandler() { // expect secondary addresses not to be deleted suite.NotNil(updatedShipment.PpmShipment.SecondaryPickupAddress) suite.NotNil(updatedShipment.PpmShipment.SecondaryDestinationAddress) - suite.NotNil(updatedShipment.PpmShipment.SecondaryPickupPostalCode) - suite.NotNil(updatedShipment.PpmShipment.SecondaryDestinationPostalCode) + suite.NotNil(updatedShipment.PpmShipment.SecondaryPickupAddress.PostalCode) + suite.NotNil(updatedShipment.PpmShipment.SecondaryDestinationAddress.PostalCode) suite.True(*updatedShipment.PpmShipment.HasSecondaryPickupAddress) suite.True(*updatedShipment.PpmShipment.HasSecondaryDestinationAddress) diff --git a/pkg/handlers/ghcapi/ppm_document_test.go b/pkg/handlers/ghcapi/ppm_document_test.go index 5f3e321984c..7d3939049f5 100644 --- a/pkg/handlers/ghcapi/ppm_document_test.go +++ b/pkg/handlers/ghcapi/ppm_document_test.go @@ -574,7 +574,7 @@ func (suite *HandlerSuite) TestResubmitPPMShipmentDocumentationHandlerIntegratio }) suite.Run("Sets PPM to await customer if there are rejected documents", func() { - ppmShipment := factory.BuildPPMShipmentThatNeedsToBeResubmitted(suite.DB(), nil) + ppmShipment := factory.BuildPPMShipmentThatNeedsToBeResubmitted(suite.DB(), nil, nil) ppmShipment.Status = models.PPMShipmentStatusNeedsCloseout suite.NoError(suite.DB().Save(&ppmShipment)) diff --git a/pkg/handlers/internalapi/internal/payloads/model_to_payload.go b/pkg/handlers/internalapi/internal/payloads/model_to_payload.go index 9b056d48c83..1d5b025a18f 100644 --- a/pkg/handlers/internalapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/internalapi/internal/payloads/model_to_payload.go @@ -87,15 +87,11 @@ func PPMShipment(storer storage.FileStorer, ppmShipment *models.PPMShipment) *in SubmittedAt: handlers.FmtDateTimePtr(ppmShipment.SubmittedAt), ReviewedAt: handlers.FmtDateTimePtr(ppmShipment.ReviewedAt), ApprovedAt: handlers.FmtDateTimePtr(ppmShipment.ApprovedAt), - PickupPostalCode: &ppmShipment.PickupPostalCode, PickupAddress: Address(ppmShipment.PickupAddress), - SecondaryPickupPostalCode: ppmShipment.SecondaryPickupPostalCode, SecondaryPickupAddress: Address(ppmShipment.SecondaryPickupAddress), HasSecondaryPickupAddress: ppmShipment.HasSecondaryPickupAddress, ActualPickupPostalCode: ppmShipment.ActualPickupPostalCode, - DestinationPostalCode: &ppmShipment.DestinationPostalCode, DestinationAddress: Address(ppmShipment.DestinationAddress), - SecondaryDestinationPostalCode: ppmShipment.SecondaryDestinationPostalCode, SecondaryDestinationAddress: Address(ppmShipment.SecondaryDestinationAddress), HasSecondaryDestinationAddress: ppmShipment.HasSecondaryDestinationAddress, ActualDestinationPostalCode: ppmShipment.ActualDestinationPostalCode, diff --git a/pkg/handlers/internalapi/internal/payloads/payload_to_model.go b/pkg/handlers/internalapi/internal/payloads/payload_to_model.go index dd78f332b74..06aa2e65874 100644 --- a/pkg/handlers/internalapi/internal/payloads/payload_to_model.go +++ b/pkg/handlers/internalapi/internal/payloads/payload_to_model.go @@ -120,12 +120,8 @@ func PPMShipmentModelFromCreate(ppmShipment *internalmessages.CreatePPMShipment) } model := &models.PPMShipment{ - PickupPostalCode: *ppmShipment.PickupPostalCode, - SecondaryPickupPostalCode: handlers.FmtNullableStringToStringPtrNilToNil(ppmShipment.SecondaryPickupPostalCode), - DestinationPostalCode: *ppmShipment.DestinationPostalCode, - SecondaryDestinationPostalCode: handlers.FmtNullableStringToStringPtrNilToNil(ppmShipment.SecondaryDestinationPostalCode), - SITExpected: ppmShipment.SitExpected, - ExpectedDepartureDate: handlers.FmtDatePtrToPop(ppmShipment.ExpectedDepartureDate), + SITExpected: ppmShipment.SitExpected, + ExpectedDepartureDate: handlers.FmtDatePtrToPop(ppmShipment.ExpectedDepartureDate), } if ppmShipment.PickupAddress != nil { @@ -156,9 +152,7 @@ func UpdatePPMShipmentModel(ppmShipment *internalmessages.UpdatePPMShipment) *mo ppmModel := &models.PPMShipment{ ActualMoveDate: (*time.Time)(ppmShipment.ActualMoveDate), - SecondaryPickupPostalCode: handlers.FmtNullableStringToStringPtrNilToBlankString(ppmShipment.SecondaryPickupPostalCode), ActualPickupPostalCode: ppmShipment.ActualPickupPostalCode, - SecondaryDestinationPostalCode: handlers.FmtNullableStringToStringPtrNilToBlankString(ppmShipment.SecondaryDestinationPostalCode), ActualDestinationPostalCode: ppmShipment.ActualDestinationPostalCode, SITExpected: ppmShipment.SitExpected, EstimatedWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.EstimatedWeight), @@ -179,10 +173,6 @@ func UpdatePPMShipmentModel(ppmShipment *internalmessages.UpdatePPMShipment) *mo ppmModel.ExpectedDepartureDate = *handlers.FmtDatePtrToPopPtr(ppmShipment.ExpectedDepartureDate) } - if ppmShipment.PickupPostalCode != nil { - ppmModel.PickupPostalCode = *ppmShipment.PickupPostalCode - } - if ppmShipment.PickupAddress != nil { ppmModel.PickupAddress = AddressModel(ppmShipment.PickupAddress) } @@ -191,10 +181,6 @@ func UpdatePPMShipmentModel(ppmShipment *internalmessages.UpdatePPMShipment) *mo ppmModel.SecondaryPickupAddress = AddressModel(ppmShipment.SecondaryPickupAddress) } - if ppmShipment.DestinationPostalCode != nil { - ppmModel.DestinationPostalCode = *ppmShipment.DestinationPostalCode - } - if ppmShipment.DestinationAddress != nil { ppmModel.DestinationAddress = AddressModel(ppmShipment.DestinationAddress) } diff --git a/pkg/handlers/internalapi/mto_shipment_test.go b/pkg/handlers/internalapi/mto_shipment_test.go index 68e72f658b4..5d15c89bd0e 100644 --- a/pkg/handlers/internalapi/mto_shipment_test.go +++ b/pkg/handlers/internalapi/mto_shipment_test.go @@ -32,7 +32,6 @@ import ( paymentrequest "github.com/transcom/mymove/pkg/services/payment_request" "github.com/transcom/mymove/pkg/services/ppmshipment" "github.com/transcom/mymove/pkg/services/query" - "github.com/transcom/mymove/pkg/swagger/nullable" "github.com/transcom/mymove/pkg/testdatagen" "github.com/transcom/mymove/pkg/unit" ) @@ -257,16 +256,12 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerV1() { // pointers expectedDepartureDate := strfmt.Date(*subtestData.mtoShipment.RequestedPickupDate) - pickupPostal := "11111" - destinationPostalCode := "41414" sitExpected := false // reset Body params to have PPM fields params.Body = &internalmessages.CreateShipment{ MoveTaskOrderID: handlers.FmtUUID(subtestData.mtoShipment.MoveTaskOrderID), PpmShipment: &internalmessages.CreatePPMShipment{ ExpectedDepartureDate: &expectedDepartureDate, - PickupPostalCode: &pickupPostal, - DestinationPostalCode: &destinationPostalCode, SitExpected: &sitExpected, PickupAddress: &internalmessages.Address{ City: &pickupAddress.City, @@ -311,10 +306,6 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerV1() { suite.Equal(models.MTOShipmentStatusDraft, models.MTOShipmentStatus(createdShipment.Status)) suite.Equal(*params.Body.MoveTaskOrderID, createdShipment.MoveTaskOrderID) suite.Equal(*params.Body.PpmShipment.ExpectedDepartureDate, *createdShipment.PpmShipment.ExpectedDepartureDate) - suite.Equal(*params.Body.PpmShipment.PickupPostalCode, *createdShipment.PpmShipment.PickupPostalCode) - suite.Nil(createdShipment.PpmShipment.SecondaryPickupPostalCode) - suite.Equal(*params.Body.PpmShipment.DestinationPostalCode, *createdShipment.PpmShipment.DestinationPostalCode) - suite.Nil(createdShipment.PpmShipment.SecondaryDestinationPostalCode) suite.Equal(*params.Body.PpmShipment.SitExpected, *createdShipment.PpmShipment.SitExpected) suite.Equal(*params.Body.PpmShipment.PickupAddress.StreetAddress1, *createdShipment.PpmShipment.PickupAddress.StreetAddress1) suite.Equal(*params.Body.PpmShipment.DestinationAddress.StreetAddress1, *createdShipment.PpmShipment.DestinationAddress.StreetAddress1) @@ -327,8 +318,6 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerV1() { ppmShipmentType := internalmessages.MTOShipmentTypePPM // pointers expectedDepartureDate := strfmt.Date(*subtestData.mtoShipment.RequestedPickupDate) - pickupPostal := "11111" - destinationPostalCode := "41414" sitExpected := false // create PPM addressed @@ -341,12 +330,8 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerV1() { params.Body = &internalmessages.CreateShipment{ MoveTaskOrderID: handlers.FmtUUID(subtestData.mtoShipment.MoveTaskOrderID), PpmShipment: &internalmessages.CreatePPMShipment{ - ExpectedDepartureDate: &expectedDepartureDate, - PickupPostalCode: &pickupPostal, - SecondaryPickupPostalCode: nullable.NewString("11112"), - DestinationPostalCode: &destinationPostalCode, - SecondaryDestinationPostalCode: nullable.NewString("41415"), - SitExpected: &sitExpected, + ExpectedDepartureDate: &expectedDepartureDate, + SitExpected: &sitExpected, PickupAddress: &internalmessages.Address{ City: &pickupAddress.City, Country: pickupAddress.Country, @@ -408,10 +393,6 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerV1() { suite.Equal(models.MTOShipmentStatusDraft, models.MTOShipmentStatus(createdShipment.Status)) suite.Equal(*params.Body.MoveTaskOrderID, createdShipment.MoveTaskOrderID) suite.Equal(*params.Body.PpmShipment.ExpectedDepartureDate, *createdShipment.PpmShipment.ExpectedDepartureDate) - suite.Equal(*params.Body.PpmShipment.PickupPostalCode, *createdShipment.PpmShipment.PickupPostalCode) - suite.Equal(*params.Body.PpmShipment.SecondaryPickupPostalCode.Value, *createdShipment.PpmShipment.SecondaryPickupPostalCode) - suite.Equal(*params.Body.PpmShipment.DestinationPostalCode, *createdShipment.PpmShipment.DestinationPostalCode) - suite.Equal(*params.Body.PpmShipment.SecondaryDestinationPostalCode.Value, *createdShipment.PpmShipment.SecondaryDestinationPostalCode) suite.Equal(*params.Body.PpmShipment.SitExpected, *createdShipment.PpmShipment.SitExpected) suite.Equal(*params.Body.PpmShipment.PickupAddress.StreetAddress1, *createdShipment.PpmShipment.PickupAddress.StreetAddress1) suite.Equal(*params.Body.PpmShipment.DestinationAddress.StreetAddress1, *createdShipment.PpmShipment.DestinationAddress.StreetAddress1) @@ -558,8 +539,6 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerV1() { ppmShipmentType := internalmessages.MTOShipmentTypePPM expectedDepartureDate := strfmt.Date(*subtestData.mtoShipment.RequestedPickupDate) - pickupPostal := "11111" - destinationPostalCode := "41414" sitExpected := false badID, _ := uuid.NewV4() @@ -568,8 +547,6 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerV1() { MoveTaskOrderID: handlers.FmtUUID(badID), PpmShipment: &internalmessages.CreatePPMShipment{ ExpectedDepartureDate: &expectedDepartureDate, - PickupPostalCode: &pickupPostal, - DestinationPostalCode: &destinationPostalCode, SitExpected: &sitExpected, }, ShipmentType: &ppmShipmentType, @@ -802,8 +779,6 @@ func (suite *HandlerSuite) TestUpdateMTOShipmentHandler() { // checkDatesAndLocationsDidntChange - ensures dates and locations fields didn't change checkDatesAndLocationsDidntChange := func(updatedShipment *internalmessages.MTOShipment, originalShipment models.MTOShipment) { suite.EqualDatePtr(&originalShipment.PPMShipment.ExpectedDepartureDate, updatedShipment.PpmShipment.ExpectedDepartureDate) - suite.Equal(originalShipment.PPMShipment.PickupPostalCode, *updatedShipment.PpmShipment.PickupPostalCode) - suite.Equal(originalShipment.PPMShipment.DestinationPostalCode, *updatedShipment.PpmShipment.DestinationPostalCode) suite.Equal(originalShipment.PPMShipment.SITExpected, updatedShipment.PpmShipment.SitExpected) } @@ -842,8 +817,6 @@ func (suite *HandlerSuite) TestUpdateMTOShipmentHandler() { { Model: models.PPMShipment{ ExpectedDepartureDate: time.Date(testdatagen.GHCTestYear, time.March, 15, 0, 0, 0, 0, time.UTC), - PickupPostalCode: "90808", - DestinationPostalCode: "79912", SITExpected: models.BoolPointer(true), }, }, @@ -851,8 +824,6 @@ func (suite *HandlerSuite) TestUpdateMTOShipmentHandler() { }, desiredShipment: internalmessages.UpdatePPMShipment{ ExpectedDepartureDate: handlers.FmtDate(time.Date(testdatagen.GHCTestYear, time.April, 27, 0, 0, 0, 0, time.UTC)), - PickupPostalCode: handlers.FmtString("90900"), - DestinationPostalCode: handlers.FmtString("79916"), SitExpected: handlers.FmtBool(false), }, estimatedIncentive: nil, @@ -860,52 +831,9 @@ func (suite *HandlerSuite) TestUpdateMTOShipmentHandler() { // check all fields changed as expected desiredShipment.ExpectedDepartureDate.Equal(*updatedShipment.PpmShipment.ExpectedDepartureDate) - suite.Equal(desiredShipment.PickupPostalCode, updatedShipment.PpmShipment.PickupPostalCode) - suite.Equal(desiredShipment.DestinationPostalCode, updatedShipment.PpmShipment.DestinationPostalCode) suite.Equal(desiredShipment.SitExpected, updatedShipment.PpmShipment.SitExpected) }, }, - "Edit estimated dates & locations - add secondary zips": { - setUpOriginalPPM: func() models.PPMShipment { - return factory.BuildMinimalPPMShipment(suite.DB(), nil, nil) - }, - desiredShipment: internalmessages.UpdatePPMShipment{ - SecondaryPickupPostalCode: nullable.NewString("90900"), - SecondaryDestinationPostalCode: nullable.NewString("79916"), - }, - estimatedIncentive: nil, - runChecks: func(updatedShipment *internalmessages.MTOShipment, originalShipment models.MTOShipment, desiredShipment internalmessages.UpdatePPMShipment) { - checkDatesAndLocationsDidntChange(updatedShipment, originalShipment) - - // check new fields were set - suite.Equal(desiredShipment.SecondaryPickupPostalCode, nullable.NewString(*updatedShipment.PpmShipment.SecondaryPickupPostalCode)) - suite.Equal(desiredShipment.SecondaryDestinationPostalCode, nullable.NewString(*updatedShipment.PpmShipment.SecondaryDestinationPostalCode)) - }, - }, - "Edit estimated dates & locations - remove secondary zips": { - setUpOriginalPPM: func() models.PPMShipment { - return factory.BuildMinimalPPMShipment(suite.DB(), []factory.Customization{ - { - Model: models.PPMShipment{ - SecondaryPickupPostalCode: models.StringPointer("90900"), - SecondaryDestinationPostalCode: models.StringPointer("79916"), - }, - }, - }, nil) - }, - desiredShipment: internalmessages.UpdatePPMShipment{ - SecondaryPickupPostalCode: nullable.NewNullString(), - SecondaryDestinationPostalCode: nullable.NewNullString(), - }, - estimatedIncentive: nil, - runChecks: func(updatedShipment *internalmessages.MTOShipment, originalShipment models.MTOShipment, _ internalmessages.UpdatePPMShipment) { - checkDatesAndLocationsDidntChange(updatedShipment, originalShipment) - - // check expected fields were updated - suite.Nil(updatedShipment.PpmShipment.SecondaryPickupPostalCode) - suite.Nil(updatedShipment.PpmShipment.SecondaryDestinationPostalCode) - }, - }, "Add estimated weights - no pro gear": { setUpOriginalPPM: func() models.PPMShipment { return factory.BuildMinimalPPMShipment(suite.DB(), nil, nil) @@ -1590,10 +1518,6 @@ func (suite *HandlerSuite) TestListMTOShipmentsHandler() { suite.EqualDateTimePtr(expectedShipment.PPMShipment.SubmittedAt, returnedShipment.PpmShipment.SubmittedAt) suite.EqualDateTimePtr(expectedShipment.PPMShipment.ReviewedAt, returnedShipment.PpmShipment.ReviewedAt) suite.EqualDateTimePtr(expectedShipment.PPMShipment.ApprovedAt, returnedShipment.PpmShipment.ApprovedAt) - suite.Equal(expectedShipment.PPMShipment.PickupPostalCode, *returnedShipment.PpmShipment.PickupPostalCode) - suite.Equal(expectedShipment.PPMShipment.SecondaryPickupPostalCode, returnedShipment.PpmShipment.SecondaryPickupPostalCode) - suite.Equal(expectedShipment.PPMShipment.DestinationPostalCode, *returnedShipment.PpmShipment.DestinationPostalCode) - suite.Equal(expectedShipment.PPMShipment.SecondaryDestinationPostalCode, returnedShipment.PpmShipment.SecondaryDestinationPostalCode) suite.Equal(*expectedShipment.PPMShipment.SITExpected, *returnedShipment.PpmShipment.SitExpected) suite.EqualPoundPointers(expectedShipment.PPMShipment.EstimatedWeight, returnedShipment.PpmShipment.EstimatedWeight) suite.Equal(expectedShipment.PPMShipment.HasProGear, returnedShipment.PpmShipment.HasProGear) diff --git a/pkg/handlers/internalapi/ppm_shipment_test.go b/pkg/handlers/internalapi/ppm_shipment_test.go index 2a6377c8972..e5d3e72d0af 100644 --- a/pkg/handlers/internalapi/ppm_shipment_test.go +++ b/pkg/handlers/internalapi/ppm_shipment_test.go @@ -495,7 +495,7 @@ func (suite *HandlerSuite) TestSubmitPPMShipmentDocumentationHandlerIntegration( func (suite *HandlerSuite) TestResubmitPPMShipmentDocumentationHandlerUnit() { setUpPPMShipment := func() models.PPMShipment { - ppmShipment := factory.BuildPPMShipmentThatNeedsToBeResubmitted(nil, nil) + ppmShipment := factory.BuildPPMShipmentThatNeedsToBeResubmitted(nil, nil, nil) ppmShipment.ID = uuid.Must(uuid.NewV4()) ppmShipment.CreatedAt = time.Now() @@ -799,7 +799,7 @@ func (suite *HandlerSuite) TestResubmitPPMShipmentDocumentationHandlerIntegratio var needsCloseoutSM models.ServiceMember suite.PreloadData(func() { - shipmentNeedsResubmitted = factory.BuildPPMShipmentThatNeedsToBeResubmitted(suite.DB(), userUploader) + shipmentNeedsResubmitted = factory.BuildPPMShipmentThatNeedsToBeResubmitted(suite.DB(), userUploader, nil) shipmentNeedsResubmitted.SubmittedAt = &submissionTime suite.NoError(suite.DB().Save(&shipmentNeedsResubmitted)) needsResubmittedSM = shipmentNeedsResubmitted.Shipment.MoveTaskOrder.Orders.ServiceMember diff --git a/pkg/handlers/primeapi/mto_shipment_test.go b/pkg/handlers/primeapi/mto_shipment_test.go index b679c87df7d..8e47fb14465 100644 --- a/pkg/handlers/primeapi/mto_shipment_test.go +++ b/pkg/handlers/primeapi/mto_shipment_test.go @@ -179,10 +179,6 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandler() { counselorRemarks := "Some counselor remarks" expectedDepartureDate := time.Now().AddDate(0, 0, 10) - pickupPostalCode := "30907" - secondaryPickupPostalCode := "30809" - destinationPostalCode := "29212" - secondaryDestinationPostalCode := "29201" sitExpected := true sitLocation := primemessages.SITLocationTypeDESTINATION sitEstimatedWeight := unit.Pound(1500) @@ -202,20 +198,16 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandler() { ShipmentType: primemessages.NewMTOShipmentType(primemessages.MTOShipmentTypePPM), CounselorRemarks: &counselorRemarks, PpmShipment: &primemessages.CreatePPMShipment{ - ExpectedDepartureDate: handlers.FmtDate(expectedDepartureDate), - PickupPostalCode: &pickupPostalCode, - SecondaryPickupPostalCode: &secondaryPickupPostalCode, - DestinationPostalCode: &destinationPostalCode, - SecondaryDestinationPostalCode: &secondaryDestinationPostalCode, - SitExpected: &sitExpected, - SitLocation: &sitLocation, - SitEstimatedWeight: handlers.FmtPoundPtr(&sitEstimatedWeight), - SitEstimatedEntryDate: handlers.FmtDate(sitEstimatedEntryDate), - SitEstimatedDepartureDate: handlers.FmtDate(sitEstimatedDepartureDate), - EstimatedWeight: handlers.FmtPoundPtr(&estimatedWeight), - HasProGear: &hasProGear, - ProGearWeight: handlers.FmtPoundPtr(&proGearWeight), - SpouseProGearWeight: handlers.FmtPoundPtr(&spouseProGearWeight), + ExpectedDepartureDate: handlers.FmtDate(expectedDepartureDate), + SitExpected: &sitExpected, + SitLocation: &sitLocation, + SitEstimatedWeight: handlers.FmtPoundPtr(&sitEstimatedWeight), + SitEstimatedEntryDate: handlers.FmtDate(sitEstimatedEntryDate), + SitEstimatedDepartureDate: handlers.FmtDate(sitEstimatedDepartureDate), + EstimatedWeight: handlers.FmtPoundPtr(&estimatedWeight), + HasProGear: &hasProGear, + ProGearWeight: handlers.FmtPoundPtr(&proGearWeight), + SpouseProGearWeight: handlers.FmtPoundPtr(&spouseProGearWeight), }, }, } @@ -247,10 +239,6 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandler() { suite.Equal(createdShipment.ID.String(), createdPPM.ShipmentID.String()) suite.Equal(primemessages.PPMShipmentStatusSUBMITTED, createdPPM.Status) suite.Equal(handlers.FmtDatePtr(&expectedDepartureDate), createdPPM.ExpectedDepartureDate) - suite.Equal(&pickupPostalCode, createdPPM.PickupPostalCode) - suite.Equal(&secondaryPickupPostalCode, createdPPM.SecondaryPickupPostalCode) - suite.Equal(&destinationPostalCode, createdPPM.DestinationPostalCode) - suite.Equal(&secondaryDestinationPostalCode, createdPPM.SecondaryDestinationPostalCode) suite.Equal(&sitExpected, createdPPM.SitExpected) suite.Equal(&sitLocation, createdPPM.SitLocation) suite.Equal(handlers.FmtPoundPtr(&sitEstimatedWeight), createdPPM.SitEstimatedWeight) @@ -1045,10 +1033,6 @@ func (suite *HandlerSuite) TestUpdateMTOShipmentHandler() { year, month, day := time.Now().Date() actualMoveDate := time.Date(year, month, day-7, 0, 0, 0, 0, time.UTC) expectedDepartureDate := actualMoveDate.Add(time.Hour * 24 * 2) - pickupPostalCode := "30907" - secondaryPickupPostalCode := "30809" - destinationPostalCode := "36106" - secondaryDestinationPostalCode := "36101" sitExpected := true sitLocation := primemessages.SITLocationTypeDESTINATION sitEstimatedWeight := unit.Pound(1700) @@ -1069,20 +1053,16 @@ func (suite *HandlerSuite) TestUpdateMTOShipmentHandler() { Body: &primemessages.UpdateMTOShipment{ CounselorRemarks: handlers.FmtString("Test remark"), PpmShipment: &primemessages.UpdatePPMShipment{ - ExpectedDepartureDate: handlers.FmtDatePtr(&expectedDepartureDate), - PickupPostalCode: &pickupPostalCode, - SecondaryPickupPostalCode: &secondaryPickupPostalCode, - DestinationPostalCode: &destinationPostalCode, - SecondaryDestinationPostalCode: &secondaryDestinationPostalCode, - SitExpected: &sitExpected, - SitEstimatedWeight: handlers.FmtPoundPtr(&sitEstimatedWeight), - SitEstimatedEntryDate: handlers.FmtDatePtr(&sitEstimatedEntryDate), - SitEstimatedDepartureDate: handlers.FmtDatePtr(&sitEstimatedDepartureDate), - SitLocation: &sitLocation, - EstimatedWeight: handlers.FmtPoundPtr(&estimatedWeight), - HasProGear: &hasProGear, - ProGearWeight: handlers.FmtPoundPtr(&proGearWeight), - SpouseProGearWeight: handlers.FmtPoundPtr(&spouseProGearWeight), + ExpectedDepartureDate: handlers.FmtDatePtr(&expectedDepartureDate), + SitExpected: &sitExpected, + SitEstimatedWeight: handlers.FmtPoundPtr(&sitEstimatedWeight), + SitEstimatedEntryDate: handlers.FmtDatePtr(&sitEstimatedEntryDate), + SitEstimatedDepartureDate: handlers.FmtDatePtr(&sitEstimatedDepartureDate), + SitLocation: &sitLocation, + EstimatedWeight: handlers.FmtPoundPtr(&estimatedWeight), + HasProGear: &hasProGear, + ProGearWeight: handlers.FmtPoundPtr(&proGearWeight), + SpouseProGearWeight: handlers.FmtPoundPtr(&spouseProGearWeight), }, }, } @@ -1111,10 +1091,6 @@ func (suite *HandlerSuite) TestUpdateMTOShipmentHandler() { suite.Equal(ppmShipment.Shipment.ID.String(), updatedShipment.ID.String()) suite.Equal(handlers.FmtDatePtr(&expectedDepartureDate), updatedShipment.PpmShipment.ExpectedDepartureDate) - suite.Equal(&pickupPostalCode, updatedShipment.PpmShipment.PickupPostalCode) - suite.Equal(&secondaryPickupPostalCode, updatedShipment.PpmShipment.SecondaryPickupPostalCode) - suite.Equal(&destinationPostalCode, updatedShipment.PpmShipment.DestinationPostalCode) - suite.Equal(&secondaryDestinationPostalCode, updatedShipment.PpmShipment.SecondaryDestinationPostalCode) suite.Equal(sitExpected, *updatedShipment.PpmShipment.SitExpected) suite.Equal(&sitLocation, updatedShipment.PpmShipment.SitLocation) suite.Equal(handlers.FmtPoundPtr(&sitEstimatedWeight), updatedShipment.PpmShipment.SitEstimatedWeight) diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index dccac3b487b..32e1458c1f3 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -458,37 +458,33 @@ func PPMShipment(ppmShipment *models.PPMShipment) *primemessages.PPMShipment { } payloadPPMShipment := &primemessages.PPMShipment{ - ID: *handlers.FmtUUID(ppmShipment.ID), - ShipmentID: *handlers.FmtUUID(ppmShipment.ShipmentID), - CreatedAt: strfmt.DateTime(ppmShipment.CreatedAt), - UpdatedAt: strfmt.DateTime(ppmShipment.UpdatedAt), - Status: primemessages.PPMShipmentStatus(ppmShipment.Status), - ExpectedDepartureDate: handlers.FmtDate(ppmShipment.ExpectedDepartureDate), - ActualMoveDate: handlers.FmtDatePtr(ppmShipment.ActualMoveDate), - SubmittedAt: handlers.FmtDateTimePtr(ppmShipment.SubmittedAt), - ReviewedAt: handlers.FmtDateTimePtr(ppmShipment.ReviewedAt), - ApprovedAt: handlers.FmtDateTimePtr(ppmShipment.ApprovedAt), - PickupPostalCode: &ppmShipment.PickupPostalCode, - SecondaryPickupPostalCode: ppmShipment.SecondaryPickupPostalCode, - ActualPickupPostalCode: ppmShipment.ActualPickupPostalCode, - DestinationPostalCode: &ppmShipment.DestinationPostalCode, - SecondaryDestinationPostalCode: ppmShipment.SecondaryDestinationPostalCode, - ActualDestinationPostalCode: ppmShipment.ActualDestinationPostalCode, - SitExpected: ppmShipment.SITExpected, - SitEstimatedWeight: handlers.FmtPoundPtr(ppmShipment.SITEstimatedWeight), - SitEstimatedEntryDate: handlers.FmtDatePtr(ppmShipment.SITEstimatedEntryDate), - SitEstimatedDepartureDate: handlers.FmtDatePtr(ppmShipment.SITEstimatedDepartureDate), - SitEstimatedCost: handlers.FmtCost(ppmShipment.SITEstimatedCost), - EstimatedWeight: handlers.FmtPoundPtr(ppmShipment.EstimatedWeight), - EstimatedIncentive: handlers.FmtCost(ppmShipment.EstimatedIncentive), - HasProGear: ppmShipment.HasProGear, - ProGearWeight: handlers.FmtPoundPtr(ppmShipment.ProGearWeight), - SpouseProGearWeight: handlers.FmtPoundPtr(ppmShipment.SpouseProGearWeight), - HasRequestedAdvance: ppmShipment.HasRequestedAdvance, - AdvanceAmountRequested: handlers.FmtCost(ppmShipment.AdvanceAmountRequested), - HasReceivedAdvance: ppmShipment.HasReceivedAdvance, - AdvanceAmountReceived: handlers.FmtCost(ppmShipment.AdvanceAmountReceived), - ETag: etag.GenerateEtag(ppmShipment.UpdatedAt), + ID: *handlers.FmtUUID(ppmShipment.ID), + ShipmentID: *handlers.FmtUUID(ppmShipment.ShipmentID), + CreatedAt: strfmt.DateTime(ppmShipment.CreatedAt), + UpdatedAt: strfmt.DateTime(ppmShipment.UpdatedAt), + Status: primemessages.PPMShipmentStatus(ppmShipment.Status), + ExpectedDepartureDate: handlers.FmtDate(ppmShipment.ExpectedDepartureDate), + ActualMoveDate: handlers.FmtDatePtr(ppmShipment.ActualMoveDate), + SubmittedAt: handlers.FmtDateTimePtr(ppmShipment.SubmittedAt), + ReviewedAt: handlers.FmtDateTimePtr(ppmShipment.ReviewedAt), + ApprovedAt: handlers.FmtDateTimePtr(ppmShipment.ApprovedAt), + ActualPickupPostalCode: ppmShipment.ActualPickupPostalCode, + ActualDestinationPostalCode: ppmShipment.ActualDestinationPostalCode, + SitExpected: ppmShipment.SITExpected, + SitEstimatedWeight: handlers.FmtPoundPtr(ppmShipment.SITEstimatedWeight), + SitEstimatedEntryDate: handlers.FmtDatePtr(ppmShipment.SITEstimatedEntryDate), + SitEstimatedDepartureDate: handlers.FmtDatePtr(ppmShipment.SITEstimatedDepartureDate), + SitEstimatedCost: handlers.FmtCost(ppmShipment.SITEstimatedCost), + EstimatedWeight: handlers.FmtPoundPtr(ppmShipment.EstimatedWeight), + EstimatedIncentive: handlers.FmtCost(ppmShipment.EstimatedIncentive), + HasProGear: ppmShipment.HasProGear, + ProGearWeight: handlers.FmtPoundPtr(ppmShipment.ProGearWeight), + SpouseProGearWeight: handlers.FmtPoundPtr(ppmShipment.SpouseProGearWeight), + HasRequestedAdvance: ppmShipment.HasRequestedAdvance, + AdvanceAmountRequested: handlers.FmtCost(ppmShipment.AdvanceAmountRequested), + HasReceivedAdvance: ppmShipment.HasReceivedAdvance, + AdvanceAmountReceived: handlers.FmtCost(ppmShipment.AdvanceAmountReceived), + ETag: etag.GenerateEtag(ppmShipment.UpdatedAt), } if ppmShipment.SITLocation != nil { diff --git a/pkg/handlers/primeapi/payloads/payload_to_model.go b/pkg/handlers/primeapi/payloads/payload_to_model.go index 8dd4ef8a78e..21f7dfc79f4 100644 --- a/pkg/handlers/primeapi/payloads/payload_to_model.go +++ b/pkg/handlers/primeapi/payloads/payload_to_model.go @@ -202,26 +202,31 @@ func PPMShipmentModelFromCreate(ppmShipment *primemessages.CreatePPMShipment) *m } model := &models.PPMShipment{ - Status: models.PPMShipmentStatusSubmitted, - SITExpected: ppmShipment.SitExpected, - SecondaryPickupPostalCode: ppmShipment.SecondaryPickupPostalCode, - SecondaryDestinationPostalCode: ppmShipment.SecondaryDestinationPostalCode, - EstimatedWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.EstimatedWeight), - HasProGear: ppmShipment.HasProGear, + Status: models.PPMShipmentStatusSubmitted, + SITExpected: ppmShipment.SitExpected, + EstimatedWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.EstimatedWeight), + HasProGear: ppmShipment.HasProGear, } + addressModel := &models.Address{ + StreetAddress1: "Deprecated Endpoint Prime V2", + StreetAddress2: models.StringPointer("Endpoint no longer supported"), + StreetAddress3: models.StringPointer("Update address field to appropriate values"), + City: "DEPV2", + State: "CA", + PostalCode: "90210", + Country: models.StringPointer("US"), + } + + model.PickupAddress = addressModel + + model.DestinationAddress = addressModel + expectedDepartureDate := handlers.FmtDatePtrToPopPtr(ppmShipment.ExpectedDepartureDate) if expectedDepartureDate != nil && !expectedDepartureDate.IsZero() { model.ExpectedDepartureDate = *expectedDepartureDate } - if ppmShipment.PickupPostalCode != nil { - model.PickupPostalCode = *ppmShipment.PickupPostalCode - } - if ppmShipment.DestinationPostalCode != nil { - model.DestinationPostalCode = *ppmShipment.DestinationPostalCode - } - if model.SITExpected != nil && *model.SITExpected { if ppmShipment.SitLocation != nil { sitLocation := models.SITLocationType(*ppmShipment.SitLocation) @@ -340,13 +345,11 @@ func PPMShipmentModelFromUpdate(ppmShipment *primemessages.UpdatePPMShipment) *m } model := &models.PPMShipment{ - SecondaryPickupPostalCode: ppmShipment.SecondaryPickupPostalCode, - SecondaryDestinationPostalCode: ppmShipment.SecondaryDestinationPostalCode, - SITExpected: ppmShipment.SitExpected, - EstimatedWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.EstimatedWeight), - HasProGear: ppmShipment.HasProGear, - ProGearWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.ProGearWeight), - SpouseProGearWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.SpouseProGearWeight), + SITExpected: ppmShipment.SitExpected, + EstimatedWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.EstimatedWeight), + HasProGear: ppmShipment.HasProGear, + ProGearWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.ProGearWeight), + SpouseProGearWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.SpouseProGearWeight), } expectedDepartureDate := handlers.FmtDatePtrToPopPtr(ppmShipment.ExpectedDepartureDate) @@ -354,13 +357,6 @@ func PPMShipmentModelFromUpdate(ppmShipment *primemessages.UpdatePPMShipment) *m model.ExpectedDepartureDate = *expectedDepartureDate } - if ppmShipment.PickupPostalCode != nil { - model.PickupPostalCode = *ppmShipment.PickupPostalCode - } - if ppmShipment.DestinationPostalCode != nil { - model.DestinationPostalCode = *ppmShipment.DestinationPostalCode - } - if ppmShipment.SitLocation != nil { sitLocation := models.SITLocationType(*ppmShipment.SitLocation) model.SITLocation = &sitLocation diff --git a/pkg/handlers/primeapi/payloads/payload_to_model_test.go b/pkg/handlers/primeapi/payloads/payload_to_model_test.go index 9f21104cf2b..5018c934349 100644 --- a/pkg/handlers/primeapi/payloads/payload_to_model_test.go +++ b/pkg/handlers/primeapi/payloads/payload_to_model_test.go @@ -528,8 +528,6 @@ func (suite *PayloadsSuite) TestShipmentAddressUpdateModel() { func (suite *PayloadsSuite) TestPPMShipmentModelFromCreate() { time := time.Now() expectedDepartureDate := handlers.FmtDatePtr(&time) - pickupPostalCode := "" - destinationPostalCode := "" sitExpected := true estimatedWeight := int64(5000) hasProGear := true @@ -538,8 +536,6 @@ func (suite *PayloadsSuite) TestPPMShipmentModelFromCreate() { ppmShipment := primemessages.CreatePPMShipment{ ExpectedDepartureDate: expectedDepartureDate, - PickupPostalCode: &pickupPostalCode, - DestinationPostalCode: &destinationPostalCode, SitExpected: &sitExpected, EstimatedWeight: &estimatedWeight, HasProGear: &hasProGear, @@ -556,6 +552,4 @@ func (suite *PayloadsSuite) TestPPMShipmentModelFromCreate() { suite.True(*model.HasProGear) suite.Equal(unit.Pound(proGearWeight), *model.ProGearWeight) suite.Equal(unit.Pound(spouseProGearWeight), *model.SpouseProGearWeight) - suite.Equal(pickupPostalCode, model.PickupPostalCode) - suite.Equal(destinationPostalCode, model.DestinationPostalCode) } diff --git a/pkg/handlers/primeapiv2/mto_shipment_test.go b/pkg/handlers/primeapiv2/mto_shipment_test.go index 823fea0f729..2c14ade2219 100644 --- a/pkg/handlers/primeapiv2/mto_shipment_test.go +++ b/pkg/handlers/primeapiv2/mto_shipment_test.go @@ -173,10 +173,6 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandler() { counselorRemarks := "Some counselor remarks" expectedDepartureDate := time.Now().AddDate(0, 0, 10) - pickupPostalCode := "30907" - secondaryPickupPostalCode := "30809" - destinationPostalCode := "29212" - secondaryDestinationPostalCode := "29201" sitExpected := true sitLocation := primev2messages.SITLocationTypeDESTINATION sitEstimatedWeight := unit.Pound(1500) @@ -196,20 +192,16 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandler() { ShipmentType: primev2messages.NewMTOShipmentType(primev2messages.MTOShipmentTypePPM), CounselorRemarks: &counselorRemarks, PpmShipment: &primev2messages.CreatePPMShipment{ - ExpectedDepartureDate: handlers.FmtDate(expectedDepartureDate), - PickupPostalCode: &pickupPostalCode, - SecondaryPickupPostalCode: &secondaryPickupPostalCode, - DestinationPostalCode: &destinationPostalCode, - SecondaryDestinationPostalCode: &secondaryDestinationPostalCode, - SitExpected: &sitExpected, - SitLocation: &sitLocation, - SitEstimatedWeight: handlers.FmtPoundPtr(&sitEstimatedWeight), - SitEstimatedEntryDate: handlers.FmtDate(sitEstimatedEntryDate), - SitEstimatedDepartureDate: handlers.FmtDate(sitEstimatedDepartureDate), - EstimatedWeight: handlers.FmtPoundPtr(&estimatedWeight), - HasProGear: &hasProGear, - ProGearWeight: handlers.FmtPoundPtr(&proGearWeight), - SpouseProGearWeight: handlers.FmtPoundPtr(&spouseProGearWeight), + ExpectedDepartureDate: handlers.FmtDate(expectedDepartureDate), + SitExpected: &sitExpected, + SitLocation: &sitLocation, + SitEstimatedWeight: handlers.FmtPoundPtr(&sitEstimatedWeight), + SitEstimatedEntryDate: handlers.FmtDate(sitEstimatedEntryDate), + SitEstimatedDepartureDate: handlers.FmtDate(sitEstimatedDepartureDate), + EstimatedWeight: handlers.FmtPoundPtr(&estimatedWeight), + HasProGear: &hasProGear, + ProGearWeight: handlers.FmtPoundPtr(&proGearWeight), + SpouseProGearWeight: handlers.FmtPoundPtr(&spouseProGearWeight), }, }, } @@ -241,10 +233,6 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandler() { suite.Equal(createdShipment.ID.String(), createdPPM.ShipmentID.String()) suite.Equal(primev2messages.PPMShipmentStatusSUBMITTED, createdPPM.Status) suite.Equal(handlers.FmtDatePtr(&expectedDepartureDate), createdPPM.ExpectedDepartureDate) - suite.Equal(&pickupPostalCode, createdPPM.PickupPostalCode) - suite.Equal(&secondaryPickupPostalCode, createdPPM.SecondaryPickupPostalCode) - suite.Equal(&destinationPostalCode, createdPPM.DestinationPostalCode) - suite.Equal(&secondaryDestinationPostalCode, createdPPM.SecondaryDestinationPostalCode) suite.Equal(&sitExpected, createdPPM.SitExpected) suite.Equal(&sitLocation, createdPPM.SitLocation) suite.Equal(handlers.FmtPoundPtr(&sitEstimatedWeight), createdPPM.SitEstimatedWeight) diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index 97ca6defb42..d17826d0c45 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -404,37 +404,33 @@ func PPMShipment(ppmShipment *models.PPMShipment) *primev2messages.PPMShipment { } payloadPPMShipment := &primev2messages.PPMShipment{ - ID: *handlers.FmtUUID(ppmShipment.ID), - ShipmentID: *handlers.FmtUUID(ppmShipment.ShipmentID), - CreatedAt: strfmt.DateTime(ppmShipment.CreatedAt), - UpdatedAt: strfmt.DateTime(ppmShipment.UpdatedAt), - Status: primev2messages.PPMShipmentStatus(ppmShipment.Status), - ExpectedDepartureDate: handlers.FmtDate(ppmShipment.ExpectedDepartureDate), - ActualMoveDate: handlers.FmtDatePtr(ppmShipment.ActualMoveDate), - SubmittedAt: handlers.FmtDateTimePtr(ppmShipment.SubmittedAt), - ReviewedAt: handlers.FmtDateTimePtr(ppmShipment.ReviewedAt), - ApprovedAt: handlers.FmtDateTimePtr(ppmShipment.ApprovedAt), - PickupPostalCode: &ppmShipment.PickupPostalCode, - SecondaryPickupPostalCode: ppmShipment.SecondaryPickupPostalCode, - ActualPickupPostalCode: ppmShipment.ActualPickupPostalCode, - DestinationPostalCode: &ppmShipment.DestinationPostalCode, - SecondaryDestinationPostalCode: ppmShipment.SecondaryDestinationPostalCode, - ActualDestinationPostalCode: ppmShipment.ActualDestinationPostalCode, - SitExpected: ppmShipment.SITExpected, - SitEstimatedWeight: handlers.FmtPoundPtr(ppmShipment.SITEstimatedWeight), - SitEstimatedEntryDate: handlers.FmtDatePtr(ppmShipment.SITEstimatedEntryDate), - SitEstimatedDepartureDate: handlers.FmtDatePtr(ppmShipment.SITEstimatedDepartureDate), - SitEstimatedCost: handlers.FmtCost(ppmShipment.SITEstimatedCost), - EstimatedWeight: handlers.FmtPoundPtr(ppmShipment.EstimatedWeight), - EstimatedIncentive: handlers.FmtCost(ppmShipment.EstimatedIncentive), - HasProGear: ppmShipment.HasProGear, - ProGearWeight: handlers.FmtPoundPtr(ppmShipment.ProGearWeight), - SpouseProGearWeight: handlers.FmtPoundPtr(ppmShipment.SpouseProGearWeight), - HasRequestedAdvance: ppmShipment.HasRequestedAdvance, - AdvanceAmountRequested: handlers.FmtCost(ppmShipment.AdvanceAmountRequested), - HasReceivedAdvance: ppmShipment.HasReceivedAdvance, - AdvanceAmountReceived: handlers.FmtCost(ppmShipment.AdvanceAmountReceived), - ETag: etag.GenerateEtag(ppmShipment.UpdatedAt), + ID: *handlers.FmtUUID(ppmShipment.ID), + ShipmentID: *handlers.FmtUUID(ppmShipment.ShipmentID), + CreatedAt: strfmt.DateTime(ppmShipment.CreatedAt), + UpdatedAt: strfmt.DateTime(ppmShipment.UpdatedAt), + Status: primev2messages.PPMShipmentStatus(ppmShipment.Status), + ExpectedDepartureDate: handlers.FmtDate(ppmShipment.ExpectedDepartureDate), + ActualMoveDate: handlers.FmtDatePtr(ppmShipment.ActualMoveDate), + SubmittedAt: handlers.FmtDateTimePtr(ppmShipment.SubmittedAt), + ReviewedAt: handlers.FmtDateTimePtr(ppmShipment.ReviewedAt), + ApprovedAt: handlers.FmtDateTimePtr(ppmShipment.ApprovedAt), + ActualPickupPostalCode: ppmShipment.ActualPickupPostalCode, + ActualDestinationPostalCode: ppmShipment.ActualDestinationPostalCode, + SitExpected: ppmShipment.SITExpected, + SitEstimatedWeight: handlers.FmtPoundPtr(ppmShipment.SITEstimatedWeight), + SitEstimatedEntryDate: handlers.FmtDatePtr(ppmShipment.SITEstimatedEntryDate), + SitEstimatedDepartureDate: handlers.FmtDatePtr(ppmShipment.SITEstimatedDepartureDate), + SitEstimatedCost: handlers.FmtCost(ppmShipment.SITEstimatedCost), + EstimatedWeight: handlers.FmtPoundPtr(ppmShipment.EstimatedWeight), + EstimatedIncentive: handlers.FmtCost(ppmShipment.EstimatedIncentive), + HasProGear: ppmShipment.HasProGear, + ProGearWeight: handlers.FmtPoundPtr(ppmShipment.ProGearWeight), + SpouseProGearWeight: handlers.FmtPoundPtr(ppmShipment.SpouseProGearWeight), + HasRequestedAdvance: ppmShipment.HasRequestedAdvance, + AdvanceAmountRequested: handlers.FmtCost(ppmShipment.AdvanceAmountRequested), + HasReceivedAdvance: ppmShipment.HasReceivedAdvance, + AdvanceAmountReceived: handlers.FmtCost(ppmShipment.AdvanceAmountReceived), + ETag: etag.GenerateEtag(ppmShipment.UpdatedAt), } if ppmShipment.SITLocation != nil { diff --git a/pkg/handlers/primeapiv2/payloads/payload_to_model.go b/pkg/handlers/primeapiv2/payloads/payload_to_model.go index a023512eb64..fcc00bcabe3 100644 --- a/pkg/handlers/primeapiv2/payloads/payload_to_model.go +++ b/pkg/handlers/primeapiv2/payloads/payload_to_model.go @@ -210,26 +210,31 @@ func PPMShipmentModelFromCreate(ppmShipment *primev2messages.CreatePPMShipment) } model := &models.PPMShipment{ - Status: models.PPMShipmentStatusSubmitted, - SITExpected: ppmShipment.SitExpected, - SecondaryPickupPostalCode: ppmShipment.SecondaryPickupPostalCode, - SecondaryDestinationPostalCode: ppmShipment.SecondaryDestinationPostalCode, - EstimatedWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.EstimatedWeight), - HasProGear: ppmShipment.HasProGear, + Status: models.PPMShipmentStatusSubmitted, + SITExpected: ppmShipment.SitExpected, + EstimatedWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.EstimatedWeight), + HasProGear: ppmShipment.HasProGear, } + addressModel := &models.Address{ + StreetAddress1: "Deprecated Endpoint Prime V1", + StreetAddress2: models.StringPointer("Endpoint no longer supported"), + StreetAddress3: models.StringPointer("Update address field to appropriate values"), + City: "DEPV1", + State: "CA", + PostalCode: "90210", + Country: models.StringPointer("US"), + } + + model.PickupAddress = addressModel + + model.DestinationAddress = addressModel + expectedDepartureDate := handlers.FmtDatePtrToPopPtr(ppmShipment.ExpectedDepartureDate) if expectedDepartureDate != nil && !expectedDepartureDate.IsZero() { model.ExpectedDepartureDate = *expectedDepartureDate } - if ppmShipment.PickupPostalCode != nil { - model.PickupPostalCode = *ppmShipment.PickupPostalCode - } - if ppmShipment.DestinationPostalCode != nil { - model.DestinationPostalCode = *ppmShipment.DestinationPostalCode - } - if model.SITExpected != nil && *model.SITExpected { if ppmShipment.SitLocation != nil { sitLocation := models.SITLocationType(*ppmShipment.SitLocation) @@ -350,13 +355,11 @@ func PPMShipmentModelFromUpdate(ppmShipment *primev2messages.UpdatePPMShipment) } model := &models.PPMShipment{ - SecondaryPickupPostalCode: ppmShipment.SecondaryPickupPostalCode, - SecondaryDestinationPostalCode: ppmShipment.SecondaryDestinationPostalCode, - SITExpected: ppmShipment.SitExpected, - EstimatedWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.EstimatedWeight), - HasProGear: ppmShipment.HasProGear, - ProGearWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.ProGearWeight), - SpouseProGearWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.SpouseProGearWeight), + SITExpected: ppmShipment.SitExpected, + EstimatedWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.EstimatedWeight), + HasProGear: ppmShipment.HasProGear, + ProGearWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.ProGearWeight), + SpouseProGearWeight: handlers.PoundPtrFromInt64Ptr(ppmShipment.SpouseProGearWeight), } expectedDepartureDate := handlers.FmtDatePtrToPopPtr(ppmShipment.ExpectedDepartureDate) @@ -364,13 +367,6 @@ func PPMShipmentModelFromUpdate(ppmShipment *primev2messages.UpdatePPMShipment) model.ExpectedDepartureDate = *expectedDepartureDate } - if ppmShipment.PickupPostalCode != nil { - model.PickupPostalCode = *ppmShipment.PickupPostalCode - } - if ppmShipment.DestinationPostalCode != nil { - model.DestinationPostalCode = *ppmShipment.DestinationPostalCode - } - if ppmShipment.SitLocation != nil { sitLocation := models.SITLocationType(*ppmShipment.SitLocation) model.SITLocation = &sitLocation diff --git a/pkg/handlers/primeapiv2/payloads/payload_to_model_test.go b/pkg/handlers/primeapiv2/payloads/payload_to_model_test.go index b1e2ad3d482..513a6b6fba0 100644 --- a/pkg/handlers/primeapiv2/payloads/payload_to_model_test.go +++ b/pkg/handlers/primeapiv2/payloads/payload_to_model_test.go @@ -488,8 +488,6 @@ func (suite *PayloadsSuite) TestShipmentAddressUpdateModel() { func (suite *PayloadsSuite) TestPPMShipmentModelFromCreate() { time := time.Now() expectedDepartureDate := handlers.FmtDatePtr(&time) - pickupPostalCode := "" - destinationPostalCode := "" sitExpected := true estimatedWeight := int64(5000) hasProGear := true @@ -498,8 +496,6 @@ func (suite *PayloadsSuite) TestPPMShipmentModelFromCreate() { ppmShipment := primev2messages.CreatePPMShipment{ ExpectedDepartureDate: expectedDepartureDate, - PickupPostalCode: &pickupPostalCode, - DestinationPostalCode: &destinationPostalCode, SitExpected: &sitExpected, EstimatedWeight: &estimatedWeight, HasProGear: &hasProGear, @@ -516,6 +512,4 @@ func (suite *PayloadsSuite) TestPPMShipmentModelFromCreate() { suite.True(*model.HasProGear) suite.Equal(unit.Pound(proGearWeight), *model.ProGearWeight) suite.Equal(unit.Pound(spouseProGearWeight), *model.SpouseProGearWeight) - suite.Equal(pickupPostalCode, model.PickupPostalCode) - suite.Equal(destinationPostalCode, model.DestinationPostalCode) } diff --git a/pkg/handlers/primeapiv3/payloads/payload_to_model.go b/pkg/handlers/primeapiv3/payloads/payload_to_model.go index abdec21acb8..66f72ed17f6 100644 --- a/pkg/handlers/primeapiv3/payloads/payload_to_model.go +++ b/pkg/handlers/primeapiv3/payloads/payload_to_model.go @@ -227,34 +227,22 @@ func PPMShipmentModelFromCreate(ppmShipment *primev3messages.CreatePPMShipment) addressModel = AddressModel(&ppmShipment.PickupAddress.Address) if addressModel != nil { model.PickupAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.PickupPostalCode = addressModel.PostalCode } addressModel = AddressModel(&ppmShipment.SecondaryPickupAddress.Address) if addressModel != nil { model.SecondaryPickupAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.SecondaryPickupPostalCode = &addressModel.PostalCode model.HasSecondaryPickupAddress = handlers.FmtBool(true) } addressModel = AddressModel(&ppmShipment.DestinationAddress.Address) if addressModel != nil { model.DestinationAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.DestinationPostalCode = addressModel.PostalCode } addressModel = AddressModel(&ppmShipment.SecondaryDestinationAddress.Address) if addressModel != nil { model.SecondaryDestinationAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.SecondaryDestinationPostalCode = &addressModel.PostalCode model.HasSecondaryDestinationAddress = handlers.FmtBool(true) } @@ -391,9 +379,6 @@ func PPMShipmentModelFromUpdate(ppmShipment *primev3messages.UpdatePPMShipment) addressModel = AddressModel(&ppmShipment.PickupAddress.Address) if addressModel != nil { model.PickupAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.PickupPostalCode = addressModel.PostalCode } // only assume secondary address is added if has flag is set to true. If false the address will be ignored. @@ -403,18 +388,12 @@ func PPMShipmentModelFromUpdate(ppmShipment *primev3messages.UpdatePPMShipment) model.SecondaryPickupAddress = addressModel secondaryPickupAddressID := uuid.FromStringOrNil(addressModel.ID.String()) model.SecondaryPickupAddressID = &secondaryPickupAddressID - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.SecondaryPickupPostalCode = &addressModel.PostalCode } } addressModel = AddressModel(&ppmShipment.DestinationAddress.Address) if addressModel != nil { model.DestinationAddress = addressModel - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.DestinationPostalCode = addressModel.PostalCode } // only assume secondary address is added if has flag is set to true. If false the address will be ignored. @@ -424,9 +403,6 @@ func PPMShipmentModelFromUpdate(ppmShipment *primev3messages.UpdatePPMShipment) model.SecondaryDestinationAddress = addressModel secondaryDestinationAddressID := uuid.FromStringOrNil(addressModel.ID.String()) model.SecondaryDestinationAddressID = &secondaryDestinationAddressID - // Set legacy postalCode using address. This is to make it backward compatiable with - // existing workflow in v2. Eventually postalCode column will be dropped when v2 is deprecated. - model.SecondaryDestinationPostalCode = &addressModel.PostalCode } } diff --git a/pkg/handlers/primeapiv3/payloads/payload_to_model_test.go b/pkg/handlers/primeapiv3/payloads/payload_to_model_test.go index be9392c0a34..4fe21e6bf60 100644 --- a/pkg/handlers/primeapiv3/payloads/payload_to_model_test.go +++ b/pkg/handlers/primeapiv3/payloads/payload_to_model_test.go @@ -565,10 +565,6 @@ func (suite *PayloadsSuite) TestPPMShipmentModelFromCreate() { suite.True(*model.HasProGear) suite.Equal(unit.Pound(proGearWeight), *model.ProGearWeight) suite.Equal(unit.Pound(spouseProGearWeight), *model.SpouseProGearWeight) - suite.Equal(address.PostalCode, model.PickupPostalCode) - suite.Equal(address.PostalCode, model.DestinationPostalCode) - suite.Equal(address2.PostalCode, *model.SecondaryPickupPostalCode) - suite.Equal(address2.PostalCode, *model.SecondaryDestinationPostalCode) suite.True(*model.HasSecondaryPickupAddress) suite.True(*model.HasSecondaryDestinationAddress) suite.NotNil(model) diff --git a/pkg/models/ppm_shipment.go b/pkg/models/ppm_shipment.go index 30de7fbebf5..bd96929881c 100644 --- a/pkg/models/ppm_shipment.go +++ b/pkg/models/ppm_shipment.go @@ -170,18 +170,14 @@ type PPMShipment struct { ApprovedAt *time.Time `json:"approved_at" db:"approved_at"` W2Address *Address `belongs_to:"addresses" fk_id:"w2_address_id"` W2AddressID *uuid.UUID `db:"w2_address_id"` - PickupPostalCode string `json:"pickup_postal_code" db:"pickup_postal_code"` PickupAddress *Address `belongs_to:"addresses" fk_id:"pickup_postal_address_id"` PickupAddressID *uuid.UUID `db:"pickup_postal_address_id"` - SecondaryPickupPostalCode *string `json:"secondary_pickup_postal_code" db:"secondary_pickup_postal_code"` SecondaryPickupAddress *Address `belongs_to:"addresses" fk_id:"secondary_pickup_postal_address_id"` SecondaryPickupAddressID *uuid.UUID `db:"secondary_pickup_postal_address_id"` HasSecondaryPickupAddress *bool `db:"has_secondary_pickup_address"` ActualPickupPostalCode *string `json:"actual_pickup_postal_code" db:"actual_pickup_postal_code"` - DestinationPostalCode string `json:"destination_postal_code" db:"destination_postal_code"` DestinationAddress *Address `belongs_to:"addresses" fk_id:"destination_postal_address_id"` DestinationAddressID *uuid.UUID `db:"destination_postal_address_id"` - SecondaryDestinationPostalCode *string `json:"secondary_destination_postal_code" db:"secondary_destination_postal_code"` SecondaryDestinationAddress *Address `belongs_to:"addresses" fk_id:"secondary_destination_postal_address_id"` SecondaryDestinationAddressID *uuid.UUID `db:"secondary_destination_postal_address_id"` HasSecondaryDestinationAddress *bool `db:"has_secondary_destination_address"` @@ -241,14 +237,10 @@ func (p PPMShipment) Validate(_ *pop.Connection) (*validate.Errors, error) { &OptionalTimeIsPresent{Name: "ReviewedAt", Field: p.ReviewedAt}, &OptionalTimeIsPresent{Name: "ApprovedAt", Field: p.ApprovedAt}, &OptionalUUIDIsPresent{Name: "W2AddressID", Field: p.W2AddressID}, - &validators.StringIsPresent{Name: "PickupPostalCode", Field: p.PickupPostalCode}, &OptionalUUIDIsPresent{Name: "PickupAddressID", Field: p.PickupAddressID}, - &StringIsNilOrNotBlank{Name: "SecondaryPickupPostalCode", Field: p.SecondaryPickupPostalCode}, &OptionalUUIDIsPresent{Name: "SecondaryPickupAddressID", Field: p.SecondaryPickupAddressID}, &StringIsNilOrNotBlank{Name: "ActualPickupPostalCode", Field: p.ActualPickupPostalCode}, - &validators.StringIsPresent{Name: "DestinationPostalCode", Field: p.DestinationPostalCode}, &OptionalUUIDIsPresent{Name: "DestinationAddressID", Field: p.DestinationAddressID}, - &StringIsNilOrNotBlank{Name: "SecondaryDestinationPostalCode", Field: p.SecondaryDestinationPostalCode}, &OptionalUUIDIsPresent{Name: "SecondaryDestinationAddressID", Field: p.SecondaryDestinationAddressID}, &StringIsNilOrNotBlank{Name: "ActualDestinationPostalCode", Field: p.ActualDestinationPostalCode}, &OptionalPoundIsNonNegative{Name: "EstimatedWeight", Field: p.EstimatedWeight}, diff --git a/pkg/models/ppm_shipment_test.go b/pkg/models/ppm_shipment_test.go index e6a71c90e22..c6fc18b263f 100644 --- a/pkg/models/ppm_shipment_test.go +++ b/pkg/models/ppm_shipment_test.go @@ -19,6 +19,8 @@ func (suite *ModelSuite) TestPPMShipmentValidation() { blankAdvanceStatus := models.PPMAdvanceStatus("") blankSITLocation := models.SITLocationType("") + pickupAddressID, _ := uuid.NewV4() + destinationAddressID, _ := uuid.NewV4() testCases := map[string]struct { ppmShipment models.PPMShipment @@ -29,19 +31,22 @@ func (suite *ModelSuite) TestPPMShipmentValidation() { ShipmentID: uuid.Must(uuid.NewV4()), ExpectedDepartureDate: testdatagen.PeakRateCycleStart, Status: models.PPMShipmentStatusDraft, - PickupPostalCode: "90210", - DestinationPostalCode: "94535", + PickupAddressID: models.UUIDPointer(pickupAddressID), + DestinationAddressID: models.UUIDPointer(destinationAddressID), }, expectedErrs: nil, }, "Missing Required Fields": { - ppmShipment: models.PPMShipment{}, + ppmShipment: models.PPMShipment{ + PickupAddressID: models.UUIDPointer(uuid.Nil), + DestinationAddressID: models.UUIDPointer(uuid.Nil), + }, expectedErrs: map[string][]string{ + "pickup_address_id": {"PickupAddressID can not be blank."}, + "destination_address_id": {"DestinationAddressID can not be blank."}, "shipment_id": {"ShipmentID can not be blank."}, "expected_departure_date": {"ExpectedDepartureDate can not be blank."}, "status": {fmt.Sprintf("Status is not in the list [%s].", validPPMShipmentStatuses)}, - "pickup_postal_code": {"PickupPostalCode can not be blank."}, - "destination_postal_code": {"DestinationPostalCode can not be blank."}, }, }, "Optional fields raise errors with invalid values": { @@ -50,62 +55,60 @@ func (suite *ModelSuite) TestPPMShipmentValidation() { ShipmentID: uuid.Must(uuid.NewV4()), ExpectedDepartureDate: testdatagen.PeakRateCycleStart, Status: models.PPMShipmentStatusDraft, - PickupPostalCode: "90210", - DestinationPostalCode: "94535", // Now setting optional fields with invalid values. - DeletedAt: models.TimePointer(time.Time{}), - ActualMoveDate: models.TimePointer(time.Time{}), - SubmittedAt: models.TimePointer(time.Time{}), - ReviewedAt: models.TimePointer(time.Time{}), - ApprovedAt: models.TimePointer(time.Time{}), - W2AddressID: models.UUIDPointer(uuid.Nil), - SecondaryPickupPostalCode: models.StringPointer(""), - ActualPickupPostalCode: models.StringPointer(""), - SecondaryDestinationPostalCode: models.StringPointer(""), - ActualDestinationPostalCode: models.StringPointer(""), - EstimatedWeight: models.PoundPointer(unit.Pound(-1)), - ProGearWeight: models.PoundPointer(unit.Pound(-1)), - SpouseProGearWeight: models.PoundPointer(unit.Pound(-1)), - EstimatedIncentive: models.CentPointer(unit.Cents(0)), - FinalIncentive: models.CentPointer(unit.Cents(0)), - AdvanceAmountRequested: models.CentPointer(unit.Cents(0)), - AdvanceStatus: &blankAdvanceStatus, - AdvanceAmountReceived: models.CentPointer(unit.Cents(0)), - SITLocation: &blankSITLocation, - SITEstimatedWeight: models.PoundPointer(unit.Pound(-1)), - SITEstimatedEntryDate: models.TimePointer(time.Time{}), - SITEstimatedDepartureDate: models.TimePointer(time.Time{}), - SITEstimatedCost: models.CentPointer(unit.Cents(0)), - AOAPacketID: models.UUIDPointer(uuid.Nil), - PaymentPacketID: models.UUIDPointer(uuid.Nil), + DeletedAt: models.TimePointer(time.Time{}), + ActualMoveDate: models.TimePointer(time.Time{}), + SubmittedAt: models.TimePointer(time.Time{}), + ReviewedAt: models.TimePointer(time.Time{}), + ApprovedAt: models.TimePointer(time.Time{}), + PickupAddressID: models.UUIDPointer(uuid.Nil), + DestinationAddressID: models.UUIDPointer(uuid.Nil), + W2AddressID: models.UUIDPointer(uuid.Nil), + ActualPickupPostalCode: models.StringPointer(""), + ActualDestinationPostalCode: models.StringPointer(""), + EstimatedWeight: models.PoundPointer(unit.Pound(-1)), + ProGearWeight: models.PoundPointer(unit.Pound(-1)), + SpouseProGearWeight: models.PoundPointer(unit.Pound(-1)), + EstimatedIncentive: models.CentPointer(unit.Cents(0)), + FinalIncentive: models.CentPointer(unit.Cents(0)), + AdvanceAmountRequested: models.CentPointer(unit.Cents(0)), + AdvanceStatus: &blankAdvanceStatus, + AdvanceAmountReceived: models.CentPointer(unit.Cents(0)), + SITLocation: &blankSITLocation, + SITEstimatedWeight: models.PoundPointer(unit.Pound(-1)), + SITEstimatedEntryDate: models.TimePointer(time.Time{}), + SITEstimatedDepartureDate: models.TimePointer(time.Time{}), + SITEstimatedCost: models.CentPointer(unit.Cents(0)), + AOAPacketID: models.UUIDPointer(uuid.Nil), + PaymentPacketID: models.UUIDPointer(uuid.Nil), }, expectedErrs: map[string][]string{ - "deleted_at": {"DeletedAt can not be blank."}, - "actual_move_date": {"ActualMoveDate can not be blank."}, - "submitted_at": {"SubmittedAt can not be blank."}, - "reviewed_at": {"ReviewedAt can not be blank."}, - "approved_at": {"ApprovedAt can not be blank."}, - "w2_address_id": {"W2AddressID can not be blank."}, - "secondary_pickup_postal_code": {"SecondaryPickupPostalCode can not be blank."}, - "actual_pickup_postal_code": {"ActualPickupPostalCode can not be blank."}, - "secondary_destination_postal_code": {"SecondaryDestinationPostalCode can not be blank."}, - "actual_destination_postal_code": {"ActualDestinationPostalCode can not be blank."}, - "estimated_weight": {"-1 is less than zero."}, - "pro_gear_weight": {"-1 is less than zero."}, - "spouse_pro_gear_weight": {"-1 is less than zero."}, - "estimated_incentive": {"EstimatedIncentive must be greater than zero, got: 0."}, - "final_incentive": {"FinalIncentive must be greater than zero, got: 0."}, - "advance_amount_requested": {"AdvanceAmountRequested must be greater than zero, got: 0."}, - "advance_status": {fmt.Sprintf("AdvanceStatus is not in the list [%s].", validPPMShipmentAdvanceStatuses)}, - "advance_amount_received": {"AdvanceAmountReceived must be greater than zero, got: 0."}, - "sitlocation": {fmt.Sprintf("SITLocation is not in the list [%s].", validSITLocations)}, - "sitestimated_weight": {"-1 is less than zero."}, - "sitestimated_entry_date": {"SITEstimatedEntryDate can not be blank."}, - "sitestimated_departure_date": {"SITEstimatedDepartureDate can not be blank."}, - "sitestimated_cost": {"SITEstimatedCost must be greater than zero, got: 0."}, - "aoapacket_id": {"AOAPacketID can not be blank."}, - "payment_packet_id": {"PaymentPacketID can not be blank."}, + "deleted_at": {"DeletedAt can not be blank."}, + "actual_move_date": {"ActualMoveDate can not be blank."}, + "submitted_at": {"SubmittedAt can not be blank."}, + "reviewed_at": {"ReviewedAt can not be blank."}, + "approved_at": {"ApprovedAt can not be blank."}, + "pickup_address_id": {"PickupAddressID can not be blank."}, + "destination_address_id": {"DestinationAddressID can not be blank."}, + "w2_address_id": {"W2AddressID can not be blank."}, + "actual_pickup_postal_code": {"ActualPickupPostalCode can not be blank."}, + "actual_destination_postal_code": {"ActualDestinationPostalCode can not be blank."}, + "estimated_weight": {"-1 is less than zero."}, + "pro_gear_weight": {"-1 is less than zero."}, + "spouse_pro_gear_weight": {"-1 is less than zero."}, + "estimated_incentive": {"EstimatedIncentive must be greater than zero, got: 0."}, + "final_incentive": {"FinalIncentive must be greater than zero, got: 0."}, + "advance_amount_requested": {"AdvanceAmountRequested must be greater than zero, got: 0."}, + "advance_status": {fmt.Sprintf("AdvanceStatus is not in the list [%s].", validPPMShipmentAdvanceStatuses)}, + "advance_amount_received": {"AdvanceAmountReceived must be greater than zero, got: 0."}, + "sitlocation": {fmt.Sprintf("SITLocation is not in the list [%s].", validSITLocations)}, + "sitestimated_weight": {"-1 is less than zero."}, + "sitestimated_entry_date": {"SITEstimatedEntryDate can not be blank."}, + "sitestimated_departure_date": {"SITEstimatedDepartureDate can not be blank."}, + "sitestimated_cost": {"SITEstimatedCost must be greater than zero, got: 0."}, + "aoapacket_id": {"AOAPacketID can not be blank."}, + "payment_packet_id": {"PaymentPacketID can not be blank."}, }, }, } diff --git a/pkg/notifications/ppm_packet_email.go b/pkg/notifications/ppm_packet_email.go index 07c50b64499..8d294099d6e 100644 --- a/pkg/notifications/ppm_packet_email.go +++ b/pkg/notifications/ppm_packet_email.go @@ -104,8 +104,8 @@ func (p PpmPacketEmail) GetEmailData(appCtx appcontext.AppContext) (PpmPacketEma err := appCtx.DB().Find(&ppmShipment, p.ppmShipmentID) if err != nil { return PpmPacketEmailData{}, LoggerData{}, err - } else if ppmShipment.PickupPostalCode == "" || ppmShipment.DestinationPostalCode == "" { - return PpmPacketEmailData{}, LoggerData{}, fmt.Errorf("no pickup or destination postal code found for this shipment") + } else if ppmShipment.PickupAddressID == nil || ppmShipment.DestinationAddressID == nil { + return PpmPacketEmailData{}, LoggerData{}, fmt.Errorf("no pickup or destination address found for this shipment") } var mtoShipment models.MTOShipment @@ -181,8 +181,8 @@ func (p PpmPacketEmail) GetEmailData(appCtx appcontext.AppContext) (PpmPacketEma // Fallback to using ZIPs if the above if-block for city,state doesn't happen return PpmPacketEmailData{ - OriginZIP: &ppmShipment.PickupPostalCode, - DestinationZIP: &ppmShipment.DestinationPostalCode, + OriginZIP: &ppmShipment.PickupAddress.PostalCode, + DestinationZIP: &ppmShipment.DestinationAddress.PostalCode, SubmitLocation: submitLocation, ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], Locator: move.Locator, diff --git a/pkg/notifications/ppm_packet_email_test.go b/pkg/notifications/ppm_packet_email_test.go index 36d72955910..561e028d7a6 100644 --- a/pkg/notifications/ppm_packet_email_test.go +++ b/pkg/notifications/ppm_packet_email_test.go @@ -93,13 +93,11 @@ func (suite *NotificationSuite) TestPpmPacketEmailHTMLTemplateRenderForAirAndSpa }, nil) customPPM := models.PPMShipment{ - ID: uuid.Must(uuid.NewV4()), - ShipmentID: shipment.ID, - Status: models.PPMShipmentStatusWaitingOnCustomer, - PickupAddressID: &pickupAddress.ID, - DestinationAddressID: &destinationAddress.ID, - PickupPostalCode: "33169", - DestinationPostalCode: "33040", + ID: uuid.Must(uuid.NewV4()), + ShipmentID: shipment.ID, + Status: models.PPMShipmentStatusWaitingOnCustomer, + PickupAddressID: &pickupAddress.ID, + DestinationAddressID: &destinationAddress.ID, } ppmShipment := factory.BuildPPMShipmentReadyForFinalCustomerCloseOut(suite.DB(), nil, []factory.Customization{ @@ -185,13 +183,11 @@ func (suite *NotificationSuite) TestPpmPacketEmailHTMLTemplateRenderForArmy() { }, nil) customPPM := models.PPMShipment{ - ID: uuid.Must(uuid.NewV4()), - ShipmentID: shipment.ID, - Status: models.PPMShipmentStatusWaitingOnCustomer, - PickupAddressID: &pickupAddress.ID, - DestinationAddressID: &destinationAddress.ID, - PickupPostalCode: pickupAddress.PostalCode, - DestinationPostalCode: destinationAddress.PostalCode, + ID: uuid.Must(uuid.NewV4()), + ShipmentID: shipment.ID, + Status: models.PPMShipmentStatusWaitingOnCustomer, + PickupAddressID: &pickupAddress.ID, + DestinationAddressID: &destinationAddress.ID, } ppmShipment := factory.BuildPPMShipmentReadyForFinalCustomerCloseOut(suite.DB(), nil, []factory.Customization{ @@ -277,13 +273,11 @@ func (suite *NotificationSuite) TestPpmPacketEmailHTMLTemplateRenderForNavalBran }, nil) customPPM := models.PPMShipment{ - ID: uuid.Must(uuid.NewV4()), - ShipmentID: shipment.ID, - Status: models.PPMShipmentStatusWaitingOnCustomer, - PickupAddressID: &pickupAddress.ID, - DestinationAddressID: &destinationAddress.ID, - PickupPostalCode: pickupAddress.PostalCode, - DestinationPostalCode: destinationAddress.PostalCode, + ID: uuid.Must(uuid.NewV4()), + ShipmentID: shipment.ID, + Status: models.PPMShipmentStatusWaitingOnCustomer, + PickupAddressID: &pickupAddress.ID, + DestinationAddressID: &destinationAddress.ID, } ppmShipment := factory.BuildPPMShipmentReadyForFinalCustomerCloseOut(suite.DB(), nil, []factory.Customization{ @@ -370,13 +364,11 @@ func (suite *NotificationSuite) TestPpmPacketEmailTextTemplateRender() { }, nil) customPPM := models.PPMShipment{ - ID: uuid.Must(uuid.NewV4()), - ShipmentID: shipment.ID, - Status: models.PPMShipmentStatusWaitingOnCustomer, - PickupAddressID: &pickupAddress.ID, - DestinationAddressID: &destinationAddress.ID, - PickupPostalCode: "79329", - DestinationPostalCode: "90210", + ID: uuid.Must(uuid.NewV4()), + ShipmentID: shipment.ID, + Status: models.PPMShipmentStatusWaitingOnCustomer, + PickupAddressID: &pickupAddress.ID, + DestinationAddressID: &destinationAddress.ID, } ppmShipment := factory.BuildPPMShipmentReadyForFinalCustomerCloseOut(suite.DB(), nil, []factory.Customization{ @@ -440,11 +432,9 @@ func (suite *NotificationSuite) TestPpmPacketEmailZipcodeFallback() { }, nil) customPPM := models.PPMShipment{ - ID: uuid.Must(uuid.NewV4()), - ShipmentID: shipment.ID, - Status: models.PPMShipmentStatusWaitingOnCustomer, - PickupPostalCode: "79329", - DestinationPostalCode: "90210", + ID: uuid.Must(uuid.NewV4()), + ShipmentID: shipment.ID, + Status: models.PPMShipmentStatusWaitingOnCustomer, } ppmShipment := factory.BuildPPMShipmentReadyForFinalCustomerCloseOut(suite.DB(), nil, []factory.Customization{ diff --git a/pkg/paperwork/evaluation_report.go b/pkg/paperwork/evaluation_report.go index 5da62044319..8e12454489c 100644 --- a/pkg/paperwork/evaluation_report.go +++ b/pkg/paperwork/evaluation_report.go @@ -329,8 +329,8 @@ func FormatValuesShipment(shipment models.MTOShipment) ShipmentValues { ShipmentType: string(shipment.ShipmentType), } if shipment.PPMShipment != nil { - vals.PPMOriginZIP = shipment.PPMShipment.PickupPostalCode - vals.PPMDestinationZIP = shipment.PPMShipment.DestinationPostalCode + vals.PPMOriginZIP = shipment.PPMShipment.PickupAddress.PostalCode + vals.PPMDestinationZIP = shipment.PPMShipment.DestinationAddress.PostalCode vals.PPMDepartureDate = shipment.PPMShipment.ExpectedDepartureDate.Format(dateFormat) } if shipment.StorageFacility != nil { diff --git a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go index d1e0b8593f6..bd79d1f8560 100644 --- a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go +++ b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go @@ -67,8 +67,8 @@ func (suite *ServiceParamValueLookupsSuite) TestDistanceLookup() { ppmShipment := factory.BuildPPMShipment(suite.DB(), nil, nil) distanceZipLookup := DistanceZipLookup{ - PickupAddress: models.Address{PostalCode: ppmShipment.PickupPostalCode}, - DestinationAddress: models.Address{PostalCode: ppmShipment.DestinationPostalCode}, + PickupAddress: models.Address{PostalCode: ppmShipment.PickupAddress.PostalCode}, + DestinationAddress: models.Address{PostalCode: ppmShipment.DestinationAddress.PostalCode}, } appContext := suite.AppContextForTest() @@ -79,7 +79,7 @@ func (suite *ServiceParamValueLookupsSuite) TestDistanceLookup() { suite.NoError(err) planner := suite.planner.(*mocks.Planner) - planner.AssertCalled(suite.T(), "ZipTransitDistance", appContext, ppmShipment.PickupPostalCode, ppmShipment.DestinationPostalCode) + planner.AssertCalled(suite.T(), "ZipTransitDistance", appContext, ppmShipment.PickupAddress.PostalCode, ppmShipment.DestinationAddress.PostalCode) err = suite.DB().Reload(&ppmShipment.Shipment) suite.NoError(err) @@ -98,8 +98,8 @@ func (suite *ServiceParamValueLookupsSuite) TestDistanceLookup() { }, }, nil) distanceZipLookup := DistanceZipLookup{ - PickupAddress: models.Address{PostalCode: ppmShipment.PickupPostalCode}, - DestinationAddress: models.Address{PostalCode: ppmShipment.DestinationPostalCode}, + PickupAddress: models.Address{PostalCode: ppmShipment.PickupAddress.PostalCode}, + DestinationAddress: models.Address{PostalCode: ppmShipment.DestinationAddress.PostalCode}, } appContext := suite.AppContextForTest() @@ -110,7 +110,7 @@ func (suite *ServiceParamValueLookupsSuite) TestDistanceLookup() { suite.NoError(err) planner := suite.planner.(*mocks.Planner) - planner.AssertCalled(suite.T(), "ZipTransitDistance", appContext, ppmShipment.PickupPostalCode, ppmShipment.DestinationPostalCode) + planner.AssertCalled(suite.T(), "ZipTransitDistance", appContext, ppmShipment.PickupAddress.PostalCode, ppmShipment.DestinationAddress.PostalCode) err = suite.DB().Reload(&ppmShipment.Shipment) suite.NoError(err) diff --git a/pkg/services/order/order_fetcher_test.go b/pkg/services/order/order_fetcher_test.go index c16c8420cba..83f3a68b44c 100644 --- a/pkg/services/order/order_fetcher_test.go +++ b/pkg/services/order/order_fetcher_test.go @@ -361,6 +361,7 @@ func (suite *OrderServiceSuite) TestListOrders() { // Under test: ListOrders // Set up: Make 2 moves, with different ppm types, and search for both types // Expected outcome: search results should only include the move with the PPM type that was searched for + postalCode := "50309" officeUser, partialPPMMove, session := setupTestData() suite.Equal("PARTIAL", *partialPPMMove.PPMType) ppmShipment := factory.BuildPPMShipmentThatNeedsCloseout(suite.DB(), nil, []factory.Customization{ @@ -370,6 +371,12 @@ func (suite *OrderServiceSuite) TestListOrders() { Locator: "FULLLL", }, }, + { + Model: models.Address{ + PostalCode: postalCode, + }, + Type: &factory.Addresses.PickupAddress, + }, }) fullPPMMove := ppmShipment.Shipment.MoveTaskOrder @@ -398,8 +405,16 @@ func (suite *OrderServiceSuite) TestListOrders() { // Expected outcome: search results should only include the move with the PPM status that was searched for officeUser, partialPPMMove, session := setupTestData() suite.Equal("PARTIAL", *partialPPMMove.PPMType) + postalCode := "50309" - ppmShipmentNeedsCloseout := factory.BuildPPMShipmentThatNeedsCloseout(suite.DB(), nil, nil) + ppmShipmentNeedsCloseout := factory.BuildPPMShipmentThatNeedsCloseout(suite.DB(), nil, []factory.Customization{ + { + Model: models.Address{ + PostalCode: postalCode, + }, + Type: &factory.Addresses.PickupAddress, + }, + }) // Search for PARTIAL PPM moves moves, _, err := orderFetcher.ListOrders(suite.AppContextWithSessionForTest(&session), officeUser.ID, &services.ListOrderParams{ PPMStatus: models.StringPointer("NEEDS_CLOSEOUT"), @@ -409,7 +424,14 @@ func (suite *OrderServiceSuite) TestListOrders() { suite.Equal(1, len(moves)) suite.Equal(moves[0].MTOShipments[0].PPMShipment.Status, ppmShipmentNeedsCloseout.Shipment.PPMShipment.Status) - ppmShipmentWaiting := factory.BuildPPMShipmentThatNeedsToBeResubmitted(suite.DB(), nil) + ppmShipmentWaiting := factory.BuildPPMShipmentThatNeedsToBeResubmitted(suite.DB(), nil, []factory.Customization{ + { + Model: models.Address{ + PostalCode: postalCode, + }, + Type: &factory.Addresses.PickupAddress, + }, + }) // Search for FULL PPM moves moves, _, err = orderFetcher.ListOrders(suite.AppContextWithSessionForTest(&session), officeUser.ID, &services.ListOrderParams{ PPMStatus: models.StringPointer("WAITING_ON_CUSTOMER"), @@ -457,6 +479,7 @@ func (suite *OrderServiceSuite) TestListOrders() { // Set up: Make 2 moves with PPM shipments ready for closeout, with different submitted_at times, // and search for a specific move // Expected outcome: Only the one move with the right date should be returned + postalCode := "50309" officeUser, _, session := setupTestData() // Create a PPM submitted on April 1st @@ -467,6 +490,12 @@ func (suite *OrderServiceSuite) TestListOrders() { SubmittedAt: &closeoutInitiatedDate, }, }, + { + Model: models.Address{ + PostalCode: postalCode, + }, + Type: &factory.Addresses.PickupAddress, + }, }) // Create a PPM submitted on April 2nd @@ -495,6 +524,7 @@ func (suite *OrderServiceSuite) TestListOrders() { // Set up: Make one move with multiple ppm shipments with different closeout initiated times, and // search for multiple different times // Expected outcome: Only a search for the latest of the closeout dates should find the move + postalCode := "50309" officeUser, _, session := setupTestData() // Create a PPM submitted on April 1st @@ -505,6 +535,12 @@ func (suite *OrderServiceSuite) TestListOrders() { SubmittedAt: &closeoutInitiatedDate, }, }, + { + Model: models.Address{ + PostalCode: postalCode, + }, + Type: &factory.Addresses.PickupAddress, + }, }) // Add another PPM for the same move submitted on April 1st closeoutInitiatedDate2 := time.Date(2022, 04, 02, 0, 0, 0, 0, time.UTC) @@ -1855,7 +1891,7 @@ func (suite *OrderServiceSuite) TestListOrdersForTOOWithNTSRelease() { } func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPM() { - postalCode := "90210" + postalCode := "50309" partialPPMType := models.MovePPMTypePARTIAL ppmShipment := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ @@ -1871,9 +1907,10 @@ func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPM() { }, }, { - Model: models.PPMShipment{ - PickupPostalCode: postalCode, + Model: models.Address{ + PostalCode: postalCode, }, + Type: &factory.Addresses.PickupAddress, }, }, nil) // Make a TOO user. @@ -1887,7 +1924,7 @@ func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPM() { } // GBLOC for the below doesn't really matter, it just means the query for the moves passes the inner join in ListOrders - factory.FetchOrBuildPostalCodeToGBLOC(suite.DB(), ppmShipment.PickupPostalCode, tooOfficeUser.TransportationOffice.Gbloc) + factory.FetchOrBuildPostalCodeToGBLOC(suite.DB(), ppmShipment.PickupAddress.PostalCode, tooOfficeUser.TransportationOffice.Gbloc) orderFetcher := NewOrderFetcher() moves, moveCount, err := orderFetcher.ListOrders(suite.AppContextWithSessionForTest(&session), tooOfficeUser.ID, &services.ListOrderParams{}) @@ -1897,7 +1934,7 @@ func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPM() { } func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPMWithDeletedShipment() { - postalCode := "90210" + postalCode := "50309" deletedAt := time.Now() move := factory.BuildMove(suite.DB(), []factory.Customization{ { @@ -1908,9 +1945,10 @@ func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPMWithDeletedShipment() }, nil) ppmShipment := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ { - Model: models.PPMShipment{ - PickupPostalCode: postalCode, + Model: models.Address{ + PostalCode: postalCode, }, + Type: &factory.Addresses.PickupAddress, }, }, nil) factory.BuildMTOShipment(suite.DB(), []factory.Customization{ @@ -1948,7 +1986,7 @@ func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPMWithDeletedShipment() } func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPMWithOneDeletedShipmentButOtherExists() { - postalCode := "90210" + postalCode := "50309" deletedAt := time.Now() move := factory.BuildMove(suite.DB(), []factory.Customization{ { @@ -1965,10 +2003,15 @@ func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPMWithOneDeletedShipmen }, { Model: models.PPMShipment{ - PickupPostalCode: postalCode, - CreatedAt: time.Now(), + CreatedAt: time.Now(), }, }, + { + Model: models.Address{ + PostalCode: postalCode, + }, + Type: &factory.Addresses.PickupAddress, + }, }, nil) // This shipment is created after the first one, but not deleted factory.BuildPPMShipment(suite.DB(), []factory.Customization{ @@ -1978,9 +2021,14 @@ func (suite *OrderServiceSuite) TestListOrdersForTOOWithPPMWithOneDeletedShipmen }, { Model: models.PPMShipment{ - PickupPostalCode: postalCode, - CreatedAt: time.Now().Add(time.Minute * time.Duration(1)), + CreatedAt: time.Now().Add(time.Minute * time.Duration(1)), + }, + }, + { + Model: models.Address{ + PostalCode: postalCode, }, + Type: &factory.Addresses.PickupAddress, }, }, nil) factory.BuildMTOShipment(suite.DB(), []factory.Customization{ diff --git a/pkg/services/ppm_closeout/ppm_closeout_test.go b/pkg/services/ppm_closeout/ppm_closeout_test.go index 9bcc78587aa..cbf7c94e90a 100644 --- a/pkg/services/ppm_closeout/ppm_closeout_test.go +++ b/pkg/services/ppm_closeout/ppm_closeout_test.go @@ -348,7 +348,7 @@ func (suite *PPMCloseoutSuite) TestPPMShipmentCreator() { appCtx := suite.AppContextForTest() mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) mockedPaymentRequestHelper.On( "FetchServiceParamsForServiceItems", diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index 77e9c62eb67..6d56fc15f75 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -247,8 +247,6 @@ func (f estimatePPM) calculatePrice(appCtx appcontext.AppContext, ppmShipment *m // Check different address values for a postal code if ppmShipment.ActualPickupPostalCode != nil { pickupPostal = *ppmShipment.ActualPickupPostalCode - } else if ppmShipment.PickupPostalCode != "" { - pickupPostal = ppmShipment.PickupPostalCode } else if ppmShipment.PickupAddress.PostalCode != "" { pickupPostal = ppmShipment.PickupAddress.PostalCode } @@ -256,8 +254,6 @@ func (f estimatePPM) calculatePrice(appCtx appcontext.AppContext, ppmShipment *m // Same for destination if ppmShipment.ActualDestinationPostalCode != nil { destPostal = *ppmShipment.ActualDestinationPostalCode - } else if ppmShipment.DestinationPostalCode != "" { - destPostal = ppmShipment.DestinationPostalCode } else if ppmShipment.DestinationAddress.PostalCode != "" { destPostal = ppmShipment.DestinationAddress.PostalCode } diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index a94fe259e93..9089a340e57 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -776,7 +776,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { oldPPMShipment := factory.BuildPPMShipmentThatNeedsCloseout(suite.DB(), nil, []factory.Customization{ { Model: models.PPMShipment{ - ActualPickupPostalCode: models.StringPointer("90210"), + ActualPickupPostalCode: models.StringPointer("50309"), ActualDestinationPostalCode: models.StringPointer("30813"), ActualMoveDate: models.TimePointer(moveDate), FinalIncentive: models.CentPointer(unit.Cents(500000)), @@ -815,13 +815,13 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { // DTOD distance is going to be less than the HHG Rand McNally distance of 2361 miles mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) ppmFinal, err := ppmEstimator.FinalIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM) suite.NilOrNoVerrs(err) mockedPlanner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813") + "50309", "30813") mockedPaymentRequestHelper.AssertCalled(suite.T(), "FetchServiceParamsForServiceItems", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]models.MTOServiceItem")) originalWeight, newWeight := SumWeightTickets(oldPPMShipment, newPPM) @@ -839,7 +839,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { oldPPMShipment := factory.BuildPPMShipmentThatNeedsCloseout(suite.DB(), nil, []factory.Customization{ { Model: models.PPMShipment{ - ActualPickupPostalCode: models.StringPointer("90210"), + ActualPickupPostalCode: models.StringPointer("50309"), ActualDestinationPostalCode: models.StringPointer("30813"), ActualMoveDate: models.TimePointer(moveDate), FinalIncentive: models.CentPointer(unit.Cents(500000)), @@ -885,13 +885,13 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { // DTOD distance is going to be less than the HHG Rand McNally distance of 2361 miles mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) ppmFinal, err := ppmEstimator.FinalIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM) suite.NilOrNoVerrs(err) mockedPlanner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813") + "50309", "30813") mockedPaymentRequestHelper.AssertCalled(suite.T(), "FetchServiceParamsForServiceItems", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]models.MTOServiceItem")) originalWeight, newWeight := SumWeightTickets(oldPPMShipment, newPPM) @@ -908,7 +908,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { oldPPMShipment := factory.BuildPPMShipmentThatNeedsCloseout(suite.DB(), nil, []factory.Customization{ { Model: models.PPMShipment{ - ActualPickupPostalCode: models.StringPointer("90210"), + ActualPickupPostalCode: models.StringPointer("50309"), ActualDestinationPostalCode: models.StringPointer("30813"), ActualMoveDate: models.TimePointer(moveDate), FinalIncentive: models.CentPointer(unit.Cents(500000)), @@ -1366,7 +1366,6 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { shipmentOriginSIT := factory.BuildPPMShipment(nil, []factory.Customization{ { Model: models.PPMShipment{ - DestinationPostalCode: "30813", SITExpected: models.BoolPointer(true), SITLocation: &originLocation, SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), @@ -1402,10 +1401,9 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, }, nil) - shipmentOriginSIT := factory.BuildPPMShipment(nil, []factory.Customization{ + shipmentDestinationSIT := factory.BuildPPMShipment(nil, []factory.Customization{ { Model: models.PPMShipment{ - DestinationPostalCode: "30813", SITExpected: models.BoolPointer(true), SITLocation: &destinationLocation, SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), @@ -1413,6 +1411,30 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { SITEstimatedDepartureDate: models.TimePointer(entryDate.Add(time.Hour * 24 * 30)), }, }, + { + Model: &models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 1234"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Des Moines", + State: "IA", + PostalCode: "50309", + Country: models.StringPointer("US"), + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: &models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 12345"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Fort Eisenhower", + State: "GA", + PostalCode: "30813", + Country: models.StringPointer("US"), + }, + Type: &factory.Addresses.DeliveryAddress, + }, { Model: mtoShipment, LinkOnly: true, @@ -1422,7 +1444,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), "50309", "30813").Return(2294, nil) - _, estimatedSITCost, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), models.PPMShipment{}, &shipmentOriginSIT) + _, estimatedSITCost, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), models.PPMShipment{}, &shipmentDestinationSIT) suite.NoError(err) suite.NotNil(estimatedSITCost) @@ -1445,7 +1467,6 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { shipmentOriginSIT := factory.BuildPPMShipment(nil, []factory.Customization{ { Model: models.PPMShipment{ - DestinationPostalCode: "30813", SITExpected: models.BoolPointer(true), SITLocation: &destinationLocation, SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), @@ -1453,6 +1474,30 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { SITEstimatedDepartureDate: &entryDate, }, }, + { + Model: models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 1234"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Des Moines", + State: "IA", + PostalCode: "50309", + Country: models.StringPointer("US"), + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 12345"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Fort Eisenhower", + State: "GA", + PostalCode: "50309", + Country: models.StringPointer("US"), + }, + Type: &factory.Addresses.DeliveryAddress, + }, { Model: mtoShipment, LinkOnly: true, diff --git a/pkg/services/ppmshipment/ppm_shipment_creator_test.go b/pkg/services/ppmshipment/ppm_shipment_creator_test.go index eb230b4062c..44fd6a29ce5 100644 --- a/pkg/services/ppmshipment/ppm_shipment_creator_test.go +++ b/pkg/services/ppmshipment/ppm_shipment_creator_test.go @@ -70,9 +70,25 @@ func (suite *PPMShipmentSuite) TestPPMShipmentCreator() { // Set required fields for PPMShipment subtestData := createSubtestData(models.PPMShipment{ ExpectedDepartureDate: testdatagen.NextValidMoveDate, - PickupPostalCode: "90909", - DestinationPostalCode: "90905", SITExpected: models.BoolPointer(false), + PickupAddress: &models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 1234"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Des Moines", + State: "IA", + PostalCode: "50308", + Country: models.StringPointer("US"), + }, + DestinationAddress: &models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 12345"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Fort Eisenhower", + State: "GA", + PostalCode: "30183", + Country: models.StringPointer("US"), + }, }, nil) ppmEstimator.On( @@ -160,8 +176,6 @@ func (suite *PPMShipmentSuite) TestPPMShipmentCreator() { // Set required fields for PPMShipment expectedDepartureDate := testdatagen.NextValidMoveDate - pickupPostalCode := "29212" - destinationPostalCode := "78234" sitExpected := false estimatedWeight := unit.Pound(2450) hasProGear := false @@ -198,8 +212,6 @@ func (suite *PPMShipmentSuite) TestPPMShipmentCreator() { subtestData := createSubtestData(models.PPMShipment{ Status: models.PPMShipmentStatusSubmitted, ExpectedDepartureDate: expectedDepartureDate, - PickupPostalCode: pickupPostalCode, - DestinationPostalCode: destinationPostalCode, SITExpected: &sitExpected, EstimatedWeight: &estimatedWeight, HasProGear: &hasProGear, @@ -223,8 +235,6 @@ func (suite *PPMShipmentSuite) TestPPMShipmentCreator() { suite.NotZero(createdPPMShipment.ID) suite.NotEqual(uuid.Nil.String(), createdPPMShipment.ID.String()) suite.Equal(expectedDepartureDate, createdPPMShipment.ExpectedDepartureDate) - suite.Equal(pickupPostalCode, createdPPMShipment.PickupPostalCode) - suite.Equal(destinationPostalCode, createdPPMShipment.DestinationPostalCode) suite.Equal(&sitExpected, createdPPMShipment.SITExpected) suite.Equal(&estimatedWeight, createdPPMShipment.EstimatedWeight) suite.Equal(&hasProGear, createdPPMShipment.HasProGear) diff --git a/pkg/services/ppmshipment/ppm_shipment_router_test.go b/pkg/services/ppmshipment/ppm_shipment_router_test.go index 690a2e329df..8b4d95ece91 100644 --- a/pkg/services/ppmshipment/ppm_shipment_router_test.go +++ b/pkg/services/ppmshipment/ppm_shipment_router_test.go @@ -316,7 +316,7 @@ func (suite *PPMShipmentSuite) TestSubmitCloseOutDocumentation() { }) suite.Run("Does not set the SubmittedAt time if it is already set", func() { - ppmShipment := factory.BuildPPMShipmentThatNeedsToBeResubmitted(nil, nil) + ppmShipment := factory.BuildPPMShipmentThatNeedsToBeResubmitted(nil, nil, nil) suite.FatalNotNil(ppmShipment.SubmittedAt) originalSubmittedAt := *ppmShipment.SubmittedAt diff --git a/pkg/services/ppmshipment/ppm_shipment_updater_test.go b/pkg/services/ppmshipment/ppm_shipment_updater_test.go index 728b8f08366..775a74eb510 100644 --- a/pkg/services/ppmshipment/ppm_shipment_updater_test.go +++ b/pkg/services/ppmshipment/ppm_shipment_updater_test.go @@ -95,17 +95,55 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { { Model: models.PPMShipment{ ExpectedDepartureDate: testdatagen.NextValidMoveDate, - PickupPostalCode: "79912", - DestinationPostalCode: "90909", SITExpected: models.BoolPointer(false), }, }, + { + Model: models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 1234"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Des Moines", + State: "IA", + PostalCode: "50309", + Country: models.StringPointer("US"), + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 12345"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Fort Eisenhower", + State: "GA", + PostalCode: "50309", + Country: models.StringPointer("US"), + }, + Type: &factory.Addresses.DeliveryAddress, + }, }, nil) newPPM := models.PPMShipment{ ExpectedDepartureDate: testdatagen.NextValidMoveDate.Add(testdatagen.OneWeek), - PickupPostalCode: "79906", - DestinationPostalCode: "94303", SITExpected: models.BoolPointer(true), + PickupAddress: &models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 1234"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Des Moines", + State: "IA", + PostalCode: "50308", + Country: models.StringPointer("US"), + }, + DestinationAddress: &models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 12345"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Fort Eisenhower", + State: "GA", + PostalCode: "30183", + Country: models.StringPointer("US"), + }, } updatedPPM, err := subtestData.ppmShipmentUpdater.UpdatePPMShipmentWithDefaultCheck(appCtx, &newPPM, originalPPM.ShipmentID) @@ -114,8 +152,8 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that should now be updated suite.Equal(newPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(newPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(newPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) + suite.Equal(newPPM.PickupAddress.PostalCode, updatedPPM.PickupAddress.PostalCode) + suite.Equal(newPPM.DestinationAddress.PostalCode, updatedPPM.DestinationAddress.PostalCode) suite.Equal(newPPM.SITExpected, updatedPPM.SITExpected) // Estimated Incentive shouldn't be set since we don't have all the necessary fields. @@ -133,8 +171,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { { Model: models.PPMShipment{ ExpectedDepartureDate: testdatagen.NextValidMoveDate, - PickupPostalCode: "79912", - DestinationPostalCode: "90909", SITExpected: models.BoolPointer(false), EstimatedWeight: models.PoundPointer(4000), HasProGear: models.BoolPointer(false), @@ -145,8 +181,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { newPPM := models.PPMShipment{ ExpectedDepartureDate: testdatagen.NextValidMoveDate.Add(testdatagen.OneWeek), - PickupPostalCode: "79906", - DestinationPostalCode: "94303", SITExpected: models.BoolPointer(true), } @@ -160,78 +194,10 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that should now be updated suite.Equal(newPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(newPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(newPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(newPPM.SITExpected, updatedPPM.SITExpected) suite.Equal(*newFakeEstimatedIncentive, *updatedPPM.EstimatedIncentive) }) - suite.Run("Can successfully update a PPMShipment - edit estimated dates & locations - add secondary zips", func() { - appCtx := suite.AppContextWithSessionForTest(&auth.Session{}) - - subtestData := setUpForTests(nil, nil, nil) - - originalPPM := factory.BuildMinimalPPMShipment(appCtx.DB(), nil, nil) - - newPPM := models.PPMShipment{ - SecondaryPickupPostalCode: models.StringPointer("79906"), - SecondaryDestinationPostalCode: models.StringPointer("94303"), - } - - updatedPPM, err := subtestData.ppmShipmentUpdater.UpdatePPMShipmentWithDefaultCheck(appCtx, &newPPM, originalPPM.ShipmentID) - - suite.NilOrNoVerrs(err) - - // Fields that shouldn't have changed - suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) - suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) - - // Fields that should now be updated - suite.Equal(*newPPM.SecondaryPickupPostalCode, *updatedPPM.SecondaryPickupPostalCode) - suite.Equal(*newPPM.SecondaryDestinationPostalCode, *updatedPPM.SecondaryDestinationPostalCode) - - // Estimated Incentive shouldn't be set since we don't have all the necessary fields. - suite.Nil(updatedPPM.EstimatedIncentive) - }) - - suite.Run("Can successfully update a PPMShipment - edit estimated dates & locations - remove secondary zips", func() { - appCtx := suite.AppContextWithSessionForTest(&auth.Session{}) - - subtestData := setUpForTests(nil, nil, nil) - - originalPPM := factory.BuildMinimalPPMShipment(appCtx.DB(), []factory.Customization{ - { - Model: models.PPMShipment{ - SecondaryPickupPostalCode: models.StringPointer("79906"), - SecondaryDestinationPostalCode: models.StringPointer("94303"), - }, - }, - }, nil) - newPPM := models.PPMShipment{ - SecondaryPickupPostalCode: models.StringPointer(""), - SecondaryDestinationPostalCode: models.StringPointer(""), - } - - updatedPPM, err := subtestData.ppmShipmentUpdater.UpdatePPMShipmentWithDefaultCheck(appCtx, &newPPM, originalPPM.ShipmentID) - - suite.NilOrNoVerrs(err) - - // Fields that shouldn't have changed - suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) - suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) - - // Fields that should now be updated - suite.Nil(updatedPPM.SecondaryPickupPostalCode) - suite.Nil(updatedPPM.SecondaryDestinationPostalCode) - - // Estimated Incentive shouldn't be set since we don't have all the necessary fields. - suite.Nil(updatedPPM.EstimatedIncentive) - }) - suite.Run("Can successfully update a PPMShipment - add estimated weights - no pro gear", func() { appCtx := suite.AppContextWithSessionForTest(&auth.Session{}) @@ -250,8 +216,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) // Fields that should now be updated @@ -285,8 +249,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) // Fields that should now be updated @@ -329,8 +291,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) // Fields that should now be updated @@ -371,8 +331,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) // Fields that should now be updated @@ -407,8 +365,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) suite.Equal(*originalPPM.EstimatedWeight, *updatedPPM.EstimatedWeight) suite.Equal(*originalPPM.HasProGear, *updatedPPM.HasProGear) @@ -446,8 +402,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) suite.Equal(*originalPPM.EstimatedWeight, *updatedPPM.EstimatedWeight) suite.Equal(*originalPPM.HasProGear, *updatedPPM.HasProGear) @@ -486,8 +440,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) suite.Equal(*originalPPM.EstimatedWeight, *updatedPPM.EstimatedWeight) suite.Equal(*originalPPM.HasProGear, *updatedPPM.HasProGear) @@ -532,8 +484,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) suite.Equal(*originalPPM.EstimatedWeight, *updatedPPM.EstimatedWeight) suite.Equal(*originalPPM.HasProGear, *updatedPPM.HasProGear) @@ -576,8 +526,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) suite.Equal(*originalPPM.EstimatedWeight, *updatedPPM.EstimatedWeight) suite.Equal(*originalPPM.HasProGear, *updatedPPM.HasProGear) @@ -620,8 +568,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) suite.Equal(*originalPPM.EstimatedWeight, *updatedPPM.EstimatedWeight) suite.Equal(*originalPPM.HasProGear, *updatedPPM.HasProGear) @@ -662,8 +608,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) suite.Equal(originalPPM.SITExpected, updatedPPM.SITExpected) suite.Equal(*originalPPM.EstimatedWeight, *updatedPPM.EstimatedWeight) suite.Equal(*originalPPM.HasProGear, *updatedPPM.HasProGear) @@ -708,10 +652,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) - suite.Equal(originalPPM.SecondaryPickupPostalCode, updatedPPM.SecondaryPickupPostalCode) - suite.Equal(originalPPM.SecondaryDestinationPostalCode, updatedPPM.SecondaryDestinationPostalCode) suite.Equal(*originalPPM.EstimatedWeight, *updatedPPM.EstimatedWeight) suite.Equal(*originalPPM.HasProGear, *updatedPPM.HasProGear) suite.Equal(*originalPPM.ProGearWeight, *updatedPPM.ProGearWeight) @@ -758,10 +698,6 @@ func (suite *PPMShipmentSuite) TestUpdatePPMShipment() { // Fields that shouldn't have changed suite.Equal(originalPPM.ExpectedDepartureDate.Format(dateOnly), updatedPPM.ExpectedDepartureDate.Format(dateOnly)) - suite.Equal(originalPPM.PickupPostalCode, updatedPPM.PickupPostalCode) - suite.Equal(originalPPM.DestinationPostalCode, updatedPPM.DestinationPostalCode) - suite.Equal(originalPPM.SecondaryPickupPostalCode, updatedPPM.SecondaryPickupPostalCode) - suite.Equal(originalPPM.SecondaryDestinationPostalCode, updatedPPM.SecondaryDestinationPostalCode) suite.Equal(*originalPPM.EstimatedWeight, *updatedPPM.EstimatedWeight) suite.Equal(*originalPPM.HasProGear, *updatedPPM.HasProGear) suite.Equal(*originalPPM.ProGearWeight, *updatedPPM.ProGearWeight) diff --git a/pkg/services/ppmshipment/rules.go b/pkg/services/ppmshipment/rules.go index 87af94fd93c..24c11c3f229 100644 --- a/pkg/services/ppmshipment/rules.go +++ b/pkg/services/ppmshipment/rules.go @@ -60,19 +60,19 @@ func checkRequiredFields() ppmShipmentValidator { return ppmShipmentValidatorFunc(func(_ appcontext.AppContext, newPPMShipment models.PPMShipment, _ *models.PPMShipment, _ *models.MTOShipment) error { verrs := validate.NewErrors() - // Check that we have something in the expectedDepartureDate field: - if newPPMShipment.ExpectedDepartureDate.IsZero() { - verrs.Add("expectedDepartureDate", "cannot be a zero value") - } - // Check that we have something in the pickupPostalCode field: - if newPPMShipment.PickupPostalCode == "" { - verrs.Add("pickupPostalCode", "cannot be nil or empty") + if newPPMShipment.PickupAddressID == nil || newPPMShipment.PickupAddressID == models.UUIDPointer(uuid.Nil) { + verrs.Add("pickupAddressID", "cannot be nil or empty") } // Check that we have something in the destinationPostalCode field: - if newPPMShipment.DestinationPostalCode == "" { - verrs.Add("destinationPostalCode", "cannot be nil or empty") + if newPPMShipment.DestinationAddressID == nil || newPPMShipment.PickupAddressID == models.UUIDPointer(uuid.Nil) { + verrs.Add("destinationAddressID", "cannot be nil or empty") + } + + // Check that we have something in the expectedDepartureDate field: + if newPPMShipment.ExpectedDepartureDate.IsZero() { + verrs.Add("expectedDepartureDate", "cannot be a zero value") } if newPPMShipment.SITExpected == nil { diff --git a/pkg/services/ppmshipment/rules_test.go b/pkg/services/ppmshipment/rules_test.go index 197e59b5ea4..156496ec0a6 100644 --- a/pkg/services/ppmshipment/rules_test.go +++ b/pkg/services/ppmshipment/rules_test.go @@ -147,18 +147,38 @@ func (suite *PPMShipmentSuite) TestValidationRules() { suite.Run("CheckRequiredFields()", func() { expectedTime := time.Now() - pickupPostal := "99999" - destPostalcode := "99999" sitExpected := false shipmentID := uuid.Must(uuid.NewV4()) + pickupAddressID, _ := uuid.NewV4() + destinationAddressID, _ := uuid.NewV4() + pickupAddress := &models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 1234"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Des Moines", + State: "IA", + PostalCode: "50309", + Country: models.StringPointer("US"), + } + destinationAddress := &models.Address{ + StreetAddress1: "987 Other Avenue", + StreetAddress2: models.StringPointer("P.O. Box 12345"), + StreetAddress3: models.StringPointer("c/o Another Person"), + City: "Fort Eisenhower", + State: "GA", + PostalCode: "50309", + Country: models.StringPointer("US"), + } suite.Run("success", func() { newPPMShipment := models.PPMShipment{ ShipmentID: shipmentID, ExpectedDepartureDate: expectedTime, - PickupPostalCode: pickupPostal, - DestinationPostalCode: destPostalcode, SITExpected: &sitExpected, + PickupAddress: pickupAddress, + PickupAddressID: &pickupAddressID, + DestinationAddress: destinationAddress, + DestinationAddressID: &destinationAddressID, } err := checkRequiredFields().Validate(suite.AppContextForTest(), newPPMShipment, nil, nil) @@ -175,46 +195,54 @@ func (suite *PPMShipmentSuite) TestValidationRules() { { "Missing expected departure date", models.PPMShipment{ - ShipmentID: shipmentID, - PickupPostalCode: pickupPostal, - DestinationPostalCode: destPostalcode, - SITExpected: &sitExpected, + ShipmentID: shipmentID, + SITExpected: &sitExpected, + PickupAddress: pickupAddress, + PickupAddressID: &pickupAddressID, + DestinationAddress: destinationAddress, + DestinationAddressID: &destinationAddressID, }, "expectedDepartureDate", "cannot be a zero value"}, { - "Missing pickup postal code", + "Missing SIT Expected value", models.PPMShipment{ ShipmentID: shipmentID, ExpectedDepartureDate: expectedTime, - DestinationPostalCode: destPostalcode, - SITExpected: &sitExpected, + SITExpected: nil, + PickupAddress: pickupAddress, + PickupAddressID: &pickupAddressID, + DestinationAddress: destinationAddress, + DestinationAddressID: &destinationAddressID, }, - "pickupPostalCode", - "cannot be nil or empty", + "sitExpected", + "cannot be nil", }, { - "Missing destination postal code", + "Missing PickupAddressID Expected value", models.PPMShipment{ ShipmentID: shipmentID, ExpectedDepartureDate: expectedTime, - PickupPostalCode: pickupPostal, SITExpected: &sitExpected, + PickupAddress: pickupAddress, + DestinationAddress: destinationAddress, + DestinationAddressID: &destinationAddressID, }, - "destinationPostalCode", + "pickupAddressID", "cannot be nil or empty", }, { - "Missing SIT Expected value", + "Missing DestinationAddressID Expected value", models.PPMShipment{ ShipmentID: shipmentID, ExpectedDepartureDate: expectedTime, - PickupPostalCode: pickupPostal, - DestinationPostalCode: destPostalcode, - SITExpected: nil, + SITExpected: &sitExpected, + PickupAddress: pickupAddress, + PickupAddressID: &pickupAddressID, + DestinationAddress: destinationAddress, }, - "sitExpected", - "cannot be nil", + "destinationAddressID", + "cannot be nil or empty", }, } diff --git a/pkg/services/ppmshipment/validation.go b/pkg/services/ppmshipment/validation.go index 5eaa6b959bb..9c10a96bbb9 100644 --- a/pkg/services/ppmshipment/validation.go +++ b/pkg/services/ppmshipment/validation.go @@ -73,9 +73,7 @@ func mergePPMShipment(newPPMShipment models.PPMShipment, oldPPMShipment *models. ppmShipment.ActualMoveDate = services.SetOptionalDateTimeField(newPPMShipment.ActualMoveDate, ppmShipment.ActualMoveDate) } - ppmShipment.SecondaryPickupPostalCode = services.SetOptionalStringField(newPPMShipment.SecondaryPickupPostalCode, ppmShipment.SecondaryPickupPostalCode) ppmShipment.ActualPickupPostalCode = services.SetOptionalStringField(newPPMShipment.ActualPickupPostalCode, ppmShipment.ActualPickupPostalCode) - ppmShipment.SecondaryDestinationPostalCode = services.SetOptionalStringField(newPPMShipment.SecondaryDestinationPostalCode, ppmShipment.SecondaryDestinationPostalCode) ppmShipment.ActualDestinationPostalCode = services.SetOptionalStringField(newPPMShipment.ActualDestinationPostalCode, ppmShipment.ActualDestinationPostalCode) ppmShipment.HasProGear = services.SetNoNilOptionalBoolField(newPPMShipment.HasProGear, ppmShipment.HasProGear) ppmShipment.EstimatedWeight = services.SetNoNilOptionalPoundField(newPPMShipment.EstimatedWeight, ppmShipment.EstimatedWeight) @@ -125,7 +123,6 @@ func mergePPMShipment(newPPMShipment models.PPMShipment, oldPPMShipment *models. ppmShipment.HasSecondaryPickupAddress = newPPMShipment.HasSecondaryPickupAddress ppmShipment.SecondaryPickupAddress = nil ppmShipment.SecondaryPickupAddressID = nil - ppmShipment.SecondaryPickupPostalCode = nil } else if newPPMShipment.SecondaryPickupAddress != nil { ppmShipment.SecondaryPickupAddress = newPPMShipment.SecondaryPickupAddress ppmShipment.HasSecondaryPickupAddress = models.BoolPointer(true) @@ -146,7 +143,6 @@ func mergePPMShipment(newPPMShipment models.PPMShipment, oldPPMShipment *models. ppmShipment.HasSecondaryDestinationAddress = newPPMShipment.HasSecondaryDestinationAddress ppmShipment.SecondaryDestinationAddress = nil ppmShipment.SecondaryDestinationAddressID = nil - ppmShipment.SecondaryDestinationPostalCode = nil } else if newPPMShipment.SecondaryDestinationAddress != nil { ppmShipment.SecondaryDestinationAddress = newPPMShipment.SecondaryDestinationAddress ppmShipment.HasSecondaryDestinationAddress = models.BoolPointer(true) @@ -177,13 +173,6 @@ func mergePPMShipment(newPPMShipment models.PPMShipment, oldPPMShipment *models. ppmShipment.ExpectedDepartureDate = newPPMShipment.ExpectedDepartureDate } - if newPPMShipment.PickupPostalCode != "" { - ppmShipment.PickupPostalCode = newPPMShipment.PickupPostalCode - } - if newPPMShipment.DestinationPostalCode != "" { - ppmShipment.DestinationPostalCode = newPPMShipment.DestinationPostalCode - } - if newPPMShipment.WeightTickets != nil && len(newPPMShipment.WeightTickets) >= 1 { ppmShipment.WeightTickets = newPPMShipment.WeightTickets } diff --git a/pkg/services/ppmshipment/validation_test.go b/pkg/services/ppmshipment/validation_test.go index 2989874613b..497bb037469 100644 --- a/pkg/services/ppmshipment/validation_test.go +++ b/pkg/services/ppmshipment/validation_test.go @@ -64,8 +64,6 @@ func (suite *PPMShipmentSuite) TestMergePPMShipment() { ShipmentID: shipmentID, Status: models.PPMShipmentStatusDraft, ExpectedDepartureDate: time.Date(2020, time.March, 15, 0, 0, 0, 0, time.UTC), - PickupPostalCode: "90210", - DestinationPostalCode: "08004", PickupAddress: &models.Address{ StreetAddress1: "123 Pickup", City: "New York", @@ -82,11 +80,6 @@ func (suite *PPMShipmentSuite) TestMergePPMShipment() { DestinationAddressID: models.UUIDPointer(uuid.Must(uuid.NewV4())), } - if oldFlags.hasSecondaryZips { - oldShipment.SecondaryPickupPostalCode = models.StringPointer("90880") - oldShipment.SecondaryDestinationPostalCode = models.StringPointer("08900") - } - if ppmState >= PPMShipmentSIT { oldShipment.SITExpected = &oldFlags.hasSIT @@ -150,8 +143,6 @@ func (suite *PPMShipmentSuite) TestMergePPMShipment() { // checkDatesAndLocationsDidntChange - ensures dates and locations fields didn't change checkDatesAndLocationsDidntChange := func(mergedShipment models.PPMShipment, oldShipment models.PPMShipment) { suite.Equal(oldShipment.ExpectedDepartureDate, mergedShipment.ExpectedDepartureDate) - suite.Equal(oldShipment.PickupPostalCode, mergedShipment.PickupPostalCode) - suite.Equal(oldShipment.DestinationPostalCode, mergedShipment.DestinationPostalCode) } // checkEstimatedWeightsDidntChange - ensures estimated weights fields didn't change @@ -229,8 +220,6 @@ func (suite *PPMShipmentSuite) TestMergePPMShipment() { }, newShipment: models.PPMShipment{ ExpectedDepartureDate: time.Time{}, - PickupPostalCode: "", - DestinationPostalCode: "", SITExpected: nil, }, runChecks: func(mergedShipment models.PPMShipment, oldShipment models.PPMShipment, _ models.PPMShipment) { @@ -249,64 +238,14 @@ func (suite *PPMShipmentSuite) TestMergePPMShipment() { }, newShipment: models.PPMShipment{ ExpectedDepartureDate: time.Date(2020, time.May, 15, 0, 0, 0, 0, time.UTC), - PickupPostalCode: "90206", - DestinationPostalCode: "79912", SITExpected: models.BoolPointer(true), }, runChecks: func(mergedShipment models.PPMShipment, _ models.PPMShipment, newShipment models.PPMShipment) { // ensure existing fields were changed suite.Equal(newShipment.ExpectedDepartureDate, mergedShipment.ExpectedDepartureDate) - suite.Equal(newShipment.PickupPostalCode, mergedShipment.PickupPostalCode) - suite.Equal(newShipment.DestinationPostalCode, mergedShipment.DestinationPostalCode) suite.Equal(newShipment.SITExpected, mergedShipment.SITExpected) }, }, - "Can add secondary ZIPs": { - oldState: PPMShipmentStateDatesAndLocations, - oldFlags: flags{ - hasSecondaryZips: false, - hasSIT: false, - hasProGear: false, - hasRequestedAdvance: false, - hasReceivedAdvance: false, - }, - newShipment: models.PPMShipment{ - SecondaryPickupPostalCode: models.StringPointer("90880"), - SecondaryDestinationPostalCode: models.StringPointer("79936"), - }, - runChecks: func(mergedShipment models.PPMShipment, oldShipment models.PPMShipment, newShipment models.PPMShipment) { - // ensure existing fields weren't changed - checkDatesAndLocationsDidntChange(mergedShipment, oldShipment) - checkSITDidntChange(mergedShipment, oldShipment) - - // ensure fields were set correctly - suite.Equal(newShipment.SecondaryPickupPostalCode, mergedShipment.SecondaryPickupPostalCode) - suite.Equal(newShipment.SecondaryDestinationPostalCode, mergedShipment.SecondaryDestinationPostalCode) - }, - }, - "Can remove secondary ZIPs": { - oldState: PPMShipmentStateDatesAndLocations, - oldFlags: flags{ - hasSecondaryZips: true, - hasSIT: false, - hasProGear: false, - hasRequestedAdvance: false, - hasReceivedAdvance: false, - }, - newShipment: models.PPMShipment{ - SecondaryPickupPostalCode: models.StringPointer(""), - SecondaryDestinationPostalCode: models.StringPointer(""), - }, - runChecks: func(mergedShipment models.PPMShipment, oldShipment models.PPMShipment, _ models.PPMShipment) { - // ensure existing fields weren't changed - checkDatesAndLocationsDidntChange(mergedShipment, oldShipment) - checkSITDidntChange(mergedShipment, oldShipment) - - // ensure fields were set correctly - suite.Nil(mergedShipment.SecondaryPickupPostalCode) - suite.Nil(mergedShipment.SecondaryDestinationPostalCode) - }, - }, "Add estimated weights - no pro gear": { oldState: PPMShipmentStateDatesAndLocations, oldFlags: flags{ diff --git a/pkg/testdatagen/scenario/e2ebasic.go b/pkg/testdatagen/scenario/e2ebasic.go index 95e2cf91eb5..4d20bf90941 100644 --- a/pkg/testdatagen/scenario/e2ebasic.go +++ b/pkg/testdatagen/scenario/e2ebasic.go @@ -960,8 +960,6 @@ func serviceMemberWithOrdersAndPPMMove05(appCtx appcontext.AppContext, userUploa Status: models.PPMShipmentStatusDraft, EstimatedWeight: models.PoundPointer(unit.Pound(4000)), EstimatedIncentive: models.CentPointer(unit.Cents(1000000)), - PickupPostalCode: "90210", - DestinationPostalCode: "76127", ExpectedDepartureDate: departureDate, }, } @@ -991,8 +989,6 @@ func serviceMemberWithOrdersAndPPMMove06(appCtx appcontext.AppContext, userUploa Status: models.PPMShipmentStatusDraft, EstimatedWeight: models.PoundPointer(unit.Pound(4000)), EstimatedIncentive: models.CentPointer(unit.Cents(1000000)), - PickupPostalCode: "90210", - DestinationPostalCode: "76127", ExpectedDepartureDate: departureDate, }, } diff --git a/pkg/testdatagen/scenario/shared.go b/pkg/testdatagen/scenario/shared.go index 05245a4379a..b449473d85f 100644 --- a/pkg/testdatagen/scenario/shared.go +++ b/pkg/testdatagen/scenario/shared.go @@ -807,8 +807,6 @@ func createUnSubmittedMoveWithFullPPMShipment2(appCtx appcontext.AppContext, use Status: models.PPMShipmentStatusDraft, EstimatedWeight: models.PoundPointer(unit.Pound(4000)), EstimatedIncentive: models.CentPointer(unit.Cents(1000000)), - PickupPostalCode: "90210", - DestinationPostalCode: "76127", ExpectedDepartureDate: departureDate, }, } @@ -839,8 +837,6 @@ func createUnSubmittedMoveWithFullPPMShipment3(appCtx appcontext.AppContext, use Status: models.PPMShipmentStatusDraft, EstimatedWeight: models.PoundPointer(unit.Pound(4000)), EstimatedIncentive: models.CentPointer(unit.Cents(1000000)), - PickupPostalCode: "90210", - DestinationPostalCode: "76127", ExpectedDepartureDate: departureDate, }, } @@ -870,8 +866,6 @@ func createUnSubmittedMoveWithFullPPMShipment4(appCtx appcontext.AppContext, use Status: models.PPMShipmentStatusDraft, EstimatedWeight: models.PoundPointer(unit.Pound(4000)), EstimatedIncentive: models.CentPointer(unit.Cents(1000000)), - PickupPostalCode: "90210", - DestinationPostalCode: "76127", ExpectedDepartureDate: departureDate, }, } @@ -901,8 +895,6 @@ func createUnSubmittedMoveWithFullPPMShipment5(appCtx appcontext.AppContext, use Status: models.PPMShipmentStatusDraft, EstimatedWeight: models.PoundPointer(unit.Pound(4000)), EstimatedIncentive: models.CentPointer(unit.Cents(1000000)), - PickupPostalCode: "90210", - DestinationPostalCode: "76127", ExpectedDepartureDate: departureDate, }, } diff --git a/pkg/testdatagen/testharness/make_move.go b/pkg/testdatagen/testharness/make_move.go index c24759546e4..365d585f403 100644 --- a/pkg/testdatagen/testharness/make_move.go +++ b/pkg/testdatagen/testharness/make_move.go @@ -4448,8 +4448,6 @@ func MakeDraftMoveWithPPMWithDepartureDate(appCtx appcontext.AppContext) models. Status: models.PPMShipmentStatusDraft, EstimatedWeight: models.PoundPointer(unit.Pound(4000)), EstimatedIncentive: models.CentPointer(unit.Cents(1000000)), - PickupPostalCode: "90210", - DestinationPostalCode: "76127", ExpectedDepartureDate: departureDate, }, } diff --git a/src/components/Customer/PPM/Booking/DateAndLocationForm/DateAndLocationForm.jsx b/src/components/Customer/PPM/Booking/DateAndLocationForm/DateAndLocationForm.jsx index e7dad5c5415..cfa0b330452 100644 --- a/src/components/Customer/PPM/Booking/DateAndLocationForm/DateAndLocationForm.jsx +++ b/src/components/Customer/PPM/Booking/DateAndLocationForm/DateAndLocationForm.jsx @@ -47,18 +47,14 @@ let validationShape = { const DateAndLocationForm = ({ mtoShipment, destinationDutyLocation, serviceMember, move, onBack, onSubmit }) => { const initialValues = { - pickupPostalCode: mtoShipment?.ppmShipment?.pickupPostalCode || '', useCurrentResidence: false, pickupAddress: {}, secondaryPickupAddress: {}, hasSecondaryPickupAddress: mtoShipment?.ppmShipment?.secondaryPickupAddress ? 'true' : 'false', - secondaryPickupPostalCode: mtoShipment?.ppmShipment?.secondaryPickupPostalCode || '', useCurrentDestinationAddress: false, - destinationPostalCode: mtoShipment?.ppmShipment?.destinationPostalCode || '', hasSecondaryDestinationAddress: mtoShipment?.ppmShipment?.secondaryDestinationAddress ? 'true' : 'false', destinationAddress: {}, secondaryDestinationAddress: {}, - secondaryDestinationPostalCode: mtoShipment?.ppmShipment?.secondaryDestinationPostalCode || '', sitExpected: mtoShipment?.ppmShipment?.sitExpected ? 'true' : 'false', expectedDepartureDate: mtoShipment?.ppmShipment?.expectedDepartureDate || '', closeoutOffice: move?.closeoutOffice || {}, diff --git a/src/components/Customer/PPM/Booking/DateAndLocationForm/DateAndLocationForm.stories.jsx b/src/components/Customer/PPM/Booking/DateAndLocationForm/DateAndLocationForm.stories.jsx index fa0a0d538e4..009f0e23d50 100644 --- a/src/components/Customer/PPM/Booking/DateAndLocationForm/DateAndLocationForm.stories.jsx +++ b/src/components/Customer/PPM/Booking/DateAndLocationForm/DateAndLocationForm.stories.jsx @@ -71,10 +71,6 @@ MTOShipmentDatesAndLocation.args = { id: '123', ppmShipment: { id: '123', - pickupPostalCode: '12345', - secondaryPickupPostalCode: '34512', - destinationPostalCode: '94611', - secondaryDestinationPostalCode: '90210', sitExpected: 'true', expectedDepartureDate: '2022-09-23', }, diff --git a/src/components/Customer/PPM/Booking/EstimatedWeightsProGearForm/EstimatedWeightsProGearForm.test.jsx b/src/components/Customer/PPM/Booking/EstimatedWeightsProGearForm/EstimatedWeightsProGearForm.test.jsx index cde0ed96852..8f4694f79a2 100644 --- a/src/components/Customer/PPM/Booking/EstimatedWeightsProGearForm/EstimatedWeightsProGearForm.test.jsx +++ b/src/components/Customer/PPM/Booking/EstimatedWeightsProGearForm/EstimatedWeightsProGearForm.test.jsx @@ -22,8 +22,6 @@ const defaultProps = { id: '123', ppmShipment: { id: '123', - pickupPostalCode: '20002', - destinationPostalCode: '20004', sitExpected: false, expectedDepartureDate: '2022-12-31', }, diff --git a/src/components/Customer/PPM/Closeout/AboutForm/AboutForm.stories.jsx b/src/components/Customer/PPM/Closeout/AboutForm/AboutForm.stories.jsx index 13116b3c00a..06e577c7eeb 100644 --- a/src/components/Customer/PPM/Closeout/AboutForm/AboutForm.stories.jsx +++ b/src/components/Customer/PPM/Closeout/AboutForm/AboutForm.stories.jsx @@ -43,10 +43,7 @@ BlankWithDefaultZIPs.args = { id: 'f3c29ac7-823a-496a-90dd-b7ab0d4b0ece', moveTaskOrderId: 'e9864ee5-56e7-401d-9a7b-a5ea9a83bdea', shipmentType: SHIPMENT_OPTIONS.PPM, - ppmShipment: { - pickupPostalCode: '10001', - destinationPostalCode: '10002', - }, + ppmShipment: {}, }, postalCodeValidator: () => {}, }; diff --git a/src/components/Customer/Review/Review.stories.jsx b/src/components/Customer/Review/Review.stories.jsx index 46c6f6085de..d4e1ef28412 100644 --- a/src/components/Customer/Review/Review.stories.jsx +++ b/src/components/Customer/Review/Review.stories.jsx @@ -222,8 +222,6 @@ const PPMShipment = { updated_at: '2020-09-01T22:30:00.000Z', ppmShipment: { expectedDepartureDate: '2021-06-23', - pickupPostalCode: '13643', - destinationPostalCode: '91945', sitExpected: false, estimatedWeight: 5000, estimatedIncentive: 1000000, @@ -240,8 +238,6 @@ const IncompeletePPMShipment = { updated_at: '2020-09-01T22:30:00.000Z', ppmShipment: { expectedDepartureDate: '2021-06-23', - pickupPostalCode: '13643', - destinationPostalCode: '91945', sitExpected: false, hasRequestedAdvance: null, }, diff --git a/src/components/Customer/Review/ShipmentCard/ShipmentCard.stories.jsx b/src/components/Customer/Review/ShipmentCard/ShipmentCard.stories.jsx index 0eca09b8308..09c8d6dd181 100644 --- a/src/components/Customer/Review/ShipmentCard/ShipmentCard.stories.jsx +++ b/src/components/Customer/Review/ShipmentCard/ShipmentCard.stories.jsx @@ -106,8 +106,6 @@ const ppmShipmentDefaultProps = { id: '93964f85-ae24-44a5-9e5b-73d1bc521e69', shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { - pickupPostalCode: '00000', - destinationPostalCode: '11111', estimatedWeight: 5000, expectedDepartureDate: new Date('01/01/2020').toISOString(), sitExpected: true, @@ -132,10 +130,6 @@ const ppmShipmentSecondaryZIPProps = { id: '93964f85-ae24-44a5-9e5b-73d1bc521e69', shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { - pickupPostalCode: '00000', - secondaryPickupPostalCode: '00001', - destinationPostalCode: '11111', - secondaryDestinationPostalCode: '11112', estimatedWeight: 5000, expectedDepartureDate: new Date('01/01/2020').toISOString(), sitExpected: true, @@ -150,8 +144,6 @@ const ppmShipmentProGearProps = { id: '93964f85-ae24-44a5-9e5b-73d1bc521e69', shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { - pickupPostalCode: '00000', - destinationPostalCode: '11111', estimatedWeight: 5000, hasProGear: true, proGearWeight: 1299, @@ -169,8 +161,6 @@ const ppmShipmentIncompleteProps = { id: '93964f85-ae24-44a5-9e5b-73d1bc521e69', shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { - pickupPostalCode: '00000', - destinationPostalCode: '11111', expectedDepartureDate: new Date('01/01/2020').toISOString(), }, status: shipmentStatuses.DRAFT, diff --git a/src/components/Office/DefinitionLists/PPMShipmentInfoList.stories.jsx b/src/components/Office/DefinitionLists/PPMShipmentInfoList.stories.jsx index 7c5ae124900..bb521fa1c8a 100644 --- a/src/components/Office/DefinitionLists/PPMShipmentInfoList.stories.jsx +++ b/src/components/Office/DefinitionLists/PPMShipmentInfoList.stories.jsx @@ -15,18 +15,14 @@ const ppmInfo = { advanceAmountRequested: 598700, approvedAt: null, createdAt: '2022-04-29T21:48:21.581Z', - destinationPostalCode: '30813', eTag: 'MjAyMi0wNC0yOVQyMTo0ODoyMS41ODE0MzFa', estimatedIncentive: 1000000, estimatedWeight: 4000, expectedDepartureDate: '2020-03-15', hasProGear: true, id: 'b6ec215c-2cef-45fe-8d4a-35f445cd4768', - pickupPostalCode: '90210', proGearWeight: 1987, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: 'b5c2d9a1-d1e6-485d-9678-8b62deb0d801', spouseProGearWeight: 498, status: 'SUBMITTED', diff --git a/src/components/Office/DefinitionLists/ShipmentInfoListSelector.test.jsx b/src/components/Office/DefinitionLists/ShipmentInfoListSelector.test.jsx index 173fb4d1da8..0f4e449c350 100644 --- a/src/components/Office/DefinitionLists/ShipmentInfoListSelector.test.jsx +++ b/src/components/Office/DefinitionLists/ShipmentInfoListSelector.test.jsx @@ -58,18 +58,14 @@ const ppmInfo = { advanceAmountRequested: 598700, approvedAt: null, createdAt: '2022-04-29T21:48:21.581Z', - destinationPostalCode: '30813', eTag: 'MjAyMi0wNC0yOVQyMTo0ODoyMS41ODE0MzFa', estimatedIncentive: 1000000, estimatedWeight: 4000, expectedDepartureDate: '2020-03-15', hasProGear: true, id: 'b6ec215c-2cef-45fe-8d4a-35f445cd4768', - pickupPostalCode: '90210', proGearWeight: 1987, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: 'b5c2d9a1-d1e6-485d-9678-8b62deb0d801', spouseProGearWeight: 498, status: 'SUBMITTED', diff --git a/src/components/Office/EvaluationReportPreview/EvaluationReportPreview.test.jsx b/src/components/Office/EvaluationReportPreview/EvaluationReportPreview.test.jsx index 4ebd2f9e64d..e17bf11020d 100644 --- a/src/components/Office/EvaluationReportPreview/EvaluationReportPreview.test.jsx +++ b/src/components/Office/EvaluationReportPreview/EvaluationReportPreview.test.jsx @@ -54,7 +54,6 @@ const mtoShipments = [ advanceAmountRequested: 598700, approvedAt: null, createdAt: '2022-08-15T16:11:26.545Z', - destinationPostalCode: '30813', eTag: 'MjAyMi0wOC0xNVQxNjoxMToyNi41NDU2NTha', estimatedIncentive: 1000000, estimatedWeight: 4000, @@ -63,11 +62,8 @@ const mtoShipments = [ hasReceivedAdvance: null, hasRequestedAdvance: true, id: '62f0e96e-e562-4d22-91c8-a17237b9c609', - pickupPostalCode: '90210', proGearWeight: 1987, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: '22ee7ad8-7147-4ee0-bbe6-264aef36d7cc', sitEstimatedCost: null, sitEstimatedDepartureDate: null, diff --git a/src/components/Office/EvaluationReportShipmentDisplay/EvaluationReportShipmentDisplay.jsx b/src/components/Office/EvaluationReportShipmentDisplay/EvaluationReportShipmentDisplay.jsx index 0eea11c9e03..b13f4b0f6c6 100644 --- a/src/components/Office/EvaluationReportShipmentDisplay/EvaluationReportShipmentDisplay.jsx +++ b/src/components/Office/EvaluationReportShipmentDisplay/EvaluationReportShipmentDisplay.jsx @@ -154,14 +154,10 @@ EvaluationReportShipmentDisplay.propTypes = { shipmentType: PropTypes.string, hasRequestedAdvance: PropTypes.bool, advanceAmountRequested: PropTypes.number, - destinationPostalCode: PropTypes.string, estimatedIncentive: PropTypes.number, estimatedWeight: PropTypes.string, expectedDepartureDate: PropTypes.string, - pickupPostalCode: PropTypes.string, proGearWeight: PropTypes.string, - secondaryDestinationPostalCode: PropTypes.string, - secondaryPickupPostalCode: PropTypes.string, spouseProGearWeight: PropTypes.string, customerRemarks: PropTypes.string, tacType: PropTypes.string, diff --git a/src/components/Office/PPM/ReviewWeightTicket/ReviewWeightTicket.test.jsx b/src/components/Office/PPM/ReviewWeightTicket/ReviewWeightTicket.test.jsx index a9456354e20..61cfdb6dd98 100644 --- a/src/components/Office/PPM/ReviewWeightTicket/ReviewWeightTicket.test.jsx +++ b/src/components/Office/PPM/ReviewWeightTicket/ReviewWeightTicket.test.jsx @@ -168,7 +168,6 @@ const fullShipmentProps = { advanceStatus: 'APPROVED', approvedAt: '2022-04-15T12:30:00.000Z', createdAt: '2023-12-20T17:33:48.206Z', - destinationPostalCode: '30813', eTag: 'MjAyMy0xMi0yMFQxNzozMzo1MC4xMDExNDFa', estimatedIncentive: 1000000, estimatedWeight: 4000, @@ -179,12 +178,9 @@ const fullShipmentProps = { hasRequestedAdvance: true, id: '8ac2411e-d3eb-43e1-b98f-2476cfe8c02e', movingExpenses: null, - pickupPostalCode: '90210', proGearWeight: 1987, proGearWeightTickets: null, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: '0ec4a5d2-3cca-4d1f-a2db-91f83d22644a', sitEstimatedCost: null, sitEstimatedDepartureDate: null, @@ -306,7 +302,6 @@ const fullShipmentProps = { advanceStatus: 'APPROVED', approvedAt: '2022-04-15T12:30:00.000Z', createdAt: '2023-12-20T17:33:48.206Z', - destinationPostalCode: '30813', eTag: 'MjAyMy0xMi0yMFQxNzozMzo1MC4xMDExNDFa', estimatedIncentive: 1000000, estimatedWeight: 4000, @@ -317,12 +312,9 @@ const fullShipmentProps = { hasRequestedAdvance: true, id: '8ac2411e-d3eb-43e1-b98f-2476cfe8c02e', movingExpenses: null, - pickupPostalCode: '90210', proGearWeight: 1987, proGearWeightTickets: null, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: '0ec4a5d2-3cca-4d1f-a2db-91f83d22644a', sitEstimatedCost: null, sitEstimatedDepartureDate: null, diff --git a/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.jsx b/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.jsx index b517ba25765..07f31bb88eb 100644 --- a/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.jsx +++ b/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.jsx @@ -74,8 +74,8 @@ const ShipmentQAEReportHeader = ({ shipment, destinationDutyLocationPostalCode, break; case SHIPMENT_OPTIONS.PPM: heading = 'PPM'; - pickupAddress = shipment.ppmShipment.pickupPostalCode; - destinationAddress = shipment.ppmShipment.destinationPostalCode; + pickupAddress = shipment.ppmShipment.pickupAddress.postalCode; + destinationAddress = shipment.ppmShipment.destinationAddress.postalCode; shipmentAccentStyle = styles.ppmShipmentType; break; default: diff --git a/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.stories.jsx b/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.stories.jsx index 843eaf19676..605c8ee28a0 100644 --- a/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.stories.jsx +++ b/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.stories.jsx @@ -46,8 +46,18 @@ const ppmShipment = { id: '22222', shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { - pickupPostalCode: '89503', - destinationPostalCode: '90210', + pickupAddress: { + streetAddress1: '123 Any St', + city: 'Anytown', + state: 'AK', + postalCode: '90210', + }, + destinationAddress: { + streetAddress1: '123 Any St', + city: 'Anytown', + state: 'AK', + postalCode: '90210', + }, }, }; diff --git a/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.test.jsx b/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.test.jsx index a9a5ecbfb24..f1a62ac3b57 100644 --- a/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.test.jsx +++ b/src/components/Office/QAEReportTable/ShipmentQAEReportHeader.test.jsx @@ -63,8 +63,8 @@ const ppmShipment = { id: 'c3c64a08-778d-4f9f-8b67-b2502e0fb5e9', shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { - pickupPostalCode: '90210', - destinationPostalCode: '94535', + pickupAddress, + destinationAddress, }, status: 'SUBMITTED', createdAt: '2022-07-12T19:38:35.886Z', @@ -121,8 +121,10 @@ describe('ShipmentQAEReportHeader', () => { ); expect(screen.getByTestId('shipmentHeader')).toHaveTextContent('EVLRPT-04'); - expect(screen.getByTestId('shipmentHeader')).toHaveTextContent(ppmShipment.ppmShipment.pickupPostalCode); - expect(screen.getByTestId('shipmentHeader')).toHaveTextContent(ppmShipment.ppmShipment.destinationPostalCode); + expect(screen.getByTestId('shipmentHeader')).toHaveTextContent(ppmShipment.ppmShipment.pickupAddress.postalCode); + expect(screen.getByTestId('shipmentHeader')).toHaveTextContent( + ppmShipment.ppmShipment.destinationAddress.postalCode, + ); expect(screen.getByRole('button', { name: 'Create report' })).toBeVisible(); }); it('renders a shipment but disables button when move is locked', () => { diff --git a/src/components/Office/QAEReportTable/ShipmentQAEReports.stories.jsx b/src/components/Office/QAEReportTable/ShipmentQAEReports.stories.jsx index 905c7d2ad95..d1751f63b20 100644 --- a/src/components/Office/QAEReportTable/ShipmentQAEReports.stories.jsx +++ b/src/components/Office/QAEReportTable/ShipmentQAEReports.stories.jsx @@ -48,10 +48,32 @@ const ppmShipment = { id: '22222222-2222-2222-2222-222222222222', shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { - pickupPostalCode: '89503', - destinationPostalCode: '90210', + pickupAddress: { + streetAddress1: '123 Any St', + city: 'Anytown', + state: 'AK', + postalCode: '90210', + }, + destinationAddress: { + streetAddress1: '123 Any St', + city: 'Anytown', + state: 'AK', + postalCode: '90210', + }, }, createdAt: '2020-01-01T00:02:00.999Z', + pickupAddress: { + streetAddress1: '123 Any St', + city: 'Anytown', + state: 'AK', + postalCode: '90210', + }, + destinationAddress: { + streetAddress1: '123 Any St', + city: 'Anytown', + state: 'AK', + postalCode: '90210', + }, }; const ntsShipment = { diff --git a/src/components/Office/ShipmentDisplay/ShipmentDisplay.jsx b/src/components/Office/ShipmentDisplay/ShipmentDisplay.jsx index f3151f8fb8b..1f19a9dad5a 100644 --- a/src/components/Office/ShipmentDisplay/ShipmentDisplay.jsx +++ b/src/components/Office/ShipmentDisplay/ShipmentDisplay.jsx @@ -212,14 +212,10 @@ ShipmentDisplay.propTypes = { shipmentType: PropTypes.string, hasRequestedAdvance: PropTypes.bool, advanceAmountRequested: PropTypes.number, - destinationPostalCode: PropTypes.string, estimatedIncentive: PropTypes.number, estimatedWeight: PropTypes.string, expectedDepartureDate: PropTypes.string, - pickupPostalCode: PropTypes.string, proGearWeight: PropTypes.string, - secondaryDestinationPostalCode: PropTypes.string, - secondaryPickupPostalCode: PropTypes.string, spouseProGearWeight: PropTypes.string, customerRemarks: PropTypes.string, tacType: PropTypes.string, diff --git a/src/components/Office/ShipmentDisplay/ShipmentDisplayTestData.js b/src/components/Office/ShipmentDisplay/ShipmentDisplayTestData.js index 93b0b58adce..5bf1b4e5a11 100644 --- a/src/components/Office/ShipmentDisplay/ShipmentDisplayTestData.js +++ b/src/components/Office/ShipmentDisplay/ShipmentDisplayTestData.js @@ -148,18 +148,14 @@ export const ppmInfo = { approvedAt: null, createdAt: '2022-04-29T21:48:21.581Z', deletedAt: null, - destinationPostalCode: '30813', eTag: 'MjAyMi0wNC0yOVQyMTo0ODoyMS41ODE0MzFa', estimatedIncentive: 1000000, estimatedWeight: 4000, expectedDepartureDate: '2020-03-15', hasProGear: true, id: 'b6ec215c-2cef-45fe-8d4a-35f445cd4768', - pickupPostalCode: '90210', proGearWeight: 1987, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: 'b5c2d9a1-d1e6-485d-9678-8b62deb0d801', spouseProGearWeight: 498, status: 'SUBMITTED', @@ -237,18 +233,14 @@ export const ppmInfoRejected = { approvedAt: null, createdAt: '2022-04-29T21:48:21.581Z', deletedAt: null, - destinationPostalCode: '30813', eTag: 'MjAyMi0wNC0yOVQyMTo0ODoyMS41ODE0MzFa', estimatedIncentive: 1000000, estimatedWeight: 4000, expectedDepartureDate: '2020-03-15', hasProGear: true, id: 'b6ec215c-2cef-45fe-8d4a-35f445cd4768', - pickupPostalCode: '90210', proGearWeight: 1987, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: 'b5c2d9a1-d1e6-485d-9678-8b62deb0d801', spouseProGearWeight: 498, status: 'WAITING_ON_CUSTOMER', @@ -266,18 +258,14 @@ export const ppmInfoMultiple = { approvedAt: null, createdAt: '2022-04-29T21:48:21.581Z', deletedAt: null, - destinationPostalCode: '30813', eTag: 'MjAyMi0wNC0yOVQyMTo0ODoyMS41ODE0MzFa', estimatedIncentive: 1000000, estimatedWeight: 4000, expectedDepartureDate: '2020-03-15', hasProGear: true, id: 'b6ec215c-2cef-45fe-8d4a-35f445cd4768', - pickupPostalCode: '90210', proGearWeight: 1987, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: 'b5c2d9a1-d1e6-485d-9678-8b62deb0d801', spouseProGearWeight: 498, status: 'SUBMITTED', @@ -295,18 +283,14 @@ export const ppmInfoMultiple2 = { approvedAt: null, createdAt: '2022-04-29T21:48:21.581Z', deletedAt: null, - destinationPostalCode: '11201', eTag: 'MjAyMi0wNC0yOVQyMTo0ODoyMS41ODE0MzFa', estimatedIncentive: 1000000, estimatedWeight: 2000, expectedDepartureDate: '2022-05-02', hasProGear: true, id: 'b6ec215c-2cef-45fe-8d4a-35f445cd4768', - pickupPostalCode: '89103', proGearWeight: 1987, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: 'b5c2d9a1-d1e6-485d-9678-8b62deb0d801', spouseProGearWeight: 498, status: 'SUBMITTED', diff --git a/src/components/Office/ShipmentForm/ShipmentForm.jsx b/src/components/Office/ShipmentForm/ShipmentForm.jsx index 5835e955c62..c743788ee01 100644 --- a/src/components/Office/ShipmentForm/ShipmentForm.jsx +++ b/src/components/Office/ShipmentForm/ShipmentForm.jsx @@ -1001,8 +1001,8 @@ const ShipmentForm = (props) => { cost={mtoShipment.ppmShipment?.sitEstimatedCost} weight={mtoShipment.ppmShipment?.sitEstimatedWeight} sitLocation={mtoShipment.ppmShipment?.sitLocation} - originZip={mtoShipment.ppmShipment?.pickupPostalCode} - destinationZip={mtoShipment.ppmShipment?.destinationPostalCode} + originZip={mtoShipment.ppmShipment?.pickupAddress.postalCode} + destinationZip={mtoShipment.ppmShipment?.destinationAddress.postalCode} departureDate={mtoShipment.ppmShipment?.sitEstimatedDepartureDate} entryDate={mtoShipment.ppmShipment?.sitEstimatedEntryDate} /> diff --git a/src/components/Office/ShipmentForm/ShipmentForm.stories.jsx b/src/components/Office/ShipmentForm/ShipmentForm.stories.jsx index b4358d99215..eff75a6ed33 100644 --- a/src/components/Office/ShipmentForm/ShipmentForm.stories.jsx +++ b/src/components/Office/ShipmentForm/ShipmentForm.stories.jsx @@ -114,12 +114,22 @@ const mockPPMShipment = { id: '4774f99f-bc94-467a-9469-b6f81657b9ef', mtoShipmentId: mockMtoShipment.id, expectedDepartureDate: '2022-12-31', - pickupPostalCode: '90210', - destinationPostalCode: '30813', estimatedWeight: 2000, sitExpected: false, hasProGear: false, estimatedIncentive: 1000000, + pickupAddress: { + streetAddress1: '812 S 129th St', + city: 'San Antonio', + state: 'TX', + postalCode: '78234', + }, + destinationAddress: { + streetAddress1: '441 SW Rio de la Plata Drive', + city: 'Tacoma', + state: 'WA', + postalCode: '98421', + }, }; const mockMtoShipmentTypePPM = { diff --git a/src/components/Office/ShipmentForm/ShipmentForm.test.jsx b/src/components/Office/ShipmentForm/ShipmentForm.test.jsx index 85736a60595..add16a413d9 100644 --- a/src/components/Office/ShipmentForm/ShipmentForm.test.jsx +++ b/src/components/Office/ShipmentForm/ShipmentForm.test.jsx @@ -1703,12 +1703,26 @@ describe('ShipmentForm component', () => { const mockPPMShipmentWithSIT = { sitEstimatedCost: 123400, sitEstimatedWeight: 2345, - pickupPostalCode: '12345', - destinationPostalCode: '54321', sitLocation: 'DESTINATION', sitEstimatedDepartureDate: '2022-10-29', sitEstimatedEntryDate: '2022-08-06', sitExpected: true, + pickupAddress: { + streetAddress1: '111 Test Street', + streetAddress2: '222 Test Street', + streetAddress3: 'Test Man', + city: 'Test City', + state: 'KY', + postalCode: '42701', + }, + destinationAddress: { + streetAddress1: '222 Test Street', + streetAddress2: '333 Test Street', + streetAddress3: 'Test Man', + city: 'Test City', + state: 'KY', + postalCode: '42703', + }, }; const defaultSITProps = { diff --git a/src/components/PrimeUI/Shipment/Shipment.jsx b/src/components/PrimeUI/Shipment/Shipment.jsx index e573b510aee..18d394d061a 100644 --- a/src/components/PrimeUI/Shipment/Shipment.jsx +++ b/src/components/PrimeUI/Shipment/Shipment.jsx @@ -136,7 +136,8 @@ const Shipment = ({ shipment, moveId, onDelete, mtoServiceItems }) => {
Estimated Weight:
-
{shipment.primeEstimatedWeight}
+ {shipment.shipmentType === SHIPMENT_OPTIONS.NTSR &&
{shipment.ntsRecordedWeight}
} + {shipment.shipmentType !== SHIPMENT_OPTIONS.NTSR &&
{shipment.primeEstimatedWeight}
}
Actual Weight:
diff --git a/src/components/PrimeUI/Shipment/Shipment.test.jsx b/src/components/PrimeUI/Shipment/Shipment.test.jsx index d95a7dd6416..f53374a889a 100644 --- a/src/components/PrimeUI/Shipment/Shipment.test.jsx +++ b/src/components/PrimeUI/Shipment/Shipment.test.jsx @@ -12,6 +12,7 @@ import { toDollarString, } from 'utils/formatters'; import { MockProviders } from 'testUtils'; +import { SHIPMENT_OPTIONS } from 'shared/constants'; const shipmentId = 'ce01a5b8-9b44-4511-8a8d-edb60f2a4aee'; const moveId = '9c7b255c-2981-4bf8-839f-61c7458e2b4d'; @@ -231,6 +232,26 @@ describe('Shipment details component fields and values are present', () => { }); }); +const shipmentNTSR = { + ...approvedMoveTaskOrder.moveTaskOrder.mtoShipments[0], + shipmentType: SHIPMENT_OPTIONS.NTSR, + ntsRecordedWeight: 1000, +}; + +describe('Shipment details component fields and values are present for NTSR', () => { + it('renders the correct estimated weight', () => { + render( + + + , + ); + + const field = screen.getByText('Estimated Weight:'); + expect(field).toBeInTheDocument(); + expect(field.nextElementSibling.textContent).toBe(shipmentNTSR.ntsRecordedWeight.toString()); + }); +}); + const divertedShipment = { ...approvedMoveTaskOrder.moveTaskOrder.mtoShipments[0], diversion: true, diff --git a/src/pages/MyMove/Home/MoveHome.test.jsx b/src/pages/MyMove/Home/MoveHome.test.jsx index 566c968707a..ead5c51619c 100644 --- a/src/pages/MyMove/Home/MoveHome.test.jsx +++ b/src/pages/MyMove/Home/MoveHome.test.jsx @@ -262,7 +262,6 @@ const defaultPropsOrdersWithUnsubmittedShipments = { advanceAmountRequested: null, approvedAt: null, createdAt: '2024-02-20T17:21:48.248Z', - destinationPostalCode: '73503', eTag: 'MjAyNC0wMi0yMFQxNzoyMjowMy4wODU5Mzda', estimatedIncentive: 339123, estimatedWeight: 2000, @@ -273,12 +272,9 @@ const defaultPropsOrdersWithUnsubmittedShipments = { hasRequestedAdvance: false, id: '5f1f0b88-9cb9-4b48-a9ad-2af6c1113ca2', movingExpenses: [], - pickupPostalCode: '74133', proGearWeight: null, proGearWeightTickets: [], reviewedAt: null, - secondaryDestinationPostalCode: null, - secondaryPickupPostalCode: null, shipmentId: '0c7f88b8-75a9-41fe-b884-ea39e6024f24', sitEstimatedCost: null, sitEstimatedDepartureDate: null, @@ -481,7 +477,6 @@ const defaultPropsOrdersWithSubmittedShipments = { advanceAmountRequested: null, approvedAt: null, createdAt: '2024-02-20T17:21:48.248Z', - destinationPostalCode: '73503', eTag: 'MjAyNC0wMi0yMFQxNzoyMjowMy4wODU5Mzda', estimatedIncentive: 339123, estimatedWeight: 2000, @@ -492,12 +487,9 @@ const defaultPropsOrdersWithSubmittedShipments = { hasRequestedAdvance: false, id: '5f1f0b88-9cb9-4b48-a9ad-2af6c1113ca2', movingExpenses: [], - pickupPostalCode: '74133', proGearWeight: null, proGearWeightTickets: [], reviewedAt: null, - secondaryDestinationPostalCode: null, - secondaryPickupPostalCode: null, shipmentId: '0c7f88b8-75a9-41fe-b884-ea39e6024f24', sitEstimatedCost: null, sitEstimatedDepartureDate: null, @@ -670,7 +662,6 @@ const defaultPropsAmendedOrdersWithAdvanceRequested = { advanceAmountRequested: 400000, approvedAt: null, createdAt: '2024-02-20T17:40:25.842Z', - destinationPostalCode: '73503', eTag: 'MjAyNC0wMi0yMFQxNzo0MDo0Ny43NzI5MzNa', estimatedIncentive: 678255, estimatedWeight: 4000, @@ -681,12 +672,9 @@ const defaultPropsAmendedOrdersWithAdvanceRequested = { hasRequestedAdvance: true, id: 'd18b865f-fd12-495d-91fa-65b53d72705a', movingExpenses: [], - pickupPostalCode: '74133', proGearWeight: null, proGearWeightTickets: [], reviewedAt: null, - secondaryDestinationPostalCode: null, - secondaryPickupPostalCode: null, shipmentId: '322ebc9f-0ca8-4943-a7a8-39235f4e680b', sitEstimatedCost: null, sitEstimatedDepartureDate: null, @@ -878,7 +866,6 @@ const defaultPropsWithAdvanceAndPPMApproved = { advanceStatus: 'APPROVED', approvedAt: '2024-02-20T18:01:14.760Z', createdAt: '2024-02-20T17:40:25.842Z', - destinationPostalCode: '73503', eTag: 'MjAyNC0wMi0yMFQxODowMToxNC43NjAyNTha', estimatedIncentive: 678255, estimatedWeight: 4000, @@ -889,12 +876,9 @@ const defaultPropsWithAdvanceAndPPMApproved = { hasRequestedAdvance: true, id: expectedPpmShipmentID, movingExpenses: [], - pickupPostalCode: '74133', proGearWeight: null, proGearWeightTickets: [], reviewedAt: null, - secondaryDestinationPostalCode: null, - secondaryPickupPostalCode: null, shipmentId: '322ebc9f-0ca8-4943-a7a8-39235f4e680b', sitEstimatedCost: null, sitEstimatedDepartureDate: null, diff --git a/src/pages/MyMove/Home/index.test.jsx b/src/pages/MyMove/Home/index.test.jsx index e4d3b9deac0..db9583fc993 100644 --- a/src/pages/MyMove/Home/index.test.jsx +++ b/src/pages/MyMove/Home/index.test.jsx @@ -101,8 +101,6 @@ const incompletePPMShipment = { shipmentId: mtoPPMShipmentId, status: ppmShipmentStatuses.DRAFT, expectedDepartureDate: '2022-08-25', - pickupPostalCode: '90210', - destinationPostalCode: '30813', createdAt: ppmShipmentCreatedDate.toISOString(), updatedAt: ppmShipmentCreatedDate.toISOString(), eTag: window.btoa(ppmShipmentCreatedDate.toISOString()), @@ -196,8 +194,8 @@ const ppmShipmentWithActualShipmentInfo = { ppmShipment: { ...approvedPPMShipment.ppmShipment, actualMoveDate: approvedPPMShipment.ppmShipment.expectedDepartureDate, - actualPickupPostalCode: approvedPPMShipment.ppmShipment.pickupPostalCode, - actualDestinationPostalCode: approvedPPMShipment.ppmShipment.destinationPostalCode, + actualPickupPostalCode: approvedPPMShipment.ppmShipment.pickupAddress.postalCode, + actualDestinationPostalCode: approvedPPMShipment.ppmShipment.destinationAddress.postalCode, hasReceivedAdvance: approvedPPMShipment.ppmShipment.hasRequestedAdvance, advanceAmountReceived: approvedPPMShipment.ppmShipment.advanceAmountRequested, }, diff --git a/src/pages/MyMove/PPM/Booking/Advance/Advance.test.jsx b/src/pages/MyMove/PPM/Booking/Advance/Advance.test.jsx index 2c614eb1b72..3465f9c0479 100644 --- a/src/pages/MyMove/PPM/Booking/Advance/Advance.test.jsx +++ b/src/pages/MyMove/PPM/Booking/Advance/Advance.test.jsx @@ -43,8 +43,6 @@ const mockMTOShipment = { shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { id: uuidv4(), - pickupPostalCode: '20002', - destinationPostalCode: '20004', sitExpected: false, expectedDepartureDate: '2022-12-31', eTag: mockPPMShipmentETag, diff --git a/src/pages/MyMove/PPM/Booking/DateAndLocation/DateAndLocation.jsx b/src/pages/MyMove/PPM/Booking/DateAndLocation/DateAndLocation.jsx index f64f6986c3f..1502b0947f6 100644 --- a/src/pages/MyMove/PPM/Booking/DateAndLocation/DateAndLocation.jsx +++ b/src/pages/MyMove/PPM/Booking/DateAndLocation/DateAndLocation.jsx @@ -72,28 +72,15 @@ const DateAndLocation = ({ mtoShipment, serviceMember, destinationDutyLocation, const hasSecondaryPickupAddress = values.hasSecondaryPickupAddress === 'true'; const hasSecondaryDestinationAddress = values.hasSecondaryDestinationAddress === 'true'; - let secondaryPickupPostalCode = null; - if (hasSecondaryPickupAddress && values.secondaryPickupAddress?.address) { - secondaryPickupPostalCode = values.secondaryPickupAddress.address.postalCode; - } - - let secondaryDestinationPostalCode = null; - if (hasSecondaryDestinationAddress && values.secondaryDestinationAddress?.address) { - secondaryDestinationPostalCode = values.secondaryDestinationAddress.address.postalCode; - } const createOrUpdateShipment = { moveTaskOrderID: moveId, shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { - pickupPostalCode: values.pickupAddress.address.postalCode, pickupAddress: formatAddressForAPI(values.pickupAddress.address), hasSecondaryPickupAddress, // I think sending this is necessary so we know if the customer wants to clear their previously secondary ZIPs, or we could send nulls for those fields. - secondaryPickupPostalCode, - destinationPostalCode: values.destinationAddress.address.postalCode, destinationAddress: formatAddressForAPI(values.destinationAddress.address), hasSecondaryDestinationAddress, - secondaryDestinationPostalCode, sitExpected: values.sitExpected === 'true', expectedDepartureDate: formatDateForSwagger(values.expectedDepartureDate), }, diff --git a/src/pages/MyMove/PPM/Booking/DateAndLocation/DateAndLocation.test.jsx b/src/pages/MyMove/PPM/Booking/DateAndLocation/DateAndLocation.test.jsx index 1d2f41fb71c..63aa4dd1e94 100644 --- a/src/pages/MyMove/PPM/Booking/DateAndLocation/DateAndLocation.test.jsx +++ b/src/pages/MyMove/PPM/Booking/DateAndLocation/DateAndLocation.test.jsx @@ -154,10 +154,6 @@ const fullShipmentProps = { state: 'VA', postalCode: '20005', }, - pickupPostalCode: '20002', - secondaryPickupPostalCode: '20003', - destinationPostalCode: '20004', - secondaryDestinationPostalCode: '20005', sitExpected: true, expectedDepartureDate: '2022-12-31', }, @@ -260,12 +256,8 @@ describe('DateAndLocation component', () => { state: 'VA', streetAddress1: '123 Any St', }, - pickupPostalCode: '10001', - destinationPostalCode: '10002', hasSecondaryPickupAddress: false, - secondaryPickupPostalCode: null, hasSecondaryDestinationAddress: false, - secondaryDestinationPostalCode: null, sitExpected: false, expectedDepartureDate: '2022-07-04', }, @@ -345,12 +337,8 @@ describe('DateAndLocation component', () => { state: 'VA', streetAddress1: '123 Any St', }, - pickupPostalCode: '10001', - destinationPostalCode: '10002', hasSecondaryPickupAddress: false, - secondaryPickupPostalCode: null, hasSecondaryDestinationAddress: false, - secondaryDestinationPostalCode: null, sitExpected: false, expectedDepartureDate: '2022-07-04', }, @@ -507,12 +495,8 @@ describe('DateAndLocation component', () => { state: 'VA', streetAddress1: '123 Any St', }, - pickupPostalCode: '10001', - destinationPostalCode: '10002', hasSecondaryPickupAddress: true, - secondaryPickupPostalCode: '10003', hasSecondaryDestinationAddress: true, - secondaryDestinationPostalCode: '10004', sitExpected: true, expectedDepartureDate: '2022-07-04', }, @@ -908,12 +892,8 @@ describe('DateAndLocation component', () => { state: 'VA', postalCode: '20005', }, - pickupPostalCode: '20002', - destinationPostalCode: '20003', hasSecondaryPickupAddress: true, - secondaryPickupPostalCode: '20004', hasSecondaryDestinationAddress: true, - secondaryDestinationPostalCode: '20005', sitExpected: true, expectedDepartureDate: '2022-12-31', }, @@ -973,12 +953,8 @@ describe('DateAndLocation component', () => { state: 'VA', postalCode: '20005', }, - pickupPostalCode: '20002', - destinationPostalCode: '20003', hasSecondaryPickupAddress: true, - secondaryPickupPostalCode: '20004', hasSecondaryDestinationAddress: true, - secondaryDestinationPostalCode: '20005', sitExpected: true, expectedDepartureDate: '2022-07-04', }, diff --git a/src/pages/MyMove/PPM/Booking/EstimatedWeightsProGear/EstimatedWeightsProGear.test.jsx b/src/pages/MyMove/PPM/Booking/EstimatedWeightsProGear/EstimatedWeightsProGear.test.jsx index 29c80d80d88..eb665e1c5e0 100644 --- a/src/pages/MyMove/PPM/Booking/EstimatedWeightsProGear/EstimatedWeightsProGear.test.jsx +++ b/src/pages/MyMove/PPM/Booking/EstimatedWeightsProGear/EstimatedWeightsProGear.test.jsx @@ -56,8 +56,6 @@ const mockMTOShipment = { shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { id: uuidv4(), - pickupPostalCode: '20002', - destinationPostalCode: '20004', sitExpected: false, expectedDepartureDate: '2022-12-31', eTag: window.btoa(new Date()), diff --git a/src/pages/MyMove/PPM/Closeout/Expenses/Expenses.test.jsx b/src/pages/MyMove/PPM/Closeout/Expenses/Expenses.test.jsx index 08937f2fbfd..fda52e1b17d 100644 --- a/src/pages/MyMove/PPM/Closeout/Expenses/Expenses.test.jsx +++ b/src/pages/MyMove/PPM/Closeout/Expenses/Expenses.test.jsx @@ -35,8 +35,6 @@ const mockMTOShipment = { shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { id: mockPPMShipmentId, - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advance: 598700, diff --git a/src/pages/MyMove/PPM/Closeout/ProGear/ProGear.test.jsx b/src/pages/MyMove/PPM/Closeout/ProGear/ProGear.test.jsx index 4aed88bbe57..86def2b1691 100644 --- a/src/pages/MyMove/PPM/Closeout/ProGear/ProGear.test.jsx +++ b/src/pages/MyMove/PPM/Closeout/ProGear/ProGear.test.jsx @@ -44,8 +44,6 @@ const mockMTOShipment = { shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { id: mockPPMShipmentId, - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advance: 598700, diff --git a/src/pages/MyMove/PPM/Closeout/Review/Review.test.jsx b/src/pages/MyMove/PPM/Closeout/Review/Review.test.jsx index c58deec0507..9836b49886a 100644 --- a/src/pages/MyMove/PPM/Closeout/Review/Review.test.jsx +++ b/src/pages/MyMove/PPM/Closeout/Review/Review.test.jsx @@ -33,8 +33,6 @@ const mockMTOShipment = { actualDestinationPostalCode: '10004', advanceReceived: true, advanceAmountReceived: '6000000', - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advanceAmountRequested: 598700, @@ -61,8 +59,6 @@ const mockMTOShipmentWithWeightTicket = { actualDestinationPostalCode: '10004', advanceReceived: true, advanceAmountReceived: '6000000', - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advanceAmountRequested: 598700, @@ -89,8 +85,6 @@ const mockMTOShipmentWithWeightTicketDeleted = { actualDestinationPostalCode: '10004', advanceReceived: true, advanceAmountReceived: '6000000', - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advanceAmountRequested: 598700, @@ -117,8 +111,6 @@ const mockMTOShipmentWithIncompleteWeightTicket = { actualDestinationPostalCode: '10004', advanceReceived: true, advanceAmountReceived: '6000000', - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advanceAmountRequested: 598700, @@ -144,8 +136,6 @@ const mockMTOShipmentWithProGear = { actualDestinationPostalCode: '10004', advanceReceived: true, advanceAmountReceived: '6000000', - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advanceAmountRequested: 598700, @@ -172,8 +162,6 @@ const mockMTOShipmentWithProGearDeleted = { actualDestinationPostalCode: '10004', advanceReceived: true, advanceAmountReceived: '6000000', - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advanceAmountRequested: 598700, @@ -202,8 +190,6 @@ const mockMTOShipmentWithExpenses = { actualDestinationPostalCode: '10004', advanceReceived: true, advanceAmountReceived: '6000000', - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advanceAmountRequested: 598700, @@ -230,8 +216,6 @@ const mockMTOShipmentWithExpensesDeleted = { actualDestinationPostalCode: '10004', advanceReceived: true, advanceAmountReceived: '6000000', - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advanceAmountRequested: 598700, diff --git a/src/pages/MyMove/PPM/Closeout/WeightTickets/WeightTickets.test.jsx b/src/pages/MyMove/PPM/Closeout/WeightTickets/WeightTickets.test.jsx index 0c9c62bac4f..f225676d952 100644 --- a/src/pages/MyMove/PPM/Closeout/WeightTickets/WeightTickets.test.jsx +++ b/src/pages/MyMove/PPM/Closeout/WeightTickets/WeightTickets.test.jsx @@ -37,8 +37,6 @@ const mockMTOShipment = { shipmentType: SHIPMENT_OPTIONS.PPM, ppmShipment: { id: mockPPMShipmentId, - pickupPostalCode: '10001', - destinationPostalCode: '10002', expectedDepartureDate: '2022-04-30', advanceRequested: true, advance: 598700, diff --git a/src/pages/Office/MoveTaskOrder/moveTaskOrderUnitTestData.js b/src/pages/Office/MoveTaskOrder/moveTaskOrderUnitTestData.js index d728470da7c..98c40f0dcc7 100644 --- a/src/pages/Office/MoveTaskOrder/moveTaskOrderUnitTestData.js +++ b/src/pages/Office/MoveTaskOrder/moveTaskOrderUnitTestData.js @@ -1900,7 +1900,6 @@ export const reviewWeightsQuery = { advanceStatus: 'APPROVED', approvedAt: '2022-04-15T12:30:00.000Z', createdAt: '2023-02-28T18:02:59.869Z', - destinationPostalCode: '30813', eTag: 'MjAyMy0wMi0yOFQxODowMjo1OS44Njk2ODZa', estimatedIncentive: 1000000, estimatedWeight: 4000, @@ -1911,12 +1910,9 @@ export const reviewWeightsQuery = { hasRequestedAdvance: true, id: '919bd9a9-29ca-47c3-8cd3-fb4b0eabfba3', movingExpenses: null, - pickupPostalCode: '90210', proGearWeight: 1987, proGearWeightTickets: null, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: '93ec03fc-219d-46ad-9227-9cbd3b465e47', sitEstimatedCost: null, sitEstimatedDepartureDate: null, @@ -2354,7 +2350,6 @@ export const reviewWeightsNoProGearQuery = { advanceStatus: 'APPROVED', approvedAt: '2022-04-15T12:30:00.000Z', createdAt: '2023-02-28T18:02:59.869Z', - destinationPostalCode: '30813', eTag: 'MjAyMy0wMi0yOFQxODowMjo1OS44Njk2ODZa', estimatedIncentive: 1000000, estimatedWeight: 4000, @@ -2365,12 +2360,9 @@ export const reviewWeightsNoProGearQuery = { hasRequestedAdvance: true, id: '919bd9a9-29ca-47c3-8cd3-fb4b0eabfba3', movingExpenses: null, - pickupPostalCode: '90210', proGearWeight: null, proGearWeightTickets: null, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: '93ec03fc-219d-46ad-9227-9cbd3b465e47', sitEstimatedCost: null, sitEstimatedDepartureDate: null, diff --git a/src/pages/Office/Orders/Orders.jsx b/src/pages/Office/Orders/Orders.jsx index 9eda8b68d7c..58d1dcaa25c 100644 --- a/src/pages/Office/Orders/Orders.jsx +++ b/src/pages/Office/Orders/Orders.jsx @@ -85,7 +85,13 @@ const Orders = () => { } return loa[key] || ''; }); - return dfasMap.join('*'); + let longLoa = dfasMap.join('*'); + // remove any number of spaces following an asterisk in a LOA string + longLoa = longLoa.replace(/\* +/g, '*'); + // remove any number of spaces preceding an asterisk in a LOA string + longLoa = longLoa.replace(/ +\*/g, '*'); + + return longLoa; }; const { mutate: validateLoa } = useMutation(getLoa, { diff --git a/src/pages/Office/Orders/Orders.test.jsx b/src/pages/Office/Orders/Orders.test.jsx index a50b2e69a9d..c058a170a96 100644 --- a/src/pages/Office/Orders/Orders.test.jsx +++ b/src/pages/Office/Orders/Orders.test.jsx @@ -310,4 +310,20 @@ describe('Orders page', () => { expect(loaTextField).toHaveValue(expectedLongLineOfAccounting); }); }); + describe('LOA concatenation with regex removes extra spaces', () => { + it('concatenates the LOA string correctly and without extra spaces', async () => { + let extraSpacesLongLineOfAccounting = + '1 **20062016*1234 *0000**1A *123A**00000000** **** ***22NL** *000000*SEE PCS ORDERS* *12345**B1*'; + const expectedLongLineOfAccounting = + '1**20062016*1234*0000**1A*123A**00000000*********22NL***000000*SEE PCS ORDERS**12345**B1*'; + + // preserves spaces in column values such as 'SEE PCS ORDERS' + // remove any number of spaces following an asterisk in a LOA string + extraSpacesLongLineOfAccounting = extraSpacesLongLineOfAccounting.replace(/\* +/g, '*'); + // remove any number of spaces preceding an asterisk in a LOA string + extraSpacesLongLineOfAccounting = extraSpacesLongLineOfAccounting.replace(/ +\*/g, '*'); + + expect(extraSpacesLongLineOfAccounting).toEqual(expectedLongLineOfAccounting); + }); + }); }); diff --git a/src/pages/Office/ServicesCounselingOrders/ServicesCounselingOrders.jsx b/src/pages/Office/ServicesCounselingOrders/ServicesCounselingOrders.jsx index 44daab45439..4e090dde06e 100644 --- a/src/pages/Office/ServicesCounselingOrders/ServicesCounselingOrders.jsx +++ b/src/pages/Office/ServicesCounselingOrders/ServicesCounselingOrders.jsx @@ -105,7 +105,13 @@ const ServicesCounselingOrders = ({ hasDocuments }) => { } return loa[key] || ''; }); - return dfasMap.join('*'); + let longLoa = dfasMap.join('*'); + // remove any number of spaces following an asterisk in a LOA string + longLoa = longLoa.replace(/\* +/g, '*'); + // remove any number of spaces preceding an asterisk in a LOA string + longLoa = longLoa.replace(/ +\*/g, '*'); + + return longLoa; }; const { mutate: validateLoa } = useMutation(getLoa, { diff --git a/src/pages/Office/ServicesCounselingOrders/ServicesCounselingOrders.test.jsx b/src/pages/Office/ServicesCounselingOrders/ServicesCounselingOrders.test.jsx index 71409bcbea5..285bf861703 100644 --- a/src/pages/Office/ServicesCounselingOrders/ServicesCounselingOrders.test.jsx +++ b/src/pages/Office/ServicesCounselingOrders/ServicesCounselingOrders.test.jsx @@ -391,4 +391,20 @@ describe('Orders page', () => { expect(loaTextField).toHaveValue(expectedLongLineOfAccounting); }); }); + describe('LOA concatenation with regex removes extra spaces', () => { + it('concatenates the LOA string correctly and without extra spaces', async () => { + let extraSpacesLongLineOfAccounting = + '1 **20062016*1234 *0000**1A *123A**00000000** **** ***22NL** *000000*SEE PCS ORDERS* *12345**B1*'; + const expectedLongLineOfAccounting = + '1**20062016*1234*0000**1A*123A**00000000*********22NL***000000*SEE PCS ORDERS**12345**B1*'; + + // preserves spaces in column values such as 'SEE PCS ORDERS' + // remove any number of spaces following an asterisk in a LOA string + extraSpacesLongLineOfAccounting = extraSpacesLongLineOfAccounting.replace(/\* +/g, '*'); + // remove any number of spaces preceding an asterisk in a LOA string + extraSpacesLongLineOfAccounting = extraSpacesLongLineOfAccounting.replace(/ +\*/g, '*'); + + expect(extraSpacesLongLineOfAccounting).toEqual(expectedLongLineOfAccounting); + }); + }); }); diff --git a/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.test.jsx b/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.test.jsx index 423e56fb472..be215371d31 100644 --- a/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.test.jsx +++ b/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.test.jsx @@ -61,14 +61,12 @@ const moveTaskOrder = { advance: 598700, advanceRequested: true, createdAt: '2022-05-24T21:06:35.901Z', - destinationPostalCode: '30813', eTag: 'MjAyMi0wNS0yNFQyMTowNjozNS45MDEwMjNa', estimatedIncentive: 1000000, estimatedWeight: 4000, expectedDepartureDate: '2020-03-15', hasProGear: false, id: '5b21b808-6933-43ea-8f6f-02fc0a639835', - pickupPostalCode: '90210', shipmentId: '88ececed-eaf1-42e2-b060-cd90d11ad080', status: 'SUBMITTED', submittedAt: '2022-05-24T21:06:35.890Z', diff --git a/src/pages/PrimeUI/Shipment/PrimeUIShipmentUpdate.test.jsx b/src/pages/PrimeUI/Shipment/PrimeUIShipmentUpdate.test.jsx index 2e27c5baecd..a3b57c831eb 100644 --- a/src/pages/PrimeUI/Shipment/PrimeUIShipmentUpdate.test.jsx +++ b/src/pages/PrimeUI/Shipment/PrimeUIShipmentUpdate.test.jsx @@ -147,7 +147,6 @@ const approvedMoveTaskOrder = { advanceAmountRequested: 598700, approvedAt: '2022-07-03T14:20:21.620Z', createdAt: '2022-06-30T13:41:33.265Z', - destinationPostalCode: '30813', eTag: 'MjAyMi0wNy0wMVQxNDoyMzoxOS43ODA1Mlo=', estimatedIncentive: 1000000, estimatedWeight: 4000, @@ -156,11 +155,8 @@ const approvedMoveTaskOrder = { hasReceivedAdvance: true, hasRequestedAdvance: true, id: 'd733fe2f-b08d-434a-ad8d-551f4d597b03', - pickupPostalCode: '90210', proGearWeight: 1987, reviewedAt: '2022-07-02T14:20:14.636Z', - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: '1b695b60-c3ed-401b-b2e3-808d095eb8cc', sitEstimatedCost: 123456, sitEstimatedDepartureDate: '2022-07-13', diff --git a/src/store/entities/selectors.test.js b/src/store/entities/selectors.test.js index 29a465e42ec..c62eac57b39 100644 --- a/src/store/entities/selectors.test.js +++ b/src/store/entities/selectors.test.js @@ -1310,7 +1310,6 @@ describe('selectWeightTicketAndIndexById', () => { advanceAmountRequested: 598700, approvedAt: '2022-04-15T12:30:00.000Z', createdAt: '2022-07-01T01:10:51.231Z', - destinationPostalCode: '30813', eTag: 'MjAyMi0wNy0xMVQxODoyMDoxOC43NTIwMDNa', estimatedIncentive: 1000000, estimatedWeight: 4000, @@ -1319,11 +1318,8 @@ describe('selectWeightTicketAndIndexById', () => { hasReceivedAdvance: false, hasRequestedAdvance: true, id: 'b9ae4c25-1376-4b9b-8781-106b5ae7ecab', - pickupPostalCode: '90210', proGearWeight: 1987, reviewedAt: null, - secondaryDestinationPostalCode: '30814', - secondaryPickupPostalCode: '90211', shipmentId: '2ed2998e-ae36-46cd-af83-c3ecee55fe3e', sitEstimatedCost: null, sitEstimatedDepartureDate: null, diff --git a/src/types/shipment.js b/src/types/shipment.js index 5574590d477..1e56ea0bc0c 100644 --- a/src/types/shipment.js +++ b/src/types/shipment.js @@ -51,11 +51,7 @@ export const PPMShipmentShape = shape({ submittedAt: string, reviewedAt: string, approvedAt: string, - pickupPostalCode: string, - secondaryPickupPostalCode: string, actualPickupPostalCode: string, - destinationPostalCode: string, - secondaryDestinationPostalCode: string, actualDestinationPostalCode: string, sitExpected: bool, estimatedWeight: number, diff --git a/src/utils/shipments.test.js b/src/utils/shipments.test.js index 0e185b69d6f..d81312ac3ed 100644 --- a/src/utils/shipments.test.js +++ b/src/utils/shipments.test.js @@ -27,8 +27,6 @@ describe('shipments utils', () => { ppmShipment: { id: '2', expectedDepartureDate: '2022-04-01', - pickupPostalCode: '90210', - destinationPostalCode: '90211', sitExpected: false, estimatedWeight: 7999, hasProGear: false, @@ -47,8 +45,6 @@ describe('shipments utils', () => { ppmShipment: { id: '2', expectedDepartureDate: '2022-04-01', - pickupPostalCode: '90210', - destinationPostalCode: '90211', sitExpected: false, estimatedWeight: 7999, hasProGear: false, @@ -66,8 +62,6 @@ describe('shipments utils', () => { ppmShipment: { id: '2', expectedDepartureDate: '2022-04-01', - pickupPostalCode: '90210', - destinationPostalCode: '90211', sitExpected: false, estimatedWeight: 7999, hasProGear: false, @@ -84,8 +78,6 @@ describe('shipments utils', () => { ppmShipment: { id: '2', expectedDepartureDate: '2022-04-01', - pickupPostalCode: '90210', - destinationPostalCode: '90211', sitExpected: false, estimatedWeight: 7999, hasProGear: false, @@ -108,8 +100,6 @@ describe('shipments utils', () => { shipmentId: v4(), status: ppmShipmentStatuses.WAITING_ON_CUSTOMER, expectedDepartureDate: '2022-08-08', - pickupPostalCode: '90210', - destinationPostalCode: '30813', sitExpected: false, estimatedWeight: 4000, hasProGear: false, diff --git a/src/utils/test/factories/ppmShipment.js b/src/utils/test/factories/ppmShipment.js index 37b2d3e357e..a69b75c4a4a 100644 --- a/src/utils/test/factories/ppmShipment.js +++ b/src/utils/test/factories/ppmShipment.js @@ -37,8 +37,6 @@ const createBasePPMShipment = (fieldOverrides = {}) => { shipmentId: mtoPPMShipmentId, status: ppmShipmentStatuses.DRAFT, expectedDepartureDate: '2022-09-15', - pickupPostalCode: '90210', - destinationPostalCode: '30813', sitExpected: false, estimatedWeight: null, hasProGear: null, diff --git a/swagger-def/definitions/Affiliation.yaml b/swagger-def/definitions/Affiliation.yaml index 32469d5b12e..ab02b866ed9 100644 --- a/swagger-def/definitions/Affiliation.yaml +++ b/swagger-def/definitions/Affiliation.yaml @@ -9,6 +9,8 @@ enum: &AFFILIATION - AIR_FORCE - COAST_GUARD - SPACE_FORCE + - NAVY_AND_MARINES + - AIR_AND_SPACE_FORCE - OTHER x-display-value: ARMY: Army diff --git a/swagger-def/definitions/PPMShipment.yaml b/swagger-def/definitions/PPMShipment.yaml index b79829250c9..a473578295b 100644 --- a/swagger-def/definitions/PPMShipment.yaml +++ b/swagger-def/definitions/PPMShipment.yaml @@ -59,23 +59,8 @@ properties: type: string x-nullable: true x-omitempty: false - pickupPostalCode: - description: The postal code of the origin location where goods are being moved from. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ pickupAddress: $ref: 'Address.yaml' - secondaryPickupPostalCode: - format: An optional secondary pickup location near the origin where additional goods exist. - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false hasSecondaryPickupAddress: type: boolean x-omitempty: false @@ -95,24 +80,8 @@ properties: pattern: ^(\d{5})$ x-nullable: true x-omitempty: false - destinationPostalCode: - description: The postal code of the destination location where goods are being delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ destinationAddress: $ref: 'Address.yaml' - secondaryDestinationPostalCode: - description: An optional secondary location near the destination where goods will be dropped off. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false hasSecondaryDestinationAddress: type: boolean x-omitempty: false @@ -253,7 +222,5 @@ required: - createdAt - status - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - eTag diff --git a/swagger-def/definitions/prime/PPMShipment.yaml b/swagger-def/definitions/prime/PPMShipment.yaml index e238bbb36dd..ed5bda88097 100644 --- a/swagger-def/definitions/prime/PPMShipment.yaml +++ b/swagger-def/definitions/prime/PPMShipment.yaml @@ -54,21 +54,6 @@ properties: type: string x-nullable: true x-omitempty: false - pickupPostalCode: - description: The postal code of the origin location where goods are being moved from. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - secondaryPickupPostalCode: - description: An optional secondary pickup location near the origin where additional goods exist. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false actualPickupPostalCode: description: > The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. @@ -79,20 +64,6 @@ properties: pattern: ^(\d{5})$ x-nullable: true x-omitempty: false - destinationPostalCode: - description: The postal code of the destination location where goods are being delivered to. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - secondaryDestinationPostalCode: - description: An optional secondary location near the destination where goods will be dropped off. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false actualDestinationPostalCode: description: > The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. @@ -202,7 +173,5 @@ required: - createdAt - status - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - eTag diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 644661a8c6e..1a58107082e 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -1894,46 +1894,19 @@ definitions: Date the customer expects to move. format: date type: string - pickupPostalCode: - description: zip code - format: zip - type: string - title: ZIP - example: "90210" - pattern: ^(\d{5})$ pickupAddress: - $ref: 'definitions/Address.yaml' - secondaryPickupPostalCode: - format: zip - title: ZIP - example: "90210" - pattern: ^(\d{5})$ - $ref: definitions/NullableString.yaml + $ref: "definitions/Address.yaml" secondaryPickupAddress: - $ref: 'definitions/Address.yaml' - destinationPostalCode: - format: zip - type: string - title: ZIP - example: "90210" - pattern: ^(\d{5})$ + $ref: "definitions/Address.yaml" destinationAddress: - $ref: 'definitions/Address.yaml' - secondaryDestinationPostalCode: - format: zip - title: ZIP - example: "90210" - pattern: ^(\d{5})$ - $ref: definitions/NullableString.yaml + $ref: "definitions/Address.yaml" secondaryDestinationAddress: $ref: 'definitions/Address.yaml' sitExpected: type: boolean required: - expectedDepartureDate - - pickupPostalCode - pickupAddress - - destinationPostalCode - destinationAddress - sitExpected UpdatePPMShipment: @@ -1949,22 +1922,8 @@ definitions: format: date type: string x-nullable: true - pickupPostalCode: - description: zip code - format: zip - type: string - title: ZIP - example: "90210" - pattern: ^(\d{5})$ - x-nullable: true pickupAddress: - $ref: 'definitions/Address.yaml' - secondaryPickupPostalCode: - format: zip - title: ZIP - example: "90210" - pattern: ^(\d{5})$ - $ref: definitions/NullableString.yaml + $ref: "definitions/Address.yaml" secondaryPickupAddress: $ref: 'definitions/Address.yaml' hasSecondaryPickupAddress: @@ -1980,21 +1939,8 @@ definitions: example: "90210" pattern: ^(\d{5})$ x-nullable: true - destinationPostalCode: - format: zip - type: string - title: ZIP - example: "90210" - pattern: ^(\d{5})$ - x-nullable: true destinationAddress: - $ref: 'definitions/Address.yaml' - secondaryDestinationPostalCode: - format: zip - title: ZIP - example: "90210" - pattern: ^(\d{5})$ - $ref: definitions/NullableString.yaml + $ref: "definitions/Address.yaml" secondaryDestinationAddress: $ref: 'definitions/Address.yaml' hasSecondaryDestinationAddress: diff --git a/swagger-def/prime.yaml b/swagger-def/prime.yaml index 9b84dd9e5eb..c00ec935da6 100644 --- a/swagger-def/prime.yaml +++ b/swagger-def/prime.yaml @@ -295,8 +295,6 @@ paths: 'shipmentType': 'PPM', 'ppmShipment': { - 'pickupPostalCode': '90210', - 'destinationPostalCode': '10001', 'expectedDepartureDate': '2022-10-01', 'estimatedWeight': 4999, 'hasProGear': false, @@ -1558,35 +1556,14 @@ definitions: Date the customer expects to begin moving from their origin. format: date type: string - pickupPostalCode: - description: The postal code of the origin location where goods are being moved from. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - secondaryPickupPostalCode: - description: An optional secondary pickup location near the origin where additional goods exist. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - destinationPostalCode: - description: The postal code of the destination location where goods are being delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - secondaryDestinationPostalCode: - description: An optional secondary location near the destination where goods will be dropped off. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true + pickupAddress: + description: The address of the origin location where goods are being moved from. + allOf: + - $ref: 'definitions/Address.yaml' + destinationAddress: + description: The address of the destination location where goods are being delivered to. + allOf: + - $ref: 'definitions/Address.yaml' sitExpected: description: | Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. @@ -1630,8 +1607,6 @@ definitions: x-nullable: true required: - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - estimatedWeight - hasProGear @@ -2085,35 +2060,6 @@ definitions: format: date type: string x-nullable: true - pickupPostalCode: - description: The postal code of the origin location where goods are being moved from. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - secondaryPickupPostalCode: - description: An optional secondary pickup location near the origin where additional goods exist. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - destinationPostalCode: - description: The postal code of the destination location where goods are being delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - secondaryDestinationPostalCode: - description: An optional secondary location near the destination where goods will be dropped off. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true sitExpected: description: | Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. diff --git a/swagger-def/prime_v2.yaml b/swagger-def/prime_v2.yaml index 9b1c9985600..4857297b19c 100644 --- a/swagger-def/prime_v2.yaml +++ b/swagger-def/prime_v2.yaml @@ -156,8 +156,6 @@ paths: 'shipmentType': 'PPM', 'ppmShipment': { - 'pickupPostalCode': '90210', - 'destinationPostalCode': '10001', 'expectedDepartureDate': '2022-10-01', 'estimatedWeight': 4999, 'hasProGear': false, @@ -405,35 +403,14 @@ definitions: Date the customer expects to begin moving from their origin. format: date type: string - pickupPostalCode: - description: The postal code of the origin location where goods are being moved from. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - secondaryPickupPostalCode: - description: An optional secondary pickup location near the origin where additional goods exist. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - destinationPostalCode: - description: The postal code of the destination location where goods are being delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - secondaryDestinationPostalCode: - description: An optional secondary location near the destination where goods will be dropped off. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true + pickupAddress: + description: The address of the origin location where goods are being moved from. + allOf: + - $ref: 'definitions/Address.yaml' + destinationAddress: + description: The address of the destination location where goods are being delivered to. + allOf: + - $ref: 'definitions/Address.yaml' sitExpected: description: | Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. @@ -477,8 +454,6 @@ definitions: x-nullable: true required: - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - estimatedWeight - hasProGear @@ -571,35 +546,6 @@ definitions: format: date type: string x-nullable: true - pickupPostalCode: - description: The postal code of the origin location where goods are being moved from. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - secondaryPickupPostalCode: - description: An optional secondary pickup location near the origin where additional goods exist. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - destinationPostalCode: - description: The postal code of the destination location where goods are being delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - secondaryDestinationPostalCode: - description: An optional secondary location near the destination where goods will be dropped off. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true sitExpected: description: | Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 28eee8a86f9..acb2f5e89b1 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -6606,6 +6606,8 @@ definitions: - AIR_FORCE - COAST_GUARD - SPACE_FORCE + - NAVY_AND_MARINES + - AIR_AND_SPACE_FORCE - OTHER x-display-value: ARMY: Army @@ -8176,27 +8178,8 @@ definitions: type: string x-nullable: true x-omitempty: false - pickupPostalCode: - description: >- - The postal code of the origin location where goods are being moved - from. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ pickupAddress: $ref: '#/definitions/Address' - secondaryPickupPostalCode: - format: >- - An optional secondary pickup location near the origin where additional - goods exist. - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false hasSecondaryPickupAddress: type: boolean x-omitempty: false @@ -8217,28 +8200,8 @@ definitions: pattern: ^(\d{5})$ x-nullable: true x-omitempty: false - destinationPostalCode: - description: >- - The postal code of the destination location where goods are being - delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ destinationAddress: $ref: '#/definitions/Address' - secondaryDestinationPostalCode: - description: >- - An optional secondary location near the destination where goods will - be dropped off. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false hasSecondaryDestinationAddress: type: boolean x-omitempty: false @@ -8402,8 +8365,6 @@ definitions: - createdAt - status - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - eTag ShipmentAddressUpdateStatus: diff --git a/swagger/internal.yaml b/swagger/internal.yaml index b5c70961299..ac664742e8e 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -1923,46 +1923,19 @@ definitions: Date the customer expects to move. format: date type: string - pickupPostalCode: - description: zip code - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ pickupAddress: $ref: '#/definitions/Address' - secondaryPickupPostalCode: - format: zip - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - $ref: '#/definitions/NullableString' secondaryPickupAddress: $ref: '#/definitions/Address' - destinationPostalCode: - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ destinationAddress: $ref: '#/definitions/Address' - secondaryDestinationPostalCode: - format: zip - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - $ref: '#/definitions/NullableString' secondaryDestinationAddress: $ref: '#/definitions/Address' sitExpected: type: boolean required: - expectedDepartureDate - - pickupPostalCode - pickupAddress - - destinationPostalCode - destinationAddress - sitExpected UpdatePPMShipment: @@ -1978,22 +1951,8 @@ definitions: format: date type: string x-nullable: true - pickupPostalCode: - description: zip code - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true pickupAddress: $ref: '#/definitions/Address' - secondaryPickupPostalCode: - format: zip - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - $ref: '#/definitions/NullableString' secondaryPickupAddress: $ref: '#/definitions/Address' hasSecondaryPickupAddress: @@ -2010,21 +1969,8 @@ definitions: example: '90210' pattern: ^(\d{5})$ x-nullable: true - destinationPostalCode: - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true destinationAddress: $ref: '#/definitions/Address' - secondaryDestinationPostalCode: - format: zip - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - $ref: '#/definitions/NullableString' secondaryDestinationAddress: $ref: '#/definitions/Address' hasSecondaryDestinationAddress: @@ -2472,6 +2418,8 @@ definitions: - AIR_FORCE - COAST_GUARD - SPACE_FORCE + - NAVY_AND_MARINES + - AIR_AND_SPACE_FORCE - OTHER x-display-value: ARMY: Army @@ -3312,27 +3260,8 @@ definitions: type: string x-nullable: true x-omitempty: false - pickupPostalCode: - description: >- - The postal code of the origin location where goods are being moved - from. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ pickupAddress: $ref: '#/definitions/Address' - secondaryPickupPostalCode: - format: >- - An optional secondary pickup location near the origin where additional - goods exist. - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false hasSecondaryPickupAddress: type: boolean x-omitempty: false @@ -3353,28 +3282,8 @@ definitions: pattern: ^(\d{5})$ x-nullable: true x-omitempty: false - destinationPostalCode: - description: >- - The postal code of the destination location where goods are being - delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ destinationAddress: $ref: '#/definitions/Address' - secondaryDestinationPostalCode: - description: >- - An optional secondary location near the destination where goods will - be dropped off. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false hasSecondaryDestinationAddress: type: boolean x-omitempty: false @@ -3538,8 +3447,6 @@ definitions: - createdAt - status - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - eTag PpmID: @@ -3572,12 +3479,6 @@ definitions: RENTAL_EQUIPMENT: Rental equipment TOLLS: Tolls WEIGHING_FEE: Weighing fee - NullableString: - type: string - x-go-type: - import: - package: github.com/transcom/mymove/pkg/swagger/nullable - type: String paths: /feature-flags/user-boolean/{key}: post: diff --git a/swagger/orders.yaml b/swagger/orders.yaml index 7fe7eba2545..4a0dd8d3cb1 100644 --- a/swagger/orders.yaml +++ b/swagger/orders.yaml @@ -813,6 +813,8 @@ definitions: - AIR_FORCE - COAST_GUARD - SPACE_FORCE + - NAVY_AND_MARINES + - AIR_AND_SPACE_FORCE - OTHER x-display-value: ARMY: Army diff --git a/swagger/prime.yaml b/swagger/prime.yaml index 3b87fd90eee..9b2f4327e01 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -371,8 +371,6 @@ paths: moveTaskOrderId: 5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8 shipmentType: PPM ppmShipment: - pickupPostalCode: '90210' - destinationPostalCode: '10001' expectedDepartureDate: '2022-10-01' estimatedWeight: 4999 hasProGear: false @@ -1885,43 +1883,16 @@ definitions: Date the customer expects to begin moving from their origin. format: date type: string - pickupPostalCode: - description: >- - The postal code of the origin location where goods are being moved - from. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - secondaryPickupPostalCode: - description: >- - An optional secondary pickup location near the origin where additional - goods exist. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - destinationPostalCode: + pickupAddress: + description: The address of the origin location where goods are being moved from. + allOf: + - $ref: '#/definitions/Address' + destinationAddress: description: >- - The postal code of the destination location where goods are being + The address of the destination location where goods are being delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - secondaryDestinationPostalCode: - description: >- - An optional secondary location near the destination where goods will - be dropped off. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true + allOf: + - $ref: '#/definitions/Address' sitExpected: description: > Captures whether some or all of the PPM shipment will require @@ -1975,8 +1946,6 @@ definitions: x-nullable: true required: - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - estimatedWeight - hasProGear @@ -2802,43 +2771,6 @@ definitions: format: date type: string x-nullable: true - pickupPostalCode: - description: >- - The postal code of the origin location where goods are being moved - from. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - secondaryPickupPostalCode: - description: >- - An optional secondary pickup location near the origin where additional - goods exist. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - destinationPostalCode: - description: >- - The postal code of the destination location where goods are being - delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - secondaryDestinationPostalCode: - description: >- - An optional secondary location near the destination where goods will - be dropped off. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true sitExpected: description: > Captures whether some or all of the PPM shipment will require @@ -3959,25 +3891,6 @@ definitions: type: string x-nullable: true x-omitempty: false - pickupPostalCode: - description: >- - The postal code of the origin location where goods are being moved - from. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - secondaryPickupPostalCode: - description: >- - An optional secondary pickup location near the origin where additional - goods exist. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false actualPickupPostalCode: description: > The actual postal code where the PPM shipment started. To be filled @@ -3989,24 +3902,6 @@ definitions: pattern: ^(\d{5})$ x-nullable: true x-omitempty: false - destinationPostalCode: - description: >- - The postal code of the destination location where goods are being - delivered to. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - secondaryDestinationPostalCode: - description: >- - An optional secondary location near the destination where goods will - be dropped off. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false actualDestinationPostalCode: description: > The actual postal code where the PPM shipment ended. To be filled once @@ -4136,8 +4031,6 @@ definitions: - createdAt - status - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - eTag ShipmentAddressUpdateStatus: diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index b3d0e32b228..675117aaed7 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -200,8 +200,6 @@ paths: moveTaskOrderId: 5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8 shipmentType: PPM ppmShipment: - pickupPostalCode: '90210' - destinationPostalCode: '10001' expectedDepartureDate: '2022-10-01' estimatedWeight: 4999 hasProGear: false @@ -699,43 +697,16 @@ definitions: Date the customer expects to begin moving from their origin. format: date type: string - pickupPostalCode: - description: >- - The postal code of the origin location where goods are being moved - from. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - secondaryPickupPostalCode: - description: >- - An optional secondary pickup location near the origin where additional - goods exist. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - destinationPostalCode: + pickupAddress: + description: The address of the origin location where goods are being moved from. + allOf: + - $ref: '#/definitions/Address' + destinationAddress: description: >- - The postal code of the destination location where goods are being + The address of the destination location where goods are being delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - secondaryDestinationPostalCode: - description: >- - An optional secondary location near the destination where goods will - be dropped off. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true + allOf: + - $ref: '#/definitions/Address' sitExpected: description: > Captures whether some or all of the PPM shipment will require @@ -789,8 +760,6 @@ definitions: x-nullable: true required: - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - estimatedWeight - hasProGear @@ -891,43 +860,6 @@ definitions: format: date type: string x-nullable: true - pickupPostalCode: - description: >- - The postal code of the origin location where goods are being moved - from. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - secondaryPickupPostalCode: - description: >- - An optional secondary pickup location near the origin where additional - goods exist. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - destinationPostalCode: - description: >- - The postal code of the destination location where goods are being - delivered to. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - secondaryDestinationPostalCode: - description: >- - An optional secondary location near the destination where goods will - be dropped off. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true sitExpected: description: > Captures whether some or all of the PPM shipment will require @@ -2342,25 +2274,6 @@ definitions: type: string x-nullable: true x-omitempty: false - pickupPostalCode: - description: >- - The postal code of the origin location where goods are being moved - from. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - secondaryPickupPostalCode: - description: >- - An optional secondary pickup location near the origin where additional - goods exist. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false actualPickupPostalCode: description: > The actual postal code where the PPM shipment started. To be filled @@ -2372,24 +2285,6 @@ definitions: pattern: ^(\d{5})$ x-nullable: true x-omitempty: false - destinationPostalCode: - description: >- - The postal code of the destination location where goods are being - delivered to. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - secondaryDestinationPostalCode: - description: >- - An optional secondary location near the destination where goods will - be dropped off. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false actualDestinationPostalCode: description: > The actual postal code where the PPM shipment ended. To be filled once @@ -2519,8 +2414,6 @@ definitions: - createdAt - status - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - sitExpected - eTag ShipmentAddressUpdateStatus: diff --git a/yarn.lock b/yarn.lock index 4d6d0481ed1..6d1e12f846e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -110,12 +110,12 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-annotate-as-pure@^7.12.10", "@babel/helper-annotate-as-pure@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" - integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== +"@babel/helper-annotate-as-pure@^7.12.10", "@babel/helper-annotate-as-pure@^7.22.5", "@babel/helper-annotate-as-pure@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz#5373c7bc8366b12a033b4be1ac13a206c6656aab" + integrity sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.24.7" "@babel/helper-builder-binary-assignment-operator-visitor@^7.22.15": version "7.22.15" @@ -133,13 +133,13 @@ "@babel/helper-module-imports" "^7.12.5" "@babel/types" "^7.12.11" -"@babel/helper-builder-react-jsx@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.22.5.tgz#9b325d4558fb51b0bb51e4837a2bf8f707029e97" - integrity sha512-GYZBuAC9Vl4jnPun18TeNGyqkKWQ+3AtZHbgnrdT//0yCV+qcFyXj0X+9DJyD2jYi0C+55gRcUAhE35sk2Mm9g== +"@babel/helper-builder-react-jsx@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.24.7.tgz#28ff89b64f1b3ccdb6f755550bc3b6ea0c8ac9a5" + integrity sha512-k87H7LeQijAXxI6gGWRbf+PAOZTn8jFr6SPgPrALrebOQYC+pVELsolqgRJrG6wWQIsAlZezB/pHnyvfgsCA9A== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/helper-annotate-as-pure" "^7.24.7" + "@babel/types" "^7.24.7" "@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.22.9", "@babel/helper-compilation-targets@^7.23.6": version "7.23.6" @@ -297,16 +297,21 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" - integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== +"@babel/helper-string-parser@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz#4d2d0f14820ede3b9807ea5fc36dfc8cd7da07f2" + integrity sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg== "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" + integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== + "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.22.5", "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" @@ -1230,13 +1235,13 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.11", "@babel/types@^7.12.6", "@babel/types@^7.18.4", "@babel/types@^7.2.0", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.23.9" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.9.tgz#1dd7b59a9a2b5c87f8b41e52770b5ecbf492e002" - integrity sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q== +"@babel/types@^7.0.0", "@babel/types@^7.12.11", "@babel/types@^7.12.6", "@babel/types@^7.18.4", "@babel/types@^7.2.0", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.24.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.7.tgz#6027fe12bc1aa724cd32ab113fb7f1988f1f66f2" + integrity sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q== dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" + "@babel/helper-string-parser" "^7.24.7" + "@babel/helper-validator-identifier" "^7.24.7" to-fast-properties "^2.0.0" "@base2/pretty-print-object@1.0.1": @@ -1648,17 +1653,17 @@ resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.0.tgz#88da2b70d6ca18aaa6ed3687832e11f39e80624b" integrity sha512-HNii132xfomg5QVZw0HwXXpN22s7VBHQBv9CeOu9tfJnhsWQNd2lmTNi8CSrnw5B+5YOmzu1UoPAyxaXsJ6RgQ== -"@fortawesome/fontawesome-common-types@6.5.1": - version "6.5.1" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.1.tgz#fdb1ec4952b689f5f7aa0bffe46180bb35490032" - integrity sha512-GkWzv+L6d2bI5f/Vk6ikJ9xtl7dfXtoRu3YGE6nq0p/FFqA1ebMOAWg3XgRyb0I6LYyYkiAo+3/KrwuBp8xG7A== +"@fortawesome/fontawesome-common-types@6.5.2": + version "6.5.2" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.2.tgz#eaf2f5699f73cef198454ebc0c414e3688898179" + integrity sha512-gBxPg3aVO6J0kpfHNILc+NMhXnqHumFxOmjYCFfOiLZfwhnnfhtsdA2hfJlDnj+8PjAs6kKQPenOTKj3Rf7zHw== -"@fortawesome/fontawesome-svg-core@^6.5.1": - version "6.5.1" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.1.tgz#9d56d46bddad78a7ebb2043a97957039fcebcf0a" - integrity sha512-MfRCYlQPXoLlpem+egxjfkEuP9UQswTrlCOsknus/NcMoblTH2g0jPrapbcIb04KGA7E2GZxbAccGZfWoYgsrQ== +"@fortawesome/fontawesome-svg-core@^6.5.2": + version "6.5.2" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.2.tgz#4b42de71e196039b0d5ccf88559b8044e3296c21" + integrity sha512-5CdaCBGl8Rh9ohNdxeeTMxIj8oc3KNBgIeLMvJosBMdslK/UnEB8rzyDRrbKdL1kDweqBPo4GT9wvnakHWucZw== dependencies: - "@fortawesome/fontawesome-common-types" "6.5.1" + "@fortawesome/fontawesome-common-types" "6.5.2" "@fortawesome/free-regular-svg-icons@^6.4.0": version "6.4.0" @@ -7130,10 +7135,10 @@ core-js@^2.0.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== -core-js@^3.19.2, core-js@^3.29.0, core-js@^3.37.0, core-js@^3.8.2: - version "3.37.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.37.0.tgz#d8dde58e91d156b2547c19d8a4efd5c7f6c426bb" - integrity sha512-fu5vHevQ8ZG4og+LXug8ulUtVxjOcEYvifJr7L5Bfq9GOztVqsKd9/59hUk2ZSbCrS3BqUr3EpaYGIYzq7g3Ug== +core-js@^3.19.2, core-js@^3.29.0, core-js@^3.37.1, core-js@^3.8.2: + version "3.37.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.37.1.tgz#d21751ddb756518ac5a00e4d66499df981a62db9" + integrity sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw== core-util-is@~1.0.0: version "1.0.3"