| @@ -170,9 +170,16 @@ | ||
| 170 | 170 | * Build date information array from rule |
| 171 | 171 | */ |
| 172 | 172 | private function buildDateInfo(string $date, RecurringRule $rule): array |
| 173 | 173 | { |
| 174 | - $cap = (int) ($rule->capacity_value ?? 0); | |
| 174 | + // Mirror CapacityService's precedence: the rule editor writes the seat cap | |
| 175 | + // to `seats_total` and leaves `capacity_value` NULL, so reading | |
| 176 | + // capacity_value alone reported 0 seats for every rule created in the UI | |
| 177 | + // (a date that shows no capacity yet is not marked full). | |
| 178 | + $cap = (int) ($rule->seats_total ?? 0); | |
| 179 | + if ($cap <= 0) { | |
| 180 | + $cap = (int) ($rule->capacity_value ?? 0); | |
| 181 | + } | |
| 175 | 182 | |
| 176 | 183 | return [ |
| 177 | 184 | 'date' => $date, |
| 178 | 185 | 'max_capacity' => $cap, |