Skip to content

Commit

Permalink
Merge branch 'main' into MAIN-B-21984
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmanley-caci authored Jan 23, 2025
2 parents e470341 + 8c33d68 commit 13a1a9c
Show file tree
Hide file tree
Showing 16 changed files with 1,403 additions and 640 deletions.
386 changes: 4 additions & 382 deletions artifacts/accessibilityReport.html

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions pkg/services/ghcrateengine/intl_shipping_and_linehaul_pricer.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,17 @@ func (p intlShippingAndLinehaulPricer) Price(appCtx appcontext.AppContext, contr
return 0, nil, fmt.Errorf("could not find contract with code: %s: %w", contractCode, err)
}

basePrice := float64(perUnitCents)
escalatedPrice, contractYear, err := escalatePriceForContractYear(
appCtx,
contract.ID,
referenceDate,
true,
basePrice)
// getting the contract year so we can use the escalation compounded value
contractYear, err := fetchContractYear(appCtx, contract.ID, referenceDate)
if err != nil {
return 0, nil, fmt.Errorf("could not calculate escalated price: %w", err)
return 0, nil, fmt.Errorf("could not find contract year with contract ID: %s and date: %s: %w", contract.ID, referenceDate, err)
}

escalatedPrice = escalatedPrice * weight.ToCWTFloat64()
totalPriceCents := unit.Cents(math.Round(escalatedPrice))
basePrice := float64(perUnitCents) / 100
escalatedPrice := basePrice * contractYear.EscalationCompounded
escalatedPrice = math.Round(escalatedPrice*100) / 100
totalEscalatedPrice := escalatedPrice * weight.ToCWTFloat64()
totalPriceCents := unit.Cents(math.Round(totalEscalatedPrice * 100))

params := services.PricingDisplayParams{
{
Expand Down
6 changes: 6 additions & 0 deletions pkg/testdatagen/testharness/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ var actionDispatcher = map[string]actionFunc{
"OfficeUserWithGSR": func(appCtx appcontext.AppContext) testHarnessResponse {
return MakeOfficeUserWithGSR(appCtx)
},
"InternationalAlaskaBasicHHGMoveForTOO": func(appCtx appcontext.AppContext) testHarnessResponse {
return MakeInternationalAlaskaBasicHHGMoveForTOO(appCtx)
},
"InternationalHHGMoveWithServiceItemsandPaymentRequestsForTIO": func(appCtx appcontext.AppContext) testHarnessResponse {
return MakeBasicInternationalHHGMoveWithServiceItemsandPaymentRequestsForTIO(appCtx)
},
}

func Actions() []string {
Expand Down
Loading

0 comments on commit 13a1a9c

Please sign in to comment.