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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 239
openapi_spec_hash: 85e424bee4fe449466ceada88117613e
openapi_spec_hash: 49d468466a752f8ea72af00d00683f50
config_hash: 1ca082e374ef7000e2a5971e8da740e0
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions src/Entities/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Increase\Entities\Entity\Joint;
use Increase\Entities\Entity\NaturalPerson;
use Increase\Entities\Entity\RiskRating;
use Increase\Entities\Entity\SoleProprietorship;
use Increase\Entities\Entity\Status;
use Increase\Entities\Entity\Structure;
use Increase\Entities\Entity\TermsAgreement;
Expand All @@ -29,6 +30,7 @@
* @phpstan-import-type JointShape from \Increase\Entities\Entity\Joint
* @phpstan-import-type NaturalPersonShape from \Increase\Entities\Entity\NaturalPerson
* @phpstan-import-type RiskRatingShape from \Increase\Entities\Entity\RiskRating
* @phpstan-import-type SoleProprietorshipShape from \Increase\Entities\Entity\SoleProprietorship
* @phpstan-import-type EntitySupplementalDocumentShape from \Increase\SupplementalDocuments\EntitySupplementalDocument
* @phpstan-import-type TermsAgreementShape from \Increase\Entities\Entity\TermsAgreement
* @phpstan-import-type ThirdPartyVerificationShape from \Increase\Entities\Entity\ThirdPartyVerification
Expand All @@ -47,6 +49,7 @@
* joint: null|Joint|JointShape,
* naturalPerson: null|NaturalPerson|NaturalPersonShape,
* riskRating: null|RiskRating|RiskRatingShape,
* soleProprietorship: null|SoleProprietorship|SoleProprietorshipShape,
* status: Status|value-of<Status>,
* structure: Structure|value-of<Structure>,
* supplementalDocuments: list<EntitySupplementalDocument|EntitySupplementalDocumentShape>,
Expand Down Expand Up @@ -128,6 +131,12 @@ final class Entity implements BaseModel
#[Required('risk_rating')]
public ?RiskRating $riskRating;

/**
* Details of the sole proprietorship entity. Will be present if `structure` is equal to `sole_proprietorship`.
*/
#[Required('sole_proprietorship')]
public ?SoleProprietorship $soleProprietorship;

/**
* The status of the entity.
*
Expand Down Expand Up @@ -203,6 +212,7 @@ final class Entity implements BaseModel
* joint: ...,
* naturalPerson: ...,
* riskRating: ...,
* soleProprietorship: ...,
* status: ...,
* structure: ...,
* supplementalDocuments: ...,
Expand All @@ -229,6 +239,7 @@ final class Entity implements BaseModel
* ->withJoint(...)
* ->withNaturalPerson(...)
* ->withRiskRating(...)
* ->withSoleProprietorship(...)
* ->withStatus(...)
* ->withStructure(...)
* ->withSupplementalDocuments(...)
Expand All @@ -254,6 +265,7 @@ public function __construct()
* @param Joint|JointShape|null $joint
* @param NaturalPerson|NaturalPersonShape|null $naturalPerson
* @param RiskRating|RiskRatingShape|null $riskRating
* @param SoleProprietorship|SoleProprietorshipShape|null $soleProprietorship
* @param Status|value-of<Status> $status
* @param Structure|value-of<Structure> $structure
* @param list<EntitySupplementalDocument|EntitySupplementalDocumentShape> $supplementalDocuments
Expand All @@ -275,6 +287,7 @@ public static function with(
Joint|array|null $joint,
NaturalPerson|array|null $naturalPerson,
RiskRating|array|null $riskRating,
SoleProprietorship|array|null $soleProprietorship,
Status|string $status,
Structure|string $structure,
array $supplementalDocuments,
Expand All @@ -297,6 +310,7 @@ public static function with(
$self['joint'] = $joint;
$self['naturalPerson'] = $naturalPerson;
$self['riskRating'] = $riskRating;
$self['soleProprietorship'] = $soleProprietorship;
$self['status'] = $status;
$self['structure'] = $structure;
$self['supplementalDocuments'] = $supplementalDocuments;
Expand Down Expand Up @@ -444,6 +458,20 @@ public function withRiskRating(RiskRating|array|null $riskRating): self
return $self;
}

/**
* Details of the sole proprietorship entity. Will be present if `structure` is equal to `sole_proprietorship`.
*
* @param SoleProprietorship|SoleProprietorshipShape|null $soleProprietorship
*/
public function withSoleProprietorship(
SoleProprietorship|array|null $soleProprietorship
): self {
$self = clone $this;
$self['soleProprietorship'] = $soleProprietorship;

return $self;
}

/**
* The status of the entity.
*
Expand Down
221 changes: 221 additions & 0 deletions src/Entities/Entity/SoleProprietorship.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
<?php

declare(strict_types=1);

namespace Increase\Entities\Entity;

use Increase\Core\Attributes\Required;
use Increase\Core\Concerns\SdkModel;
use Increase\Core\Contracts\BaseModel;
use Increase\Entities\Entity\SoleProprietorship\Address;
use Increase\Entities\Entity\SoleProprietorship\SoleProprietor;

/**
* Details of the sole proprietorship entity. Will be present if `structure` is equal to `sole_proprietorship`.
*
* @phpstan-import-type AddressShape from \Increase\Entities\Entity\SoleProprietorship\Address
* @phpstan-import-type SoleProprietorShape from \Increase\Entities\Entity\SoleProprietorship\SoleProprietor
*
* @phpstan-type SoleProprietorshipShape = array{
* address: Address|AddressShape,
* doingBusinessAsName: string|null,
* email: string|null,
* industryCode: string|null,
* soleProprietor: SoleProprietor|SoleProprietorShape,
* taxIdentifier: string|null,
* website: string|null,
* }
*/
final class SoleProprietorship implements BaseModel
{
/** @use SdkModel<SoleProprietorshipShape> */
use SdkModel;

/**
* The sole proprietorship's address.
*/
#[Required]
public Address $address;

/**
* The name under which the sole proprietorship does business.
*/
#[Required('doing_business_as_name')]
public ?string $doingBusinessAsName;

/**
* An email address for the sole proprietorship.
*/
#[Required]
public ?string $email;

/**
* The numeric North American Industry Classification System (NAICS) code submitted for the sole proprietorship.
*/
#[Required('industry_code')]
public ?string $industryCode;

/**
* The individual who operates the sole proprietorship.
*/
#[Required('sole_proprietor')]
public SoleProprietor $soleProprietor;

/**
* The Employer Identification Number (EIN) for the sole proprietorship.
*/
#[Required('tax_identifier')]
public ?string $taxIdentifier;

/**
* The sole proprietorship's website.
*/
#[Required]
public ?string $website;

/**
* `new SoleProprietorship()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* SoleProprietorship::with(
* address: ...,
* doingBusinessAsName: ...,
* email: ...,
* industryCode: ...,
* soleProprietor: ...,
* taxIdentifier: ...,
* website: ...,
* )
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new SoleProprietorship)
* ->withAddress(...)
* ->withDoingBusinessAsName(...)
* ->withEmail(...)
* ->withIndustryCode(...)
* ->withSoleProprietor(...)
* ->withTaxIdentifier(...)
* ->withWebsite(...)
* ```
*/
public function __construct()
{
$this->initialize();
}

/**
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*
* @param Address|AddressShape $address
* @param SoleProprietor|SoleProprietorShape $soleProprietor
*/
public static function with(
Address|array $address,
?string $doingBusinessAsName,
?string $email,
?string $industryCode,
SoleProprietor|array $soleProprietor,
?string $taxIdentifier,
?string $website,
): self {
$self = new self;

$self['address'] = $address;
$self['doingBusinessAsName'] = $doingBusinessAsName;
$self['email'] = $email;
$self['industryCode'] = $industryCode;
$self['soleProprietor'] = $soleProprietor;
$self['taxIdentifier'] = $taxIdentifier;
$self['website'] = $website;

return $self;
}

/**
* The sole proprietorship's address.
*
* @param Address|AddressShape $address
*/
public function withAddress(Address|array $address): self
{
$self = clone $this;
$self['address'] = $address;

return $self;
}

/**
* The name under which the sole proprietorship does business.
*/
public function withDoingBusinessAsName(?string $doingBusinessAsName): self
{
$self = clone $this;
$self['doingBusinessAsName'] = $doingBusinessAsName;

return $self;
}

/**
* An email address for the sole proprietorship.
*/
public function withEmail(?string $email): self
{
$self = clone $this;
$self['email'] = $email;

return $self;
}

/**
* The numeric North American Industry Classification System (NAICS) code submitted for the sole proprietorship.
*/
public function withIndustryCode(?string $industryCode): self
{
$self = clone $this;
$self['industryCode'] = $industryCode;

return $self;
}

/**
* The individual who operates the sole proprietorship.
*
* @param SoleProprietor|SoleProprietorShape $soleProprietor
*/
public function withSoleProprietor(
SoleProprietor|array $soleProprietor
): self {
$self = clone $this;
$self['soleProprietor'] = $soleProprietor;

return $self;
}

/**
* The Employer Identification Number (EIN) for the sole proprietorship.
*/
public function withTaxIdentifier(?string $taxIdentifier): self
{
$self = clone $this;
$self['taxIdentifier'] = $taxIdentifier;

return $self;
}

/**
* The sole proprietorship's website.
*/
public function withWebsite(?string $website): self
{
$self = clone $this;
$self['website'] = $website;

return $self;
}
}
Loading