changes to sms packages and option to create user

This commit is contained in:
Simon Pocrnjič
2025-11-06 21:54:07 +01:00
parent ad8e0d5cee
commit 1395b72ae8
102 changed files with 1386 additions and 319 deletions
@@ -24,10 +24,10 @@ public function test_db_whitelist_extension_allows_new_attribute(): void
$user->roles()->sync([$role->id]);
$this->actingAs($user);
// Extend DB whitelist: add duplicate safe attribute (description already in config but we will ensure merge works)
// Extend DB whitelist: add duplicate safe attribute (description already in config but we will ensure merge works)
$settings = DocumentSetting::instance();
$wl = $settings->whitelist;
$wl['contract'] = array_values(array_unique(array_merge($wl['contract'] ?? [], ['reference','description'])));
$wl['contract'] = array_values(array_unique(array_merge($wl['contract'] ?? [], ['reference', 'description'])));
$settings->whitelist = $wl;
$settings->save();
app(\App\Services\Documents\DocumentSettings::class)->refresh();
@@ -37,7 +37,7 @@ public function test_db_whitelist_extension_allows_new_attribute(): void
$zip = new \ZipArchive;
$zip->open($tmp, \ZipArchive::OVERWRITE);
$zip->addFromString('[Content_Types].xml', '<Types></Types>');
$zip->addFromString('word/document.xml', '<w:document><w:body>{{contract.description}}</w:body></w:document>');
$zip->addFromString('word/document.xml', '<w:document><w:body>{{contract.description}}</w:body></w:document>');
$zip->close();
$bytes = file_get_contents($tmp);
Storage::disk('public')->put('templates/whitelist-attr.docx', $bytes);
@@ -64,7 +64,7 @@ public function test_db_whitelist_extension_allows_new_attribute(): void
]);
$template->save();
$contract = Contract::factory()->create(['description' => 'Opis test']);
$contract = Contract::factory()->create(['description' => 'Opis test']);
$resp = $this->postJson(route('contracts.generate-document', ['contract' => $contract->uuid]), [
'template_slug' => 'wl-template',