-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate credit system for env usage (#230)
* migrate credit system for env usage * credit system validation rules
- Loading branch information
Showing
10 changed files
with
253 additions
and
215 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 |
---|---|---|
|
@@ -3,4 +3,12 @@ APP_DEBUG=1 | |
DB_DSN=mysql:host=db;dbname=bikesharing;charset=utf8 | ||
DB_USER=bikesharing | ||
DB_PASSWORD=password | ||
SMTP_FROM_EMAIL=[email protected] | ||
SMTP_FROM_EMAIL=[email protected] | ||
CREDIT_SYSTEM_ENABLED=true | ||
CREDIT_SYSTEM_CURRENCY=$ | ||
CREDIT_SYSTEM_MIN_BALANCE=2 | ||
CREDIT_SYSTEM_RENTAL_FEE=2 | ||
CREDIT_SYSTEM_PRICE_CYCLE=0 | ||
CREDIT_SYSTEM_LONG_RENTAL_FEE=5 | ||
CREDIT_SYSTEM_LIMIT_INCREASE_FEE=10 | ||
CREDIT_SYSTEM_VIOLATION_FEE=5 |
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
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
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,56 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BikeShare\Credit; | ||
|
||
interface CreditSystemInterface | ||
{ | ||
/** | ||
* @return int | ||
*/ | ||
public function getUserCredit($userId); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getMinRequiredCredit(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isEnoughCreditForRent($userid); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isEnabled(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCreditCurrency(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getRentalFee(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getPriceCycle(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getLongRentalFee(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getLimitIncreaseFee(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getViolationFee(); | ||
public function getUserCredit($userId): float; | ||
|
||
public function getMinRequiredCredit(): float; | ||
|
||
public function isEnoughCreditForRent($userid): bool; | ||
|
||
public function isEnabled(): bool; | ||
|
||
public function getCreditCurrency(): string; | ||
|
||
public function getRentalFee(): float; | ||
|
||
public function getPriceCycle(): int; | ||
|
||
public function getLongRentalFee(): float; | ||
|
||
public function getLimitIncreaseFee(): float; | ||
|
||
public function getViolationFee(): float; | ||
} |
Oops, something went wrong.