cats_core 1.0.0 → 1.0.4
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 +4 -4
- data/app/models/cats/core/menu.rb +1 -0
- data/app/models/cats/core/notification.rb +7 -0
- data/app/models/cats/core/role.rb +1 -0
- data/app/models/cats/core/user.rb +2 -0
- data/app/services/cats/core/token_auth_service.rb +20 -0
- data/db/migrate/20210724074657_create_cats_core_notifications.rb +13 -0
- data/lib/cats/core/version.rb +1 -1
- data/lib/cats_core.rb +1 -0
- data/spec/factories/cats/core/notifications.rb +8 -0
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d2e957d3c24b295e163776c3ecd67c21e16877687a0c2f4682be641ea2278a5
|
4
|
+
data.tar.gz: 1230cf3469e3a2943cad4e91d229e5aefb110f84e459b741022e28d91b099c62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0b8e1139d6a14e4afc0c49914b2d1cc1f9fe4e6e180410cb15368160f7705ab76665bb8805f37d538207f14d92126a20a70cc7ccbce1b6c4380025a15f06a30
|
7
|
+
data.tar.gz: 9e1dc4a4ecfd31ce032e64111a5d0d21f4c89a70e0732cfcba688e1e90804e2a9c8cea50ec8a602b7d73fed7d968117ea83c44a0538e436bc4584513823e0b61
|
@@ -5,6 +5,8 @@ module Cats
|
|
5
5
|
rolify
|
6
6
|
|
7
7
|
belongs_to :application_module
|
8
|
+
has_and_belongs_to_many :roles, join_table: :cats_core_users_cats_core_roles
|
9
|
+
has_many :notifications, as: :recipient
|
8
10
|
|
9
11
|
validates :first_name, :last_name, :email, presence: true
|
10
12
|
validates :password, length: { minimum: 6 }
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class TokenAuthService
|
4
|
+
AUTH_SECRET = '592fac227e8ee4ff985e376d554604f36c974b4f4605eb8d7ebe4dd1cf8fd8aa8e0cb85df1b48a8ec60cac7bb4117d854'\
|
5
|
+
'5c359123e14f6784dcd88e6e6a1ea8c'.freeze
|
6
|
+
|
7
|
+
def self.issue(payload)
|
8
|
+
JWT.encode(payload, auth_secret, 'HS256')
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.decode(token)
|
12
|
+
JWT.decode(token, auth_secret, true, algorithm: 'HS256').first
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.auth_secret
|
16
|
+
AUTH_SECRET
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateCatsCoreNotifications < ActiveRecord::Migration[6.1]
|
2
|
+
def change
|
3
|
+
create_table :cats_core_notifications do |t|
|
4
|
+
t.references :recipient, polymorphic: true, null: false
|
5
|
+
t.string :type
|
6
|
+
t.jsonb :params
|
7
|
+
t.datetime :read_at
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :cats_core_notifications, :read_at
|
12
|
+
end
|
13
|
+
end
|
data/lib/cats/core/version.rb
CHANGED
data/lib/cats_core.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cats_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ancestry
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.2.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: noticed
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rails
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,6 +212,7 @@ files:
|
|
198
212
|
- app/models/cats/core/location.rb
|
199
213
|
- app/models/cats/core/menu.rb
|
200
214
|
- app/models/cats/core/menu_item.rb
|
215
|
+
- app/models/cats/core/notification.rb
|
201
216
|
- app/models/cats/core/program.rb
|
202
217
|
- app/models/cats/core/role.rb
|
203
218
|
- app/models/cats/core/role_menu.rb
|
@@ -208,6 +223,7 @@ files:
|
|
208
223
|
- app/models/cats/core/user.rb
|
209
224
|
- app/models/cats/core/way_bill.rb
|
210
225
|
- app/models/cats/core/way_bill_item.rb
|
226
|
+
- app/services/cats/core/token_auth_service.rb
|
211
227
|
- config/routes.rb
|
212
228
|
- db/migrate/20210715114238_create_cats_core_application_modules.rb
|
213
229
|
- db/migrate/20210715114910_create_cats_core_users.rb
|
@@ -227,6 +243,7 @@ files:
|
|
227
243
|
- db/migrate/20210718045516_create_cats_core_way_bills.rb
|
228
244
|
- db/migrate/20210718050751_create_cats_core_way_bill_items.rb
|
229
245
|
- db/migrate/20210718202957_create_cats_core_commodity_transactions.rb
|
246
|
+
- db/migrate/20210724074657_create_cats_core_notifications.rb
|
230
247
|
- lib/cats/core.rb
|
231
248
|
- lib/cats/core/engine.rb
|
232
249
|
- lib/cats/core/version.rb
|
@@ -240,6 +257,7 @@ files:
|
|
240
257
|
- spec/factories/cats/core/locations.rb
|
241
258
|
- spec/factories/cats/core/menu_items.rb
|
242
259
|
- spec/factories/cats/core/menus.rb
|
260
|
+
- spec/factories/cats/core/notifications.rb
|
243
261
|
- spec/factories/cats/core/programs.rb
|
244
262
|
- spec/factories/cats/core/role_menus.rb
|
245
263
|
- spec/factories/cats/core/roles.rb
|