diff --git a/src/Contracts/OfferField.php b/src/Contracts/OfferField.php index db3e302..dc2182e 100644 --- a/src/Contracts/OfferField.php +++ b/src/Contracts/OfferField.php @@ -8,7 +8,9 @@ final class OfferField { /** - * @param 'text'|'number'|'date'|'select'|'boolean' $type + * @param 'text'|'number'|'date'|'select'|'boolean'|'user' $type 'user' is + * an address the console can search its own directory for, + * while still accepting one typed in full. * @param array $options For 'select', value => label. */ public function __construct( diff --git a/tests/Feature/OfferProviderTest.php b/tests/Feature/OfferProviderTest.php index 25f9e73..ef09647 100644 --- a/tests/Feature/OfferProviderTest.php +++ b/tests/Feature/OfferProviderTest.php @@ -14,6 +14,7 @@ use Tests\Support\StrictCreateOfferRequest; use Tests\Support\User; use Tests\TestCase; +use Whilesmart\Admin\Contracts\OfferField; use Whilesmart\Admin\Http\Requests\UpdateMailTemplateRequest; use Whilesmart\Admin\Support\Offer; use Whilesmart\Admin\Support\OfferRegistry; @@ -200,4 +201,15 @@ public static function unknownProvider(): array 'revoking' => ['DELETE', 'api/admin/offers/credits/1'], ]; } + + public function test_a_field_may_ask_for_a_person(): void + { + $field = new OfferField( + name: 'for_email', + label: 'Only for', + type: 'user', + ); + + $this->assertSame('user', $field->toArray()['type']); + } }