Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accounts and settlements #1596

Open
wants to merge 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
8afc6fe
Add accounts and settlements models
kyungmin Dec 23, 2014
a93e510
Add payable account page
kyungmin Dec 24, 2014
d75b715
Upadte settlement summary section
kyungmin Dec 26, 2014
bfa55b0
Rename files
kyungmin Dec 27, 2014
9f05f99
Display settlement table
kyungmin Dec 29, 2014
7af062d
Group transactions by settlement and order
kyungmin Dec 30, 2014
5ab79ee
Merge branch 'master' of https://github.com/balanced/balanced-dashboa…
kyungmin Dec 30, 2014
54e6beb
Filter out settled transactions in the unsettled transactions table
kyungmin Dec 30, 2014
c92ed75
Adjust the table column widths
kyungmin Jan 6, 2015
a9b44e4
Populate settled transaction IDs (incomplte)
kyungmin Jan 6, 2015
476c973
Fix table columns
kyungmin Jan 6, 2015
4b9d7e8
Merge branch 'master' of https://github.com/balanced/balanced-dashboa…
kyungmin Jan 6, 2015
947e7b5
Filter unsettled credits
kyungmin Jan 6, 2015
3ce3959
Group transactions by order by settlement
kyungmin Jan 8, 2015
13cd4b4
Beautify
kyungmin Jan 8, 2015
d1b3d6e
Add tabs in the customer page
kyungmin Jan 8, 2015
87d0e2f
Add tabs in the customer page
kyungmin Jan 8, 2015
b1d3233
Display payable account balance in the customer page
kyungmin Jan 8, 2015
3a3b010
Update search to include settlements
kyungmin Jan 8, 2015
ffd40fb
Update transactions grouped by order table
kyungmin Jan 8, 2015
a434c70
Polish accounts and settlements pages
kyungmin Jan 9, 2015
1003a93
Fix tables in the order page
kyungmin Jan 9, 2015
202206e
Increase the order icon size and fix alignments
kyungmin Jan 9, 2015
5fdfada
Merge branch 'master' of https://github.com/balanced/balanced-dashboa…
kyungmin Jan 12, 2015
056b6df
Update balanced addon model version
kyungmin Jan 13, 2015
e5cb42a
Update accounts and settlements tables
kyungmin Jan 13, 2015
0995ac2
Add regular settlement model
kyungmin Jan 14, 2015
767ccc0
Fix accounts/settlements results table by adding regular models
kyungmin Jan 14, 2015
a798d86
Add accounts to creditable funding instruments
kyungmin Jan 14, 2015
66ca248
Display internal accounts table on settings page
kyungmin Jan 14, 2015
575a2b7
Merge branch 'master' of https://github.com/balanced/balanced-dashboa…
kyungmin Jan 14, 2015
63d1ac1
Update balanced addon model version
kyungmin Jan 14, 2015
d5c1487
Combine orders and transactions tab
kyungmin Jan 15, 2015
4af6f83
Simplify payment method text in the transactions table
kyungmin Jan 15, 2015
be250bd
Display payment source and destination for all tables
kyungmin Jan 16, 2015
7c1ed2e
Display settlment payment methods
kyungmin Jan 16, 2015
7a1fb84
Refactor grouped transaction tables and update tests
kyungmin Jan 17, 2015
106c753
Update tests
kyungmin Jan 20, 2015
9579cb0
Display payable account balance in order summary section
kyungmin Jan 20, 2015
e43d9a8
Display correct payment icons in settlment summary section
kyungmin Jan 20, 2015
ce97c5d
Display merchant link in settlment summary section
kyungmin Jan 20, 2015
18c3a47
Replace old loading and delete icons
kyungmin Jan 20, 2015
ebfc235
Update search results tab
kyungmin Jan 21, 2015
1e139bc
Add filters to order transactions table
kyungmin Jan 22, 2015
df54635
Add empty orders page
kyungmin Jan 22, 2015
d20f887
Add empty orders page
kyungmin Jan 22, 2015
63adaa3
Improve the empty states
kyungmin Jan 22, 2015
49c121b
Add new icon to the settlement tab
kyungmin Jan 22, 2015
6e2ad54
Add empty settlement page
kyungmin Jan 22, 2015
d7e4105
Fixes #1631: Creating a debit automatically creates customers and order
kyungmin Jan 23, 2015
533f66e
Associate refunds and reversals to orders
kyungmin Jan 23, 2015
4f4d411
Display merchant's orders table in the customer page
kyungmin Jan 23, 2015
9057b3d
Use consistent description format
kyungmin Jan 23, 2015
01427a7
Merge branch 'master' of https://github.com/balanced/balanced-dashboa…
kyungmin Jan 23, 2015
8b4a1c9
Update customer activity labels
kyungmin Jan 24, 2015
2a72a27
Fixes #1631: Make debit this customer create orders automatically
kyungmin Jan 26, 2015
48842de
Fixes #1631: Always credit from orders
kyungmin Jan 26, 2015
715f6aa
Breakdown customer activity based on buyer and merchant role
kyungmin Jan 27, 2015
53f18f3
Fix broken redirect routes
kyungmin Jan 27, 2015
999e447
Allow one off credit without orders
kyungmin Jan 28, 2015
37e0d75
Refactor grouped transaction tables
kyungmin Jan 28, 2015
00ca405
Porting summary sections to using individual templates
cohitre Jan 28, 2015
78a5a18
Removing unused files
cohitre Jan 28, 2015
ed8db90
Display settlement in order and txn details page
kyungmin Jan 29, 2015
2e2f16a
Don't require order for credit bank account
kyungmin Jan 29, 2015
420cef2
fixing tests and readding edit description modal trigger
cohitre Jan 29, 2015
af6d075
Changelog
cohitre Jan 29, 2015
9abece1
Fix some tests
kyungmin Jan 29, 2015
ccf5ee2
Merge remote-tracking branch 'kk/accountsAndSettlements2' into accoun…
cohitre Jan 29, 2015
a7f8583
Making order use funding instrument view for displaying account
cohitre Jan 29, 2015
c8c0f09
Add debit into this order modal
kyungmin Jan 29, 2015
cff37ff
Merge pull request #17 from cohitre/accountsAndSettlements2
kyungmin Jan 29, 2015
cb00c6e
Fix add funds modal
kyungmin Jan 29, 2015
3335f46
Merge branch 'accountsAndSettlements2' of https://github.com/kyungmin…
kyungmin Jan 29, 2015
3f27552
Update summary section values
kyungmin Jan 29, 2015
1de34bf
Add maximum credit amount validation and clean up form section labels
kyungmin Jan 29, 2015
b3fceaa
Fixes #1634 & fixes #1572: Update 'on statement as' field
kyungmin Jan 30, 2015
ed80d70
Update payment method display in transactions table
kyungmin Jan 30, 2015
b0949bf
Fix some testsg
kyungmin Jan 30, 2015
521e860
Update order status
kyungmin Jan 30, 2015
854a1aa
Change order icon into status icon
kyungmin Jan 30, 2015
5adf61c
Update order status description
kyungmin Jan 30, 2015
ef0e0fb
Merge branch 'master' of https://github.com/balanced/balanced-dashboa…
kyungmin Jan 30, 2015
8249f72
Fix card modals
kyungmin Jan 31, 2015
623f532
Fix some tests
kyungmin Jan 31, 2015
81bb867
Fix some tests
kyungmin Jan 31, 2015
775a133
Shorten the cvv fields and fix tests
kyungmin Jan 31, 2015
a5ebef9
Fix bank account test
kyungmin Feb 2, 2015
edc17bc
Fix more tests
kyungmin Feb 17, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Brocfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var fonts = pickFiles('bower_components/strapped/static/fonts', {

var images = pickFiles('bower_components/strapped/static/images', {
srcDir: '/',
files: ['**/*.png', '**/*.gif'],
files: ['**/*.png'],
destDir: '/images'
});

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Balanced Dashboard Changelog


### master

* Refactoring how model sidebars are displayed
* Turning off marketplace application process temporarily
* Fixing restart verification button not showing after the wait period is over

### 1.2.1
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ module.exports = function(grunt) {
/*
grunt task commands
*/
grunt.registerTask('default', ['clean', 'bower', 'copy', 'exec:ember_server']);
grunt.registerTask('default', ['clean', 'copy', 'exec:ember_server']);
grunt.registerTask('test', ['bower:install', 'exec:ember_test']);
grunt.registerTask('build', ['bower:install', 'exec:ember_build_production']);
grunt.registerTask('deploy', ['admin:uninstall', 'build', 's3:productionCached', 's3:productionUncached']);
Expand Down
11 changes: 4 additions & 7 deletions app/controllers/marketplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,15 @@ var MarketplaceController = Ember.ObjectController.extend({
return this.get("auth.signedIn") && this.get("model");
}.property("auth.signedIn", "model"),

transactionSelected: isSelected('marketplace.transactions', 'credits', 'debits', 'holds', 'refunds', 'reversals'),
orderSelected: isSelected('marketplace.orders', 'orders'),
customerSelected: isSelected('marketplace.customers', 'customer'),
fundingInstrumentSelected: isSelected('marketplace.funding_instruments', 'bank_accounts', 'cards'),
orderSelected: isSelected('marketplace.orders', 'orders', 'credits', 'debits', 'holds', 'refunds', 'reversals'),
settlementSelected: isSelected('marketplace.settlements', 'settlement'),
disputeSelected: isSelected('marketplace.disputes', 'dispute'),
customerSelected: isSelected('marketplace.customers', 'customer'),
fundingInstrumentSelected: isSelected('marketplace.funding_instruments', 'bank_accounts', 'cards', 'account'),
logSelected: isSelected('marketplace.logs', 'log'),
invoiceSelected: isSelected('marketplace.invoices', 'invoice'),
settingSelected: isSelected('marketplace.settings'),

// Note: need this since bind-attr only works for a single property
paymentSelected: Ember.computed.or('transactionSelected', 'orderSelected'),

disputesResultsLoader: function() {
if (this.get("model")) {
return this.get('model').getDisputesLoader({
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/marketplace/import-payouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var MarketplaceImportPayoutsController = Ember.Controller.extend(Ember.Evented,
callback();
}
var count = collection.filterBy('isSaved').get('length');
self.transitionToRoute('marketplace.transactions');
self.transitionToRoute('marketplace.orders');

self.refresh('');
var message = '%@ payouts were successfully submitted. Payouts might take a couple seconds to appear in the transactions list.'.fmt(count);
Expand Down
10 changes: 10 additions & 0 deletions app/controllers/marketplace/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ var MarketplaceSettingsController = Ember.ObjectController.extend(actionsMixin,

ownerCustomer: Ember.computed.oneWay("marketplace.owner_customer"),

accountsResultsLoader: function() {
if (this.get("owner_customer")) {
return this.get("owner_customer").getAccountsLoader({
limit: 10
});
} else {
return this.get("container").lookup("results-loader:base");
}
}.property("owner_customer"),

fundingInstrumentsResultsLoader: function() {
if (this.get("owner_customer")) {
return this.get("owner_customer").getFundingInstrumentsLoader({
Expand Down
16 changes: 16 additions & 0 deletions app/controllers/marketplace/settlements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Ember from "ember";

var MarketplaceSettlementsController = Ember.ObjectController.extend({
needs: ['marketplace'],
resultsLoader: Ember.computed.oneWay("model"),
actions: {
changeDateFilter: function(startTime, endTime) {
this.get("resultsLoader").setProperties({
endTime: endTime,
startTime: startTime
});
},
}
});

export default MarketplaceSettlementsController;
17 changes: 7 additions & 10 deletions app/initializers/legacy-routes-initializer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ LegacyRoutesInitializer =
klass = createRedirectRoute(createArgs...)
container.register("route:#{name}", klass)

defineRoute("account", "customer", "account")
defineRoute("accounts", "marketplace.customer")
defineRoute("accounts.index", 'marketplace.customers', "accounts")

defineRoute("bank-account.index", 'activity.funding_instruments')
defineRoute("cards.index", "activity.funding_instruments")

defineRoute("marketplace-redirect-activity-transactions", "marketplace.transactions")
defineRoute("marketplace-redirect-activity-orders", "activity.orders")
defineRoute("marketplace-redirect-activity-customers", "marketplace.customers")
defineRoute("marketplace-redirect-activity-funding-instruments", "marketplace.funding-instruments")
defineRoute("marketplace-redirect-activity-disputes", "marketplace.disputes")
defineRoute("marketplace-redirect-invoices", "marketplace.invoices")
defineRoute("marketplace.redirect-activity-transactions", "marketplace.orders")
defineRoute("marketplace.redirect-transactions", "marketplace.orders")
defineRoute("marketplace.redirect-activity-orders", "marketplace.orders")
defineRoute("marketplace.redirect-activity-customers", "marketplace.customers")
defineRoute("marketplace.redirect-activity-funding-instruments", "marketplace.funding-instruments")
defineRoute("marketplace.redirect-activity-disputes", "marketplace.disputes")
defineRoute("marketplace.redirect-invoices", "marketplace.invoices")

`export default LegacyRoutesInitializer`
1 change: 1 addition & 0 deletions app/initializers/result-loaders-initializer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ LOADER_NAMES = [
"marketplace-search"
"orders"
"transactions"
"unsettled-transactions"
]

ResultLoadersInitializer =
Expand Down
1 change: 1 addition & 0 deletions app/initializers/type-mappings-initializer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ TypeMappingsInitializer =
TypeMappings.addTypeMapping(key, klass)

registerMapping "api_key", "api-key"
registerMapping "account"
registerMapping "bank_account", "bank-account"
registerMapping "bank-account", "bank-account"
registerMapping "bank_account_verification", "verification"
Expand Down
47 changes: 0 additions & 47 deletions app/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,53 +239,6 @@ var Utils = Ember.Namespace.create({
}
},

applyUriFilters: function(uri, params) {
if (!uri) {
return uri;
}

var transformedParams = ['limit', 'offset', 'sortField', 'sortOrder', 'minDate', 'maxDate', 'type', 'query'];

var filteringParams = {
limit: params.limit || 10,
offset: params.offset || 0
};

if (params.sortField && params.sortOrder && params.sortOrder !== 'none') {
filteringParams.sort = params.sortField + ',' + params.sortOrder;
}

if (params.minDate) {
filteringParams['created_at[>]'] = params.minDate.toISOString();
}
if (params.maxDate) {
filteringParams['created_at[<]'] = params.maxDate.toISOString();
}
if (params.type) {
switch (params.type) {
case 'search':
filteringParams['type[in]'] = Constants.SEARCH.SEARCH_TYPES.join(',');
break;
case 'transaction':
filteringParams['type[in]'] = Constants.SEARCH.TRANSACTION_TYPES.join(',');
break;
case 'funding_instrument':
filteringParams['type[in]'] = Constants.SEARCH.FUNDING_INSTRUMENT_TYPES.join(',');
break;
default:
filteringParams.type = params.type;
}
}
filteringParams.q = '';
if (params.query && params.query !== '%') {
filteringParams.q = params.query;
}

filteringParams = _.extend(filteringParams, _.omit(params, transformedParams));
filteringParams = Utils.sortDict(filteringParams);
return this.buildUri(uri, filteringParams);
},

buildUri: function(path, queryStringObject) {
var queryString = _.isString(queryStringObject) ?
queryStringObject :
Expand Down
24 changes: 24 additions & 0 deletions app/models/account.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
`import Ember from "ember";`
`import Model from "./core/model";`
`import Computed from "balanced-dashboard/utils/computed";`
`import Constants from "balanced-dashboard/utils/constants";`

Account = Model.extend(
routeName: "account"
route_name: "account"
isPayableAccount: Ember.computed.equal("type", "payable")
appears_on_statement_max_length: Constants.MAXLENGTH.APPEARS_ON_STATEMENT_BANK_ACCOUNT,

type_name: Ember.computed "type", ->
type = @get("type")

if type
"#{type.capitalize()} account"
else
"account"

description_with_type: Ember.computed "id", ->
"Payable account: #{@get("id")}"
)

`export default Account;`
20 changes: 20 additions & 0 deletions app/models/bk/account.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
`import Ember from "ember";`
`import BkAccount from "balanced-addon-models/models/account";`
`import Computed from "balanced-dashboard/utils/computed";`
`import BkUtils from "balanced-dashboard/utils/bk-utils";`

Account = BkAccount.extend(
routeName: "account",
route_name: "account",
isPayableAccount: Ember.computed.equal("type", "payable"),
type_name: (->
type = @get("type").capitalize()
"%@ account".fmt(type)
).property("type"),
description_with_type: Ember.computed("id", ->
"Payable account: #{@get("id")}"
),
toLegacyModel: BkUtils.generateToLegacyModelMethod("account")
)

`export default Account;`
9 changes: 6 additions & 3 deletions app/models/bk/bank-account.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
`import Ember from "ember";`
`import BankAccount from "balanced-addon-models/models/bank-account";`
`import BkBankAccount from "balanced-addon-models/models/bank-account";`
`import BkUtils from "balanced-dashboard/utils/bk-utils";`

BkBankAccount = BankAccount.extend(
BankAccount = BkBankAccount.extend(
routeName: "bank_accounts"
toLegacyModel: BkUtils.generateToLegacyModelMethod("bank_account")
)

`export default BkBankAccount;`
`export default BankAccount;`
2 changes: 1 addition & 1 deletion app/models/bk/customer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
`import BkCustomer from "balanced-addon-models/models/customer";`

Customer = BkCustomer.extend(
routeName: "customer"
routeName: "customer",
)

`export default Customer;`
13 changes: 13 additions & 0 deletions app/models/bk/settlement.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
`import Ember from "ember";`
`import Utils from "balanced-dashboard/lib/utils";`
`import BkSettlement from "balanced-addon-models/models/settlement";`

Settlement = BkSettlement.extend(
routeName: "settlement",
type_name: "Settlement",
amountInDollars: (->
"$%@".fmt(Utils.centsToDollars(@get("amount")))
).property("amount")
)

`export default Settlement;`
18 changes: 0 additions & 18 deletions app/models/card-validatable.coffee

This file was deleted.

Loading