Skip to content

Commit 0e1f4d1

Browse files
committed
[10.x] Added the ability to throw a uuid for inserting a bunch.
1 parent 3334e22 commit 0e1f4d1

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/External/Api/TransactionQuery.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ private function __construct(
2222
private readonly Wallet $wallet,
2323
private readonly float|int|string $amount,
2424
private readonly ?array $meta,
25-
private readonly bool $confirmed
25+
private readonly bool $confirmed,
26+
private readonly ?string $uuid
2627
) {
2728
}
2829

@@ -33,9 +34,10 @@ public static function createDeposit(
3334
Wallet $wallet,
3435
float|int|string $amount,
3536
?array $meta,
36-
bool $confirmed = true
37+
bool $confirmed = true,
38+
?string $uuid = null
3739
): self {
38-
return new self(self::TYPE_DEPOSIT, $wallet, $amount, $meta, $confirmed);
40+
return new self(self::TYPE_DEPOSIT, $wallet, $amount, $meta, $confirmed, $uuid);
3941
}
4042

4143
/**
@@ -45,9 +47,10 @@ public static function createWithdraw(
4547
Wallet $wallet,
4648
float|int|string $amount,
4749
?array $meta,
48-
bool $confirmed = true
50+
bool $confirmed = true,
51+
?string $uuid = null
4952
): self {
50-
return new self(self::TYPE_WITHDRAW, $wallet, $amount, $meta, $confirmed);
53+
return new self(self::TYPE_WITHDRAW, $wallet, $amount, $meta, $confirmed, $uuid);
5154
}
5255

5356
/**
@@ -80,4 +83,9 @@ public function isConfirmed(): bool
8083
{
8184
return $this->confirmed;
8285
}
86+
87+
public function getUuid(): ?string
88+
{
89+
return $this->uuid;
90+
}
8391
}

src/External/Api/TransactionQueryHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ public function apply(array $objects): array
3636
$query->getAmount(),
3737
$query->getMeta(),
3838
$query->isConfirmed(),
39+
$query->getUuid(),
3940
),
4041
TransactionQuery::TYPE_WITHDRAW => $this->prepareService->withdraw(
4142
$query->getWallet(),
4243
$query->getAmount(),
4344
$query->getMeta(),
4445
$query->isConfirmed(),
46+
$query->getUuid(),
4547
)
4648
},
4749
$objects

0 commit comments

Comments
 (0)