ish_models 0.0.33.258 → 0.0.33.259

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e1f1bed433ccb852de3a46410a673a4e4552b4f48221f4c286ca15f5b805689
4
- data.tar.gz: 180e91b85001dbdca3d42a7af78a5dabf7fb6b5aa5e92b153e75e5ac7b1d1e2b
3
+ metadata.gz: 434c9832f29b5dc7ac32419df75a2144df407572d654af9349730eb3ba72f532
4
+ data.tar.gz: adf60195f2ab27e2569883195553115b5c3d03f852452f5648bb96e19cd3fd7c
5
5
  SHA512:
6
- metadata.gz: ad31349efdde87b88e17797f250a3fc99e7c25fad9d1a38d061a8519f4773e0b30aa065371f9645f025d7390ce3bfecbda8742857139ad96077bcebb1580c8d4
7
- data.tar.gz: cc3390211ef7febde3b27b4f3bddd9dd4916e1bcd128cb6d5587b89c435bd6435002cafe05bd78ec4c09e812c040587d17db793d1384056273d27c83f09a8eff
6
+ metadata.gz: 8eff90b4979e39b82f502c9a95dbfaed444349bf1659f1f79e4325785863d6d28363e7c9639f963e61368760cdda0e082097028bdc11abd9ad43a56ead2c1953
7
+ data.tar.gz: 19b76388d5b8e12a6b2525586d350412b0e5cd04cc5844ca10b4e457a2d1dd131b085ddb90d6673dc0800f5a0faba0ccdd2c640d9b70ec9046e164e2137075e8
data/lib/ish/invoice.rb CHANGED
@@ -9,18 +9,27 @@ class Ish::Invoice
9
9
  include Mongoid::Timestamps
10
10
  include Mongoid::Autoinc
11
11
 
12
- store_in :collection => 'ish_invoice'
12
+ store_in collection: 'ish_invoice'
13
13
 
14
- field :email, :type => String
14
+ field :email, type: String
15
15
 
16
- field :number, :type => Integer
16
+ field :invoice_id, type: String # stripe
17
+
18
+ field :leadset_id, type: Integer
19
+ def leadset
20
+ Leadset.find leadset_id
21
+ end
22
+
23
+ field :number, type: Integer
17
24
  increments :number
18
25
 
19
- field :amount, :type => Integer
26
+ field :amount, type: Integer
20
27
 
21
28
  has_many :payments, :class_name => 'Ish::Payment'
22
- field :paid_amount, :type => Integer, :default => 0
29
+ field :paid_amount, type: Integer, :default => 0
30
+
31
+ field :description, type: String
23
32
 
24
- field :description, :type => String
33
+ field :items, type: Array
25
34
 
26
35
  end
@@ -17,7 +17,6 @@ class Ish::UserProfile
17
17
  validates_format_of :email,:with => /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
18
18
  validates_uniqueness_of :email
19
19
 
20
-
21
20
  field :name
22
21
 
23
22
  def export_fields
@@ -34,11 +33,16 @@ class Ish::UserProfile
34
33
  field :fb_expires_in
35
34
 
36
35
  field :lang, default: 'en'
36
+ field :leadset_id, type: Integer
37
+ def organization_name
38
+ 'Some Org'
39
+ # ::Leadset.find( leadset_id )&.name
40
+ end
37
41
 
38
- ROLES = [ :guy, :manager, :admin ]
39
42
  ROLE_GUY = :guy
40
43
  ROLE_MANAGER = :manager
41
44
  ROLE_ADMIN = :admin
45
+ ROLES = [ :guy, :manager, :admin ]
42
46
  field :role_name, :type => Symbol, default: :guy
43
47
 
44
48
  has_one :profile_photo, inverse_of: :profile_city, class_name: 'Photo'
@@ -57,7 +61,6 @@ class Ish::UserProfile
57
61
  has_many :newsitems, inverse_of: :profile
58
62
  has_and_belongs_to_many :friends, :class_name => '::Ish::UserProfile', inverse_of: :friendeds
59
63
  has_and_belongs_to_many :friendeds, :class_name => '::Ish::UserProfile', inverse_of: :friends
60
- belongs_to :organization, class_name: '::Wco::Organization', inverse_of: :profile
61
64
 
62
65
  def sudoer?
63
66
  %w( piousbox@gmail.com victor@wasya.co ).include?( self.email )
data/lib/ish_models.rb CHANGED
@@ -74,7 +74,7 @@ require 'office/email_message'
74
74
  require 'office/email_message_stub'
75
75
  require 'office/scheduled_email_action'
76
76
 
77
- require 'wco/organization'
77
+ # require 'wco/organization' ## Use leadset. _vp_ 2023-08-09
78
78
  require 'wco/product'
79
79
  require 'wco/subscription'
80
80
 
@@ -1,4 +1,7 @@
1
1
 
2
+ ##
3
+ ## @TODO: merge this into a Leadset (sql) _vp_ 2023-08-09
4
+ ##
2
5
  class Wco::Organization
3
6
  include Mongoid::Document
4
7
  include Mongoid::Timestamps
data/lib/wco/product.rb CHANGED
@@ -4,8 +4,19 @@ class Wco::Product
4
4
  include Mongoid::Timestamps
5
5
 
6
6
  field :name
7
+
7
8
  field :product_id # stripe
9
+ field :price_id # stripe
10
+
11
+ field :price_cents, type: Integer
12
+
13
+ INTERVALS = [ nil, 'day', 'week', 'month', 'year' ]
14
+ field :interval, type: String
8
15
 
9
16
  has_many :subscriptions, class_name: '::Wco::Subscription', inverse_of: :subscription
10
17
 
18
+ def self.list
19
+ [ [nil,nil] ] + self.all.map { |i| [i.name, i.price_id] }
20
+ end
21
+
11
22
  end
@@ -3,7 +3,7 @@ class Wco::Subscription
3
3
  include Mongoid::Document
4
4
  include Mongoid::Timestamps
5
5
 
6
- belongs_to :organization, class_name: '::Wco::Organization', inverse_of: :subscriptions
6
+ # belongs_to :organization, class_name: '::Wco::Organization', inverse_of: :subscriptions
7
7
  belongs_to :product, class_name: '::Wco::Product', inverse_of: :subscriptions
8
8
 
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.258
4
+ version: 0.0.33.259
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -171,7 +171,7 @@ files:
171
171
  - lib/photo.rb
172
172
  - lib/report.rb
173
173
  - lib/video.rb
174
- - lib/wco/organization.rb
174
+ - lib/wco/organization.rb-trash
175
175
  - lib/wco/product.rb
176
176
  - lib/wco/subscription.rb
177
177
  homepage: https://wasya.co