-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from wanderlust-group-project-1/finalize
Finalize
- Loading branch information
Showing
585 changed files
with
43,129 additions
and
33,064 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Web test with Selenium | ||
|
||
on: | ||
push: | ||
branches: [ dev, test-workflow ] | ||
pull_request: | ||
branches: [ dev, test-workflow ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# setup site using docker-compose | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- run: cp example.env .env | ||
- run: cp database/example.env database/.env | ||
- name: Run docker compose | ||
run: docker compose up -d | ||
|
||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install selenium | ||
- name: Run test | ||
run: | | ||
python test.py | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
/vendor/ | ||
database/.env | ||
.env | ||
public/uploads/ | ||
.pytest_cache | ||
public/uploads/rental_services/ | ||
|
||
|
||
|
||
server.env | ||
setup.sql | ||
public/assets/scss/wl/dashboard/index.css | ||
public/assets/scss/wl/dashboard/index.css.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
{ | ||
"liveServer.settings.port": 5501 | ||
"liveServer.settings.port": 5501, | ||
|
||
"liveSassCompile.settings.formats": [ | ||
{ | ||
"format": "expanded", | ||
"extensionName": ".css", | ||
"savePath": "./public/assets/scss/index", | ||
"savePathReplacementPairs": null | ||
} | ||
] | ||
} |
Binary file not shown.
0
...c/assets/FrontEnd Demo/imgs/logo copy.png → Logo.png
100755 → 100644
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
|
||
class Cart { | ||
use Controller; | ||
|
||
public function create(string $a = '', string $b = '', string $c = ''):void { | ||
|
||
$request = new JSONRequest(); | ||
$response = new JSONResponse(); | ||
|
||
$cart = new CartModel; | ||
|
||
$data = [ | ||
'customer_id' => UserMiddleware::getUser()['id'], | ||
'start_date' => $request->get('start_date'), | ||
'end_date' => $request->get('end_date'), | ||
]; | ||
|
||
$result = $cart->createCart($data); | ||
|
||
$response->data($result)->statusCode(200)->send(); | ||
|
||
|
||
} | ||
|
||
public function addItem(string $a = '', string $b = '', string $c = ''):void { | ||
|
||
$request = new JSONRequest(); | ||
$response = new JSONResponse(); | ||
|
||
$cart = new CartModel; | ||
|
||
$data = [ | ||
'customer_id' => UserMiddleware::getUser()['id'], | ||
'equipment_id' => $request->get('equipment_id'), | ||
'count' => $request->get('count'), | ||
]; | ||
|
||
$result = $cart->addItemToCart($data); | ||
|
||
$response->data([ | ||
'message' => 'Item added to cart', | ||
'status' => 'success', | ||
'data' => $result | ||
|
||
]) | ||
->statusCode(200) | ||
->send(); | ||
|
||
|
||
} | ||
|
||
public function count(string $a = '', string $b = '', string $c = ''):void { | ||
|
||
$request = new JSONRequest(); | ||
$response = new JSONResponse(); | ||
|
||
$cart = new CartModel; | ||
|
||
$data = [ | ||
'customer_id' => UserMiddleware::getUser()['id'], | ||
]; | ||
|
||
$result = $cart->countItem($data); | ||
|
||
$response->data($result)->statusCode(200)->send(); | ||
|
||
|
||
} | ||
|
||
public function removeItem(string $a = '', string $b = '', string $c = ''):void { | ||
|
||
$request = new JSONRequest(); | ||
$response = new JSONResponse(); | ||
|
||
$item = new CartItemModel; | ||
|
||
$data = [ | ||
'customer_id' => UserMiddleware::getUser()['id'], | ||
'id' => $request->get('id'), | ||
]; | ||
|
||
$result = $item->removeCartItem($data); | ||
|
||
$response->data([ | ||
'message' => 'Item removed from cart', | ||
'status' => 'success' | ||
]) | ||
->statusCode(200) | ||
->send(); | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
class Complaints | ||
{ | ||
use Controller; | ||
|
||
public function index() | ||
{ | ||
|
||
$this->view('rental/complaints'); | ||
} | ||
|
||
public function cancelComplaint(string $a = '', string $b = '', string $c = ''): void | ||
{ | ||
|
||
$complaint = new RentReturnComplaintModel; | ||
$complaint->cancelComplaint($a); | ||
|
||
$response = new JSONResponse; | ||
$response->statusCode(200)->data(['complaint_id' => $a])->send(); | ||
} | ||
|
||
public function resolveComplaint(string $a = ''): void | ||
{ | ||
|
||
$complaint = new RentComplaintModel; | ||
$complaint->resolveComplaint($a); | ||
|
||
$response = new JSONResponse; | ||
$response->statusCode(200)->success(true)->data(['complaint_id' => $a])->send(); | ||
} | ||
|
||
public function cancelCustomerComplaint(string $a = '', string $b = '', string $c = ''): void | ||
{ | ||
|
||
$complaint = new RentComplaintModel; | ||
$complaint->cancelComplaint($a); | ||
|
||
$response = new JSONResponse; | ||
$response->statusCode(200)->data(['complaint_id' => $a])->send(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
class Customer { | ||
use Controller; | ||
|
||
|
||
public function uploadImage(string $a = '', string $b = '', string $c = ''):void { | ||
|
||
$request = JSONRequest::createFromFormData(); | ||
$response = new JSONResponse(); | ||
|
||
$customer = new CustomerModel; | ||
|
||
$data = [ | ||
'image' => $_FILES['image'], | ||
|
||
]; | ||
$id = UserMiddleware::getUser()['id']; | ||
|
||
$image = $customer->uploadImage($data, $id); | ||
|
||
|
||
if($image){ | ||
$response->statusCode(200)->data(['image' => $image['image']])->send(); | ||
}else{ | ||
$response->statusCode(400)->data(['error' => 'Image upload failed'])->send(); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.