ish_manager 0.1.8.451 → 0.1.8.452

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba59c20a5d3690b618e806310714a938247c560185b157c23864de32b5fd0d56
4
- data.tar.gz: a4b2b75980173a70c910334529756d7d0b665b179ef14331be373305d2007c19
3
+ metadata.gz: 07f21609640dbe8208ee3874d6b249430abcdded538d3885a99a79ca8e7c6e53
4
+ data.tar.gz: 5e0a1d0c3b190ad641e71aae2f1fac1fda1d55e880d560dc7e7038754ec96a04
5
5
  SHA512:
6
- metadata.gz: 406373e09e49ebf65537a4e610f28c335e0c382abbed7cb8b258a5de2d2046acfb5c46fd6ceffc0da33c5965cd5de031489c5368c2e8a0fb321c9157ac2611f8
7
- data.tar.gz: bfe9e7d67f626cbd26154fdbd1e1080774ff757754d1c84fa9b8d57f09f1a47dfd31f4d8650fa109df16ceda727b8d1370afa4185deb0e28558c1cd7e1503932
6
+ metadata.gz: 277b32101ba85d7efd36bd68a0841e8eae8711a777573de6082eac2ec9733d0ce0c391bbdb9ec45c7a0adf4c0b9dffb8ea7f230bb8fd46ac72e31ed1ab7fe3c7
7
+ data.tar.gz: 4d7d19ca7e698415d7a32b5c2ea6ffa5590a647012691f1bfd877b8c8aa65412651e91e17d68abe3782299cd82a9713019c8b97a8d3ef97274e02429fc46ad0e
@@ -92,7 +92,8 @@ ul:not(.browser-default).bullets, {
92
92
  }
93
93
  .application-home {
94
94
  .bordered-card {
95
- max-width: 400px;
95
+ display: inline-block;
96
+ // max-width: 400px;
96
97
  }
97
98
  }
98
99
 
@@ -39,11 +39,6 @@ class ::IshManager::IroPursesController < IshManager::ApplicationController
39
39
  authorize! :my, @purse
40
40
 
41
41
  @strategies = Iro::CoveredCallStrategy.all
42
- @current_underlying_strike = @strategies[0].current_underlying_strike
43
- underlyings = Tda::Stock.get_quotes( @strategies.map(&:ticker).compact.uniq.join(",") )
44
- underlyings.each do |ticker, v|
45
- Iro::CoveredCallStrategy.where( ticker: ticker ).update( current_underlying_strike: v[:mark] )
46
- end
47
42
 
48
43
  if params[:statuses]
49
44
  @positions = @purse.positions.where( :status.in => params[:statuses].split(',') )
@@ -51,7 +46,11 @@ class ::IshManager::IroPursesController < IshManager::ApplicationController
51
46
  @positions = @purse.positions
52
47
  end
53
48
  @positions = @positions.order({ expires_on: :asc, strike: :asc })
54
- @positions.map &:refresh
49
+ # @positions.map do |p|
50
+ # if p[:status] == 'active'
51
+ # # p.refresh
52
+ # end
53
+ # end
55
54
 
56
55
  render params[:kind] || @purse.parsed_config[:kind] || 'show'
57
56
  end
@@ -59,7 +58,7 @@ class ::IshManager::IroPursesController < IshManager::ApplicationController
59
58
  def roll_prep
60
59
  @strategies = Iro::CoveredCallStrategy.all
61
60
  @position = Iro::Position.find params[:id]
62
- puts! @position, '@position'
61
+ # puts! @position, '@position'
63
62
  @positions = [ @position ]
64
63
  @purse = @position.purse
65
64
  @strategy = @position.strategy
@@ -0,0 +1,15 @@
1
+
2
+ class IshManager::ProductsController < IshManager::ApplicationController
3
+
4
+ before_action :set_lists
5
+
6
+ # alphabetized : )
7
+
8
+ def index
9
+ authorize! :index, Wco::Product
10
+ Stripe.api_key = ::STRIPE_SK
11
+ Stripe.api_version = '2020-08-27'
12
+ @products = Stripe::Product.list().data
13
+ end
14
+
15
+ end
@@ -0,0 +1,19 @@
1
+
2
+ class IshManager::SubscriptionsController < IshManager::ApplicationController
3
+
4
+ before_action :set_lists
5
+
6
+ # alphabetized : )
7
+
8
+ def index
9
+ authorize! :index, Wco::Subscription
10
+
11
+ Stripe.api_key = ::STRIPE_SK
12
+ Stripe.api_version = '2020-08-27'
13
+ @customers = Stripe::Customer.list().data
14
+ @users = User.all
15
+ @organizations = Wco::Organization.all()
16
+ @subscriptions = Stripe::Subscription.list().data
17
+ end
18
+
19
+ end
@@ -74,5 +74,14 @@ module IshManager
74
74
  a ? 'Y' : '-'
75
75
  end
76
76
 
77
+ def pp_list inns
78
+ out = "<ul>"
79
+ inns.each do |inn|
80
+ out = "#{out}<li>#{inn}</li>"
81
+ end
82
+ out = "#{out}</ul>"
83
+ return raw out
84
+ end
85
+
77
86
  end
78
87
  end
@@ -103,15 +103,27 @@
103
103
  Iro Wor
104
104
  .a
105
105
  %ul
106
+
107
+ %li
108
+ = link_to 'Watches', iro_watches_path
109
+ %li
110
+ = link_to 'Plots', 'http://localhost:3000/iron_warbler/NOPE-1', target: '_blank'
106
111
  %li
107
112
  = link_to 'Purses', iro_purses_path
108
113
  - Iro::Purse.all.map do |p|
109
- = link_to "[#{p.id} show]", iro_purse_path(p)
110
- = link_to "[#{p.id} gui]", iro_purse_path({ id: p.id, kind: 'show_gameui' })
114
+ = "[#{p.id}"
115
+ = link_to "show", iro_purse_path(p)
116
+ = link_to "gui", iro_purse_path({ id: p.id, kind: 'show_gameui' })
117
+ = "]"
111
118
  = link_to '[+]', new_iro_purse_path
119
+ .c
120
+
121
+ %i.fa.fa-compress.collapse-expand#collapseHeaderWco
122
+ Wco
123
+ .a
124
+ %ul
112
125
  %li
113
- = link_to 'Watches', iro_watches_path
126
+ = link_to 'Products & Prices', products_path
114
127
  %li
115
- = link_to 'Plots', 'http://localhost:3000/iron_warbler/NOPE-1', target: '_blank'
128
+ = link_to 'Customers & Subscriptions', subscriptions_path
116
129
  .c
117
-
@@ -1,6 +1,6 @@
1
1
 
2
2
  .application-home.max-width
3
- Welcome home
3
+ %h5 Welcome home
4
4
 
5
5
  .bordered-card
6
6
  = form_tag "https://www.cgtrader.com/free-3d-models", method: :get, target: :_blank do
@@ -14,3 +14,19 @@
14
14
  %p Search Youtube:
15
15
  = text_field_tag "search_query"
16
16
  = submit_tag 'search'
17
+
18
+ .bordered-card
19
+ %h5.center.text-center USD to COP
20
+ #root{ width: 500, height: 300 }
21
+ %script{src: "/recharts-example-out.js", type: "module"}
22
+ %script{type: "module"}
23
+
24
+
25
+ import App from '/recharts-example-out.js';
26
+
27
+ const el = document.querySelector('#root')
28
+ const e = React.createElement;
29
+
30
+ const domContainer = document.querySelector('#root');
31
+ const root = ReactDOM.createRoot(domContainer);
32
+ root.render(e(App));
@@ -25,13 +25,5 @@
25
25
  .iro-strategy.item= render 'ish_manager/iro_strategies/form', strategy: strat
26
26
  .c
27
27
 
28
- .iro-position-statuses-selector
29
- = form_tag( {}, { method: :get } ) do
30
- - if !params[:statuses]
31
- - params[:statuses] = ::Iro::Position::STATUSES
32
- - ::Iro::Position::STATUSES.each do |status|
33
- .field
34
- %label= status
35
- = check_box_tag "statuses[]", status, params[:statuses].include?( status )
36
- = submit_tag 'Submit'
28
+
37
29
 
@@ -1,10 +1,20 @@
1
1
 
2
- .iro-purses--show
2
+ .iro-purses--show.padded
3
3
 
4
4
  %h5.collapse-expand#positions
5
5
  Positions (#{@positions.length})
6
6
  = link_to '[+]', new_iro_position_path({ iro_purse_id: @purse.id })
7
7
  .positions
8
+ .iro-position-statuses-selector
9
+ = form_tag( {}, { method: :get } ) do
10
+ - if !params[:statuses]
11
+ - params[:statuses] = ::Iro::Position::STATUSES
12
+ - ::Iro::Position::STATUSES.each do |status|
13
+ .field
14
+ %label= status
15
+ = check_box_tag "statuses[]", status, params[:statuses].include?( status )
16
+ = submit_tag 'Submit'
17
+
8
18
  %table.bordered
9
19
  %thead
10
20
  %tr
@@ -58,8 +68,10 @@
58
68
  - @positions.each_with_index do |p, idx|
59
69
  - if idx > 0 && @positions[idx-1][:expires_on] != p[:expires_on]
60
70
  %tr
61
- %td
62
- %hr
71
+ %td{ colspan: 30, style: "background: #eee;" }
72
+ -# %hr
73
+ &nbsp;
74
+
63
75
  %tr
64
76
  %td.id
65
77
  = p.id
@@ -88,12 +100,19 @@
88
100
  %td= (p.expires_on.to_date - p.opened_on).to_i
89
101
  %td.must-roll= pp_bool p.must_roll?
90
102
  %td.should-roll
91
- .aC
92
- .a= p.should_rollp ? p.should_rollp : '-'
93
- .a= pp_bool p.should_roll?
94
- %td.next-symbol= p.next_symbol
95
- %td.next-delta= p.next_position[:delta]
96
- %td.next-outcome= pp_money p.next_outcome
97
- %td.status= p.status
103
+ .a= p.should_rollp
104
+ %td.next-symbol
105
+ = p.next_symbol
106
+ %td.next-delta
107
+ = p.next_position[:delta]
108
+ %td.next-outcome
109
+ = pp_money p.next_outcome
110
+ %td.status
111
+ = p.status
112
+ - if p.next_reasons.length > 1 ## @TODO: this is messy, remove _vp_ 2023-08-05
113
+ %tr
114
+ %td{ colspan: 30 }
115
+ Next Reasons: #{pp_list p.next_reasons}
116
+
98
117
 
99
118
 
@@ -0,0 +1,7 @@
1
+
2
+ .products-index.max-width
3
+ %h5 Products
4
+
5
+ %ul
6
+ - @products.each do |product|
7
+ %li= product.name
@@ -0,0 +1,46 @@
1
+
2
+ .container.subscriptions-index.padded
3
+ .row
4
+ .col-md-6
5
+
6
+ %h5 Stripe Customers
7
+ %ul
8
+ - @customers.each do |customer|
9
+ %li
10
+ %ul
11
+ %li <b>Email:</b> #{customer.email}
12
+ %li <b>customer_id:</b> #{customer.id}
13
+ %li
14
+ <b>Subscriptions:</b>
15
+ %ul
16
+ - @subscriptions.each do |sub|
17
+ - if sub.customer == customer.id
18
+ %li= sub.items.data[0].plan.product
19
+
20
+ .col-md-6
21
+ %h5 Wco Users
22
+ %ul
23
+ - @users.each do |user|
24
+ %li
25
+ = user.email
26
+ %ul
27
+ %li <b>profile:</b> #{user.profile.email}
28
+ %li <b>organization:</b> #{user.profile.organization.name}, customer_id: #{user.profile.organization.customer_id}
29
+ %li <b>subscriptions:</b> #{user.profile.organization.subscriptions.inspect}
30
+ %hr
31
+ %h5 Wco Organizations
32
+ %ul
33
+ - @organizations.each do |org|
34
+ %li
35
+ = org.name
36
+ %ul
37
+ %li <b>customer_id:</b> #{org.customer_id}
38
+ -# %li <b>organization:</b> #{user.profile.organization.name}, customer_id: #{user.profile.organization.customer_id}
39
+ -# %li <b>subscriptions:</b> #{user.profile.organization.subscriptions.inspect}
40
+
41
+ %hr
42
+ %h5 Subscriptions
43
+ %ul
44
+ - @subscriptions.each do |sub|
45
+ %li= sub.inspect
46
+
@@ -36,6 +36,11 @@
36
36
  = stylesheet_link_tag "ish_manager/application", media: "all"
37
37
  = javascript_include_tag "ish_manager/application"
38
38
 
39
+ %script{crossorigin: "", src: "https://unpkg.com/react@18/umd/react.development.js"}
40
+ %script{crossorigin: "", src: "https://unpkg.com/react-dom@18/umd/react-dom.development.js"}
41
+ %script{src: "https://unpkg.com/prop-types@15.6/prop-types.min.js"}
42
+ %script{src: "https://unpkg.com/recharts/umd/Recharts.js"}
43
+
39
44
  = csrf_meta_tags
40
45
  %body{ class: [ params[:controller].gsub("ish_manager/",""), "#{params[:controller].gsub("ish_manager/","")}-#{params[:action]}", params[:action], "application-fullwidth" ] }
41
46
 
data/config/routes.rb CHANGED
@@ -119,10 +119,12 @@ IshManager::Engine.routes.draw do
119
119
 
120
120
  resources :photos
121
121
  resources :payments
122
+ resources :products
122
123
 
123
124
  resources :reports
124
125
 
125
126
  resources :scheduled_email_actions
127
+ resources :subscriptions
126
128
 
127
129
  resources :user_profiles do
128
130
  resources :newsitems
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.451
4
+ version: 0.1.8.452
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-05 00:00:00.000000000 Z
11
+ date: 2023-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -477,8 +477,10 @@ files:
477
477
  - app/controllers/ish_manager/office_actions_controller.rb
478
478
  - app/controllers/ish_manager/payments_controller.rb
479
479
  - app/controllers/ish_manager/photos_controller.rb
480
+ - app/controllers/ish_manager/products_controller.rb
480
481
  - app/controllers/ish_manager/reports_controller.rb
481
482
  - app/controllers/ish_manager/scheduled_email_actions_controller.rb
483
+ - app/controllers/ish_manager/subscriptions_controller.rb
482
484
  - app/controllers/ish_manager/user_profiles_controller.rb
483
485
  - app/controllers/ish_manager/videos_controller.rb
484
486
  - app/helpers/ish_manager/application_helper.rb
@@ -727,6 +729,7 @@ files:
727
729
  - app/views/ish_manager/photos/new.haml
728
730
  - app/views/ish_manager/photos/show.haml
729
731
  - app/views/ish_manager/photos/without_gallery.haml
732
+ - app/views/ish_manager/products/index.haml
730
733
  - app/views/ish_manager/reports/_form.haml
731
734
  - app/views/ish_manager/reports/_index.haml
732
735
  - app/views/ish_manager/reports/_show_mini.haml
@@ -741,6 +744,7 @@ files:
741
744
  - app/views/ish_manager/scheduled_email_actions/index.haml
742
745
  - app/views/ish_manager/scheduled_email_actions/new.haml
743
746
  - app/views/ish_manager/scheduled_email_actions/show.haml
747
+ - app/views/ish_manager/subscriptions/index.haml
744
748
  - app/views/ish_manager/trash/email_campaigns-trash/_form.haml
745
749
  - app/views/ish_manager/trash/email_campaigns-trash/edit.haml
746
750
  - app/views/ish_manager/trash/email_campaigns-trash/index.haml