ish_models 0.0.33.258 → 0.0.33.259
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ish/invoice.rb +15 -6
- data/lib/ish/user_profile.rb +6 -3
- data/lib/ish_models.rb +1 -1
- data/lib/wco/{organization.rb → organization.rb-trash} +3 -0
- data/lib/wco/product.rb +11 -0
- data/lib/wco/subscription.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 434c9832f29b5dc7ac32419df75a2144df407572d654af9349730eb3ba72f532
|
4
|
+
data.tar.gz: adf60195f2ab27e2569883195553115b5c3d03f852452f5648bb96e19cd3fd7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
12
|
+
store_in collection: 'ish_invoice'
|
13
13
|
|
14
|
-
field :email, :
|
14
|
+
field :email, type: String
|
15
15
|
|
16
|
-
field :
|
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, :
|
26
|
+
field :amount, type: Integer
|
20
27
|
|
21
28
|
has_many :payments, :class_name => 'Ish::Payment'
|
22
|
-
field :paid_amount, :
|
29
|
+
field :paid_amount, type: Integer, :default => 0
|
30
|
+
|
31
|
+
field :description, type: String
|
23
32
|
|
24
|
-
field :
|
33
|
+
field :items, type: Array
|
25
34
|
|
26
35
|
end
|
data/lib/ish/user_profile.rb
CHANGED
@@ -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
|
|
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
|
data/lib/wco/subscription.rb
CHANGED
@@ -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.
|
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
|