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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
64 changes: 64 additions & 0 deletions .agents/skills/translations/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: translations
description: Frontend translation workflow using Lingui - extracting, adding, and compiling translations for all supported languages
---

# Frontend Translation Workflow (Lingui)

IMPORTANT: Always update translations as you develop features. When adding new translatable strings, immediately add translations for all supported languages.

## Core Commands

```bash
cd frontend

# Extract translatable strings (use --clean for accurate counts)
yarn messages:extract --clean

# Compile translations for production
yarn messages:compile

# Check for untranslated strings
cd scripts && ./list_untranslated_strings.sh
```

## Process

1. **Extract**: `yarn messages:extract --clean`
2. **Check**: Look at the output table for missing translation counts
3. **Add translations**: Update the `.po` files for each language
4. **Verify**: Run extract again to confirm 0 missing
5. **Compile**: `yarn messages:compile`

## Adding Translations

Add entries to each locale's `.po` file in `frontend/src/locales/`:

```po
#: src/path/to/component.tsx:123
msgid "Your English String"
msgstr "Translated String"
```

## Supported Languages

| Code | Language |
|------|----------|
| en | English (source - no translation needed) |
| de | Deutsch |
| es | Espanol |
| fr | Francais |
| pt | Portugues |
| pt-br | Portugues do Brasil |
| it | Italiano |
| nl | Nederlands |
| zh-cn | Simplified Chinese |
| zh-hk | Traditional Chinese (HK) |
| vi | Tieng Viet |
| ru | Russian (currently untranslated) |

## Troubleshooting

- **Counts seem wrong**: Use `--clean` flag to remove obsolete entries
- **Translation not appearing**: Run `yarn messages:compile` after adding
- **Syntax errors**: Check for proper escaping of quotes in `.po` files
65 changes: 1 addition & 64 deletions .claude/skills/translations/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,64 +1 @@
---
name: translations
description: Frontend translation workflow using Lingui - extracting, adding, and compiling translations for all supported languages
---

# Frontend Translation Workflow (Lingui)

IMPORTANT: Always update translations as you develop features. When adding new translatable strings, immediately add translations for all supported languages.

## Core Commands

```bash
cd frontend

# Extract translatable strings (use --clean for accurate counts)
yarn messages:extract --clean

# Compile translations for production
yarn messages:compile

# Check for untranslated strings
cd scripts && ./list_untranslated_strings.sh
```

## Process

1. **Extract**: `yarn messages:extract --clean`
2. **Check**: Look at the output table for missing translation counts
3. **Add translations**: Update the `.po` files for each language
4. **Verify**: Run extract again to confirm 0 missing
5. **Compile**: `yarn messages:compile`

## Adding Translations

Add entries to each locale's `.po` file in `frontend/src/locales/`:

```po
#: src/path/to/component.tsx:123
msgid "Your English String"
msgstr "Translated String"
```

## Supported Languages

| Code | Language |
|------|----------|
| en | English (source - no translation needed) |
| de | Deutsch |
| es | Espanol |
| fr | Francais |
| pt | Portugues |
| pt-br | Portugues do Brasil |
| it | Italiano |
| nl | Nederlands |
| zh-cn | Simplified Chinese |
| zh-hk | Traditional Chinese (HK) |
| vi | Tieng Viet |
| ru | Russian (currently untranslated) |

## Troubleshooting

- **Counts seem wrong**: Use `--clean` flag to remove obsolete entries
- **Translation not appearing**: Run `yarn messages:compile` after adding
- **Syntax errors**: Check for proper escaping of quotes in `.po` files
see @../../../.agents/skills/translations/SKILL.md
25 changes: 19 additions & 6 deletions .github/workflows/unit-tests.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
name: Run Unit Tests
name: Backend Tests

on:
push:
branches: [main, develop]
paths:
- 'backend/**'
- '.github/workflows/unit-tests.yml'
- '.github/workflows/tests.yml'
pull_request:
paths:
- 'backend/**'
- '.github/workflows/unit-tests.yml'
- '.github/workflows/tests.yml'

jobs:
run-tests:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['8.2', '8.3', '8.4']

services:
# Postgres is started for the Feature suite. The Unit suite does not need
# a live connection — it only reads DB_DATABASE for the _test guard check
# in CreatesApplication — so it runs in parallel with Postgres warming up.
postgres:
image: postgres:15
env:
Expand Down Expand Up @@ -80,6 +83,13 @@ jobs:
# to .env so both paths see the same config.
run: cp backend/.env.testing backend/.env

- name: Run Unit test suite
# Pure unit tests — no DB connection, no migrations. The CreatesApplication
# bootstrap detects the absence of DatabaseTransactions / RefreshDatabase
# traits and skips migrate:fresh entirely. Runs in parallel with the
# Postgres service container coming up.
run: cd backend && ./vendor/bin/phpunit --testsuite=Unit --no-coverage

- name: Wait for Postgres
run: |
for i in {1..30}; do
Expand All @@ -91,5 +101,8 @@ jobs:
echo "Postgres did not become ready in time" >&2
exit 1

- name: Run PHPUnit Tests
run: cd backend && ./vendor/bin/phpunit tests/Unit --no-coverage
- name: Run Feature test suite
# Integration tests against the real PostgreSQL test database. The first
# test that boots Laravel triggers migrate:fresh once per process via
# CreatesApplication::ensureTestDatabaseIsMigrated.
run: cd backend && ./vendor/bin/phpunit --testsuite=Feature --no-coverage
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ prompts/

/plans/**
/plans

.claude/worktrees/
11 changes: 10 additions & 1 deletion backend/app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,27 @@
use HiEvents\Jobs\Waitlist\ProcessExpiredWaitlistOffersJob;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;

class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule): void
{
$schedule->job(new SendScheduledMessagesJob)->everyMinute()->withoutOverlapping();
$schedule->job(new ProcessExpiredWaitlistOffersJob)->everyMinute()->withoutOverlapping();

$schedule->call(function (): void {
$count = DB::table('failed_jobs')->count();
if ($count > 0) {
Log::warning('Failed jobs present in queue', ['count' => $count]);
}
})->everyFiveMinutes()->name('failed-jobs-monitor')->withoutOverlapping();
}

protected function commands(): void
{
$this->load(__DIR__ . '/Commands');
$this->load(__DIR__.'/Commands');

include base_path('routes/console.php');
}
Expand Down
14 changes: 14 additions & 0 deletions backend/app/DomainObjects/AttendeeDomainObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class AttendeeDomainObject extends Generated\AttendeeDomainObjectAbstract implem
/** @var Collection<AttendeeCheckInDomainObject>|null */
private ?Collection $checkIns = null;

private ?EventOccurrenceDomainObject $eventOccurrence = null;

public static function getDefaultSort(): string
{
return self::CREATED_AT;
Expand Down Expand Up @@ -71,6 +73,7 @@ public static function getAllowedFilterFields(): array
self::STATUS,
self::PRODUCT_ID,
self::PRODUCT_PRICE_ID,
self::EVENT_OCCURRENCE_ID,
];
}

Expand Down Expand Up @@ -138,4 +141,15 @@ public function getCheckIns(): ?Collection
{
return $this->checkIns;
}

public function setEventOccurrence(?EventOccurrenceDomainObject $eventOccurrence): AttendeeDomainObject
{
$this->eventOccurrence = $eventOccurrence;
return $this;
}

public function getEventOccurrence(): ?EventOccurrenceDomainObject
{
return $this->eventOccurrence;
}
}
20 changes: 20 additions & 0 deletions backend/app/DomainObjects/CheckInListDomainObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@
use HiEvents\DomainObjects\SortingAndFiltering\AllowedSorts;
use Illuminate\Support\Collection;

/**
* A `null` event_occurrence_id means the list applies to every occurrence of the
* event (the default for recurring events and the only meaningful value for
* single-occurrence events). A non-null value scopes the list to that one
* occurrence — only attendees on that occurrence can be checked in via the list.
*/
class CheckInListDomainObject extends Generated\CheckInListDomainObjectAbstract implements IsSortable
{
private ?Collection $products = null;

private ?EventDomainObject $event = null;

private ?EventOccurrenceDomainObject $eventOccurrence = null;

private ?int $checkedInCount = null;

private ?int $totalAttendeesCount = null;
Expand Down Expand Up @@ -77,6 +85,18 @@ public function setEvent(?EventDomainObject $event): static
return $this;
}

public function getEventOccurrence(): ?EventOccurrenceDomainObject
{
return $this->eventOccurrence;
}

public function setEventOccurrence(?EventOccurrenceDomainObject $eventOccurrence): static
{
$this->eventOccurrence = $eventOccurrence;

return $this;
}

public function isExpired(string $timezone): bool
{
if ($this->getExpiresAt() === null) {
Expand Down
12 changes: 12 additions & 0 deletions backend/app/DomainObjects/Enums/BulkOccurrenceAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace HiEvents\DomainObjects\Enums;

enum BulkOccurrenceAction: string
{
use BaseEnum;

case UPDATE = 'update';
case CANCEL = 'cancel';
case DELETE = 'delete';
}
12 changes: 12 additions & 0 deletions backend/app/DomainObjects/Enums/EmailTemplateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ enum EmailTemplateType: string

case ORDER_CONFIRMATION = 'order_confirmation';
case ATTENDEE_TICKET = 'attendee_ticket';
case OCCURRENCE_CANCELLATION = 'occurrence_cancellation';

public function label(): string
{
return match ($this) {
self::ORDER_CONFIRMATION => __('Order Confirmation'),
self::ATTENDEE_TICKET => __('Attendee Ticket'),
self::OCCURRENCE_CANCELLATION => __('Date Cancellation'),
};
}

Expand All @@ -22,6 +24,16 @@ public function description(): string
return match ($this) {
self::ORDER_CONFIRMATION => __('Sent to the customer after placing an order'),
self::ATTENDEE_TICKET => __('Sent to each attendee with their ticket'),
self::OCCURRENCE_CANCELLATION => __('Sent to attendees when a scheduled date is cancelled'),
};
}

public function ctaUrlToken(): string
{
return match ($this) {
self::ORDER_CONFIRMATION => 'order.url',
self::ATTENDEE_TICKET => 'ticket.url',
self::OCCURRENCE_CANCELLATION => 'event.url',
};
}
}
Loading
Loading