Compare commits
17 Commits
shift-buil
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
2d15417dfe | |
|
|
26d4bf9647 | |
|
|
ad10d61c04 | |
|
|
3f0ab15f56 | |
|
|
4bded4db0b | |
|
|
5c80b6e474 | |
|
|
1c2df6f7f1 | |
|
|
3df5f0bf21 | |
|
|
3fb9ffbbe7 | |
|
|
b908edd99e | |
|
|
20038797f1 | |
|
|
2807f3b407 | |
|
|
c42dbc7a86 | |
|
|
463d02f22f | |
|
|
ab7ed34f81 | |
|
|
7bfec123a5 | |
|
|
7e19c63c4f |
|
|
@ -1,8 +1,11 @@
|
|||
APP_NAME="Your SwissCar GmbH - AutoManager"
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://automngr.test
|
||||
APP_PORT=80
|
||||
|
||||
USER_1_EMAIL=test@salloum.pm
|
||||
USER_1_PW=abc123
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_LEVEL=debug
|
||||
|
|
@ -11,8 +14,9 @@ DB_CONNECTION=mysql
|
|||
DB_HOST=mysql
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=automngr
|
||||
DB_USERNAME=sail
|
||||
DB_PASSWORD=password
|
||||
DB_USERNAME="sail"
|
||||
DB_PASSWORD="password"
|
||||
FORWARD_DB_PORT=3306
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
name: PHP Composer
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Validate composer.json and composer.lock
|
||||
run: composer validate --strict
|
||||
|
||||
- name: Cache Composer packages
|
||||
id: composer-cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: vendor
|
||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-php-
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --prefer-dist --no-progress
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.x'
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Build
|
||||
run: npm run build --if-present
|
||||
|
||||
- name: Laravel mix
|
||||
run: mix --production
|
||||
|
||||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
|
||||
# Docs: https://getcomposer.org/doc/articles/scripts.md
|
||||
|
||||
# - name: Run test suite
|
||||
# run: composer run-script test
|
||||
|
|
@ -11,9 +11,16 @@ Running on Laravel 8
|
|||
|
||||
Prerequisites:
|
||||
- [Docker](https://docker.com) installed and running
|
||||
- Docker compose installed
|
||||
- Composer installed
|
||||
- PHP installed
|
||||
|
||||
Steps:
|
||||
1. copy .env.example to .env
|
||||
2. add user credentials in .env
|
||||
2. run `composer update --ignore-platform-reqs`
|
||||
3. run `composer install --ignore-platform-reqs`
|
||||
1. run `./vendor/bin/sail php artisan key:generate`
|
||||
2. start app by running `./vendor/bin/sail up` inside the main directory (or configure a bash alias: `alias sail='bash vendor/bin/sail'`) then you can use `sail up`
|
||||
3. Run migrations and seed db: `sail php artisan migrate:fresh --seed`
|
||||
4. `sail npm run watch`
|
||||
|
|
|
|||
|
|
@ -24,4 +24,6 @@ final class InsuranceType extends Enum
|
|||
const FiveStar = '4';
|
||||
|
||||
const FiveStarPlus = '5';
|
||||
|
||||
const Ja = '6';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,10 +73,10 @@ class CarController extends Controller
|
|||
'known_damage' => $car->known_damage,
|
||||
'seller' => $bcontract ? $bcontract->contact->full_title : null,
|
||||
'buy_date' => $bcontract ? $bcontract->date_formatted : null,
|
||||
'price' => $bcontract ? $bcontract->price : null,
|
||||
'price' => $bcontract ? $bcontract->price_for_excel : null,
|
||||
'buyer' => $scontract ? $scontract->contact->full_title : null,
|
||||
'sell_date' => $scontract ? $scontract->date_formatted : null,
|
||||
'sell_price' => $scontract ? $scontract->price : null,
|
||||
'sell_price' => $scontract ? $scontract->price_for_excel : null,
|
||||
];
|
||||
});
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ class CarController extends Controller
|
|||
'known_damage' => $car->known_damage,
|
||||
'seller' => $contract ? $contract->contact->full_title : null,
|
||||
'buy_date' => $contract ? $contract->date_formatted : null,
|
||||
'price' => $contract ? $contract->price : null,
|
||||
'price' => $contract ? $contract->price_for_excel : null,
|
||||
];
|
||||
});
|
||||
|
||||
|
|
@ -172,10 +172,10 @@ class CarController extends Controller
|
|||
'known_damage' => $car->known_damage,
|
||||
'seller' => $bcontract ? $bcontract->contact->full_title : null,
|
||||
'buy_date' => $bcontract ? $bcontract->date_formatted : null,
|
||||
'price' => $bcontract ? $bcontract->price : null,
|
||||
'price' => $bcontract ? $bcontract->price_for_excel : null,
|
||||
'buyer' => $scontract ? $scontract->contact->full_title : null,
|
||||
'sell_date' => $scontract ? $scontract->date_formatted : null,
|
||||
'sell_price' => $scontract ? $scontract->price : null,
|
||||
'sell_price' => $scontract ? $scontract->price_for_excel : null,
|
||||
];
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
|
|
@ -19,5 +19,9 @@ class TrustProxies extends Middleware
|
|||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
}
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ class Contract extends Model
|
|||
InsuranceType::ThreeStar => '3 Stern',
|
||||
InsuranceType::FiveStar => '5 Stern',
|
||||
InsuranceType::FiveStarPlus => '5 Stern+',
|
||||
InsuranceType::Ja => 'Ja',
|
||||
default => 'Nein',
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,19 +42,25 @@ class Payment extends Model
|
|||
|
||||
public function getTypeAttribute($type)
|
||||
{
|
||||
return match ($type) {
|
||||
PaymentType::Transaction() => 'Banküberweisung',
|
||||
PaymentType::Cash() => 'Barzahlung',
|
||||
default => 'Überweisung via Cembra',
|
||||
switch ($type) {
|
||||
case PaymentType::Transaction():
|
||||
return 'Banküberweisung';
|
||||
case PaymentType::Cash():
|
||||
return 'Barzahlung';
|
||||
default:
|
||||
return 'Überweisung via Cembra';
|
||||
};
|
||||
}
|
||||
|
||||
public function getTypeTextAttribute()
|
||||
{
|
||||
return match ($this->type) {
|
||||
'Banküberweisung' => 'via Banküberweisung erhalten',
|
||||
'Barzahlung' => 'in bar erhalten',
|
||||
default => 'via Cembra-Überweisung erhalten',
|
||||
switch ($this->type) {
|
||||
case 'Banküberweisung':
|
||||
return 'via Banküberweisung erhalten';
|
||||
case 'Barzahlung':
|
||||
return 'in bar erhalten';
|
||||
default:
|
||||
return 'via Cembra-Überweisung erhalten';
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,31 +2,33 @@
|
|||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"keywords": [
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^7.3|^8.0",
|
||||
"barryvdh/laravel-dompdf": "^0.9.0",
|
||||
"bensampo/laravel-enum": "^3.3",
|
||||
"cknow/laravel-money": "^6.1",
|
||||
"fakerphp/faker": "^1.14",
|
||||
"fideloper/proxy": "^4.4",
|
||||
"php": "^8.1",
|
||||
"barryvdh/laravel-dompdf": "^1.0",
|
||||
"bensampo/laravel-enum": "^5.1",
|
||||
"cknow/laravel-money": "^7.0",
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"fruitcake/laravel-cors": "^2.0",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"inertiajs/inertia-laravel": "^0.3.5",
|
||||
"laravel/framework": "^8.12",
|
||||
"inertiajs/inertia-laravel": "^0.5",
|
||||
"laravel/framework": "^9.0",
|
||||
"laravel/jetstream": "^2.3",
|
||||
"laravel/sanctum": "^2.6",
|
||||
"laravel/tinker": "^2.5",
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"phpoffice/phpword": "^0.18.2",
|
||||
"phpoffice/phpword": "^0.18",
|
||||
"tightenco/ziggy": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"facade/ignition": "^2.5",
|
||||
"spatie/laravel-ignition": "^1.0",
|
||||
"laravel/sail": "^1.0.1",
|
||||
"mockery/mockery": "^1.4.2",
|
||||
"nunomaduro/collision": "^5.0",
|
||||
"nunomaduro/collision": "^6.1",
|
||||
"phpunit/phpunit": "^9.3.3"
|
||||
},
|
||||
"autoload": {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -36,20 +36,20 @@ class DatabaseSeeder extends Seeder
|
|||
|
||||
User::factory()->create([
|
||||
'name' => 'Nadim Salloum',
|
||||
'email' => env('USER_1_EMAIL'),
|
||||
'password' => bcrypt(env('USER_1_PW')),
|
||||
'email' => env('USER_1_EMAIL', 'test@test.ch'),
|
||||
'password' => bcrypt(env('USER_1_PW', 'abc123')),
|
||||
]);
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Mohamad Salloum',
|
||||
'email' => env('USER_2_EMAIL'),
|
||||
'password' => bcrypt(env('USER_2_PW')),
|
||||
'email' => env('USER_2_EMAIL', 'test2@test.ch'),
|
||||
'password' => bcrypt(env('USER_2_PW', 'abc123')),
|
||||
]);
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Nadim Salloum',
|
||||
'email' => env('USER_3_EMAIL'),
|
||||
'password' => bcrypt(env('USER_3_PW')),
|
||||
'email' => env('USER_3_EMAIL', 'test3@test.ch'),
|
||||
'password' => bcrypt(env('USER_3_PW', 'abc123')),
|
||||
]);
|
||||
|
||||
foreach ($this->getBrands() as $brandItem) {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ version: '3'
|
|||
services:
|
||||
laravel.test:
|
||||
build:
|
||||
context: ./vendor/laravel/sail/runtimes/8.0
|
||||
context: ./vendor/laravel/sail/runtimes/8.1
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
WWWGROUP: '${WWWGROUP}'
|
||||
image: sail-8.0/app
|
||||
image: sail-8.1/app
|
||||
ports:
|
||||
- '${APP_PORT:-80}:80'
|
||||
environment:
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -19,9 +19,9 @@
|
|||
"@vue/compiler-sfc": "^3.0.5",
|
||||
"eslint": "^7.28.0",
|
||||
"eslint-plugin-vue": "^7.11.1",
|
||||
"laravel-mix": "^6.0.6",
|
||||
"laravel-mix": "^6.0.49",
|
||||
"postcss": "^8.1.14",
|
||||
"postcss-import": "^12.0.1",
|
||||
"postcss-import": "^14.0.2",
|
||||
"tailwindcss": "^2.0.1",
|
||||
"vue-loader": "^16.1.2"
|
||||
},
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
"vue": "^3.0.5",
|
||||
"vue-currency-input": "^2.0.0",
|
||||
"vue-multiselect": "^3.0.0-alpha.2",
|
||||
"vue-unicons": "^3.2.1",
|
||||
"vue-unicons": "^3.3.1",
|
||||
"vuex": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -8,6 +8,9 @@
|
|||
</template>
|
||||
<template #info>
|
||||
<small-title title="Auto" class="mb-3" />
|
||||
<div v-if="car.deleted_at" class="col-span-12 bg-red-500 p-2 -mb-1 text-white rounded-t-md font-bold">
|
||||
Auto gelöscht am {{ car.deleted_at }}
|
||||
</div>
|
||||
<car-card :car="car" />
|
||||
</template>
|
||||
<template #actions>
|
||||
|
|
|
|||
|
|
@ -91,14 +91,14 @@ export default {
|
|||
methods: {
|
||||
fetchCity(newVal, oldVal) {
|
||||
if (newVal !== oldVal && newVal.length === 4 && this.form.country === 'CH') {
|
||||
axios.get(`https://swisspost.opendatasoft.com/api/records/1.0/search/?dataset=plz_verzeichnis_v2&q=&facet=ortbez18&refine.postleitzahl=${newVal}`)
|
||||
axios.get(`https://openplzapi.org/ch/Localities?postalCode=${newVal}`)
|
||||
.then((response) => {
|
||||
let records = response.data.records;
|
||||
if (records.length > 1) {
|
||||
let data = response.data;
|
||||
/*if (records.length > 1) {
|
||||
records = records.filter(rec => rec.geometry);
|
||||
}
|
||||
if (records[0]) {
|
||||
this.form.city = records[0].fields.ortbez18;
|
||||
}*/
|
||||
if (data[0]) {
|
||||
this.form.city = data[0].name;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
|
||||
<template #info>
|
||||
<small-title title="Kontakt" class="mb-3" />
|
||||
<div v-if="contact.deleted_at" class="col-span-12 bg-red-500 p-2 -mb-1 text-white rounded-t-md font-bold">
|
||||
Kontakt gelöscht am {{ contact.deleted_at }}
|
||||
</div>
|
||||
<contact-card :contact="contact" />
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ export default {
|
|||
price: this.contract.price,
|
||||
notes: this.contract.notes,
|
||||
insurance_type: this.contract.insurance_type,
|
||||
type: this.contract.type,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,7 +5,11 @@
|
|||
</template>
|
||||
<template #info>
|
||||
<small-title title="Vertragsinformationen" class="mb-3" />
|
||||
<div v-if="contract.deleted_at" class="col-span-12 bg-red-500 p-2 -mb-1 text-white rounded-t-md font-bold">
|
||||
Vertrag gelöscht am {{ contract.deleted_at }}
|
||||
</div>
|
||||
<div class="grid grid-cols-12 gap-2 p-5 bg-white shadow rounded-md font-medium">
|
||||
|
||||
<div class="col-span-4">
|
||||
Datum
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -187,10 +187,12 @@ MwSt-Nr: CHE-226.272.050
|
|||
<td>Restbetrag</td>
|
||||
<td>{{ $contract->left_to_pay }}</td>
|
||||
</tr>
|
||||
@if ($contract->isSellContract())
|
||||
<tr>
|
||||
<td>Bankverbindung IBAN</td>
|
||||
<td>CH69 0900 0000 1549 3981 7</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td>Lieferdatum</td>
|
||||
<td>{{ $contract->delivery_date_formatted }}</td>
|
||||
|
|
|
|||
Loading…
Reference in New Issue