058f7af9f6
Add a show function in alertStore so we can use alerts in a defined way everywhere. #12 #33
83 lines
2.6 KiB
PHP
83 lines
2.6 KiB
PHP
<?php
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Route;
|
|
use App\Http\Controllers\CustomerController;
|
|
use App\Http\Controllers\InvoiceController;
|
|
use App\Mail\Reminder;
|
|
use App\Models\Invoice;
|
|
use App\Http\Controllers\PaymentTermsController;
|
|
use App\Http\Controllers\SettingController;
|
|
use App\Mail\OrderConfirmation;
|
|
use App\Support\ApiDataTransformer;
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
|
|
Route::get('customers/{id}', [CustomerController::class, 'single']);
|
|
Route::get('customers', [CustomerController::class, 'index']);
|
|
// ->middleware('auth:sanctum');
|
|
|
|
|
|
// Route::apiResource('invoices', InvoiceController::class);
|
|
// ->middleware('auth:sanctum');
|
|
Route::get('/invoices', [InvoiceController::class, 'index']);
|
|
Route::post('/invoices', [InvoiceController::class, 'store']);
|
|
Route::get('/invoices/{id}', [InvoiceController::class, 'single']);
|
|
Route::put('/invoices/{id}', [InvoiceController::class, 'update']);
|
|
Route::delete('/invoices/{id}', [InvoiceController::class, 'delete']);
|
|
|
|
Route::get('/invoices/{id}/remind', function ($id) {
|
|
$invoice = InvoiceController::single($id);
|
|
Mail::to('daniel@vollstock.de')->send(new Reminder($invoice));
|
|
// return new Reminder($invoice);
|
|
});
|
|
|
|
Route::get('/offers/{id}/confirm', function ($id) {
|
|
// $offer = offerController::single($id);
|
|
$offer = [
|
|
'nr' => 0,
|
|
'offerDate' => '2025-10-01',
|
|
'orderDate' => '2025-10-28',
|
|
'customerId' => 0,
|
|
'customer' => [
|
|
'companyName' => '',
|
|
'vatId' => '',
|
|
'billingAddress' => [
|
|
'lineOne' => '',
|
|
'lineTwo' => '',
|
|
'city' => '',
|
|
'postalCode' => '',
|
|
'countryCode' => 'DE',
|
|
]
|
|
],
|
|
'contact' => [
|
|
'salutation' => 'Frau',
|
|
'firstName' => 'Claudia',
|
|
'lastName' => 'Mustermann',
|
|
'email' => '',
|
|
'phone' => '',
|
|
'position' => null,
|
|
'isPrimary' => false,
|
|
'avatar' => null,
|
|
],
|
|
'totalAmount' => '84.033',
|
|
'title' => "Angebots-Titel",
|
|
'text' => '',
|
|
'items' => [],
|
|
'paymentTerms' => [
|
|
'name' => 'onReceipt',
|
|
'description' => 'Bei Rechnungserhalt',
|
|
'isFixed' => true,
|
|
'days' => 14,
|
|
]
|
|
];
|
|
|
|
// Mail::to('')->cc([''])->send(new OrderConfirmation($offer));
|
|
return new OrderConfirmation($offer);
|
|
});
|
|
|
|
Route::get('/paymentterms', [PaymentTermsController::class, 'index']);
|
|
|
|
Route::get('/settings', [SettingController::class, 'index']);
|
|
Route::post('/settings', [SettingController::class, 'update']);
|