This repository has been archived by the owner on May 7, 2024. It is now read-only.
forked from transcom/mymove
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into B-17150-DB-UPDATES-OKTA
- Loading branch information
Showing
51 changed files
with
1,939 additions
and
683 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
# pull-requests: read | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
cache: false | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Require: The version of golangci-lint to use. | ||
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. | ||
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. | ||
version: v1.53 | ||
|
||
# Optional: working directory, useful for monorepos | ||
# working-directory: somedir | ||
|
||
# Optional: golangci-lint command line arguments. | ||
# | ||
# Note: By default, the `.golangci.yml` file should be at the root of the repository. | ||
# The location of the configuration file can be changed by using `--config=` | ||
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0 | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
only-new-issues: true | ||
|
||
# Optional: if set to true, then all caching functionality will be completely disabled, | ||
# takes precedence over all other caching options. | ||
# skip-cache: true | ||
|
||
# Optional: if set to true, then the action won't cache or restore ~/go/pkg. | ||
# skip-pkg-cache: true | ||
|
||
# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build. | ||
# skip-build-cache: true | ||
|
||
# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'. | ||
# install-mode: "goinstall" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,10 @@ | ||
package models_test | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
"github.com/transcom/mymove/pkg/factory" | ||
"github.com/transcom/mymove/pkg/models" | ||
) | ||
|
||
// This test will check if any field names are not being mapped properly. This test is not finalized. | ||
func TestTransportationAccountingCodeMapForUnusedFields(t *testing.T) { | ||
t.Skip("Skipping TestTransportationAccountingCodeMapForUnusedFields until the fields and usecase has been finalized.") | ||
|
||
// Example of TransportationAccountingCodeTrdmFileRecord | ||
tacFileRecord := models.TransportationAccountingCodeTrdmFileRecord{ | ||
TRNSPRTN_ACNT_CD: "4EVR", | ||
TAC_SYS_ID: "3080819", | ||
LOA_SYS_ID: "55555555", | ||
TAC_FY_TXT: "2023", | ||
TAC_FN_BL_MOD_CD: "W", | ||
ORG_GRP_DFAS_CD: "HS", | ||
TAC_MVT_DSG_ID: "", | ||
TAC_TY_CD: "O", | ||
TAC_USE_CD: "N", | ||
TAC_MAJ_CLMT_ID: "012345", | ||
TAC_BILL_ACT_TXT: "123456", | ||
TAC_COST_CTR_NM: "012345", | ||
BUIC: "", | ||
TAC_HIST_CD: "", | ||
TAC_STAT_CD: "I", | ||
TRNSPRTN_ACNT_TX: "For the purpose of MacDill AFB transporting to Scott AFB", | ||
TRNSPRTN_ACNT_BGN_DT: "2022-10-01 00:00:00", | ||
TRNSPRTN_ACNT_END_DT: "2023-09-30 00:00:00", | ||
DD_ACTVTY_ADRS_ID: "A12345", | ||
TAC_BLLD_ADD_FRST_LN_TX: "MacDill", | ||
TAC_BLLD_ADD_SCND_LN_TX: "Second Address Line", | ||
TAC_BLLD_ADD_THRD_LN_TX: "", | ||
TAC_BLLD_ADD_FRTH_LN_TX: "TAMPA FL 33621", | ||
TAC_FNCT_POC_NM: "[email protected]", | ||
} | ||
|
||
mappedStruct := models.MapTransportationAccountingCodeFileRecordToInternalStruct(tacFileRecord) | ||
|
||
reflectedMappedStruct := reflect.TypeOf(mappedStruct) | ||
reflectedTacFileRecord := reflect.TypeOf(tacFileRecord) | ||
|
||
// Iterate through each field in the tacRecord struct for the comparison | ||
for i := 0; i < reflectedTacFileRecord.NumField(); i++ { | ||
fieldName := reflectedTacFileRecord.Field(i).Name | ||
|
||
// Check if this field exists in the reflectedMappedStruct | ||
_, exists := reflectedMappedStruct.FieldByName(fieldName) | ||
|
||
// Error if the field isn't found in the reflectedMappedStruct | ||
if !exists { | ||
t.Errorf("Field '%s' in TransportationAccountingCodeTrdmFileRecord is not used in MapTransportationAccountingCodeFileRecordToInternalStruct function", fieldName) | ||
} | ||
} | ||
} | ||
|
||
// This function will test the receival of a parsed TAC that has undergone the pipe delimited .txt file parser. It will test | ||
// that the received values correctly map to our internal TAC struct. For example, our Transporation Accounting Code is called | ||
// "TAC" in its struct, however when it is received in pipe delimited format it will be received as "TRNSPRTN_ACNT_CD". | ||
// This function makes sure it gets connected properly. | ||
func TestTransportationAccountingCodeMapToInternal(t *testing.T) { | ||
|
||
tacFileRecord := models.TransportationAccountingCodeTrdmFileRecord{ | ||
TRNSPRTN_ACNT_CD: "4EVR", | ||
} | ||
|
||
mappedTacFileRecord := models.MapTransportationAccountingCodeFileRecordToInternalStruct(tacFileRecord) | ||
|
||
// Check that the TRNSPRTN_ACNT_CD field in the original struct was correctly | ||
// mapped to the TAC field in the resulting struct | ||
if mappedTacFileRecord.TAC != tacFileRecord.TRNSPRTN_ACNT_CD { | ||
t.Errorf("Expected TAC to be '%s', got '%s'", tacFileRecord.TRNSPRTN_ACNT_CD, mappedTacFileRecord.TAC) | ||
} | ||
} | ||
|
||
func (suite *ModelSuite) Test_CanSaveValidTac() { | ||
tac := models.TransportationAccountingCode{ | ||
TAC: "Tac1", | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Unclassified | ||
LOA_SYS_ID|LOA_DPT_ID|LOA_TNSFR_DPT_NM|LOA_BAF_ID|LOA_TRSY_SFX_TX|LOA_MAJ_CLM_NM|LOA_OP_AGNCY_ID|LOA_ALLT_SN_ID|LOA_PGM_ELMNT_ID|LOA_TSK_BDGT_SBLN_TX|LOA_DF_AGNCY_ALCTN_RCPNT_ID|LOA_JB_ORD_NM|LOA_SBALTMT_RCPNT_ID|LOA_WK_CNTR_RCPNT_NM|LOA_MAJ_RMBSMT_SRC_ID|LOA_DTL_RMBSMT_SRC_ID|LOA_CUST_NM|LOA_OBJ_CLS_ID|LOA_SRV_SRC_ID|LOA_SPCL_INTR_ID|LOA_BDGT_ACNT_CLS_NM|LOA_DOC_ID|LOA_CLS_REF_ID|LOA_INSTL_ACNTG_ACT_ID|LOA_LCL_INSTL_ID|LOA_FMS_TRNSACTN_ID|LOA_DSC_TX|LOA_BGN_DT|LOA_END_DT|LOA_FNCT_PRS_NM|LOA_STAT_CD|LOA_HIST_STAT_CD|LOA_HS_GDS_CD|ORG_GRP_DFAS_CD|LOA_UIC|LOA_TRNSN_ID|LOA_SUB_ACNT_ID|LOA_BET_CD|LOA_FND_TY_FG_CD|LOA_BGT_LN_ITM_ID|LOA_SCRTY_COOP_IMPL_AGNC_CD|LOA_SCRTY_COOP_DSGNTR_CD|LOA_SCRTY_COOP_LN_ITM_ID|LOA_AGNC_DSBR_CD|LOA_AGNC_ACNTNG_CD|LOA_FND_CNTR_ID|LOA_CST_CNTR_ID|LOA_PRJ_ID|LOA_ACTVTY_ID|LOA_CST_CD|LOA_WRK_ORD_ID|LOA_FNCL_AR_ID|LOA_SCRTY_COOP_CUST_CD|LOA_END_FY_TX|LOA_BG_FY_TX|LOA_BGT_RSTR_CD|LOA_BGT_SUB_ACT_CD | ||
124641|97||4930|AA37||6D|0000|MZZF0000|||||D0000||||22NL|||MA1MN4|FRT1MNUSAF7790||011000|||CONUS ENTRY|2006-10-01 00:00:00|2007-09-30 00:00:00||U|||DZ||||||||||||||||||||||| | ||
124642|97||4930|AA37||6D|0000|MZZF0000|||||D0000||||22N2|||MA1MN4|FRT1MNUSAF8790||011000|||OCONUS ENTRY|2006-10-01 00:00:00|2007-09-30 00:00:00||U|||DZ||||||||||||||||||||||| | ||
124643|97||4930|AA37||6D|0000|MZZF0000|||||D0000||||22NL|||P50MD6|FRT0MDUSAF9790||011000|||ENTRY TYPE A|2006-10-01 00:00:00|2007-09-30 00:00:00||U|||DZ||||||||||||||||||||||| | ||
124644|97||4930|AA37||6D|0000|MZZF0000|||||D0000||||22NL|||P50MN6|FRT0MNUSAF1790||011000|||ADDITIONAL ENTRY|2006-10-01 00:00:00|2007-09-30 00:00:00||U|||DZ||||||||||||||||||||||| | ||
124645|97||4930|AA37||6D|0000|MZZF0000|||||D0000||||22NL|||P51MD6|FRT1MDUSAF2790||011000|||FURNITURE KIT|2006-10-01 00:00:00|2007-09-30 00:00:00||U|||DZ||||||||||||||||||||||| | ||
124646|97||4930|AA37||6D|0000|MZZF0000|||||D0000||||22NL|||P51MN6|FRT1MNUSAF3790||011000|||PIECE FOR REPAIR|2006-10-01 00:00:00|2007-09-30 00:00:00||U|||DZ||||||||||||||||||||||| | ||
124647|97||4930|AA37||6D|0000|MZZF0000|||||D0000||||22NL|||P52MD6|FRT2MDUSAF4790||011000|||ENTRY TYPE B|2006-10-01 00:00:00|2007-09-30 00:00:00||U|||DZ||||||||||||||||||||||| | ||
124840|97||4930|AC6E||62|AC6E|SM0Z1400|||||||||22N2|||AC6E00|FRTAC6EAAJA790||028043|||PHONE REPAIR KIT|2006-10-01 00:00:00|2007-09-30 00:00:00||U|||DZ||||||||||||||||||||||| | ||
Unclassified |
Oops, something went wrong.