Skip to content

Commit a103489

Browse files
authored
Revert "feat: Implement PEPPOL e-invoicing with dynamic provider architecture…" (#112)
This reverts commit 3462b27.
1 parent 3462b27 commit a103489

File tree

55 files changed

+6
-6082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6
-6082
lines changed

Modules/Clients/Database/Migrations/2025_10_02_000007_add_peppol_validation_fields_to_relations_table.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

Modules/Clients/Models/Relation.php

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
use Modules\Core\Models\User;
1818
use Modules\Core\Traits\BelongsToCompany;
1919
use Modules\Expenses\Models\Expense;
20-
use Modules\Invoices\Enums\PeppolValidationStatus;
21-
use Modules\Invoices\Models\CustomerPeppolValidationHistory;
2220
use Modules\Invoices\Models\Invoice;
2321
use Modules\Payments\Models\Payment;
2422
use Modules\Projects\Models\Project;
@@ -39,12 +37,8 @@
3937
* @property string|null $coc_number
4038
* @property string|null $vat_number
4139
* @property string|null $peppol_id
42-
* @property string|null $peppol_scheme
4340
* @property string|null $peppol_format
4441
* @property bool $enable_e_invoicing
45-
* @property PeppolValidationStatus|null $peppol_validation_status
46-
* @property string|null $peppol_validation_message
47-
* @property Carbon|null $peppol_validated_at
4842
* @property Carbon $registered_at
4943
* @property mixed $created_at
5044
* @property mixed $updated_at
@@ -74,8 +68,6 @@ class Relation extends Model
7468
'relation_type' => RelationType::class,
7569
'relation_status' => RelationStatus::class,
7670
'enable_e_invoicing' => 'boolean',
77-
'peppol_validation_status' => PeppolValidationStatus::class,
78-
'peppol_validated_at' => 'datetime',
7971
];
8072

8173
protected $guarded = [];
@@ -169,26 +161,11 @@ public function tasks(): HasMany
169161
return $this->hasMany(Task::class, 'customer_id');
170162
}
171163

172-
/**
173-
* Define a one-to-many relationship to User models.
174-
*
175-
* @return HasMany The has-many relationship for User models.
176-
*/
177164
public function users(): HasMany
178165
{
179166
return $this->hasMany(User::class);
180167
}
181168

182-
/**
183-
* Get the Peppol validation history records for this relation.
184-
*
185-
* @return \Illuminate\Database\Eloquent\Relations\HasMany Collection of CustomerPeppolValidationHistory models related by `customer_id`.
186-
*/
187-
public function peppolValidationHistory(): HasMany
188-
{
189-
return $this->hasMany(CustomerPeppolValidationHistory::class, 'customer_id');
190-
}
191-
192169
/*
193170
|--------------------------------------------------------------------------
194171
| Accessors
@@ -203,19 +180,6 @@ public function getCustomerEmailAttribute()
203180
{
204181
return mb_trim($this->primary_ontact?->first_name . ' ' . $this->primary_contact?->last_name);
205182
}*/
206-
207-
/**
208-
* Determines whether the relation's Peppol ID has been validated and e-invoicing is enabled.
209-
*
210-
* @return bool `true` if e-invoicing is enabled, the Peppol validation status is `PeppolValidationStatus::VALID`, and `peppol_id` is not null; `false` otherwise.
211-
*/
212-
public function hasPeppolIdValidated(): bool
213-
{
214-
return $this->enable_e_invoicing
215-
&& $this->peppol_validation_status === PeppolValidationStatus::VALID
216-
&& $this->peppol_id !== null;
217-
}
218-
219183
/*
220184
|--------------------------------------------------------------------------
221185
| Scopes
@@ -237,4 +201,4 @@ protected static function newFactory(): Factory
237201
| Subqueries
238202
|--------------------------------------------------------------------------
239203
*/
240-
}
204+
}

Modules/Invoices/Config/config.php

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -153,81 +153,8 @@
153153
'enable_webhooks' => env('PEPPOL_ENABLE_WEBHOOKS', false),
154154
'enable_participant_search' => env('PEPPOL_ENABLE_PARTICIPANT_SEARCH', true),
155155
'enable_health_checks' => env('PEPPOL_ENABLE_HEALTH_CHECKS', true),
156-
'auto_retry_failed' => env('PEPPOL_AUTO_RETRY', true),
157-
'max_retries' => env('PEPPOL_MAX_RETRIES', 5),
158-
],
159-
160-
/*
161-
|--------------------------------------------------------------------------
162-
| Country to Scheme Mapping
163-
|--------------------------------------------------------------------------
164-
|
165-
| Mapping of country codes to default Peppol endpoint schemes.
166-
| Used for auto-suggesting the appropriate scheme when onboarding customers.
167-
|
168-
*/
169-
'country_scheme_mapping' => [
170-
'BE' => 'BE:CBE',
171-
'DE' => 'DE:VAT',
172-
'FR' => 'FR:SIRENE',
173-
'IT' => 'IT:VAT',
174-
'ES' => 'ES:VAT',
175-
'NL' => 'NL:KVK',
176-
'NO' => 'NO:ORGNR',
177-
'DK' => 'DK:CVR',
178-
'SE' => 'SE:ORGNR',
179-
'FI' => 'FI:OVT',
180-
'AT' => 'AT:VAT',
181-
'CH' => 'CH:UIDB',
182-
'GB' => 'GB:COH',
183-
],
184-
185-
/*
186-
|--------------------------------------------------------------------------
187-
| Retry Policy
188-
|--------------------------------------------------------------------------
189-
|
190-
| Configuration for automatic retries of failed transmissions.
191-
| Uses exponential backoff strategy.
192-
|
193-
*/
194-
'retry' => [
195-
'max_attempts' => env('PEPPOL_MAX_RETRY_ATTEMPTS', 5),
196-
'backoff_delays' => [60, 300, 1800, 7200, 21600], // 1min, 5min, 30min, 2h, 6h
197-
'retry_transient_errors' => true,
198-
'retry_unknown_errors' => true,
199-
'retry_permanent_errors' => false,
200-
],
201-
202-
/*
203-
|--------------------------------------------------------------------------
204-
| Storage Configuration
205-
|--------------------------------------------------------------------------
206-
|
207-
| Configuration for storing Peppol artifacts (XML, PDF).
208-
|
209-
*/
210-
'storage' => [
211-
'disk' => env('PEPPOL_STORAGE_DISK', 'local'),
212-
'path_template' => 'peppol/{integration_id}/{year}/{month}/{transmission_id}',
213-
'retention_days' => env('PEPPOL_RETENTION_DAYS', 2555), // 7 years default
214-
],
215-
216-
/*
217-
|--------------------------------------------------------------------------
218-
| Monitoring & Alerting
219-
|--------------------------------------------------------------------------
220-
|
221-
| Thresholds and settings for monitoring Peppol operations.
222-
|
223-
*/
224-
'monitoring' => [
225-
'alert_on_dead_transmission' => true,
226-
'dead_transmission_threshold' => 10, // Alert if > 10 dead in 1 hour
227-
'alert_on_auth_failure' => true,
228-
'status_check_interval' => 15, // minutes
229-
'reconciliation_interval' => 60, // minutes
230-
'old_transmission_threshold' => 168, // hours (7 days)
156+
'auto_retry_failed' => env('PEPPOL_AUTO_RETRY', false),
157+
'max_retries' => env('PEPPOL_MAX_RETRIES', 3),
231158
],
232159
],
233160
];

Modules/Invoices/Console/Commands/PollPeppolStatusCommand.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

Modules/Invoices/Console/Commands/RetryFailedPeppolTransmissionsCommand.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

Modules/Invoices/Console/Commands/TestPeppolIntegrationCommand.php

Lines changed: 0 additions & 53 deletions
This file was deleted.

Modules/Invoices/Database/Migrations/2025_10_02_000001_create_peppol_integrations_table.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)