EFL
Builders

ProspectBuilder

Fluent builder for constructing Prospect lead details.

Namespace and purpose

Imoli\EflLeasingSdk\Builder\ProspectBuilder is a fluent helper for building Prospect instances. It represents basic lead details such as name, tax identifier, location and contact information.

Class definition

  • Namespace: Imoli\EflLeasingSdk\Builder
  • Class: final ProspectBuilder
  • Builds: Imoli\EflLeasingSdk\Model\Lead\Prospect
namespace Imoli\EflLeasingSdk\Builder;

use Imoli\EflLeasingSdk\Model\Lead\Prospect;

final class ProspectBuilder
{
    public function withFirstName(string $firstName): self;
    public function withLastName(string $lastName): self;
    public function withNip(string $nip): self;
    public function withPostal(string $postal): self;
    public function withPhoneNo(string $phoneNo): self;
    public function withEmail(string $email): self;
    public function withDescription(?string $description): self;

    public function build(): Prospect;

    public static function create(
        string $firstName,
        string $lastName,
        string $nip,
        string $postal,
        string $phoneNo,
        string $email
    ): self;
}

Fluent API

  • withFirstName/withLastName(string $...): self – set the lead contact name.
  • withNip(string $nip): self – sets the tax identifier (NIP).
  • withPostal(string $postal): self – sets the postal code or location string.
  • withPhoneNo(string $phoneNo): self – sets the phone number.
  • withEmail(string $email): self – sets the email address.
  • withDescription(?string $description): self – optionally sets a free‑form description or note.
  • build(): Prospect
    • Requires: firstName, lastName, nip, postal, phoneNo, email.
    • Throws \LogicException if any of them is missing.
    • Returns a new Prospect instance.
  • static create(...): self
    Convenience factory that sets all required fields in one call.

Usage example

use Imoli\EflLeasingSdk\Builder\ProspectBuilder;

$prospect = ProspectBuilder::create(
        'John',
        'Doe',
        '1234567890',
        '50-000 Wroclaw',
        '+48 123456789',
        'john.doe@example.com'
    )
    ->withDescription('Interested in demo leasing offer')
    ->build();