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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.11.0"
".": "0.12.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 232
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-3309070d0c282e00842afa3021c80774f8e1f3a4517959927adfd9ffaa81c94c.yml
openapi_spec_hash: 57927271c019ee8ddd428afa8a57baaf
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-994727afca8b769c05b3531b0e560cfc71b7d2c45a49b54e09bbf73d0dbcaa1f.yml
openapi_spec_hash: bb1c55d7e08fb038a7383976bba226d1
config_hash: 27e44ed36b9c5617b580ead7231a594a
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.12.0 (2026-01-30)

Full Changelog: [v0.11.0...v0.12.0](https://github.com/Increase/increase-php/compare/v0.11.0...v0.12.0)

### Features

* **api:** api update ([f9b9413](https://github.com/Increase/increase-php/commit/f9b9413669d9bcf6c8981b2ba3364ec18f155da8))

## 0.11.0 (2026-01-30)

Full Changelog: [v0.10.0...v0.11.0](https://github.com/Increase/increase-php/compare/v0.10.0...v0.11.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d
<!-- x-release-please-start-version -->

```
composer require "increase/increase 0.11.0"
composer require "increase/increase 0.12.0"
```

<!-- x-release-please-end -->
Expand Down
28 changes: 28 additions & 0 deletions src/AccountStatements/AccountStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Increase\AccountStatements;

use Increase\AccountStatements\AccountStatement\Loan;
use Increase\AccountStatements\AccountStatement\Type;
use Increase\Core\Attributes\Required;
use Increase\Core\Concerns\SdkModel;
Expand All @@ -12,12 +13,15 @@
/**
* Account Statements are generated monthly for every active Account. You can access the statement's data via the API or retrieve a PDF with its details via its associated File.
*
* @phpstan-import-type LoanShape from \Increase\AccountStatements\AccountStatement\Loan
*
* @phpstan-type AccountStatementShape = array{
* id: string,
* accountID: string,
* createdAt: \DateTimeInterface,
* endingBalance: int,
* fileID: string,
* loan: null|Loan|LoanShape,
* startingBalance: int,
* statementPeriodEnd: \DateTimeInterface,
* statementPeriodStart: \DateTimeInterface,
Expand Down Expand Up @@ -59,6 +63,12 @@ final class AccountStatement implements BaseModel
#[Required('file_id')]
public string $fileID;

/**
* The loan balances.
*/
#[Required]
public ?Loan $loan;

/**
* The Account's balance at the start of its statement period.
*/
Expand Down Expand Up @@ -96,6 +106,7 @@ final class AccountStatement implements BaseModel
* createdAt: ...,
* endingBalance: ...,
* fileID: ...,
* loan: ...,
* startingBalance: ...,
* statementPeriodEnd: ...,
* statementPeriodStart: ...,
Expand All @@ -112,6 +123,7 @@ final class AccountStatement implements BaseModel
* ->withCreatedAt(...)
* ->withEndingBalance(...)
* ->withFileID(...)
* ->withLoan(...)
* ->withStartingBalance(...)
* ->withStatementPeriodEnd(...)
* ->withStatementPeriodStart(...)
Expand All @@ -128,6 +140,7 @@ public function __construct()
*
* You must use named parameters to construct any parameters with a default value.
*
* @param Loan|LoanShape|null $loan
* @param Type|value-of<Type> $type
*/
public static function with(
Expand All @@ -136,6 +149,7 @@ public static function with(
\DateTimeInterface $createdAt,
int $endingBalance,
string $fileID,
Loan|array|null $loan,
int $startingBalance,
\DateTimeInterface $statementPeriodEnd,
\DateTimeInterface $statementPeriodStart,
Expand All @@ -148,6 +162,7 @@ public static function with(
$self['createdAt'] = $createdAt;
$self['endingBalance'] = $endingBalance;
$self['fileID'] = $fileID;
$self['loan'] = $loan;
$self['startingBalance'] = $startingBalance;
$self['statementPeriodEnd'] = $statementPeriodEnd;
$self['statementPeriodStart'] = $statementPeriodStart;
Expand Down Expand Up @@ -211,6 +226,19 @@ public function withFileID(string $fileID): self
return $self;
}

/**
* The loan balances.
*
* @param Loan|LoanShape|null $loan
*/
public function withLoan(Loan|array|null $loan): self
{
$self = clone $this;
$self['loan'] = $loan;

return $self;
}

/**
* The Account's balance at the start of its statement period.
*/
Expand Down
111 changes: 111 additions & 0 deletions src/AccountStatements/AccountStatement/Loan.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?php

declare(strict_types=1);

namespace Increase\AccountStatements\AccountStatement;

use Increase\Core\Attributes\Required;
use Increase\Core\Concerns\SdkModel;
use Increase\Core\Contracts\BaseModel;

/**
* The loan balances.
*
* @phpstan-type LoanShape = array{
* dueAt: \DateTimeInterface|null, dueBalance: int, pastDueBalance: int
* }
*/
final class Loan implements BaseModel
{
/** @use SdkModel<LoanShape> */
use SdkModel;

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan payment is due.
*/
#[Required('due_at')]
public ?\DateTimeInterface $dueAt;

/**
* The total amount due on the loan.
*/
#[Required('due_balance')]
public int $dueBalance;

/**
* The amount past due on the loan.
*/
#[Required('past_due_balance')]
public int $pastDueBalance;

/**
* `new Loan()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* Loan::with(dueAt: ..., dueBalance: ..., pastDueBalance: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new Loan)->withDueAt(...)->withDueBalance(...)->withPastDueBalance(...)
* ```
*/
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.
*/
public static function with(
?\DateTimeInterface $dueAt,
int $dueBalance,
int $pastDueBalance
): self {
$self = new self;

$self['dueAt'] = $dueAt;
$self['dueBalance'] = $dueBalance;
$self['pastDueBalance'] = $pastDueBalance;

return $self;
}

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan payment is due.
*/
public function withDueAt(?\DateTimeInterface $dueAt): self
{
$self = clone $this;
$self['dueAt'] = $dueAt;

return $self;
}

/**
* The total amount due on the loan.
*/
public function withDueBalance(int $dueBalance): self
{
$self = clone $this;
$self['dueBalance'] = $dueBalance;

return $self;
}

/**
* The amount past due on the loan.
*/
public function withPastDueBalance(int $pastDueBalance): self
{
$self = clone $this;
$self['pastDueBalance'] = $pastDueBalance;

return $self;
}
}
Loading