Skip to content

Commit

Permalink
Reduce database calls in study, opex and cessation generation (#879)
Browse files Browse the repository at this point in the history
* Reduce database calls for study cost

* Fix wellproject cost calculation in studycost

* Fix OPEX and Cessation calculation
Remove unused wellproject properties

* Reduce database calls in opex calculation

* Use GetProjectWithoutAssets
  • Loading branch information
taustad authored Nov 17, 2022
1 parent c481f63 commit 65e8111
Show file tree
Hide file tree
Showing 17 changed files with 2,209 additions and 121 deletions.
6 changes: 0 additions & 6 deletions backend/api/Adapters/WellProjectAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ public static WellProject Convert(WellProjectDto wellProjectDto)
ProjectId = wellProjectDto.ProjectId,
Name = wellProjectDto.Name,
ArtificialLift = wellProjectDto.ArtificialLift,
RigMobDemob = wellProjectDto.RigMobDemob,
AnnualWellInterventionCost = wellProjectDto.AnnualWellInterventionCost,
PluggingAndAbandonment = wellProjectDto.PluggingAndAbandonment,
Currency = wellProjectDto.Currency,
};

Expand Down Expand Up @@ -43,9 +40,6 @@ public static void ConvertExisting(WellProject existing, WellProjectDto wellProj
existing.ProjectId = wellProjectDto.ProjectId;
existing.Name = wellProjectDto.Name;
existing.ArtificialLift = wellProjectDto.ArtificialLift;
existing.RigMobDemob = wellProjectDto.RigMobDemob;
existing.AnnualWellInterventionCost = wellProjectDto.AnnualWellInterventionCost;
existing.PluggingAndAbandonment = wellProjectDto.PluggingAndAbandonment;
existing.Currency = wellProjectDto.Currency;

if (wellProjectDto.OilProducerCostProfile != null)
Expand Down
3 changes: 0 additions & 3 deletions backend/api/Adapters/WellProjectDtoAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ public static WellProjectDto Convert(WellProject wellProject)
ProjectId = wellProject.ProjectId,
Name = wellProject.Name,
ArtificialLift = wellProject.ArtificialLift,
RigMobDemob = wellProject.RigMobDemob,
AnnualWellInterventionCost = wellProject.AnnualWellInterventionCost,
PluggingAndAbandonment = wellProject.PluggingAndAbandonment,
Currency = wellProject.Currency,
WellProjectWells = wellProject.WellProjectWells?.Select(wc => WellProjectWellDtoAdapter.Convert(wc)).ToList()
};
Expand Down
3 changes: 0 additions & 3 deletions backend/api/Dtos/WellProjectDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ public class WellProjectDto
public WaterInjectorCostProfileDto? WaterInjectorCostProfile { get; set; }
public GasInjectorCostProfileDto? GasInjectorCostProfile { get; set; }
public ArtificialLift ArtificialLift { get; set; }
public double RigMobDemob { get; set; }
public double AnnualWellInterventionCost { get; set; }
public double PluggingAndAbandonment { get; set; }
public Currency Currency { get; set; }
public List<WellProjectWellDto>? WellProjectWells { get; set; }
}
Expand Down
Loading

0 comments on commit 65e8111

Please sign in to comment.