Skip to content
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

- All project contributors should run these commands every week to ensure your local project is using the current project dependencies.
- `composer install`
- `composer setup`
- `npm install`
- `npm run build`

Expand Down
2 changes: 2 additions & 0 deletions app/Console/Commands/PollNeonParticipants.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function handle()
{

$participantIds = $this->neonApi->getTodaysParticipantIds();

Log::info('Found '.count($participantIds).' participant records to check for updates.');

foreach ($participantIds as $participantId) {
// Get the full participant record
Expand Down
20 changes: 16 additions & 4 deletions app/Services/Integrations/NeonApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,30 @@

class NeonApiService
{
protected string $baseUrl;

protected string $apiKey;
protected ?string $baseUrl;
protected ?string $apiKey;

public function __construct()
{
$this->baseUrl = config('services.neon.base_url');
$this->apiKey = config('services.neon.api_key');
}

private function ensureConfigured(): void
{
if (!$this->baseUrl) {
throw new \RuntimeException('NEON_BASE_URL is not configured.');
}

if (!$this->apiKey) {
throw new \RuntimeException('NEON_API_KEY is not configured.');
}
}

private function fetch(string $endpoint, array $fields = [], ?int $personId = null, bool $useWhereClause = true): array
{
$this->ensureConfigured();

$url = "{$this->baseUrl}/data/{$endpoint}";

$params = [
Expand Down Expand Up @@ -64,7 +76,7 @@ private function fetch(string $endpoint, array $fields = [], ?int $personId = nu

public function getTodaysParticipantIds(): array {
$todaysDate = Carbon::today('America/Chicago')->format('Y-m-d');
// $todaysDate = '2026-02-24';
// $todaysDate = '2024-02-24'; // for testing
Log::info("Collecting participant records that have been added or updated today - {$todaysDate}....");
$toReturn = $this->getParticipantIdsByDate($todaysDate);
$count = count($toReturn);
Expand Down
2 changes: 1 addition & 1 deletion app/Services/PdfIntakeFormService.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function generate(ParticipantUpdateData $participant): string
$data = $participant->toPdfArray();

// Load and fill the PDF
$pdf = new Pdf(storage_path("app/{$this->pdfTemplatePath}"));
$pdf = new Pdf(storage_path("{$this->pdfTemplatePath}"));
$pdf->fillForm($data)
->needAppearances()
->flatten()
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
}
},
"scripts": {
"setup": [
"@php artisan config:clear",
"@php artisan cache:clear"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
Expand Down
Loading