Skip to content

Commit

Permalink
Merge pull request #14353 from transcom/revert-14234-B-21636-Fix-PPTA…
Browse files Browse the repository at this point in the history
…S-Fields
  • Loading branch information
deandreJones authored Dec 10, 2024
2 parents 8d3fcf4 + 2c18c6e commit 2696628
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 44 deletions.
24 changes: 12 additions & 12 deletions pkg/gen/pptasapi/embedded_spec.go

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

2 changes: 1 addition & 1 deletion pkg/gen/pptasmessages/p_p_t_a_s_report.go

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

10 changes: 5 additions & 5 deletions pkg/gen/pptasmessages/p_p_t_a_s_shipment.go

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

24 changes: 12 additions & 12 deletions pkg/services/pptas_report/pptas_report_list_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ func (f *pptasReportListFetcher) BuildPPTASReportsFromMoves(appCtx appcontext.Ap
report.TravelType = (*string)(orders.OrdersTypeDetail)
}

if orders.SAC != nil {
report.OrderNumber = orders.SAC
}

err := populateShipmentFields(&report, appCtx, move, orders, f.tacFetcher, f.loaFetcher, f.estimator)
if err != nil {
return nil, err
Expand Down Expand Up @@ -173,7 +177,7 @@ func populateShipmentFields(
}

// populate TGET data
tacErr := inputReportTAC(report, &pptasShipment, orders, appCtx, tacFetcher, loaFetcher)
tacErr := inputReportTAC(&pptasShipment, orders, appCtx, tacFetcher, loaFetcher)
if tacErr != nil {
return tacErr
}
Expand All @@ -196,7 +200,7 @@ func populateShipmentFields(
pptasShipment.ActualOriginNetWeight = &originActualWeight
}

if shipment.Reweigh != nil && shipment.Reweigh.Weight != nil {
if shipment.Reweigh != nil {
reweigh := shipment.Reweigh.Weight.Float64()
pptasShipment.DestinationReweighNetWeight = &reweigh
}
Expand Down Expand Up @@ -512,7 +516,7 @@ func buildServiceItemCrate(serviceItem models.MTOServiceItem) pptasmessages.Crat
}

// inputs all TAC related fields and builds full line of accounting string
func inputReportTAC(report *models.PPTASReport, pptasShipment *pptasmessages.PPTASShipment, orders models.Order, appCtx appcontext.AppContext, tacFetcher services.TransportationAccountingCodeFetcher, loa services.LineOfAccountingFetcher) error {
func inputReportTAC(pptasShipment *pptasmessages.PPTASShipment, orders models.Order, appCtx appcontext.AppContext, tacFetcher services.TransportationAccountingCodeFetcher, loa services.LineOfAccountingFetcher) error {
tac, err := tacFetcher.FetchOrderTransportationAccountingCodes(models.DepartmentIndicator(*orders.DepartmentIndicator), orders.IssueDate, *orders.TAC, appCtx)
if err != nil {
return err
Expand All @@ -526,19 +530,15 @@ func inputReportTAC(report *models.PPTASReport, pptasShipment *pptasmessages.PPT
pptasShipment.Loa = &longLoa
pptasShipment.FiscalYear = tac[0].TacFyTxt
pptasShipment.Appro = tac[0].LineOfAccounting.LoaBafID
pptasShipment.Subhead = tac[0].LineOfAccounting.LoaTrsySfxTx
pptasShipment.ObjClass = tac[0].LineOfAccounting.LoaObjClsID
pptasShipment.Bcn = tac[0].LineOfAccounting.LoaAlltSnID
pptasShipment.SubAllotCD = tac[0].LineOfAccounting.LoaSbaltmtRcpntID
pptasShipment.Subhead = tac[0].LineOfAccounting.LoaObjClsID
pptasShipment.ObjClass = tac[0].LineOfAccounting.LoaAlltSnID
pptasShipment.Bcn = tac[0].LineOfAccounting.LoaSbaltmtRcpntID
pptasShipment.SubAllotCD = tac[0].LineOfAccounting.LoaInstlAcntgActID
pptasShipment.Aaa = tac[0].LineOfAccounting.LoaTrnsnID
pptasShipment.TypeCD = tac[0].LineOfAccounting.LoaJbOrdNm
pptasShipment.Paa = tac[0].LineOfAccounting.LoaInstlAcntgActID
pptasShipment.Paa = tac[0].LineOfAccounting.LoaDocID
pptasShipment.CostCD = tac[0].LineOfAccounting.LoaPgmElmntID
pptasShipment.Ddcd = tac[0].LineOfAccounting.LoaDptID

if report.OrderNumber == nil {
report.OrderNumber = tac[0].LineOfAccounting.LoaDocID
}
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion swagger-def/definitions/PPTASReport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ properties:
type: string
format: date
orderNumber:
description: LoaDocID in lines of accounting table. Not to be confused with Orders Number.
description: not to be confused with Orders Number
type: string
example: '030-00362'
x-nullable: true
Expand Down
10 changes: 5 additions & 5 deletions swagger-def/definitions/PPTASShipment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ properties:
type: string
x-nullable: true
subhead:
description: LoaTrsySfxTx in lines_of_accounting
description: LoaObjClsID in lines_of_accounting
type: string
x-nullable: true
objClass:
description: LoaObjClsID in lines_of_accounting
description: LoaAlltSnID in lines_of_accounting
type: string
x-nullable: true
bcn:
description: LoaAlltSnID in lines_of_accounting
description: LoaSbaltmtRcpntID in lines_of_accounting
type: string
x-nullable: true
subAllotCD:
description: LoaSbaltmtRcpntID in lines_of_accounting
description: LoaInstlAcntgActID in lines_of_accounting
type: string
x-nullable: true
aaa:
Expand All @@ -45,7 +45,7 @@ properties:
type: string
x-nullable: true
paa:
description: LoaInstlAcntgActID in lines_of_accounting
description: LoaDocID in lines_of_accounting
type: string
x-nullable: true
costCD:
Expand Down
14 changes: 6 additions & 8 deletions swagger/pptas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,19 @@ definitions:
type: string
x-nullable: true
subhead:
description: LoaTrsySfxTx in lines_of_accounting
description: LoaObjClsID in lines_of_accounting
type: string
x-nullable: true
objClass:
description: LoaObjClsID in lines_of_accounting
description: LoaAlltSnID in lines_of_accounting
type: string
x-nullable: true
bcn:
description: LoaAlltSnID in lines_of_accounting
description: LoaSbaltmtRcpntID in lines_of_accounting
type: string
x-nullable: true
subAllotCD:
description: LoaSbaltmtRcpntID in lines_of_accounting
description: LoaInstlAcntgActID in lines_of_accounting
type: string
x-nullable: true
aaa:
Expand All @@ -336,7 +336,7 @@ definitions:
type: string
x-nullable: true
paa:
description: LoaInstlAcntgActID in lines_of_accounting
description: LoaDocID in lines_of_accounting
type: string
x-nullable: true
costCD:
Expand Down Expand Up @@ -677,9 +677,7 @@ definitions:
type: string
format: date
orderNumber:
description: >-
LoaDocID in lines of accounting table. Not to be confused with Orders
Number.
description: not to be confused with Orders Number
type: string
example: 030-00362
x-nullable: true
Expand Down

0 comments on commit 2696628

Please sign in to comment.