Permalink
Browse files

Phortune v0.1: products

Summary:
Ref T2787. A product is the abstract representation of something you can buy or rent/subscribe to. Although the interface isn't locked down yet, this would ultimately be internal/administrative.

Products likely have some user-facing skin on top of them: plans would have a purchasing/comparison flow, physical goods would have a storefront, etc., so products don't have any information like descriptions or images, just the data that Phortune needs to correctly bill accounts.

Generally, this is very basic for the moment.

Test Plan:
{F37594}
{F37595}
{F37596}

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2787

Differential Revision: https://secure.phabricator.com/D5441
  • Loading branch information...
1 parent 4f3b5f0 commit abdaf902395132ad2d5de531e8b86b136e4bcfb7 @epriestley epriestley committed Mar 28, 2013
@@ -0,0 +1,35 @@
+CREATE TABLE {$NAMESPACE}_phortune.phortune_product (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ productName VARCHAR(255) NOT NULL,
+ productType VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ status VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ priceInCents BIGINT NOT NULL,
+ billingIntervalInMonths INT UNSIGNED,
+ trialPeriodInDays INT UNSIGNED,
+ metadata LONGTEXT NOT NULL COLLATE utf8_bin,
+ dateCreated INT UNSIGNED NOT NULL,
+ dateModified INT UNSIGNED NOT NULL,
+ UNIQUE KEY `key_phid` (phid),
+ KEY `key_status` (status)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE {$NAMESPACE}_phortune.phortune_producttransaction (
+ id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ commentPHID VARCHAR(64) COLLATE utf8_bin,
+ commentVersion INT UNSIGNED NOT NULL,
+ transactionType VARCHAR(32) NOT NULL COLLATE utf8_bin,
+ oldValue LONGTEXT NOT NULL COLLATE utf8_bin,
+ newValue LONGTEXT NOT NULL COLLATE utf8_bin,
+ contentSource LONGTEXT NOT NULL COLLATE utf8_bin,
+ metadata LONGTEXT NOT NULL COLLATE utf8_bin,
+ dateCreated INT UNSIGNED NOT NULL,
+ dateModified INT UNSIGNED NOT NULL,
+ UNIQUE KEY `key_phid` (phid),
+ KEY `key_object` (objectPHID)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -2138,14 +2138,15 @@
),
'javelin-behavior-stripe-payment-form' =>
array(
- 'uri' => '/res/87c7b043/rsrc/js/application/phortune/behavior-stripe-payment-form.js',
+ 'uri' => '/res/30bcbbb1/rsrc/js/application/phortune/behavior-stripe-payment-form.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
2 => 'javelin-json',
- 3 => 'stripe-core',
+ 3 => 'javelin-workflow',
+ 4 => 'stripe-core',
),
'disk' => '/rsrc/js/application/phortune/behavior-stripe-payment-form.js',
),
@@ -2883,7 +2884,7 @@
),
'phabricator-flag-css' =>
array(
- 'uri' => '/res/2eee890a/rsrc/css/application/flag/flag.css',
+ 'uri' => '/res/237234d7/rsrc/css/application/flag/flag.css',
'type' => 'css',
'requires' =>
array(
@@ -3704,7 +3705,7 @@
), array(
'packages' =>
array(
- '20f728ee' =>
+ '4fc2a8f9' =>
array(
'name' => 'core.pkg.css',
'symbols' =>
@@ -3746,7 +3747,7 @@
34 => 'phabricator-object-item-list-view-css',
35 => 'global-drag-and-drop-css',
),
- 'uri' => '/res/pkg/20f728ee/core.pkg.css',
+ 'uri' => '/res/pkg/4fc2a8f9/core.pkg.css',
'type' => 'css',
),
'95ceba95' =>
@@ -3937,16 +3938,16 @@
'reverse' =>
array(
'aphront-attached-file-view-css' => '6b1fccc6',
- 'aphront-dialog-view-css' => '20f728ee',
- 'aphront-error-view-css' => '20f728ee',
- 'aphront-form-view-css' => '20f728ee',
- 'aphront-list-filter-view-css' => '20f728ee',
- 'aphront-pager-view-css' => '20f728ee',
- 'aphront-panel-view-css' => '20f728ee',
- 'aphront-table-view-css' => '20f728ee',
- 'aphront-tokenizer-control-css' => '20f728ee',
- 'aphront-tooltip-css' => '20f728ee',
- 'aphront-typeahead-control-css' => '20f728ee',
+ 'aphront-dialog-view-css' => '4fc2a8f9',
+ 'aphront-error-view-css' => '4fc2a8f9',
+ 'aphront-form-view-css' => '4fc2a8f9',
+ 'aphront-list-filter-view-css' => '4fc2a8f9',
+ 'aphront-pager-view-css' => '4fc2a8f9',
+ 'aphront-panel-view-css' => '4fc2a8f9',
+ 'aphront-table-view-css' => '4fc2a8f9',
+ 'aphront-tokenizer-control-css' => '4fc2a8f9',
+ 'aphront-tooltip-css' => '4fc2a8f9',
+ 'aphront-typeahead-control-css' => '4fc2a8f9',
'differential-changeset-view-css' => '8aaacd1b',
'differential-core-view-css' => '8aaacd1b',
'differential-inline-comment-editor' => '322728f3',
@@ -3960,7 +3961,7 @@
'differential-table-of-contents-css' => '8aaacd1b',
'diffusion-commit-view-css' => 'c8ce2d88',
'diffusion-icons-css' => 'c8ce2d88',
- 'global-drag-and-drop-css' => '20f728ee',
+ 'global-drag-and-drop-css' => '4fc2a8f9',
'inline-comment-summary-css' => '8aaacd1b',
'javelin-aphlict' => '95ceba95',
'javelin-behavior' => 'fe22443b',
@@ -4032,48 +4033,48 @@
'javelin-util' => 'fe22443b',
'javelin-vector' => 'fe22443b',
'javelin-workflow' => 'fe22443b',
- 'lightbox-attachment-css' => '20f728ee',
+ 'lightbox-attachment-css' => '4fc2a8f9',
'maniphest-task-summary-css' => '6b1fccc6',
'maniphest-transaction-detail-css' => '6b1fccc6',
'phabricator-busy' => '95ceba95',
'phabricator-content-source-view-css' => '8aaacd1b',
- 'phabricator-core-buttons-css' => '20f728ee',
- 'phabricator-core-css' => '20f728ee',
- 'phabricator-crumbs-view-css' => '20f728ee',
- 'phabricator-directory-css' => '20f728ee',
+ 'phabricator-core-buttons-css' => '4fc2a8f9',
+ 'phabricator-core-css' => '4fc2a8f9',
+ 'phabricator-crumbs-view-css' => '4fc2a8f9',
+ 'phabricator-directory-css' => '4fc2a8f9',
'phabricator-drag-and-drop-file-upload' => '322728f3',
'phabricator-dropdown-menu' => '95ceba95',
'phabricator-file-upload' => '95ceba95',
- 'phabricator-filetree-view-css' => '20f728ee',
- 'phabricator-flag-css' => '20f728ee',
- 'phabricator-form-view-css' => '20f728ee',
- 'phabricator-header-view-css' => '20f728ee',
- 'phabricator-jump-nav' => '20f728ee',
+ 'phabricator-filetree-view-css' => '4fc2a8f9',
+ 'phabricator-flag-css' => '4fc2a8f9',
+ 'phabricator-form-view-css' => '4fc2a8f9',
+ 'phabricator-header-view-css' => '4fc2a8f9',
+ 'phabricator-jump-nav' => '4fc2a8f9',
'phabricator-keyboard-shortcut' => '95ceba95',
'phabricator-keyboard-shortcut-manager' => '95ceba95',
- 'phabricator-main-menu-view' => '20f728ee',
+ 'phabricator-main-menu-view' => '4fc2a8f9',
'phabricator-menu-item' => '95ceba95',
- 'phabricator-nav-view-css' => '20f728ee',
+ 'phabricator-nav-view-css' => '4fc2a8f9',
'phabricator-notification' => '95ceba95',
- 'phabricator-notification-css' => '20f728ee',
- 'phabricator-notification-menu-css' => '20f728ee',
- 'phabricator-object-item-list-view-css' => '20f728ee',
+ 'phabricator-notification-css' => '4fc2a8f9',
+ 'phabricator-notification-menu-css' => '4fc2a8f9',
+ 'phabricator-object-item-list-view-css' => '4fc2a8f9',
'phabricator-object-selector-css' => '8aaacd1b',
'phabricator-paste-file-upload' => '95ceba95',
'phabricator-prefab' => '95ceba95',
'phabricator-project-tag-css' => '6b1fccc6',
- 'phabricator-remarkup-css' => '20f728ee',
+ 'phabricator-remarkup-css' => '4fc2a8f9',
'phabricator-shaped-request' => '322728f3',
- 'phabricator-side-menu-view-css' => '20f728ee',
- 'phabricator-standard-page-view' => '20f728ee',
+ 'phabricator-side-menu-view-css' => '4fc2a8f9',
+ 'phabricator-standard-page-view' => '4fc2a8f9',
'phabricator-textareautils' => '95ceba95',
'phabricator-tooltip' => '95ceba95',
- 'phabricator-transaction-view-css' => '20f728ee',
- 'phabricator-zindex-css' => '20f728ee',
- 'sprite-apps-large-css' => '20f728ee',
- 'sprite-gradient-css' => '20f728ee',
- 'sprite-icon-css' => '20f728ee',
- 'sprite-menu-css' => '20f728ee',
- 'syntax-highlighting-css' => '20f728ee',
+ 'phabricator-transaction-view-css' => '4fc2a8f9',
+ 'phabricator-zindex-css' => '4fc2a8f9',
+ 'sprite-apps-large-css' => '4fc2a8f9',
+ 'sprite-gradient-css' => '4fc2a8f9',
+ 'sprite-icon-css' => '4fc2a8f9',
+ 'sprite-menu-css' => '4fc2a8f9',
+ 'syntax-highlighting-css' => '4fc2a8f9',
),
));
@@ -1546,8 +1546,16 @@
'PhortunePaymentMethodQuery' => 'applications/phortune/query/PhortunePaymentMethodQuery.php',
'PhortunePaymentMethodViewController' => 'applications/phortune/controller/PhortunePaymentMethodViewController.php',
'PhortuneProduct' => 'applications/phortune/storage/PhortuneProduct.php',
+ 'PhortuneProductEditController' => 'applications/phortune/controller/PhortuneProductEditController.php',
+ 'PhortuneProductEditor' => 'applications/phortune/editor/PhortuneProductEditor.php',
+ 'PhortuneProductListController' => 'applications/phortune/controller/PhortuneProductListController.php',
+ 'PhortuneProductQuery' => 'applications/phortune/query/PhortuneProductQuery.php',
+ 'PhortuneProductTransaction' => 'applications/phortune/storage/PhortuneProductTransaction.php',
+ 'PhortuneProductTransactionQuery' => 'applications/phortune/query/PhortuneProductTransactionQuery.php',
+ 'PhortuneProductViewController' => 'applications/phortune/controller/PhortuneProductViewController.php',
'PhortunePurchase' => 'applications/phortune/storage/PhortunePurchase.php',
'PhortuneStripePaymentFormView' => 'applications/phortune/view/PhortuneStripePaymentFormView.php',
+ 'PhortuneUtil' => 'applications/phortune/util/PhortuneUtil.php',
'PhrictionActionConstants' => 'applications/phriction/constants/PhrictionActionConstants.php',
'PhrictionChangeType' => 'applications/phriction/constants/PhrictionChangeType.php',
'PhrictionConstants' => 'applications/phriction/constants/PhrictionConstants.php',
@@ -3200,7 +3208,18 @@
'PhortunePaymentMethodListController' => 'PhabricatorController',
'PhortunePaymentMethodQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhortunePaymentMethodViewController' => 'PhabricatorController',
- 'PhortuneProduct' => 'PhortuneDAO',
+ 'PhortuneProduct' =>
+ array(
+ 0 => 'PhortuneDAO',
+ 1 => 'PhabricatorPolicyInterface',
+ ),
+ 'PhortuneProductEditController' => 'PhabricatorController',
+ 'PhortuneProductEditor' => 'PhabricatorApplicationTransactionEditor',
+ 'PhortuneProductListController' => 'PhabricatorController',
+ 'PhortuneProductQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
+ 'PhortuneProductTransaction' => 'PhabricatorApplicationTransaction',
+ 'PhortuneProductTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
+ 'PhortuneProductViewController' => 'PhabricatorController',
'PhortunePurchase' => 'PhortuneDAO',
'PhortuneStripePaymentFormView' => 'AphrontView',
'PhrictionActionConstants' => 'PhrictionConstants',
@@ -43,6 +43,11 @@ public function getRoutes() {
'stripe/' => array(
'testpaymentform/' => 'PhortuneStripeTestPaymentFormController',
),
+ 'product/' => array(
+ '' => 'PhortuneProductListController',
+ 'view/(?P<id>\d+)/' => 'PhortuneProductViewController',
+ 'edit/(?:(?P<id>\d+)/)?' => 'PhortuneProductEditController',
+ ),
),
);
}
@@ -54,6 +54,7 @@ public function processRequest() {
$properties->addProperty(pht('Balance'), $account->getBalanceInCents());
$payment_methods = $this->buildPaymentMethodsSection($account);
+ $purchase_history = $this->buildPurchaseHistorySection($account);
$account_history = $this->buildAccountHistorySection($account);
return $this->buildApplicationPage(
@@ -63,6 +64,7 @@ public function processRequest() {
$actions,
$properties,
$payment_methods,
+ $purchase_history,
$account_history,
),
array(
@@ -136,6 +138,19 @@ private function buildPaymentMethodsSection(PhortuneAccount $account) {
);
}
+ private function buildPurchaseHistorySection(PhortuneAccount $account) {
+ $request = $this->getRequest();
+ $user = $request->getUser();
+
+ $header = id(new PhabricatorHeaderView())
+ ->setHeader(pht('Purchase History'));
+
+ return array(
+ $header,
+
+ );
+ }
+
private function buildAccountHistorySection(PhortuneAccount $account) {
$request = $this->getRequest();
$user = $request->getUser();
Oops, something went wrong.

0 comments on commit abdaf90

Please sign in to comment.