Skip to content

Commit a16c8ff

Browse files
committed
feat: ensure all envelope files share same folder using envelope UUID
- Generate folderName once in saveEnvelope() using envelope UUID - Pass same folderName to all files via settings - Pattern: envelope-{uuid} ensures uniqueness across envelopes - All files in an envelope now go to the same folder Signed-off-by: Vitor Mattos <[email protected]>
1 parent 7f6910b commit a16c8ff

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/Service/RequestSignatureService.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,17 @@ public function saveEnvelope(array $data): array {
8181

8282
$envelope = $this->envelopeService->createEnvelope($envelopeName, $userId);
8383

84+
$envelopeFolderName = 'envelope-' . $envelope->getUuid();
85+
$envelopeSettings = array_merge($data['settings'] ?? [], [
86+
'folderName' => $envelopeFolderName,
87+
]);
88+
8489
$files = [];
8590
foreach ($data['files'] as $fileData) {
8691
$fileEntity = $this->createFileForEnvelope(
8792
$fileData,
8893
$userManager,
89-
$data['settings'] ?? []
94+
$envelopeSettings
9095
);
9196
$this->envelopeService->addFileToEnvelope($envelope->getId(), $fileEntity);
9297
$files[] = $fileEntity;

0 commit comments

Comments
 (0)