-
Notifications
You must be signed in to change notification settings - Fork 8
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 #140 from vhs/membershipcards
Membershipcards
- Loading branch information
Showing
30 changed files
with
948 additions
and
20 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,69 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Thomas | ||
* Date: 11/20/2015 | ||
* Time: 12:14 PM | ||
*/ | ||
|
||
namespace app\contracts; | ||
|
||
|
||
use vhs\services\IContract; | ||
|
||
interface IMemberCardService1 extends IContract { | ||
|
||
/** | ||
* @permission administrator | ||
* @param $key | ||
* @param $notes | ||
* @return mixed | ||
*/ | ||
public function RegisterGenuineCard($key, $notes); | ||
|
||
/** | ||
* @permission user | ||
* @param $key | ||
* @return mixed | ||
*/ | ||
public function ValidateGenuineCard($key); | ||
|
||
/** | ||
* @permission administrator | ||
* @param $email | ||
* @param $key | ||
* @return mixed | ||
*/ | ||
public function IssueCard($email, $key); | ||
|
||
/** | ||
* @permission administrator | ||
* @param $page | ||
* @param $size | ||
* @param $columns | ||
* @param $order | ||
* @param $filters | ||
* @return mixed | ||
*/ | ||
public function ListGenuineCards($page, $size, $columns, $order, $filters); | ||
|
||
/** | ||
* @permission administrator|user | ||
* @param $userid | ||
* @param $page | ||
* @param $size | ||
* @param $columns | ||
* @param $order | ||
* @param $filters | ||
* @return mixed | ||
*/ | ||
public function ListUserGenuineCards($userid, $page, $size, $columns, $order, $filters); | ||
|
||
/** | ||
* @permission administrator | ||
* @param $key | ||
* @return mixed | ||
*/ | ||
public function GetGenuineCardDetails($key); | ||
|
||
} |
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 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Thomas | ||
* Date: 11/20/2015 | ||
* Time: 12:22 PM | ||
*/ | ||
|
||
namespace app\domain; | ||
|
||
|
||
use app\schema\GenuineCardSchema; | ||
use vhs\database\wheres\Where; | ||
use vhs\domain\Domain; | ||
use vhs\domain\validations\ValidationResults; | ||
|
||
class GenuineCard extends Domain { | ||
public static function Define() { | ||
GenuineCard::Schema(GenuineCardSchema::Type()); | ||
} | ||
|
||
public function validate(ValidationResults &$results) { | ||
|
||
} | ||
|
||
/** | ||
* @param $key | ||
* @return GenuineCard[] | ||
*/ | ||
public static function findByKey($key) { | ||
return GenuineCard::where( | ||
Where::Equal(GenuineCardSchema::Columns()->key, $key) | ||
); | ||
} | ||
} | ||
|
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,20 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Thomas | ||
* Date: 11/21/2015 | ||
* Time: 12:33 PM | ||
*/ | ||
|
||
namespace app\endpoints\web; | ||
|
||
|
||
use app\services\MemberCardService; | ||
use vhs\services\endpoints\JsonEndpoint; | ||
use vhs\services\ServiceContext; | ||
|
||
class MemberCardService1 extends JsonEndpoint { | ||
public function __construct() { | ||
parent::__construct(new MemberCardService(new ServiceContext($this))); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Thomas | ||
* Date: 11/19/2015 | ||
* Time: 7:07 PM | ||
*/ | ||
|
||
namespace app\schema; | ||
|
||
|
||
use vhs\database\constraints\Constraint; | ||
use vhs\database\Table; | ||
use vhs\database\types\Type; | ||
use vhs\domain\Schema; | ||
|
||
class GenuineCardSchema extends Schema { | ||
public static function init() { | ||
$table = new Table("genuinecard"); | ||
|
||
$table->addColumn("id", Type::Int(false, 0)); | ||
$table->addColumn("key", Type::String(false, "", 255)); | ||
$table->addColumn("created", Type::DateTime(false, date("Y-m-d H:i:s"))); | ||
$table->addColumn("issued", Type::DateTime(true, null)); | ||
$table->addColumn("active", Type::Bool(false, false)); | ||
$table->addColumn("paymentid", Type::Int(true, 0)); | ||
$table->addColumn("userid", Type::Int(true, 0)); | ||
$table->addColumn("owneremail", Type::String(true, "", 255)); | ||
$table->addColumn("notes", Type::String(true, "", 255)); | ||
|
||
$table->setConstraints( | ||
Constraint::PrimaryKey($table->columns->id) | ||
); | ||
|
||
return $table; | ||
} | ||
} |
Oops, something went wrong.