Skip to content

Commit

Permalink
Change cell values for Surf (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eirik Sander-Fjeld authored Oct 6, 2022
1 parent a9ea379 commit d1ae9a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions backend/api/Helpers/ProspImportSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Surf
public string versionDate { get; set; } = null!;
public string costYear { get; set; } = null!;
public string importedCurrency { get; set; } = null!;
public string cessationCost { get; set; } = null!;
}

public class TopSide
Expand Down
7 changes: 4 additions & 3 deletions backend/api/Services/ProspExcelImportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static int ReadIntValue(IEnumerable<Cell> cellData, string coordinate)
return value;
}

return -1;
return 0;
}

private static double[] ReadDoubleValues(IEnumerable<Cell> cellData, List<string> coordinates)
Expand Down Expand Up @@ -118,7 +118,7 @@ private void ImportSurf(List<Cell> cellData, Guid sourceCaseId, Guid projectId)
var producerCount = ReadIntValue(cellData, _prospConfig.Surf.producerCount);
var waterInjectorCount = ReadIntValue(cellData, _prospConfig.Surf.waterInjectorCount);
var gasInjectorCount = ReadIntValue(cellData, _prospConfig.Surf.gasInjectorCount);

var cessationCost = ReadIntValue(cellData, _prospConfig.Surf.cessationCost);
//TODO: Add cessation cost from PROSP after feedback from PO
// var cessationCost = ReadDoubleValue(parsedData, "K88");
var costProfile = new SurfCostProfile
Expand Down Expand Up @@ -153,7 +153,8 @@ private void ImportSurf(List<Cell> cellData, Guid sourceCaseId, Guid projectId)
DG4Date = dG4Date,
ProducerCount = producerCount,
GasInjectorCount = gasInjectorCount,
WaterInjectorCount = waterInjectorCount
WaterInjectorCount = waterInjectorCount,
CessationCost = cessationCost
};
var dto = SurfDtoAdapter.Convert(newSurf);
_surfService.CreateSurf(dto, sourceCaseId);
Expand Down
9 changes: 5 additions & 4 deletions backend/api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@
"artificialLiftInt":"E48",
"riserCount":"K36",
"templateCount":"K32",
"producerCount":"E38",
"waterInjectorCount":"E39",
"gasInjectorCount":"E40",
"producerCount":"E45",
"waterInjectorCount":"E46",
"gasInjectorCount":"E47",
"versionDate":"I4",
"costYear":"K4",
"importedCurrency":"E8"
"importedCurrency":"E8",
"cessationCost": "K88"

},
"TopSide": {
Expand Down

0 comments on commit d1ae9a3

Please sign in to comment.