Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TM-1562] update terrafund report pages #629

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Http/Resources/V2/SiteReports/SiteReportResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function toArray($request)
'created_by' => $this->handleCreatedBy(),
'regeneration_description' => $this->regeneration_description,
'total_non_tree_species_planted_count' => $this->total_non_tree_species_planted_count,
'total_tree_replanting_count' => $this->total_tree_replanting_count,

'pct_survival_to_date' => $this->pct_survival_to_date,
'survival_calculation' => $this->survival_calculation,
Expand Down
5 changes: 5 additions & 0 deletions app/Models/V2/Sites/SiteReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ public function getTotalNonTreeSpeciesPlantedCountAttribute(): int
return $this->nonTreeSpecies()->visible()->sum('amount');
}

public function getTotalTreeReplantingCountAttribute(): int
{
return $this->replantingTreeSpecies()->visible()->sum('amount');
}

public function getTotalSeedsPlantedCountAttribute(): int
{
return $this->seedings()->visible()->sum('amount');
Expand Down
2 changes: 2 additions & 0 deletions app/Models/V2/TreeSpecies/TreeSpecies.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ class TreeSpecies extends Model implements EntityRelationModel
public const COLLECTION_DIRECT_SEEDING = 'direct-seeding';
public const COLLECTION_PLANTED = 'tree-planted';
public const COLLECTION_NON_TREE = 'non-tree';
public const COLLECTION_REPLANTING = 'replanting';
public const COLLECTION_NURSERY = 'nursery-seedling';
public const COLLECTION_HISTORICAL = 'historical-tree-species';

public static $collections = [
self::COLLECTION_DIRECT_SEEDING => 'Direct Seeding',
self::COLLECTION_PLANTED => 'Planted',
self::COLLECTION_NON_TREE => 'Non Tree',
self::COLLECTION_REPLANTING => 'Replanting',
self::COLLECTION_NURSERY => 'Nursery Seedling',
self::COLLECTION_HISTORICAL => 'Historical Tree Species',
];
Expand Down
Loading