├── .gitignore ├── .graphiticfg.yml ├── .rspec ├── .tool-versions ├── Gemfile ├── Gemfile.lock ├── README.md ├── Rakefile ├── app ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── controllers │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ ├── departments_controller.rb │ ├── employees_controller.rb │ ├── milestones_controller.rb │ ├── notes_controller.rb │ ├── positions_controller.rb │ ├── tasks_controller.rb │ └── teams_controller.rb ├── jobs │ └── application_job.rb ├── mailers │ └── application_mailer.rb ├── models │ ├── application_record.rb │ ├── bug.rb │ ├── concerns │ │ └── .keep │ ├── department.rb │ ├── employee.rb │ ├── epic.rb │ ├── feature.rb │ ├── milestone.rb │ ├── note.rb │ ├── position.rb │ ├── task.rb │ ├── team.rb │ └── team_membership.rb ├── resources │ ├── application_resource.rb │ ├── bug_resource.rb │ ├── department_resource.rb │ ├── employee_resource.rb │ ├── epic_resource.rb │ ├── feature_resource.rb │ ├── milestone_resource.rb │ ├── note_resource.rb │ ├── position_resource.rb │ ├── task_resource.rb │ └── team_resource.rb └── views │ └── layouts │ ├── mailer.html.erb │ └── mailer.text.erb ├── bin ├── bundle ├── rails ├── rake ├── rspec ├── setup ├── spring └── update ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cable.yml ├── credentials.yml.enc ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── application_controller_renderer.rb │ ├── backtrace_silencers.rb │ ├── cors.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ └── wrap_parameters.rb ├── locales │ └── en.yml ├── puma.rb ├── routes.rb ├── spring.rb └── storage.yml ├── db ├── migrate │ ├── 20180903174755_create_employees.rb │ ├── 20180903175706_create_positions.rb │ ├── 20180904115831_create_departments.rb │ ├── 20180904120042_add_department_id_to_positions.rb │ ├── 20180904123419_create_teams.rb │ ├── 20180904123442_create_team_memberships.rb │ ├── 20180904141521_create_notes.rb │ ├── 20180904143550_create_tasks.rb │ └── 20180904143830_create_milestones.rb ├── schema.rb └── seeds.rb ├── lib └── tasks │ └── .keep ├── log └── .keep ├── public ├── api │ └── v1 │ │ ├── schema.json │ │ └── vandal │ │ ├── assets │ │ └── img │ │ │ └── squares.png │ │ ├── css │ │ ├── app.59d17783.css │ │ └── chunk-vendors.e6a6ca22.css │ │ ├── favicon.ico │ │ ├── index.html │ │ └── js │ │ ├── app.d38ac258.js │ │ ├── app.d38ac258.js.map │ │ ├── app.f85601e5.js │ │ ├── app.f85601e5.js.map │ │ ├── chunk-vendors.326f67bb.js │ │ └── chunk-vendors.326f67bb.js.map └── robots.txt ├── spec ├── api │ └── v1 │ │ ├── departments │ │ ├── create_spec.rb │ │ ├── destroy_spec.rb │ │ ├── index_spec.rb │ │ ├── show_spec.rb │ │ └── update_spec.rb │ │ ├── employees │ │ ├── create_spec.rb │ │ ├── destroy_spec.rb │ │ ├── index_spec.rb │ │ ├── show_spec.rb │ │ └── update_spec.rb │ │ ├── milestones │ │ ├── create_spec.rb │ │ ├── destroy_spec.rb │ │ ├── index_spec.rb │ │ ├── show_spec.rb │ │ └── update_spec.rb │ │ ├── notes │ │ ├── create_spec.rb │ │ ├── destroy_spec.rb │ │ ├── index_spec.rb │ │ ├── show_spec.rb │ │ └── update_spec.rb │ │ ├── positions │ │ ├── create_spec.rb │ │ ├── destroy_spec.rb │ │ ├── index_spec.rb │ │ ├── show_spec.rb │ │ └── update_spec.rb │ │ ├── tasks │ │ ├── create_spec.rb │ │ ├── destroy_spec.rb │ │ ├── index_spec.rb │ │ ├── show_spec.rb │ │ └── update_spec.rb │ │ └── teams │ │ ├── create_spec.rb │ │ ├── destroy_spec.rb │ │ ├── index_spec.rb │ │ ├── show_spec.rb │ │ └── update_spec.rb ├── factories │ ├── departments.rb │ ├── employees.rb │ ├── milestones.rb │ ├── notes.rb │ ├── positions.rb │ ├── tasks.rb │ ├── team_memberships.rb │ └── teams.rb ├── models │ └── position_spec.rb ├── rails_helper.rb ├── resources │ ├── department │ │ ├── reads_spec.rb │ │ └── writes_spec.rb │ ├── employee │ │ ├── reads_spec.rb │ │ └── writes_spec.rb │ ├── milestone │ │ ├── reads_spec.rb │ │ └── writes_spec.rb │ ├── note │ │ ├── reads_spec.rb │ │ └── writes_spec.rb │ ├── position │ │ ├── reads_spec.rb │ │ └── writes_spec.rb │ ├── task │ │ ├── reads_spec.rb │ │ └── writes_spec.rb │ └── team │ │ ├── reads_spec.rb │ │ └── writes_spec.rb └── spec_helper.rb ├── storage └── .keep ├── tmp └── .keep └── vendor └── .keep /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore uploaded files in development 21 | /storage/* 22 | !/storage/.keep 23 | 24 | .byebug_history 25 | 26 | # Ignore master key for decrypting credentials and more. 27 | /config/master.key 28 | -------------------------------------------------------------------------------- /.graphiticfg.yml: -------------------------------------------------------------------------------- 1 | --- 2 | namespace: "/api/v1" 3 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | ruby 3.3.7 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby '3.3.7' 5 | 6 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7 | gem 'rails', '~> 8.0.2' 8 | # Use sqlite3 as the database for Active Record 9 | gem 'sqlite3' 10 | # Use Puma as the app server 11 | gem 'puma' 12 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 13 | # gem 'jbuilder', '~> 2.5' 14 | # Use Redis adapter to run Action Cable in production 15 | # gem 'redis', '~> 4.0' 16 | # Use ActiveModel has_secure_password 17 | # gem 'bcrypt', '~> 3.1.7' 18 | 19 | # Use ActiveStorage variant 20 | # gem 'mini_magick', '~> 4.8' 21 | 22 | # Use Capistrano for deployment 23 | # gem 'capistrano-rails', group: :development 24 | 25 | # Reduces boot times through caching; required in config/boot.rb 26 | gem 'bootsnap', require: false 27 | 28 | # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible 29 | gem 'rack-cors' 30 | 31 | group :development, :test do 32 | # Call 'byebug' anywhere in the code to stop execution and get a debugger console 33 | gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 34 | end 35 | 36 | group :development do 37 | gem 'listen' 38 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 39 | gem 'spring' 40 | gem 'spring-watcher-listen', '~> 2.0.0' 41 | end 42 | 43 | 44 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 45 | gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 46 | 47 | gem 'graphiti' 48 | gem 'graphiti-rails' 49 | gem 'vandal_ui' 50 | gem 'kaminari' 51 | gem 'responders' 52 | group :development, :test do 53 | gem 'rspec-rails' 54 | gem 'factory_bot_rails' 55 | gem 'faker' 56 | gem 'graphiti_spec_helpers' 57 | end 58 | 59 | group :test do 60 | gem 'database_cleaner', '~> 1.6' 61 | end 62 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (8.0.2) 5 | actionpack (= 8.0.2) 6 | activesupport (= 8.0.2) 7 | nio4r (~> 2.0) 8 | websocket-driver (>= 0.6.1) 9 | zeitwerk (~> 2.6) 10 | actionmailbox (8.0.2) 11 | actionpack (= 8.0.2) 12 | activejob (= 8.0.2) 13 | activerecord (= 8.0.2) 14 | activestorage (= 8.0.2) 15 | activesupport (= 8.0.2) 16 | mail (>= 2.8.0) 17 | actionmailer (8.0.2) 18 | actionpack (= 8.0.2) 19 | actionview (= 8.0.2) 20 | activejob (= 8.0.2) 21 | activesupport (= 8.0.2) 22 | mail (>= 2.8.0) 23 | rails-dom-testing (~> 2.2) 24 | actionpack (8.0.2) 25 | actionview (= 8.0.2) 26 | activesupport (= 8.0.2) 27 | nokogiri (>= 1.8.5) 28 | rack (>= 2.2.4) 29 | rack-session (>= 1.0.1) 30 | rack-test (>= 0.6.3) 31 | rails-dom-testing (~> 2.2) 32 | rails-html-sanitizer (~> 1.6) 33 | useragent (~> 0.16) 34 | actiontext (8.0.2) 35 | actionpack (= 8.0.2) 36 | activerecord (= 8.0.2) 37 | activestorage (= 8.0.2) 38 | activesupport (= 8.0.2) 39 | globalid (>= 0.6.0) 40 | nokogiri (>= 1.8.5) 41 | actionview (8.0.2) 42 | activesupport (= 8.0.2) 43 | builder (~> 3.1) 44 | erubi (~> 1.11) 45 | rails-dom-testing (~> 2.2) 46 | rails-html-sanitizer (~> 1.6) 47 | activejob (8.0.2) 48 | activesupport (= 8.0.2) 49 | globalid (>= 0.3.6) 50 | activemodel (8.0.2) 51 | activesupport (= 8.0.2) 52 | activerecord (8.0.2) 53 | activemodel (= 8.0.2) 54 | activesupport (= 8.0.2) 55 | timeout (>= 0.4.0) 56 | activestorage (8.0.2) 57 | actionpack (= 8.0.2) 58 | activejob (= 8.0.2) 59 | activerecord (= 8.0.2) 60 | activesupport (= 8.0.2) 61 | marcel (~> 1.0) 62 | activesupport (8.0.2) 63 | base64 64 | benchmark (>= 0.3) 65 | bigdecimal 66 | concurrent-ruby (~> 1.0, >= 1.3.1) 67 | connection_pool (>= 2.2.5) 68 | drb 69 | i18n (>= 1.6, < 2) 70 | logger (>= 1.4.2) 71 | minitest (>= 5.1) 72 | securerandom (>= 0.3) 73 | tzinfo (~> 2.0, >= 2.0.5) 74 | uri (>= 0.13.1) 75 | base64 (0.2.0) 76 | benchmark (0.4.0) 77 | bigdecimal (3.1.9) 78 | bootsnap (1.18.4) 79 | msgpack (~> 1.2) 80 | builder (3.3.0) 81 | byebug (11.1.3) 82 | concurrent-ruby (1.3.5) 83 | connection_pool (2.5.0) 84 | crass (1.0.6) 85 | database_cleaner (1.99.0) 86 | date (3.4.1) 87 | diff-lcs (1.6.0) 88 | drb (2.2.1) 89 | dry-core (1.1.0) 90 | concurrent-ruby (~> 1.0) 91 | logger 92 | zeitwerk (~> 2.6) 93 | dry-inflector (1.2.0) 94 | dry-logic (1.6.0) 95 | bigdecimal 96 | concurrent-ruby (~> 1.0) 97 | dry-core (~> 1.1) 98 | zeitwerk (~> 2.6) 99 | dry-types (1.8.2) 100 | bigdecimal (~> 3.0) 101 | concurrent-ruby (~> 1.0) 102 | dry-core (~> 1.0) 103 | dry-inflector (~> 1.0) 104 | dry-logic (~> 1.4) 105 | zeitwerk (~> 2.6) 106 | erubi (1.13.1) 107 | factory_bot (6.5.1) 108 | activesupport (>= 6.1.0) 109 | factory_bot_rails (6.4.4) 110 | factory_bot (~> 6.5) 111 | railties (>= 5.0.0) 112 | faker (3.5.1) 113 | i18n (>= 1.8.11, < 2) 114 | ffi (1.17.1-aarch64-linux-gnu) 115 | ffi (1.17.1-aarch64-linux-musl) 116 | ffi (1.17.1-arm-linux-gnu) 117 | ffi (1.17.1-arm-linux-musl) 118 | ffi (1.17.1-arm64-darwin) 119 | ffi (1.17.1-x86_64-darwin) 120 | ffi (1.17.1-x86_64-linux-gnu) 121 | ffi (1.17.1-x86_64-linux-musl) 122 | globalid (1.2.1) 123 | activesupport (>= 6.1) 124 | graphiti (1.8.1) 125 | activesupport (>= 5.2) 126 | concurrent-ruby (>= 1.2, < 2.0) 127 | dry-types (>= 0.15.0, < 2.0) 128 | graphiti_errors (~> 1.1.0) 129 | jsonapi-renderer (~> 0.2, >= 0.2.2) 130 | jsonapi-serializable (~> 0.3.0) 131 | graphiti-rails (0.4.1) 132 | graphiti (~> 1.2) 133 | railties (>= 5.0) 134 | rescue_registry (~> 1.0) 135 | graphiti_errors (1.1.2) 136 | jsonapi-serializable (~> 0.1) 137 | graphiti_spec_helpers (1.2.0) 138 | graphiti (>= 1.0.alpha.1) 139 | rspec (~> 3.0) 140 | i18n (1.14.7) 141 | concurrent-ruby (~> 1.0) 142 | io-console (0.8.0) 143 | irb (1.15.1) 144 | pp (>= 0.6.0) 145 | rdoc (>= 4.0.0) 146 | reline (>= 0.4.2) 147 | jsonapi-renderer (0.2.2) 148 | jsonapi-serializable (0.3.1) 149 | jsonapi-renderer (~> 0.2.0) 150 | kaminari (1.2.2) 151 | activesupport (>= 4.1.0) 152 | kaminari-actionview (= 1.2.2) 153 | kaminari-activerecord (= 1.2.2) 154 | kaminari-core (= 1.2.2) 155 | kaminari-actionview (1.2.2) 156 | actionview 157 | kaminari-core (= 1.2.2) 158 | kaminari-activerecord (1.2.2) 159 | activerecord 160 | kaminari-core (= 1.2.2) 161 | kaminari-core (1.2.2) 162 | listen (3.9.0) 163 | rb-fsevent (~> 0.10, >= 0.10.3) 164 | rb-inotify (~> 0.9, >= 0.9.10) 165 | logger (1.6.6) 166 | loofah (2.24.0) 167 | crass (~> 1.0.2) 168 | nokogiri (>= 1.12.0) 169 | mail (2.8.1) 170 | mini_mime (>= 0.1.1) 171 | net-imap 172 | net-pop 173 | net-smtp 174 | marcel (1.0.4) 175 | mini_mime (1.1.5) 176 | minitest (5.25.5) 177 | msgpack (1.8.0) 178 | net-imap (0.5.6) 179 | date 180 | net-protocol 181 | net-pop (0.1.2) 182 | net-protocol 183 | net-protocol (0.2.2) 184 | timeout 185 | net-smtp (0.5.1) 186 | net-protocol 187 | nio4r (2.7.4) 188 | nokogiri (1.18.5-aarch64-linux-gnu) 189 | racc (~> 1.4) 190 | nokogiri (1.18.5-aarch64-linux-musl) 191 | racc (~> 1.4) 192 | nokogiri (1.18.5-arm-linux-gnu) 193 | racc (~> 1.4) 194 | nokogiri (1.18.5-arm-linux-musl) 195 | racc (~> 1.4) 196 | nokogiri (1.18.5-arm64-darwin) 197 | racc (~> 1.4) 198 | nokogiri (1.18.5-x86_64-darwin) 199 | racc (~> 1.4) 200 | nokogiri (1.18.5-x86_64-linux-gnu) 201 | racc (~> 1.4) 202 | nokogiri (1.18.5-x86_64-linux-musl) 203 | racc (~> 1.4) 204 | pp (0.6.2) 205 | prettyprint 206 | prettyprint (0.2.0) 207 | psych (5.2.3) 208 | date 209 | stringio 210 | puma (6.6.0) 211 | nio4r (~> 2.0) 212 | racc (1.8.1) 213 | rack (3.1.12) 214 | rack-cors (2.0.2) 215 | rack (>= 2.0.0) 216 | rack-session (2.1.0) 217 | base64 (>= 0.1.0) 218 | rack (>= 3.0.0) 219 | rack-test (2.2.0) 220 | rack (>= 1.3) 221 | rackup (2.2.1) 222 | rack (>= 3) 223 | rails (8.0.2) 224 | actioncable (= 8.0.2) 225 | actionmailbox (= 8.0.2) 226 | actionmailer (= 8.0.2) 227 | actionpack (= 8.0.2) 228 | actiontext (= 8.0.2) 229 | actionview (= 8.0.2) 230 | activejob (= 8.0.2) 231 | activemodel (= 8.0.2) 232 | activerecord (= 8.0.2) 233 | activestorage (= 8.0.2) 234 | activesupport (= 8.0.2) 235 | bundler (>= 1.15.0) 236 | railties (= 8.0.2) 237 | rails-dom-testing (2.2.0) 238 | activesupport (>= 5.0.0) 239 | minitest 240 | nokogiri (>= 1.6) 241 | rails-html-sanitizer (1.6.2) 242 | loofah (~> 2.21) 243 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 244 | railties (8.0.2) 245 | actionpack (= 8.0.2) 246 | activesupport (= 8.0.2) 247 | irb (~> 1.13) 248 | rackup (>= 1.0.0) 249 | rake (>= 12.2) 250 | thor (~> 1.0, >= 1.2.2) 251 | zeitwerk (~> 2.6) 252 | rake (13.2.1) 253 | rb-fsevent (0.11.2) 254 | rb-inotify (0.11.1) 255 | ffi (~> 1.0) 256 | rdoc (6.12.0) 257 | psych (>= 4.0.0) 258 | reline (0.6.0) 259 | io-console (~> 0.5) 260 | rescue_registry (1.0.0) 261 | activesupport (>= 5.0) 262 | responders (3.1.1) 263 | actionpack (>= 5.2) 264 | railties (>= 5.2) 265 | rspec (3.13.0) 266 | rspec-core (~> 3.13.0) 267 | rspec-expectations (~> 3.13.0) 268 | rspec-mocks (~> 3.13.0) 269 | rspec-core (3.13.3) 270 | rspec-support (~> 3.13.0) 271 | rspec-expectations (3.13.3) 272 | diff-lcs (>= 1.2.0, < 2.0) 273 | rspec-support (~> 3.13.0) 274 | rspec-mocks (3.13.2) 275 | diff-lcs (>= 1.2.0, < 2.0) 276 | rspec-support (~> 3.13.0) 277 | rspec-rails (7.1.1) 278 | actionpack (>= 7.0) 279 | activesupport (>= 7.0) 280 | railties (>= 7.0) 281 | rspec-core (~> 3.13) 282 | rspec-expectations (~> 3.13) 283 | rspec-mocks (~> 3.13) 284 | rspec-support (~> 3.13) 285 | rspec-support (3.13.2) 286 | securerandom (0.4.1) 287 | spring (2.1.1) 288 | spring-watcher-listen (2.0.1) 289 | listen (>= 2.7, < 4.0) 290 | spring (>= 1.2, < 3.0) 291 | sqlite3 (2.6.0-aarch64-linux-gnu) 292 | sqlite3 (2.6.0-aarch64-linux-musl) 293 | sqlite3 (2.6.0-arm-linux-gnu) 294 | sqlite3 (2.6.0-arm-linux-musl) 295 | sqlite3 (2.6.0-arm64-darwin) 296 | sqlite3 (2.6.0-x86_64-darwin) 297 | sqlite3 (2.6.0-x86_64-linux-gnu) 298 | sqlite3 (2.6.0-x86_64-linux-musl) 299 | stringio (3.1.5) 300 | thor (1.3.2) 301 | timeout (0.4.3) 302 | tzinfo (2.0.6) 303 | concurrent-ruby (~> 1.0) 304 | uri (1.0.3) 305 | useragent (0.16.11) 306 | vandal_ui (0.4.5) 307 | websocket-driver (0.7.7) 308 | base64 309 | websocket-extensions (>= 0.1.0) 310 | websocket-extensions (0.1.5) 311 | zeitwerk (2.7.2) 312 | 313 | PLATFORMS 314 | aarch64-linux-gnu 315 | aarch64-linux-musl 316 | arm-linux-gnu 317 | arm-linux-musl 318 | arm64-darwin 319 | x86_64-darwin 320 | x86_64-linux-gnu 321 | x86_64-linux-musl 322 | 323 | DEPENDENCIES 324 | bootsnap 325 | byebug 326 | database_cleaner (~> 1.6) 327 | factory_bot_rails 328 | faker 329 | graphiti 330 | graphiti-rails 331 | graphiti_spec_helpers 332 | kaminari 333 | listen 334 | puma 335 | rack-cors 336 | rails (~> 8.0.2) 337 | responders 338 | rspec-rails 339 | spring 340 | spring-watcher-listen (~> 2.0.0) 341 | sqlite3 342 | tzinfo-data 343 | vandal_ui 344 | 345 | RUBY VERSION 346 | ruby 3.3.7p123 347 | 348 | BUNDLED WITH 349 | 2.5.22 350 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Employee Directory 2 | 3 | This is a sample application demonstrating [Graphiti](https://github.com/graphiti-api/graphiti). 4 | 5 | ## Setup 6 | 7 | - Run `bin/setup`. 8 | - `rails server` 9 | - Visit `/api/v1/vandal`. 10 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::API 2 | include Graphiti::Rails::Responders 3 | end 4 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graphiti-api/employee_directory/4930916e869f1f5d271d6ac9c10fd34f0f13d2b0/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/departments_controller.rb: -------------------------------------------------------------------------------- 1 | class DepartmentsController < ApplicationController 2 | def index 3 | departments = DepartmentResource.all(params) 4 | respond_with(departments) 5 | end 6 | 7 | def show 8 | department = DepartmentResource.find(params) 9 | respond_with(department) 10 | end 11 | 12 | def create 13 | department = DepartmentResource.build(params) 14 | 15 | if department.save 16 | render jsonapi: department, status: 201 17 | else 18 | render jsonapi_errors: department 19 | end 20 | end 21 | 22 | def update 23 | department = DepartmentResource.find(params) 24 | 25 | if department.update_attributes 26 | render jsonapi: department 27 | else 28 | render jsonapi_errors: department 29 | end 30 | end 31 | 32 | def destroy 33 | department = DepartmentResource.find(params) 34 | 35 | if department.destroy 36 | render jsonapi: { meta: {} }, status: 200 37 | else 38 | render jsonapi_errors: department 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/controllers/employees_controller.rb: -------------------------------------------------------------------------------- 1 | class EmployeesController < ApplicationController 2 | def index 3 | employees = EmployeeResource.all(params) 4 | respond_with(employees) 5 | end 6 | 7 | def show 8 | employee = EmployeeResource.find(params) 9 | respond_with(employee) 10 | end 11 | 12 | def create 13 | employee = EmployeeResource.build(params) 14 | 15 | if employee.save 16 | render jsonapi: employee, status: 201 17 | else 18 | render jsonapi_errors: employee 19 | end 20 | end 21 | 22 | def update 23 | employee = EmployeeResource.find(params) 24 | 25 | if employee.update_attributes 26 | render jsonapi: employee 27 | else 28 | render jsonapi_errors: employee 29 | end 30 | end 31 | 32 | def destroy 33 | employee = EmployeeResource.find(params) 34 | 35 | if employee.destroy 36 | render jsonapi: { meta: {} }, status: 200 37 | else 38 | render jsonapi_errors: employee 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/controllers/milestones_controller.rb: -------------------------------------------------------------------------------- 1 | class MilestonesController < ApplicationController 2 | def index 3 | milestones = MilestoneResource.all(params) 4 | respond_with(milestones) 5 | end 6 | 7 | def show 8 | milestone = MilestoneResource.find(params) 9 | respond_with(milestone) 10 | end 11 | 12 | def create 13 | milestone = MilestoneResource.build(params) 14 | 15 | if milestone.save 16 | render jsonapi: milestone, status: 201 17 | else 18 | render jsonapi_errors: milestone 19 | end 20 | end 21 | 22 | def update 23 | milestone = MilestoneResource.find(params) 24 | 25 | if milestone.update_attributes 26 | render jsonapi: milestone 27 | else 28 | render jsonapi_errors: milestone 29 | end 30 | end 31 | 32 | def destroy 33 | milestone = MilestoneResource.find(params) 34 | 35 | if milestone.destroy 36 | render jsonapi: { meta: {} }, status: 200 37 | else 38 | render jsonapi_errors: milestone 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/controllers/notes_controller.rb: -------------------------------------------------------------------------------- 1 | class NotesController < ApplicationController 2 | def index 3 | notes = NoteResource.all(params) 4 | respond_with(notes) 5 | end 6 | 7 | def show 8 | note = NoteResource.find(params) 9 | respond_with(note) 10 | end 11 | 12 | def create 13 | note = NoteResource.build(params) 14 | 15 | if note.save 16 | render jsonapi: note, status: 201 17 | else 18 | render jsonapi_errors: note 19 | end 20 | end 21 | 22 | def update 23 | note = NoteResource.find(params) 24 | 25 | if note.update_attributes 26 | render jsonapi: note 27 | else 28 | render jsonapi_errors: note 29 | end 30 | end 31 | 32 | def destroy 33 | note = NoteResource.find(params) 34 | 35 | if note.destroy 36 | render jsonapi: { meta: {} }, status: 200 37 | else 38 | render jsonapi_errors: note 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/controllers/positions_controller.rb: -------------------------------------------------------------------------------- 1 | class PositionsController < ApplicationController 2 | def index 3 | positions = PositionResource.all(params) 4 | respond_with(positions) 5 | end 6 | 7 | def show 8 | position = PositionResource.find(params) 9 | respond_with(position) 10 | end 11 | 12 | def create 13 | position = PositionResource.build(params) 14 | 15 | if position.save 16 | render jsonapi: position, status: 201 17 | else 18 | render jsonapi_errors: position 19 | end 20 | end 21 | 22 | def update 23 | position = PositionResource.find(params) 24 | 25 | if position.update_attributes 26 | render jsonapi: position 27 | else 28 | render jsonapi_errors: position 29 | end 30 | end 31 | 32 | def destroy 33 | position = PositionResource.find(params) 34 | 35 | if position.destroy 36 | render jsonapi: { meta: {} }, status: 200 37 | else 38 | render jsonapi_errors: position 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/controllers/tasks_controller.rb: -------------------------------------------------------------------------------- 1 | class TasksController < ApplicationController 2 | def index 3 | tasks = TaskResource.all(params) 4 | respond_with(tasks) 5 | end 6 | 7 | def show 8 | task = TaskResource.find(params) 9 | respond_with(task) 10 | end 11 | 12 | def create 13 | task = TaskResource.build(params) 14 | 15 | if task.save 16 | render jsonapi: task, status: 201 17 | else 18 | render jsonapi_errors: task 19 | end 20 | end 21 | 22 | def update 23 | task = TaskResource.find(params) 24 | 25 | if task.update_attributes 26 | render jsonapi: task 27 | else 28 | render jsonapi_errors: task 29 | end 30 | end 31 | 32 | def destroy 33 | task = TaskResource.find(params) 34 | 35 | if task.destroy 36 | render jsonapi: { meta: {} }, status: 200 37 | else 38 | render jsonapi_errors: task 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/controllers/teams_controller.rb: -------------------------------------------------------------------------------- 1 | class TeamsController < ApplicationController 2 | def index 3 | teams = TeamResource.all(params) 4 | respond_with(teams) 5 | end 6 | 7 | def show 8 | team = TeamResource.find(params) 9 | respond_with(team) 10 | end 11 | 12 | def create 13 | team = TeamResource.build(params) 14 | 15 | if team.save 16 | render jsonapi: team, status: 201 17 | else 18 | render jsonapi_errors: team 19 | end 20 | end 21 | 22 | def update 23 | team = TeamResource.find(params) 24 | 25 | if team.update_attributes 26 | render jsonapi: team 27 | else 28 | render jsonapi_errors: team 29 | end 30 | end 31 | 32 | def destroy 33 | team = TeamResource.find(params) 34 | 35 | if team.destroy 36 | render jsonapi: { meta: {} }, status: 200 37 | else 38 | render jsonapi_errors: team 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/bug.rb: -------------------------------------------------------------------------------- 1 | class Bug < Task 2 | end 3 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graphiti-api/employee_directory/4930916e869f1f5d271d6ac9c10fd34f0f13d2b0/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/department.rb: -------------------------------------------------------------------------------- 1 | class Department < ApplicationRecord 2 | has_many :positions 3 | has_many :teams 4 | has_many :notes, as: :notable 5 | end 6 | -------------------------------------------------------------------------------- /app/models/employee.rb: -------------------------------------------------------------------------------- 1 | class Employee < ApplicationRecord 2 | has_many :positions 3 | has_many :team_memberships 4 | has_many :teams, through: :team_memberships 5 | has_many :notes, as: :notable 6 | has_many :tasks 7 | has_many :bugs 8 | has_many :features 9 | has_many :epics 10 | has_one :current_position, 11 | -> { current(true) }, 12 | class_name: 'Position' 13 | end 14 | -------------------------------------------------------------------------------- /app/models/epic.rb: -------------------------------------------------------------------------------- 1 | class Epic < Task 2 | has_many :milestones 3 | end 4 | -------------------------------------------------------------------------------- /app/models/feature.rb: -------------------------------------------------------------------------------- 1 | class Feature < Task 2 | end 3 | -------------------------------------------------------------------------------- /app/models/milestone.rb: -------------------------------------------------------------------------------- 1 | class Milestone < ApplicationRecord 2 | belongs_to :epic 3 | end 4 | -------------------------------------------------------------------------------- /app/models/note.rb: -------------------------------------------------------------------------------- 1 | class Note < ApplicationRecord 2 | belongs_to :notable, polymorphic: true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/position.rb: -------------------------------------------------------------------------------- 1 | class Position < ApplicationRecord 2 | belongs_to :employee 3 | belongs_to :department 4 | 5 | scope :current, ->(bool) { 6 | clause = { historical_index: 1 } 7 | bool ? where(clause) : where.not(clause) 8 | } 9 | 10 | def self.reorder!(employee_id) 11 | scope = Position.where(employee_id: employee_id).order(created_at: :desc) 12 | scope.each_with_index do |p, index| 13 | p.update_attribute(:historical_index, index + 1) 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/models/task.rb: -------------------------------------------------------------------------------- 1 | class Task < ApplicationRecord 2 | TYPES = %w(Bug Feature Epic) 3 | 4 | belongs_to :team, optional: true 5 | belongs_to :employee, optional: true 6 | end 7 | -------------------------------------------------------------------------------- /app/models/team.rb: -------------------------------------------------------------------------------- 1 | class Team < ApplicationRecord 2 | belongs_to :department 3 | has_many :team_memberships 4 | has_many :employees, through: :team_memberships 5 | has_many :notes, as: :notable 6 | has_many :tasks 7 | end 8 | -------------------------------------------------------------------------------- /app/models/team_membership.rb: -------------------------------------------------------------------------------- 1 | class TeamMembership < ApplicationRecord 2 | belongs_to :team 3 | belongs_to :employee 4 | end 5 | -------------------------------------------------------------------------------- /app/resources/application_resource.rb: -------------------------------------------------------------------------------- 1 | # ApplicationResource is similar to ApplicationRecord - a base class that 2 | # holds configuration/methods for subclasses. 3 | # All Resources should inherit from ApplicationResource. 4 | class ApplicationResource < Graphiti::Resource 5 | # Use the ActiveRecord Adapter for all subclasses. 6 | # Subclasses can still override this default. 7 | self.abstract_class = true 8 | self.adapter = Graphiti::Adapters::ActiveRecord 9 | self.base_url = Rails.application.routes.default_url_options[:host] 10 | self.endpoint_namespace = '/api/v1' 11 | end 12 | -------------------------------------------------------------------------------- /app/resources/bug_resource.rb: -------------------------------------------------------------------------------- 1 | class BugResource < TaskResource 2 | end 3 | -------------------------------------------------------------------------------- /app/resources/department_resource.rb: -------------------------------------------------------------------------------- 1 | class DepartmentResource < ApplicationResource 2 | attribute :name, :string 3 | 4 | has_many :positions 5 | has_many :teams 6 | polymorphic_has_many :notes, as: :notable 7 | end 8 | -------------------------------------------------------------------------------- /app/resources/employee_resource.rb: -------------------------------------------------------------------------------- 1 | class EmployeeResource < ApplicationResource 2 | attribute :first_name, :string 3 | attribute :last_name, :string 4 | attribute :age, :integer 5 | attribute :created_at, :datetime, writable: false 6 | attribute :updated_at, :datetime, writable: false 7 | attribute :title, :string, only: [:filterable, :sortable] 8 | 9 | has_many :positions 10 | has_many :tasks 11 | many_to_many :teams 12 | polymorphic_has_many :notes, as: :notable 13 | has_one :current_position, resource: PositionResource do 14 | params do |hash| 15 | hash[:filter][:current] = true 16 | end 17 | end 18 | 19 | filter :title, only: [:eq] do 20 | eq do |scope, value| 21 | scope.joins(:current_position).merge(Position.where(title: value)) 22 | end 23 | end 24 | 25 | sort :title do |scope, value| 26 | scope.joins(:current_position).merge(Position.order(title: value)) 27 | end 28 | 29 | sort :department_name, :string do |scope, value| 30 | scope.joins(current_position: :department) 31 | .merge(Department.order(name: value)) 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /app/resources/epic_resource.rb: -------------------------------------------------------------------------------- 1 | class EpicResource < TaskResource 2 | has_many :milestones 3 | end 4 | -------------------------------------------------------------------------------- /app/resources/feature_resource.rb: -------------------------------------------------------------------------------- 1 | class FeatureResource < TaskResource 2 | attribute :points, :integer do 3 | rand(20) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/resources/milestone_resource.rb: -------------------------------------------------------------------------------- 1 | class MilestoneResource < ApplicationResource 2 | attribute :epic_id, :integer, only: [:filterable] 3 | attribute :name, :string 4 | 5 | belongs_to :epic do 6 | link do |milestone| 7 | helpers = Rails.application.routes.url_helpers 8 | helpers.task_url(milestone.epic_id) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/resources/note_resource.rb: -------------------------------------------------------------------------------- 1 | class NoteResource < ApplicationResource 2 | attribute :notable_id, :integer, only: [:filterable] 3 | attribute :body, :string 4 | 5 | filter :notable_type, :string, allow: %w(Employee Department Team) 6 | 7 | polymorphic_belongs_to :notable do 8 | group_by(:notable_type) do 9 | on(:Employee) 10 | on(:Team) 11 | on(:Department) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/resources/position_resource.rb: -------------------------------------------------------------------------------- 1 | class PositionResource < ApplicationResource 2 | attribute :employee_id, :integer, readable: false 3 | attribute :department_id, :integer, readable: false 4 | attribute :title, :string 5 | attribute :historical_index, :integer, only: [:sortable] 6 | attribute :active, :boolean 7 | 8 | belongs_to :employee 9 | belongs_to :department 10 | 11 | filter :current, :boolean do 12 | eq { |scope, value| scope.current(value) } 13 | end 14 | 15 | before_commit only: [:create, :destroy] do |position| 16 | Position.reorder!(position.employee_id) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/resources/task_resource.rb: -------------------------------------------------------------------------------- 1 | class TaskResource < ApplicationResource 2 | self.polymorphic = %w(FeatureResource BugResource EpicResource) 3 | 4 | attribute :employee_id, :integer, only: [:filterable] 5 | attribute :team_id, :integer, only: [:filterable] 6 | attribute :title, :string 7 | 8 | belongs_to :employee 9 | belongs_to :team 10 | end 11 | -------------------------------------------------------------------------------- /app/resources/team_resource.rb: -------------------------------------------------------------------------------- 1 | class TeamResource < ApplicationResource 2 | attribute :department_id, :integer, only: [:filterable] 3 | attribute :name, :string 4 | 5 | belongs_to :department 6 | many_to_many :employees 7 | has_many :tasks 8 | polymorphic_has_many :notes, as: :notable 9 | end 10 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../config/application', __dir__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /bin/rspec: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'rspec' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require "pathname" 12 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 13 | Pathname.new(__FILE__).realpath) 14 | 15 | bundle_binstub = File.expand_path("../bundle", __FILE__) 16 | 17 | if File.file?(bundle_binstub) 18 | if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ 19 | load(bundle_binstub) 20 | else 21 | abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. 22 | Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") 23 | end 24 | end 25 | 26 | require "rubygems" 27 | require "bundler/setup" 28 | 29 | load Gem.bin_path("rspec-core", "rspec") 30 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'fileutils' 3 | include FileUtils 4 | 5 | # path to your application root. 6 | APP_ROOT = File.expand_path('..', __dir__) 7 | 8 | def system!(*args) 9 | system(*args) || abort("\n== Command #{args} failed ==") 10 | end 11 | 12 | chdir APP_ROOT do 13 | # This script is a starting point to setup your application. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # puts "\n== Copying sample files ==" 21 | # unless File.exist?('config/database.yml') 22 | # cp 'config/database.yml.sample', 'config/database.yml' 23 | # end 24 | 25 | puts "\n== Preparing database ==" 26 | system! 'bin/rails db:setup' 27 | 28 | puts "\n== Removing old logs and tempfiles ==" 29 | system! 'bin/rails log:clear tmp:clear' 30 | 31 | puts "\n== Restarting application server ==" 32 | system! 'bin/rails restart' 33 | end 34 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) 11 | spring = lockfile.specs.detect { |spec| spec.name == "spring" } 12 | if spring 13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 14 | gem 'spring', spring.version 15 | require 'spring/binstub' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'fileutils' 3 | include FileUtils 4 | 5 | # path to your application root. 6 | APP_ROOT = File.expand_path('..', __dir__) 7 | 8 | def system!(*args) 9 | system(*args) || abort("\n== Command #{args} failed ==") 10 | end 11 | 12 | chdir APP_ROOT do 13 | # This script is a way to update your development environment automatically. 14 | # Add necessary update steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | puts "\n== Updating database ==" 21 | system! 'bin/rails db:migrate' 22 | 23 | puts "\n== Removing old logs and tempfiles ==" 24 | system! 'bin/rails log:clear tmp:clear' 25 | 26 | puts "\n== Restarting application server ==" 27 | system! 'bin/rails restart' 28 | end 29 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative 'boot' 2 | 3 | require "rails" 4 | # Pick the frameworks you want: 5 | require "active_model/railtie" 6 | require "active_job/railtie" 7 | require "active_record/railtie" 8 | require "active_storage/engine" 9 | require "action_controller/railtie" 10 | require "action_mailer/railtie" 11 | require "action_view/railtie" 12 | require "action_cable/engine" 13 | # require "sprockets/railtie" 14 | require "rails/test_unit/railtie" 15 | 16 | # Require the gems listed in Gemfile, including any gems 17 | # you've limited to :test, :development, or :production. 18 | Bundler.require(*Rails.groups) 19 | 20 | module EmployeeDirectory 21 | class Application < Rails::Application 22 | # Initialize configuration defaults for originally generated Rails version. 23 | config.load_defaults 5.2 24 | 25 | # Settings in config/environments/* take precedence over those specified here. 26 | # Application configuration can go into files in config/initializers 27 | # -- all .rb files in that directory are automatically loaded after loading 28 | # the framework and any gems in your application. 29 | 30 | # Only loads a smaller set of middleware suitable for API only apps. 31 | # Middleware like session, flash, cookies can be added back manually. 32 | # Skip views, helpers and assets when generating a new resource. 33 | config.api_only = true 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: employee_directory_production 11 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | 4InfaySX0eHuy+ZkzjnbPvAh9/Exiwu3arnNb+04r40kTPNTrjhUPFU2DJAuq8nitqcnqSktPHjYReu6Coif8NTO7ky+OupeRkwycjAoF1T933Ok8emVl9Hw7WBykH0L4yMdFceb0vkXro3hcxSTzs+tsb6s3PxVufaOc+WV1SgdFSngCkwxsAXKg3CT/nU1b54tMcJkGkX8WXn9LwFTPXP1jdX9ytdggx5HjdcWb2fYC5oehBoj2bVetwbabvwlU3wzXPwWPZ1Ad3CBPua6CTX76vd1oCBMtTP/tmUHl4iNqVOW7ajaFKlzGhO/EjbWJVc0EkWc4/IFD6NfMWbtGsIOVXIAFa2NqBe0CEdI5hWjKR2M15yNufWdqtKeTo/dNrUNa+uhdHzCN72yfnwHdTIrzV+yqVHBKFqb--ZcWnOWxGIsy5x9ID--hRwHbyT1C0aFVewFc1BIsg== -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports. 13 | config.consider_all_requests_local = true 14 | 15 | # Enable/disable caching. By default caching is disabled. 16 | # Run rails dev:cache to toggle caching. 17 | if Rails.root.join('tmp', 'caching-dev.txt').exist? 18 | config.action_controller.perform_caching = true 19 | 20 | config.cache_store = :memory_store 21 | config.public_file_server.headers = { 22 | 'Cache-Control' => "public, max-age=#{2.days.to_i}" 23 | } 24 | else 25 | config.action_controller.perform_caching = false 26 | 27 | config.cache_store = :null_store 28 | end 29 | 30 | # Store uploaded files on the local file system (see config/storage.yml for options) 31 | config.active_storage.service = :local 32 | 33 | # Don't care if the mailer can't send. 34 | config.action_mailer.raise_delivery_errors = false 35 | 36 | config.action_mailer.perform_caching = false 37 | 38 | # Print deprecation notices to the Rails logger. 39 | config.active_support.deprecation = :log 40 | 41 | # Raise an error on page load if there are pending migrations. 42 | config.active_record.migration_error = :page_load 43 | 44 | # Highlight code that triggered database queries in logs. 45 | config.active_record.verbose_query_logs = true 46 | 47 | 48 | # Raises error for missing translations 49 | # config.action_view.raise_on_missing_translations = true 50 | 51 | # Use an evented file watcher to asynchronously detect changes in source code, 52 | # routes, locales, etc. This feature depends on the listen gem. 53 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker 54 | end 55 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 18 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 19 | # config.require_master_key = true 20 | 21 | # Disable serving static files from the `/public` folder by default since 22 | # Apache or NGINX already handles this. 23 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 24 | 25 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 26 | # config.action_controller.asset_host = 'http://assets.example.com' 27 | 28 | # Specifies the header that your server uses for sending files. 29 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 30 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 31 | 32 | # Store uploaded files on the local file system (see config/storage.yml for options) 33 | config.active_storage.service = :local 34 | 35 | # Mount Action Cable outside main process or domain 36 | # config.action_cable.mount_path = nil 37 | # config.action_cable.url = 'wss://example.com/cable' 38 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] 39 | 40 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 41 | # config.force_ssl = true 42 | 43 | # Use the lowest log level to ensure availability of diagnostic information 44 | # when problems arise. 45 | config.log_level = :debug 46 | 47 | # Prepend all log lines with the following tags. 48 | config.log_tags = [ :request_id ] 49 | 50 | # Use a different cache store in production. 51 | # config.cache_store = :mem_cache_store 52 | 53 | # Use a real queuing backend for Active Job (and separate queues per environment) 54 | # config.active_job.queue_adapter = :resque 55 | # config.active_job.queue_name_prefix = "employee_directory_#{Rails.env}" 56 | 57 | config.action_mailer.perform_caching = false 58 | 59 | # Ignore bad email addresses and do not raise email delivery errors. 60 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 61 | # config.action_mailer.raise_delivery_errors = false 62 | 63 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 64 | # the I18n.default_locale when a translation cannot be found). 65 | config.i18n.fallbacks = true 66 | 67 | # Send deprecation notices to registered listeners. 68 | config.active_support.deprecation = :notify 69 | 70 | # Use default logging formatter so that PID and timestamp are not suppressed. 71 | config.log_formatter = ::Logger::Formatter.new 72 | 73 | # Use a different logger for distributed setups. 74 | # require 'syslog/logger' 75 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 76 | 77 | if ENV["RAILS_LOG_TO_STDOUT"].present? 78 | logger = ActiveSupport::Logger.new(STDOUT) 79 | logger.formatter = config.log_formatter 80 | config.logger = ActiveSupport::TaggedLogging.new(logger) 81 | end 82 | 83 | # Do not dump schema after migrations. 84 | config.active_record.dump_schema_after_migration = false 85 | end 86 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure public file server for tests with Cache-Control for performance. 16 | config.public_file_server.enabled = true 17 | config.public_file_server.headers = { 18 | 'Cache-Control' => "public, max-age=#{1.hour.to_i}" 19 | } 20 | 21 | # Show full error reports and disable caching. 22 | config.consider_all_requests_local = true 23 | config.action_controller.perform_caching = false 24 | 25 | # Raise exceptions instead of rendering exception templates. 26 | config.action_dispatch.show_exceptions = false 27 | 28 | # Disable request forgery protection in test environment. 29 | config.action_controller.allow_forgery_protection = false 30 | 31 | # Store uploaded files on the local file system in a temporary directory 32 | config.active_storage.service = :test 33 | 34 | config.action_mailer.perform_caching = false 35 | 36 | # Tell Action Mailer not to deliver emails to the real world. 37 | # The :test delivery method accumulates sent emails in the 38 | # ActionMailer::Base.deliveries array. 39 | config.action_mailer.delivery_method = :test 40 | 41 | # Print deprecation notices to the stderr. 42 | config.active_support.deprecation = :stderr 43 | 44 | # Raises error for missing translations 45 | # config.action_view.raise_on_missing_translations = true 46 | end 47 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/cors.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Avoid CORS issues when API is called from the frontend app. 4 | # Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests. 5 | 6 | # Read more: https://github.com/cyu/rack-cors 7 | 8 | # Rails.application.config.middleware.insert_before 0, Rack::Cors do 9 | # allow do 10 | # origins 'example.com' 11 | # 12 | # resource '*', 13 | # headers: :any, 14 | # methods: [:get, :post, :put, :patch, :delete, :options, :head] 15 | # end 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at http://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers: a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum; this matches the default thread size of Active Record. 6 | # 7 | threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } 8 | threads threads_count, threads_count 9 | 10 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 11 | # 12 | port ENV.fetch("PORT") { 3000 } 13 | 14 | # Specifies the `environment` that Puma will run in. 15 | # 16 | environment ENV.fetch("RAILS_ENV") { "development" } 17 | 18 | # Specifies the `pidfile` that Puma will use. 19 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } 20 | 21 | # Specifies the number of `workers` to boot in clustered mode. 22 | # Workers are forked webserver processes. If using threads and workers together 23 | # the concurrency of the application would be max `threads` * `workers`. 24 | # Workers do not work on JRuby or Windows (both of which do not support 25 | # processes). 26 | # 27 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 28 | 29 | # Use the `preload_app!` method when specifying a `workers` number. 30 | # This directive tells Puma to first boot the application and load code 31 | # before forking the application. This takes advantage of Copy On Write 32 | # process behavior so workers use less memory. 33 | # 34 | # preload_app! 35 | 36 | # Allow puma to be restarted by `rails restart` command. 37 | plugin :tmp_restart 38 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | scope path: ApplicationResource.endpoint_namespace, defaults: { format: :jsonapi } do 3 | mount VandalUi::Engine, at: '/vandal' 4 | 5 | resources :milestones 6 | resources :tasks 7 | resources :notes 8 | resources :teams 9 | resources :departments 10 | resources :positions 11 | resources :employees 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | %w[ 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ].each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket 23 | 24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /db/migrate/20180903174755_create_employees.rb: -------------------------------------------------------------------------------- 1 | class CreateEmployees < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :employees do |t| 4 | t.string :first_name 5 | t.string :last_name 6 | t.integer :age 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180903175706_create_positions.rb: -------------------------------------------------------------------------------- 1 | class CreatePositions < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :positions do |t| 4 | t.belongs_to :employee, index: true 5 | 6 | t.string :title 7 | t.integer :historical_index 8 | t.boolean :active 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180904115831_create_departments.rb: -------------------------------------------------------------------------------- 1 | class CreateDepartments < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :departments do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180904120042_add_department_id_to_positions.rb: -------------------------------------------------------------------------------- 1 | class AddDepartmentIdToPositions < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :positions, :department_id, :integer 4 | add_index :positions, :department_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180904123419_create_teams.rb: -------------------------------------------------------------------------------- 1 | class CreateTeams < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :teams do |t| 4 | t.belongs_to :department, index: true 5 | t.string :name 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180904123442_create_team_memberships.rb: -------------------------------------------------------------------------------- 1 | class CreateTeamMemberships < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :team_memberships do |t| 4 | t.belongs_to :team, index: true 5 | t.belongs_to :employee, index: true 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180904141521_create_notes.rb: -------------------------------------------------------------------------------- 1 | class CreateNotes < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :notes do |t| 4 | t.references :notable, polymorphic: true, index: true 5 | t.text :body 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180904143550_create_tasks.rb: -------------------------------------------------------------------------------- 1 | class CreateTasks < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :tasks do |t| 4 | t.belongs_to :employee, index: true 5 | t.belongs_to :team, index: true 6 | t.string :type, index: true 7 | t.string :title 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180904143830_create_milestones.rb: -------------------------------------------------------------------------------- 1 | class CreateMilestones < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :milestones do |t| 4 | t.belongs_to :epic, index: true 5 | t.string :name 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema[8.0].define(version: 2018_09_04_143830) do 14 | create_table "departments", force: :cascade do |t| 15 | t.string "name" 16 | t.datetime "created_at", precision: nil, null: false 17 | t.datetime "updated_at", precision: nil, null: false 18 | end 19 | 20 | create_table "employees", force: :cascade do |t| 21 | t.string "first_name" 22 | t.string "last_name" 23 | t.integer "age" 24 | t.datetime "created_at", precision: nil, null: false 25 | t.datetime "updated_at", precision: nil, null: false 26 | end 27 | 28 | create_table "milestones", force: :cascade do |t| 29 | t.integer "epic_id" 30 | t.string "name" 31 | t.datetime "created_at", precision: nil, null: false 32 | t.datetime "updated_at", precision: nil, null: false 33 | t.index ["epic_id"], name: "index_milestones_on_epic_id" 34 | end 35 | 36 | create_table "notes", force: :cascade do |t| 37 | t.string "notable_type" 38 | t.integer "notable_id" 39 | t.text "body" 40 | t.datetime "created_at", precision: nil, null: false 41 | t.datetime "updated_at", precision: nil, null: false 42 | t.index ["notable_type", "notable_id"], name: "index_notes_on_notable_type_and_notable_id" 43 | end 44 | 45 | create_table "positions", force: :cascade do |t| 46 | t.integer "employee_id" 47 | t.string "title" 48 | t.integer "historical_index" 49 | t.boolean "active" 50 | t.datetime "created_at", precision: nil, null: false 51 | t.datetime "updated_at", precision: nil, null: false 52 | t.integer "department_id" 53 | t.index ["department_id"], name: "index_positions_on_department_id" 54 | t.index ["employee_id"], name: "index_positions_on_employee_id" 55 | end 56 | 57 | create_table "tasks", force: :cascade do |t| 58 | t.integer "employee_id" 59 | t.integer "team_id" 60 | t.string "type" 61 | t.string "title" 62 | t.datetime "created_at", precision: nil, null: false 63 | t.datetime "updated_at", precision: nil, null: false 64 | t.index ["employee_id"], name: "index_tasks_on_employee_id" 65 | t.index ["team_id"], name: "index_tasks_on_team_id" 66 | t.index ["type"], name: "index_tasks_on_type" 67 | end 68 | 69 | create_table "team_memberships", force: :cascade do |t| 70 | t.integer "team_id" 71 | t.integer "employee_id" 72 | t.datetime "created_at", precision: nil, null: false 73 | t.datetime "updated_at", precision: nil, null: false 74 | t.index ["employee_id"], name: "index_team_memberships_on_employee_id" 75 | t.index ["team_id"], name: "index_team_memberships_on_team_id" 76 | end 77 | 78 | create_table "teams", force: :cascade do |t| 79 | t.integer "department_id" 80 | t.string "name" 81 | t.datetime "created_at", precision: nil, null: false 82 | t.datetime "updated_at", precision: nil, null: false 83 | t.index ["department_id"], name: "index_teams_on_department_id" 84 | end 85 | end 86 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | [ 2 | Employee, 3 | Position, 4 | Department, 5 | TeamMembership, 6 | Team, 7 | Note, 8 | Task, 9 | Milestone 10 | ].each(&:delete_all) 11 | 12 | departments = [] 13 | def create_department(name) 14 | dept = Department.create! name: name 15 | team = dept.teams.create!(name: 'Engineering Team B') 16 | team.notes.create!(body: Faker::Lorem.sentence) 17 | dept.teams.create!(name: 'Engineering Team C') 18 | dept.notes.create!(body: Faker::Lorem.sentence) 19 | dept 20 | end 21 | 22 | departments << create_department('Engineering') 23 | departments << create_department('Safety') 24 | departments << create_department('QA') 25 | 26 | 100.times do 27 | employee = Employee.create! first_name: Faker::Name.first_name, 28 | last_name: Faker::Name.last_name, 29 | age: rand(20..80) 30 | 31 | (1..2).each do |i| 32 | employee.positions.create! title: Faker::Job.title, 33 | historical_index: i, 34 | active: i == 1, 35 | department: departments.sample 36 | end 37 | 38 | employee.teams << employee.positions[0].department.teams.sample 39 | employee.notes.create!(body: Faker::Lorem.sentence) 40 | 41 | team = employee.teams.first 42 | employee.bugs.create!(title: Faker::Lorem.sentence, team: team) 43 | employee.features.create!(title: Faker::Lorem.sentence, team: team) 44 | epic = employee.epics.create!(title: Faker::Lorem.sentence, team: team) 45 | epic.milestones.create!(name: Faker::Lorem.word.titleize) 46 | end 47 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graphiti-api/employee_directory/4930916e869f1f5d271d6ac9c10fd34f0f13d2b0/lib/tasks/.keep -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graphiti-api/employee_directory/4930916e869f1f5d271d6ac9c10fd34f0f13d2b0/log/.keep -------------------------------------------------------------------------------- /public/api/v1/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources": [ 3 | { 4 | "name": "BugResource", 5 | "type": "bugs", 6 | "description": null, 7 | "attributes": { 8 | "id": { 9 | "type": "integer_id", 10 | "readable": true, 11 | "writable": true, 12 | "description": null 13 | }, 14 | "title": { 15 | "type": "string", 16 | "readable": true, 17 | "writable": true, 18 | "description": null 19 | } 20 | }, 21 | "extra_attributes": { 22 | }, 23 | "sorts": { 24 | "id": { 25 | }, 26 | "title": { 27 | } 28 | }, 29 | "filters": { 30 | "id": { 31 | "type": "integer_id", 32 | "operators": [ 33 | "eq", 34 | "not_eq", 35 | "gt", 36 | "gte", 37 | "lt", 38 | "lte" 39 | ] 40 | }, 41 | "employee_id": { 42 | "type": "integer", 43 | "operators": [ 44 | "eq", 45 | "not_eq", 46 | "gt", 47 | "gte", 48 | "lt", 49 | "lte" 50 | ] 51 | }, 52 | "team_id": { 53 | "type": "integer", 54 | "operators": [ 55 | "eq", 56 | "not_eq", 57 | "gt", 58 | "gte", 59 | "lt", 60 | "lte" 61 | ] 62 | }, 63 | "title": { 64 | "type": "string", 65 | "operators": [ 66 | "eq", 67 | "not_eq", 68 | "eql", 69 | "not_eql", 70 | "prefix", 71 | "not_prefix", 72 | "suffix", 73 | "not_suffix", 74 | "match", 75 | "not_match" 76 | ] 77 | } 78 | }, 79 | "relationships": { 80 | "employee": { 81 | "type": "belongs_to", 82 | "description": null, 83 | "resource": "EmployeeResource" 84 | }, 85 | "team": { 86 | "type": "belongs_to", 87 | "description": null, 88 | "resource": "TeamResource" 89 | } 90 | }, 91 | "polymorphic": true, 92 | "children": [ 93 | "FeatureResource", 94 | "BugResource", 95 | "EpicResource" 96 | ] 97 | }, 98 | { 99 | "name": "DepartmentResource", 100 | "type": "departments", 101 | "description": null, 102 | "attributes": { 103 | "id": { 104 | "type": "integer_id", 105 | "readable": true, 106 | "writable": true, 107 | "description": null 108 | }, 109 | "name": { 110 | "type": "string", 111 | "readable": true, 112 | "writable": true, 113 | "description": null 114 | } 115 | }, 116 | "extra_attributes": { 117 | }, 118 | "sorts": { 119 | "id": { 120 | }, 121 | "name": { 122 | } 123 | }, 124 | "filters": { 125 | "id": { 126 | "type": "integer_id", 127 | "operators": [ 128 | "eq", 129 | "not_eq", 130 | "gt", 131 | "gte", 132 | "lt", 133 | "lte" 134 | ] 135 | }, 136 | "name": { 137 | "type": "string", 138 | "operators": [ 139 | "eq", 140 | "not_eq", 141 | "eql", 142 | "not_eql", 143 | "prefix", 144 | "not_prefix", 145 | "suffix", 146 | "not_suffix", 147 | "match", 148 | "not_match" 149 | ] 150 | } 151 | }, 152 | "relationships": { 153 | "positions": { 154 | "type": "has_many", 155 | "description": null, 156 | "resource": "PositionResource" 157 | }, 158 | "teams": { 159 | "type": "has_many", 160 | "description": null, 161 | "resource": "TeamResource" 162 | }, 163 | "notes": { 164 | "type": "has_many", 165 | "description": null, 166 | "resource": "NoteResource" 167 | } 168 | } 169 | }, 170 | { 171 | "name": "EmployeeResource", 172 | "type": "employees", 173 | "description": null, 174 | "attributes": { 175 | "id": { 176 | "type": "integer_id", 177 | "readable": true, 178 | "writable": true, 179 | "description": null 180 | }, 181 | "first_name": { 182 | "type": "string", 183 | "readable": true, 184 | "writable": true, 185 | "description": null 186 | }, 187 | "last_name": { 188 | "type": "string", 189 | "readable": true, 190 | "writable": true, 191 | "description": null 192 | }, 193 | "age": { 194 | "type": "integer", 195 | "readable": true, 196 | "writable": true, 197 | "description": null 198 | }, 199 | "created_at": { 200 | "type": "datetime", 201 | "readable": true, 202 | "writable": false, 203 | "description": null 204 | }, 205 | "updated_at": { 206 | "type": "datetime", 207 | "readable": true, 208 | "writable": false, 209 | "description": null 210 | } 211 | }, 212 | "extra_attributes": { 213 | }, 214 | "sorts": { 215 | "id": { 216 | }, 217 | "first_name": { 218 | }, 219 | "last_name": { 220 | }, 221 | "age": { 222 | }, 223 | "created_at": { 224 | }, 225 | "updated_at": { 226 | }, 227 | "title": { 228 | }, 229 | "department_name": { 230 | } 231 | }, 232 | "filters": { 233 | "id": { 234 | "type": "integer_id", 235 | "operators": [ 236 | "eq", 237 | "not_eq", 238 | "gt", 239 | "gte", 240 | "lt", 241 | "lte" 242 | ] 243 | }, 244 | "first_name": { 245 | "type": "string", 246 | "operators": [ 247 | "eq", 248 | "not_eq", 249 | "eql", 250 | "not_eql", 251 | "prefix", 252 | "not_prefix", 253 | "suffix", 254 | "not_suffix", 255 | "match", 256 | "not_match" 257 | ] 258 | }, 259 | "last_name": { 260 | "type": "string", 261 | "operators": [ 262 | "eq", 263 | "not_eq", 264 | "eql", 265 | "not_eql", 266 | "prefix", 267 | "not_prefix", 268 | "suffix", 269 | "not_suffix", 270 | "match", 271 | "not_match" 272 | ] 273 | }, 274 | "age": { 275 | "type": "integer", 276 | "operators": [ 277 | "eq", 278 | "not_eq", 279 | "gt", 280 | "gte", 281 | "lt", 282 | "lte" 283 | ] 284 | }, 285 | "created_at": { 286 | "type": "datetime", 287 | "operators": [ 288 | "eq", 289 | "not_eq", 290 | "gt", 291 | "gte", 292 | "lt", 293 | "lte" 294 | ] 295 | }, 296 | "updated_at": { 297 | "type": "datetime", 298 | "operators": [ 299 | "eq", 300 | "not_eq", 301 | "gt", 302 | "gte", 303 | "lt", 304 | "lte" 305 | ] 306 | }, 307 | "title": { 308 | "type": "string", 309 | "operators": [ 310 | "eq" 311 | ] 312 | }, 313 | "team_id": { 314 | "type": "integer_id", 315 | "operators": [ 316 | "eq", 317 | "not_eq", 318 | "gt", 319 | "gte", 320 | "lt", 321 | "lte" 322 | ] 323 | } 324 | }, 325 | "relationships": { 326 | "positions": { 327 | "type": "has_many", 328 | "description": null, 329 | "resource": "PositionResource" 330 | }, 331 | "tasks": { 332 | "type": "has_many", 333 | "description": null, 334 | "resource": "TaskResource" 335 | }, 336 | "teams": { 337 | "type": "many_to_many", 338 | "description": null, 339 | "resource": "TeamResource" 340 | }, 341 | "notes": { 342 | "type": "has_many", 343 | "description": null, 344 | "resource": "NoteResource" 345 | }, 346 | "current_position": { 347 | "type": "has_one", 348 | "description": null, 349 | "resource": "PositionResource" 350 | } 351 | } 352 | }, 353 | { 354 | "name": "EpicResource", 355 | "type": "epics", 356 | "description": null, 357 | "attributes": { 358 | "id": { 359 | "type": "integer_id", 360 | "readable": true, 361 | "writable": true, 362 | "description": null 363 | }, 364 | "title": { 365 | "type": "string", 366 | "readable": true, 367 | "writable": true, 368 | "description": null 369 | } 370 | }, 371 | "extra_attributes": { 372 | }, 373 | "sorts": { 374 | "id": { 375 | }, 376 | "title": { 377 | } 378 | }, 379 | "filters": { 380 | "id": { 381 | "type": "integer_id", 382 | "operators": [ 383 | "eq", 384 | "not_eq", 385 | "gt", 386 | "gte", 387 | "lt", 388 | "lte" 389 | ] 390 | }, 391 | "employee_id": { 392 | "type": "integer", 393 | "operators": [ 394 | "eq", 395 | "not_eq", 396 | "gt", 397 | "gte", 398 | "lt", 399 | "lte" 400 | ] 401 | }, 402 | "team_id": { 403 | "type": "integer", 404 | "operators": [ 405 | "eq", 406 | "not_eq", 407 | "gt", 408 | "gte", 409 | "lt", 410 | "lte" 411 | ] 412 | }, 413 | "title": { 414 | "type": "string", 415 | "operators": [ 416 | "eq", 417 | "not_eq", 418 | "eql", 419 | "not_eql", 420 | "prefix", 421 | "not_prefix", 422 | "suffix", 423 | "not_suffix", 424 | "match", 425 | "not_match" 426 | ] 427 | } 428 | }, 429 | "relationships": { 430 | "employee": { 431 | "type": "belongs_to", 432 | "description": null, 433 | "resource": "EmployeeResource" 434 | }, 435 | "team": { 436 | "type": "belongs_to", 437 | "description": null, 438 | "resource": "TeamResource" 439 | }, 440 | "milestones": { 441 | "type": "has_many", 442 | "description": null, 443 | "resource": "MilestoneResource" 444 | } 445 | }, 446 | "polymorphic": true, 447 | "children": [ 448 | "FeatureResource", 449 | "BugResource", 450 | "EpicResource" 451 | ] 452 | }, 453 | { 454 | "name": "FeatureResource", 455 | "type": "features", 456 | "description": null, 457 | "attributes": { 458 | "id": { 459 | "type": "integer_id", 460 | "readable": true, 461 | "writable": true, 462 | "description": null 463 | }, 464 | "title": { 465 | "type": "string", 466 | "readable": true, 467 | "writable": true, 468 | "description": null 469 | }, 470 | "points": { 471 | "type": "integer", 472 | "readable": true, 473 | "writable": true, 474 | "description": null 475 | } 476 | }, 477 | "extra_attributes": { 478 | }, 479 | "sorts": { 480 | "id": { 481 | }, 482 | "title": { 483 | }, 484 | "points": { 485 | } 486 | }, 487 | "filters": { 488 | "id": { 489 | "type": "integer_id", 490 | "operators": [ 491 | "eq", 492 | "not_eq", 493 | "gt", 494 | "gte", 495 | "lt", 496 | "lte" 497 | ] 498 | }, 499 | "employee_id": { 500 | "type": "integer", 501 | "operators": [ 502 | "eq", 503 | "not_eq", 504 | "gt", 505 | "gte", 506 | "lt", 507 | "lte" 508 | ] 509 | }, 510 | "team_id": { 511 | "type": "integer", 512 | "operators": [ 513 | "eq", 514 | "not_eq", 515 | "gt", 516 | "gte", 517 | "lt", 518 | "lte" 519 | ] 520 | }, 521 | "title": { 522 | "type": "string", 523 | "operators": [ 524 | "eq", 525 | "not_eq", 526 | "eql", 527 | "not_eql", 528 | "prefix", 529 | "not_prefix", 530 | "suffix", 531 | "not_suffix", 532 | "match", 533 | "not_match" 534 | ] 535 | }, 536 | "points": { 537 | "type": "integer", 538 | "operators": [ 539 | "eq", 540 | "not_eq", 541 | "gt", 542 | "gte", 543 | "lt", 544 | "lte" 545 | ] 546 | } 547 | }, 548 | "relationships": { 549 | "employee": { 550 | "type": "belongs_to", 551 | "description": null, 552 | "resource": "EmployeeResource" 553 | }, 554 | "team": { 555 | "type": "belongs_to", 556 | "description": null, 557 | "resource": "TeamResource" 558 | } 559 | }, 560 | "polymorphic": true, 561 | "children": [ 562 | "FeatureResource", 563 | "BugResource", 564 | "EpicResource" 565 | ] 566 | }, 567 | { 568 | "name": "MilestoneResource", 569 | "type": "milestones", 570 | "description": null, 571 | "attributes": { 572 | "id": { 573 | "type": "integer_id", 574 | "readable": true, 575 | "writable": true, 576 | "description": null 577 | }, 578 | "name": { 579 | "type": "string", 580 | "readable": true, 581 | "writable": true, 582 | "description": null 583 | } 584 | }, 585 | "extra_attributes": { 586 | }, 587 | "sorts": { 588 | "id": { 589 | }, 590 | "name": { 591 | } 592 | }, 593 | "filters": { 594 | "id": { 595 | "type": "integer_id", 596 | "operators": [ 597 | "eq", 598 | "not_eq", 599 | "gt", 600 | "gte", 601 | "lt", 602 | "lte" 603 | ] 604 | }, 605 | "epic_id": { 606 | "type": "integer", 607 | "operators": [ 608 | "eq", 609 | "not_eq", 610 | "gt", 611 | "gte", 612 | "lt", 613 | "lte" 614 | ] 615 | }, 616 | "name": { 617 | "type": "string", 618 | "operators": [ 619 | "eq", 620 | "not_eq", 621 | "eql", 622 | "not_eql", 623 | "prefix", 624 | "not_prefix", 625 | "suffix", 626 | "not_suffix", 627 | "match", 628 | "not_match" 629 | ] 630 | } 631 | }, 632 | "relationships": { 633 | "epic": { 634 | "type": "belongs_to", 635 | "description": null, 636 | "resource": "EpicResource" 637 | } 638 | } 639 | }, 640 | { 641 | "name": "NoteResource", 642 | "type": "notes", 643 | "description": null, 644 | "attributes": { 645 | "id": { 646 | "type": "integer_id", 647 | "readable": true, 648 | "writable": true, 649 | "description": null 650 | }, 651 | "body": { 652 | "type": "string", 653 | "readable": true, 654 | "writable": true, 655 | "description": null 656 | } 657 | }, 658 | "extra_attributes": { 659 | }, 660 | "sorts": { 661 | "id": { 662 | }, 663 | "body": { 664 | } 665 | }, 666 | "filters": { 667 | "id": { 668 | "type": "integer_id", 669 | "operators": [ 670 | "eq", 671 | "not_eq", 672 | "gt", 673 | "gte", 674 | "lt", 675 | "lte" 676 | ] 677 | }, 678 | "notable_id": { 679 | "type": "integer", 680 | "operators": [ 681 | "eq", 682 | "not_eq", 683 | "gt", 684 | "gte", 685 | "lt", 686 | "lte" 687 | ] 688 | }, 689 | "body": { 690 | "type": "string", 691 | "operators": [ 692 | "eq", 693 | "not_eq", 694 | "eql", 695 | "not_eql", 696 | "prefix", 697 | "not_prefix", 698 | "suffix", 699 | "not_suffix", 700 | "match", 701 | "not_match" 702 | ] 703 | }, 704 | "notable_type": { 705 | "type": "string", 706 | "operators": [ 707 | "eq", 708 | "not_eq", 709 | "eql", 710 | "not_eql", 711 | "prefix", 712 | "not_prefix", 713 | "suffix", 714 | "not_suffix", 715 | "match", 716 | "not_match" 717 | ], 718 | "allow": [ 719 | "Employee", 720 | "Department", 721 | "Team" 722 | ] 723 | } 724 | }, 725 | "relationships": { 726 | "notable": { 727 | "type": "polymorphic_belongs_to", 728 | "description": null, 729 | "resources": [ 730 | "EmployeeResource", 731 | "TeamResource", 732 | "DepartmentResource" 733 | ] 734 | } 735 | } 736 | }, 737 | { 738 | "name": "PositionResource", 739 | "type": "positions", 740 | "description": null, 741 | "attributes": { 742 | "id": { 743 | "type": "integer_id", 744 | "readable": true, 745 | "writable": true, 746 | "description": null 747 | }, 748 | "employee_id": { 749 | "type": "integer", 750 | "readable": false, 751 | "writable": true, 752 | "description": null 753 | }, 754 | "department_id": { 755 | "type": "integer", 756 | "readable": false, 757 | "writable": true, 758 | "description": null 759 | }, 760 | "title": { 761 | "type": "string", 762 | "readable": true, 763 | "writable": true, 764 | "description": null 765 | }, 766 | "active": { 767 | "type": "boolean", 768 | "readable": true, 769 | "writable": true, 770 | "description": null 771 | } 772 | }, 773 | "extra_attributes": { 774 | }, 775 | "sorts": { 776 | "id": { 777 | }, 778 | "employee_id": { 779 | }, 780 | "department_id": { 781 | }, 782 | "title": { 783 | }, 784 | "historical_index": { 785 | }, 786 | "active": { 787 | } 788 | }, 789 | "filters": { 790 | "id": { 791 | "type": "integer_id", 792 | "operators": [ 793 | "eq", 794 | "not_eq", 795 | "gt", 796 | "gte", 797 | "lt", 798 | "lte" 799 | ] 800 | }, 801 | "employee_id": { 802 | "type": "integer", 803 | "operators": [ 804 | "eq", 805 | "not_eq", 806 | "gt", 807 | "gte", 808 | "lt", 809 | "lte" 810 | ] 811 | }, 812 | "department_id": { 813 | "type": "integer", 814 | "operators": [ 815 | "eq", 816 | "not_eq", 817 | "gt", 818 | "gte", 819 | "lt", 820 | "lte" 821 | ] 822 | }, 823 | "title": { 824 | "type": "string", 825 | "operators": [ 826 | "eq", 827 | "not_eq", 828 | "eql", 829 | "not_eql", 830 | "prefix", 831 | "not_prefix", 832 | "suffix", 833 | "not_suffix", 834 | "match", 835 | "not_match" 836 | ] 837 | }, 838 | "active": { 839 | "type": "boolean", 840 | "operators": [ 841 | "eq" 842 | ], 843 | "single": true 844 | }, 845 | "current": { 846 | "type": "boolean", 847 | "operators": [ 848 | "eq" 849 | ], 850 | "single": true 851 | } 852 | }, 853 | "relationships": { 854 | "employee": { 855 | "type": "belongs_to", 856 | "description": null, 857 | "resource": "EmployeeResource" 858 | }, 859 | "department": { 860 | "type": "belongs_to", 861 | "description": null, 862 | "resource": "DepartmentResource" 863 | } 864 | } 865 | }, 866 | { 867 | "name": "TaskResource", 868 | "type": "tasks", 869 | "description": null, 870 | "attributes": { 871 | "id": { 872 | "type": "integer_id", 873 | "readable": true, 874 | "writable": true, 875 | "description": null 876 | }, 877 | "title": { 878 | "type": "string", 879 | "readable": true, 880 | "writable": true, 881 | "description": null 882 | } 883 | }, 884 | "extra_attributes": { 885 | }, 886 | "sorts": { 887 | "id": { 888 | }, 889 | "title": { 890 | } 891 | }, 892 | "filters": { 893 | "id": { 894 | "type": "integer_id", 895 | "operators": [ 896 | "eq", 897 | "not_eq", 898 | "gt", 899 | "gte", 900 | "lt", 901 | "lte" 902 | ] 903 | }, 904 | "employee_id": { 905 | "type": "integer", 906 | "operators": [ 907 | "eq", 908 | "not_eq", 909 | "gt", 910 | "gte", 911 | "lt", 912 | "lte" 913 | ] 914 | }, 915 | "team_id": { 916 | "type": "integer", 917 | "operators": [ 918 | "eq", 919 | "not_eq", 920 | "gt", 921 | "gte", 922 | "lt", 923 | "lte" 924 | ] 925 | }, 926 | "title": { 927 | "type": "string", 928 | "operators": [ 929 | "eq", 930 | "not_eq", 931 | "eql", 932 | "not_eql", 933 | "prefix", 934 | "not_prefix", 935 | "suffix", 936 | "not_suffix", 937 | "match", 938 | "not_match" 939 | ] 940 | } 941 | }, 942 | "relationships": { 943 | "employee": { 944 | "type": "belongs_to", 945 | "description": null, 946 | "resource": "EmployeeResource" 947 | }, 948 | "team": { 949 | "type": "belongs_to", 950 | "description": null, 951 | "resource": "TeamResource" 952 | } 953 | }, 954 | "polymorphic": true, 955 | "children": [ 956 | "FeatureResource", 957 | "BugResource", 958 | "EpicResource" 959 | ] 960 | }, 961 | { 962 | "name": "TeamResource", 963 | "type": "teams", 964 | "description": null, 965 | "attributes": { 966 | "id": { 967 | "type": "integer_id", 968 | "readable": true, 969 | "writable": true, 970 | "description": null 971 | }, 972 | "name": { 973 | "type": "string", 974 | "readable": true, 975 | "writable": true, 976 | "description": null 977 | } 978 | }, 979 | "extra_attributes": { 980 | }, 981 | "sorts": { 982 | "id": { 983 | }, 984 | "name": { 985 | } 986 | }, 987 | "filters": { 988 | "id": { 989 | "type": "integer_id", 990 | "operators": [ 991 | "eq", 992 | "not_eq", 993 | "gt", 994 | "gte", 995 | "lt", 996 | "lte" 997 | ] 998 | }, 999 | "department_id": { 1000 | "type": "integer", 1001 | "operators": [ 1002 | "eq", 1003 | "not_eq", 1004 | "gt", 1005 | "gte", 1006 | "lt", 1007 | "lte" 1008 | ] 1009 | }, 1010 | "name": { 1011 | "type": "string", 1012 | "operators": [ 1013 | "eq", 1014 | "not_eq", 1015 | "eql", 1016 | "not_eql", 1017 | "prefix", 1018 | "not_prefix", 1019 | "suffix", 1020 | "not_suffix", 1021 | "match", 1022 | "not_match" 1023 | ] 1024 | }, 1025 | "employee_id": { 1026 | "type": "integer_id", 1027 | "operators": [ 1028 | "eq", 1029 | "not_eq", 1030 | "gt", 1031 | "gte", 1032 | "lt", 1033 | "lte" 1034 | ] 1035 | } 1036 | }, 1037 | "relationships": { 1038 | "department": { 1039 | "type": "belongs_to", 1040 | "description": null, 1041 | "resource": "DepartmentResource" 1042 | }, 1043 | "employees": { 1044 | "type": "many_to_many", 1045 | "description": null, 1046 | "resource": "EmployeeResource" 1047 | }, 1048 | "tasks": { 1049 | "type": "has_many", 1050 | "description": null, 1051 | "resource": "TaskResource" 1052 | }, 1053 | "notes": { 1054 | "type": "has_many", 1055 | "description": null, 1056 | "resource": "NoteResource" 1057 | } 1058 | } 1059 | } 1060 | ], 1061 | "endpoints": { 1062 | "/api/v1/departments": { 1063 | "actions": { 1064 | "index": { 1065 | "resource": "DepartmentResource" 1066 | }, 1067 | "show": { 1068 | "resource": "DepartmentResource" 1069 | }, 1070 | "create": { 1071 | "resource": "DepartmentResource" 1072 | }, 1073 | "update": { 1074 | "resource": "DepartmentResource" 1075 | }, 1076 | "destroy": { 1077 | "resource": "DepartmentResource" 1078 | } 1079 | } 1080 | }, 1081 | "/api/v1/employees": { 1082 | "actions": { 1083 | "index": { 1084 | "resource": "EmployeeResource" 1085 | }, 1086 | "show": { 1087 | "resource": "EmployeeResource" 1088 | }, 1089 | "create": { 1090 | "resource": "EmployeeResource" 1091 | }, 1092 | "update": { 1093 | "resource": "EmployeeResource" 1094 | }, 1095 | "destroy": { 1096 | "resource": "EmployeeResource" 1097 | } 1098 | } 1099 | }, 1100 | "/api/v1/milestones": { 1101 | "actions": { 1102 | "index": { 1103 | "resource": "MilestoneResource" 1104 | }, 1105 | "show": { 1106 | "resource": "MilestoneResource" 1107 | }, 1108 | "create": { 1109 | "resource": "MilestoneResource" 1110 | }, 1111 | "update": { 1112 | "resource": "MilestoneResource" 1113 | }, 1114 | "destroy": { 1115 | "resource": "MilestoneResource" 1116 | } 1117 | } 1118 | }, 1119 | "/api/v1/notes": { 1120 | "actions": { 1121 | "index": { 1122 | "resource": "NoteResource" 1123 | }, 1124 | "show": { 1125 | "resource": "NoteResource" 1126 | }, 1127 | "create": { 1128 | "resource": "NoteResource" 1129 | }, 1130 | "update": { 1131 | "resource": "NoteResource" 1132 | }, 1133 | "destroy": { 1134 | "resource": "NoteResource" 1135 | } 1136 | } 1137 | }, 1138 | "/api/v1/positions": { 1139 | "actions": { 1140 | "index": { 1141 | "resource": "PositionResource" 1142 | }, 1143 | "show": { 1144 | "resource": "PositionResource" 1145 | }, 1146 | "create": { 1147 | "resource": "PositionResource" 1148 | }, 1149 | "update": { 1150 | "resource": "PositionResource" 1151 | }, 1152 | "destroy": { 1153 | "resource": "PositionResource" 1154 | } 1155 | } 1156 | }, 1157 | "/api/v1/tasks": { 1158 | "actions": { 1159 | "index": { 1160 | "resource": "TaskResource" 1161 | }, 1162 | "show": { 1163 | "resource": "TaskResource" 1164 | }, 1165 | "create": { 1166 | "resource": "TaskResource" 1167 | }, 1168 | "update": { 1169 | "resource": "TaskResource" 1170 | }, 1171 | "destroy": { 1172 | "resource": "TaskResource" 1173 | } 1174 | } 1175 | }, 1176 | "/api/v1/teams": { 1177 | "actions": { 1178 | "index": { 1179 | "resource": "TeamResource" 1180 | }, 1181 | "show": { 1182 | "resource": "TeamResource" 1183 | }, 1184 | "create": { 1185 | "resource": "TeamResource" 1186 | }, 1187 | "update": { 1188 | "resource": "TeamResource" 1189 | }, 1190 | "destroy": { 1191 | "resource": "TeamResource" 1192 | } 1193 | } 1194 | } 1195 | }, 1196 | "types": { 1197 | "integer_id": { 1198 | "kind": "scalar", 1199 | "description": "Base Type. Query/persist as integer, render as string." 1200 | }, 1201 | "uuid": { 1202 | "kind": "scalar", 1203 | "description": "Base Type. Like a normal string, but by default only eq/!eq and case-sensitive." 1204 | }, 1205 | "string_enum": { 1206 | "kind": "scalar", 1207 | "description": "String enum type. Like a normal string, but only eq/!eq and case-sensitive. Limited to only the allowed values." 1208 | }, 1209 | "integer_enum": { 1210 | "kind": "scalar", 1211 | "description": "Integer enum type. Like a normal integer, but only eq/!eq filters. Limited to only the allowed values." 1212 | }, 1213 | "string": { 1214 | "kind": "scalar", 1215 | "description": "Base Type." 1216 | }, 1217 | "integer": { 1218 | "kind": "scalar", 1219 | "description": "Base Type." 1220 | }, 1221 | "big_decimal": { 1222 | "kind": "scalar", 1223 | "description": "Base Type." 1224 | }, 1225 | "float": { 1226 | "kind": "scalar", 1227 | "description": "Base Type." 1228 | }, 1229 | "boolean": { 1230 | "kind": "scalar", 1231 | "description": "Base Type." 1232 | }, 1233 | "date": { 1234 | "kind": "scalar", 1235 | "description": "Base Type." 1236 | }, 1237 | "datetime": { 1238 | "kind": "scalar", 1239 | "description": "Base Type." 1240 | }, 1241 | "hash": { 1242 | "kind": "record", 1243 | "description": "Base Type." 1244 | }, 1245 | "array": { 1246 | "kind": "array", 1247 | "description": "Base Type." 1248 | }, 1249 | "array_of_integer_ids": { 1250 | "kind": "array", 1251 | "description": "Base Type." 1252 | }, 1253 | "array_of_uuids": { 1254 | "kind": "array", 1255 | "description": "Base Type." 1256 | }, 1257 | "array_of_string_enums": { 1258 | "kind": "array", 1259 | "description": "Base Type." 1260 | }, 1261 | "array_of_integer_enums": { 1262 | "kind": "array", 1263 | "description": "Base Type." 1264 | }, 1265 | "array_of_strings": { 1266 | "kind": "array", 1267 | "description": "Base Type." 1268 | }, 1269 | "array_of_integers": { 1270 | "kind": "array", 1271 | "description": "Base Type." 1272 | }, 1273 | "array_of_big_decimals": { 1274 | "kind": "array", 1275 | "description": "Base Type." 1276 | }, 1277 | "array_of_floats": { 1278 | "kind": "array", 1279 | "description": "Base Type." 1280 | }, 1281 | "array_of_dates": { 1282 | "kind": "array", 1283 | "description": "Base Type." 1284 | }, 1285 | "array_of_datetimes": { 1286 | "kind": "array", 1287 | "description": "Base Type." 1288 | } 1289 | } 1290 | } -------------------------------------------------------------------------------- /public/api/v1/vandal/assets/img/squares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graphiti-api/employee_directory/4930916e869f1f5d271d6ac9c10fd34f0f13d2b0/public/api/v1/vandal/assets/img/squares.png -------------------------------------------------------------------------------- /public/api/v1/vandal/css/chunk-vendors.e6a6ca22.css: -------------------------------------------------------------------------------- 1 | .hljs{display:block;overflow-x:auto;padding:.5em;background:#f0f0f0}.hljs,.hljs-subst{color:#444}.hljs-comment{color:#888}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#bc6060}.hljs-literal{color:#78a960}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} -------------------------------------------------------------------------------- /public/api/v1/vandal/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graphiti-api/employee_directory/4930916e869f1f5d271d6ac9c10fd34f0f13d2b0/public/api/v1/vandal/favicon.ico -------------------------------------------------------------------------------- /public/api/v1/vandal/index.html: -------------------------------------------------------------------------------- 1 |