Skip to content

Commit

Permalink
remove merge of box with tree definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Beslogic committed Oct 17, 2024
1 parent 96cf265 commit 669dd9b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
6 changes: 0 additions & 6 deletions apps/releaf/backend/Releaf.Application/Query/GetBoxesQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ public GetBoxesQueryHandler(IBoxRepo boxRepo, ITreeRepo treeRepo)
public Task<IEnumerable<BoxAggregate>> Handle(GetBoxesQuery request, CancellationToken cancellationToken)
{
var boxAggregate = BoxRepo.GetBoxesForUser(request.OwnerId);

foreach (var item in boxAggregate)
{
var treeDefinition = TreeRepo.GetOne(item.TreeDefinitionId);
item.ChangeTreeDefinition(treeDefinition);
}

return Task.FromResult(boxAggregate);
}
Expand Down
11 changes: 0 additions & 11 deletions apps/releaf/backend/Releaf.Domain/Boxes/BoxAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public BoxAggregate(
public IEnumerable<Seed> Seeds { get; }
public BoxVitals Vitals { get; }
public GrowthInfo GrowthInfo { get; private set; }
public TreeDefinitionAggregate TreeDefinitionAggregate { get; private set; }

public void UpdateTemperatureVitals(DateTime timeStamp, double temperature)
{
Expand Down Expand Up @@ -110,14 +109,4 @@ public void ChangeGrowthInfo(GrowthInfo growthInfo)

GrowthInfo = growthInfo;
}

public void ChangeTreeDefinition(TreeDefinitionAggregate treeDefinitionAggregate)
{
if (treeDefinitionAggregate == null)
{
throw new TreeDefinitionNotFoundException();
}

TreeDefinitionAggregate = treeDefinitionAggregate;
}
}

0 comments on commit 669dd9b

Please sign in to comment.