diff --git a/app/Http/Controllers/RefundController.php b/app/Http/Controllers/RefundController.php new file mode 100644 index 00000000..dc8fe468 --- /dev/null +++ b/app/Http/Controllers/RefundController.php @@ -0,0 +1,66 @@ + + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Http/Requests/StoretransactionRequest.php b/app/Http/Requests/StoretransactionRequest.php new file mode 100644 index 00000000..a5c19220 --- /dev/null +++ b/app/Http/Requests/StoretransactionRequest.php @@ -0,0 +1,28 @@ + + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Http/Requests/UpdateRefundRequest.php b/app/Http/Requests/UpdateRefundRequest.php new file mode 100644 index 00000000..c2b0e057 --- /dev/null +++ b/app/Http/Requests/UpdateRefundRequest.php @@ -0,0 +1,28 @@ + + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Http/Requests/UpdatetransactionRequest.php b/app/Http/Requests/UpdatetransactionRequest.php new file mode 100644 index 00000000..02fb6a06 --- /dev/null +++ b/app/Http/Requests/UpdatetransactionRequest.php @@ -0,0 +1,28 @@ + + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Models/Refund.php b/app/Models/Refund.php new file mode 100644 index 00000000..00175d10 --- /dev/null +++ b/app/Models/Refund.php @@ -0,0 +1,71 @@ + "INV-1234", + "customer" => "Okta", + "seller" => "dodo", + "total" => "Rp. 15000", + "date" => "July 19, 2023 ", + "status"=>"Process Refund" + ], + [ + "orderId" => "INV-0000", + "customer" => "Selvi", + "seller" => "dedo", + "total" => "Rp. 11000", + "date" => "August 19, 2023 ", + "status"=>"Process Refund" + ], + [ + "orderId" => "INV-2313", + "customer" => "Septa", + "seller" => "dido", + "total" => "Rp. 15000", + "date" => "July 29, 2023 ", + "status"=>"Process Refund" + ], + [ + "orderId" => "INV-5664", + "customer" => "Padia", + "seller" => "dedo", + "total" => "Rp. 14000", + "date" => "July 18, 2023 ", + "status"=>"Process Refund" + ], + [ + "orderId" => "INV-9090", + "customer" => "hantu", + "seller" => "dado", + "total" => "Rp. 45000", + "date" => "June 19, 2023 ", + "status"=>"Process Refund" + ] + ]; + + public static $detail_refund=[ + [ + "orderId" => "INV-9090", + "customer" => "hantu", + "seller" => "dado", + "total" => "Rp. 45000", + "date" => "June 19, 2023 ", + "complaint" =>" Lorem ipsum dolor sit, amet consectetur adipisicing elit. Aliquam inventore, sit enim iure itaque fuga voluptates alias, eveniet quos ex reiciendis! Dolore mollitia ea inventore, excepturi hic fugiat id, magnam molestias sint ut enim repellendus, cum dolorum dolores sapiente adipisci tempora nihil omnis! Accusantium, non perspiciatis? Molestias modi debitis perferendis reprehenderit excepturi voluptates? Sit incidunt consequuntur iusto odit sapiente inventore nemo commodi, quam vero magnam temporibus ducimus praesentium assumenda blanditiis possimus perferendis totam placeat maiores. Quae ut id libero atque pariatur veritatis rerum culpa tempore consequatur quod corrupti corporis nobis quia repellendus iste quidem illum, voluptates aspernatur cumque officia. Tenetur.", + "image"=>"assets/images/dashboard/img_2.jpg" + ] + ]; + public static function HistoryRefund(){ + return self::$history_refund; + + } + public static function DetailRefund(){ + return self::$detail_refund; + } +} \ No newline at end of file diff --git a/app/Models/transaction.php b/app/Models/transaction.php new file mode 100644 index 00000000..d19c5748 --- /dev/null +++ b/app/Models/transaction.php @@ -0,0 +1,77 @@ + "INV-1234", + "customer" => "Jilhan", + "seller" => "dodo", + "total" => "Rp. 15000", + "date" => "July 19, 2023 ", + "status"=>"paid" + ], + [ + "orderId" => "INV-0000", + "customer" => "hmmm", + "seller" => "dodo", + "total" => "Rp. 11000", + "date" => "August 19, 2023 ", + "status"=>"pending" + ], + [ + "orderId" => "INV-2313", + "customer" => "nurul", + "seller" => "dido", + "total" => "Rp. 15000", + "date" => "July 29, 2023 ", + "status"=>"unpaid" + ], + [ + "orderId" => "INV-5664", + "customer" => "raihan", + "seller" => "dedo", + "total" => "Rp. 14000", + "date" => "July 18, 2023 ", + "status"=>"pending" + ], + [ + "orderId" => "INV-9090", + "customer" => "testing", + "seller" => "dado", + "total" => "Rp. 45000", + "date" => "June 19, 2023 ", + "status"=>"paid" + ] + + ]; + + private static $detail_transaction=[ + [ + "tracking_number" => "09102919209", + "orderId" => "INV-9090", + "status"=>"Pending", + "estimated" => "June 20, 2023", + "tracking_detail1"=> "August 10: processed payment", + "tracking_detail2"=> "August 12: payment in system", + "tracking_detail3"=> "August 14: payment has been received by the seller", + ], + + ]; + + + public static function allTransactions() + { + return self::$list_transaction; + } + + public static function allDetailTransactions() + { + return self::$detail_transaction; + } +} diff --git a/app/Policies/RefundPolicy.php b/app/Policies/RefundPolicy.php new file mode 100644 index 00000000..54eed0b9 --- /dev/null +++ b/app/Policies/RefundPolicy.php @@ -0,0 +1,66 @@ + + */ +class RefundFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/factories/TransactionFactory.php b/database/factories/TransactionFactory.php new file mode 100644 index 00000000..d4ba7666 --- /dev/null +++ b/database/factories/TransactionFactory.php @@ -0,0 +1,23 @@ + + */ +class TransactionFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} \ No newline at end of file diff --git a/database/migrations/2023_08_15_041903_create_transactions_table.php b/database/migrations/2023_08_15_041903_create_transactions_table.php new file mode 100644 index 00000000..30e302a0 --- /dev/null +++ b/database/migrations/2023_08_15_041903_create_transactions_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('transactions'); + } +}; diff --git a/database/migrations/2023_08_15_054606_create_refunds_table.php b/database/migrations/2023_08_15_054606_create_refunds_table.php new file mode 100644 index 00000000..22e5bf75 --- /dev/null +++ b/database/migrations/2023_08_15_054606_create_refunds_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('refunds'); + } +}; diff --git a/database/seeders/RefundSeeder.php b/database/seeders/RefundSeeder.php new file mode 100644 index 00000000..1d4f47ba --- /dev/null +++ b/database/seeders/RefundSeeder.php @@ -0,0 +1,17 @@ +
-

History Transaction

+

History Transaction

@@ -121,61 +121,22 @@ Status Action - - INV-87239 - Kusnadi - didi - Rp. 150000 - July 19, 2018 - -
Unpaid
- - - Detail - - - - INV-48574 - Hasan Basri - dodo - Rp. 150000 - July 21, 2018 - -
Paid
- + @foreach ($transaction as $transactions) + + {{ $transactions['orderId'] }} + {{ $transactions['customer'] }} + {{ $transactions['seller'] }} + {{ $transactions['total'] }} + {{ $transactions['date'] }} + +
{{ $transactions['status'] }}
+ + + Detail + - - Detail - - - - INV-48574 - Hasan Basri - dodo - Rp. 150000 - July 21, 2018 - -
Paid
- - - - Detail - - - - INV-48574 - Hasan Basri - dodo - Rp. 150000 - July 21, 2018 - -
Paid
- - - - Detail - - + + @endforeach
diff --git a/resources/views/layout/header.blade.php b/resources/views/layout/header.blade.php index 9a7ba864..6a5ed01f 100644 --- a/resources/views/layout/header.blade.php +++ b/resources/views/layout/header.blade.php @@ -203,7 +203,7 @@ -
  • List Refund
  • +
  • List Refund +
  • {{--
    diff --git a/resources/views/refund/detail-refund.blade.php b/resources/views/refund/detail-refund.blade.php new file mode 100644 index 00000000..8a009257 --- /dev/null +++ b/resources/views/refund/detail-refund.blade.php @@ -0,0 +1,36 @@ +@extends('layout.main') + +@section('content') +
    +
    +
    +
    +
    +

    Detail Refund

    +
    + @foreach ($detail_refund as $DetailRefund) +
    +
    +

    ID Order: {{ $DetailRefund['orderId'] }}

    +

    Customer Name: {{ $DetailRefund['customer'] }}

    +

    Seller Name: {{ $DetailRefund['seller'] }}

    +

    Total: {{ $DetailRefund['total'] }}

    +

    Due Date: {{ $DetailRefund['date'] }}

    +

    Reason Complaint: {{ $DetailRefund['complaint'] }}

    +

    Image/Video:

    + Return Image

    + +
    + Accept + Decline +
    + +

    +
    + @endforeach + +
    +
    +
    +
    +@endsection diff --git a/resources/views/refund/history-refund.blade.php b/resources/views/refund/history-refund.blade.php new file mode 100644 index 00000000..f01057c5 --- /dev/null +++ b/resources/views/refund/history-refund.blade.php @@ -0,0 +1,43 @@ +@extends('layout.main') +@section('content') +
    +
    +
    +
    +
    +

    History Refund

    +
    +
    +
    + + + + + + + + + + + @foreach ($history_refund as $HistoryRefund) + + + + + + + + + + @endforeach + +
    Order IDCustomerSellerTotalDue DateStatusAction
    {{ $HistoryRefund['orderId'] }}{{ $HistoryRefund['customer'] }}{{ $HistoryRefund['seller'] }}{{ $HistoryRefund['total'] }}{{ $HistoryRefund['date'] }} +
    {{ $HistoryRefund['status'] }}
    +
    + Detail +
    +
    +
    +
    +
    + @endsection diff --git a/resources/views/transaction/Detail_History_Transaction.blade.php b/resources/views/transaction/Detail_History_Transaction.blade.php index 981cfca5..34f40cd8 100644 --- a/resources/views/transaction/Detail_History_Transaction.blade.php +++ b/resources/views/transaction/Detail_History_Transaction.blade.php @@ -1,21 +1,25 @@ @extends('layout.main') @section('content') -
    -
    -
    -

    Tracking Information

    -
    -

    Tracking Number: 123456789

    -

    Status: Pending

    -

    Estimated : August 20, 2023

    + @foreach ($detail_transaction as $detail_transactions) +
    +
    +
    +

    Tracking Information

    +
    +

    Tracking Number: {{ $detail_transactions['tracking_number'] }}

    +

    Order ID: {{ $detail_transactions['orderId'] }}

    +

    Status: {{ $detail_transactions['status'] }}

    +

    Estimated: {{ $detail_transactions['estimated'] }}

    +
    +

    Tracking Details

    +
      +
    • {{ $detail_transactions['tracking_detail1'] }}
    • +
    • {{ $detail_transactions['tracking_detail2'] }}
    • +
    • {{ $detail_transactions['tracking_detail3'] }}
    • +
    -

    Tracking Details

    -
      -
    • August 10: processed payment
    • -
    • August 12: payment in system
    • -
    • August 14: payment has been received by the seller
    • -
    -
    -
    -
    +
    +
    + @endforeach @endsection diff --git a/resources/views/transaction/History_Transaction.blade.php b/resources/views/transaction/History_Transaction.blade.php index 159bcac5..48f11466 100644 --- a/resources/views/transaction/History_Transaction.blade.php +++ b/resources/views/transaction/History_Transaction.blade.php @@ -5,7 +5,7 @@
    -

    History Transaction

    +

    History Transaction

    @@ -19,61 +19,22 @@ Status Action - - INV-87239 - Kusnadi - didi - Rp. 150000 - July 19, 2018 - -
    Unpaid
    - - - Detail - - - - INV-48574 - Hasan Basri - dodo - Rp. 150000 - July 21, 2018 - -
    Paid
    - + @foreach ($transaction as $transactions) + + {{ $transactions['orderId'] }} + {{ $transactions['customer'] }} + {{ $transactions['seller'] }} + {{ $transactions['total'] }} + {{ $transactions['date'] }} + +
    {{ $transactions['status'] }}
    + + + Detail + - - Detail - - - - INV-48574 - Hasan Basri - dodo - Rp. 150000 - July 21, 2018 - -
    Paid
    - - - - Detail - - - - INV-48574 - Hasan Basri - dodo - Rp. 150000 - July 21, 2018 - -
    Paid
    - - - - Detail - - + + @endforeach
    diff --git a/resources/views/transaction/List_Transaction.blade.php b/resources/views/transaction/List_Transaction.blade.php index 093263ec..52048ef8 100644 --- a/resources/views/transaction/List_Transaction.blade.php +++ b/resources/views/transaction/List_Transaction.blade.php @@ -5,7 +5,7 @@
    -

    List Transaction

    +

    List Transaction

    @@ -20,77 +20,25 @@ Action - - INV-87239 - Kusnadi - didi - Rp. 150000 - July 19, 2018 - -
    Unpaid
    - - -
    - Edit - Delete -
    - + @foreach ($transaction as $transactions) + + {{ $transactions['orderId'] }} + {{ $transactions['customer'] }} + {{ $transactions['seller'] }} + {{ $transactions['total'] }} + {{ $transactions['date'] }} + +
    {{ $transactions['status'] }}
    + + +
    + Edit + Delete +
    + - - - INV-48574 - Hasan Basri - dodo - Rp. 150000 - July 21, 2018 - -
    Paid
    - - -
    - Edit - Delete -
    - - - - - - INV-48574 - Hasan Basri - dodo - Rp. 150000 - July 21, 2018 - -
    Paid
    - - -
    - Edit - Delete -
    - - - - - - INV-48574 - Hasan Basri - dodo - Rp. 150000 - July 21, 2018 - -
    Paid
    - - -
    - Edit - Delete -
    - - - - + + @endforeach
    diff --git a/routes/web.php b/routes/web.php index f1ea9204..879a8fb4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,5 +1,7 @@ 'Jilhan Haura', + "transaction"=>transaction::allTransactions() + ]); }); Route::get('/list_transaction', function () { - return view('transaction/List_Transaction'); + return view('transaction/List_Transaction',[ + 'name'=>'Jilhan Haura', + "transaction"=> transaction::allTransactions() + ]); }); Route::get('/history_transaction', function () { - return view('transaction/History_Transaction'); + return view('transaction/History_Transaction',[ + 'name'=>'Jilhan Haura', + "transaction"=> transaction::allTransactions() + ]); }); Route::get('/Detail_History', function () { - return view('transaction/Detail_History_Transaction');}); \ No newline at end of file + return view('transaction/Detail_History_Transaction',[ + 'name'=>'Jilhan Haura', + "detail_transaction"=> transaction::allDetailTransactions() + ]); +}); +Route::get('/history_refund', function () { + return view('refund/history-refund',[ + 'name'=>'Jilhan Haura', + "history_refund" => Refund::HistoryRefund() + ]); +}); +Route::get('/detail_refund',function() { + return view('refund/detail-refund',[ + 'name'=>'Jilhan Haura', + "detail_refund"=> Refund::DetailRefund() + ]); +}); +Route::post('/refund-accept/{id}', 'ReturnItemController@acceptRefund')->name('refund/detail-refund/refund.accept'); +Route::get('/refund-decline/{id}', 'ReturnItemController@declineRefund')->name('refund/detail-refund/refund.decline');