ish_models 0.0.33.258 → 0.0.33.260
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 +7 -3
- data/lib/ish_models.rb +1 -1
- data/lib/office/email_conversation.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: 6291450aa3af2a529bc54e193556c1463ee7cfaad5161ad2e777cfe39c09b9dd
|
4
|
+
data.tar.gz: 36613413540c6348a4b752b1c1d3b32c6ff0d4f00023a92e398a45db1bcea500
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 786129d1e89cff3d9584f90a031421a2bd491780a47c9cc2043d4ab8f38219bb86f5f14447682f697ad9efb69d43c5afce4ad0bc5a6be5549038c151dd70f8e2
|
7
|
+
data.tar.gz: f25a822b37ae6f9209318e7c550600792921fa9c82e8561a06563d2f9d3f6f6ddfcd8565063da20d66a6121dd2a8781ac4666e16855795cd589d68dd2c4446bb
|
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 )
|
@@ -82,6 +85,7 @@ class Ish::UserProfile
|
|
82
85
|
|
83
86
|
field :is_purchasing, type: Boolean, default: false
|
84
87
|
|
88
|
+
field :customer_id # stripe
|
85
89
|
|
86
90
|
# used in rake tasks
|
87
91
|
def self.generate delta
|
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.260
|
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
|