Giter Club home page Giter Club logo

hwf-staffapp's Introduction

Help With Fees - Staff App

Code Climate Test Coverage

Build Status

Overview

This app is used by staff in the courts and tribunals to enter data regarding help with fees applications, record the decision, and collect statistics.

Project Standards

  • Authentications via Devise / CanCanCan
  • Rspec features, not cucumber
  • Slim templating language
  • JavaScript in preference to Coffeescript

Redis

We are using Redis for step back navigation link. You will need to run a redis-server in order for the application to work correctly. We are using mock_redis in rspec to make it work it tests.

Feature switching

Model FeatureSwitching have following attributes: feature_key, activation_time, office_id, enabled. When apply you can "schedule" a feature to be active from a certain date or for specific office. Feature switching table is managed manually from a rails console for now.

Active Feature flag for post UCD changes

Run this in your localhost to enable UCD changes: FeatureSwitching.create(feature_key: 'band_calculation', enabled: true)

N+1 queries debugging

There is a gem called Bullet. If you want to check N+1 queries in development mode, you can uncomment Bullet related lines in development.rb

Delayed CRON Jobs (delayed_cron_job)

We need to keep an eye on the results of DWP checks. When the API is down the service will disable benefit related applications. Then we re-run failed checks in 10 minutes intervals to see if the API is back again. We are not using standard CRON table because Kubernetes have a bug. So we are using delayed cron job that has the schedule in DB table. These tasks are checked by

rake jobs:work

that needs to run on the background, currently set up in rub.sh : rake jobs:work &

Delayed jobs for BenefitChecks

To set it up (if there is no record in DB) run this in rails console: BenefitCheckRerunJob.delay(cron: '*/10 * * * *').perform_now

Delayed jobs for DWP offline notification

Runs every 5 minutes DwpReportStatusJob.delay(cron: '*/5 * * * *').perform_now

Delayed jobs for HMRC data purge

Runs 10 minutes past midnight HmrcDataPurgeJob.delay(cron: '10 0 * * *').perform_now

Delayed jobs for Personal data purge

Runs every day at 1am PersonalDataPurgeJob.delay(cron: '0 1 * * *').perform_now

Delayed jobs for Abandoned Application data purge

Runs every day at 1am AbandonedApplicationPurgeJob.delay(cron: '0 1 * * *').perform_now

Delayed jobs for Old export file data purge

Runs every day at 2am OldFileExportPurgeJob.delay(cron: '0 2 * * *').perform_now

Front end library

You will need to install govuk-frontend library

npm install --save govuk-frontend

Mimemagic gem has a dependency so you need to install this on your machine first brew install shared-mime-info.

Creating initial user

There is a rake task that takes email, password and role

rake user:create

If you want to add any custom options, use the below as an example:

rake "user:create[[email protected], 12345678900, admin, name]"

Note: the quotes around the task are important!

Run an applicants report for a finacial year

There is a rake task that creates the report

rake "reports:applicants[2021, 2022]"

this will generate a zip file applicants-2021-2022-fy.csv.zip

Run raw data extract for longer timescale

There is a rake task that creates the report

rake "reports:raw_data_extract[2021-01-01, 2022-12-31]"

this will generate a zip file raw_data-1-1-2021-31-12-2022.csv.zip

Run tests in parallel

Follow the official guides to setup your local env

Run the specs in parallel

RAILS_ENV=test bundle exec rake parallel:spec

Run the cucumber features in parallel

CAPYBARA_SERVER_PORT=random bundle exec rake parallel:features

Cucumber test report

Cucumber report is enabled now. At the end of the test run you should see a link to a website. When you run tests in parallel it will generate report per process so if you want to see one report only you should run test directly without parallel functionality.

Deployment versions trigger: 6

hwf-staffapp's People

Contributors

ahsanzx97 avatar alexavsmith avatar axemonkey avatar colinbruce avatar cwikops avatar damongreen123 avatar danielbe11 avatar daniellekushnir avatar dependabot-preview[bot] avatar dependabot[bot] avatar dotemacs avatar eyss1234 avatar fred83200 avatar garytaylor avatar jitenp avatar joshlow avatar kalvinsolirius avatar lambley avatar leoapost avatar lmoney-moj avatar mapingo avatar mattmb avatar novotnyjakub avatar pwyborn avatar roortest avatar sgmselli avatar stephenrichards avatar temi77 avatar timja avatar zaparka avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

uk-gov-mirror

hwf-staffapp's Issues

Clean up DWP checker

The way it was merged in #268 it needs to be revisited and cleaned up properly. This was just a hack.

Remove the test

./spec/services/partner_age_check_spec.rb:22

PartnerAgeCheck service doesn't have a high_threshold_exceeded...

Suggestion: Use Dependabot to keep dependencies up-to-date

Hey @zaparka,

I know you folks use Dependabot on a bunch of other repos at MoJ. Would you be up for adding it to this one? I noticed a few insecure dependencies in the Gemfile.lock (sprockets and nokogiri).

(I'm on a push to get more open source repos using Dependabot because I'm about to start displaying any failing open-source tests for dependency updates on the Dependabot compatibility-score pages, in order to help maintainers fix their libraries and users find workarounds for bugs / braking changes.)

Refactor CSS

e.g. DwpCheck.result is not solely used for dwp_check

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Update dependency rubocop-rails to v2.26.2
  • Update dependency rack-livereload to v0.6.0

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

bundler
Gemfile
  • ruby 3.3.5
  • application_insights '~> 0.5.6'
  • csv undefined
  • dotenv-rails undefined
  • rails '~> 7.2.0'
  • redis undefined
  • stackprof undefined
  • sentry-rails '~> 5.8'
  • i18n '>= 1.10'
  • parser '>= 3.1.2.0'
  • pg '~> 1.2'
  • rack-host-redirect undefined
  • rack '~> 3.1'
  • rails-i18n '~> 7.0.3'
  • azure-storage-blob '~> 2.0', '>= 2.0.3'
  • config undefined
  • bootsnap undefined
  • devise '>= 4.9.3'
  • devise_invitable '>= 2.0.9'
  • devise-security '~> 0.18.0'
  • pundit '~> 2.1'
  • ostruct undefined
  • delayed_cron_job undefined
  • delayed_job_active_record undefined
  • dartsass-sprockets "~> 3.1"
  • terser undefined
  • coffee-rails '~> 5.0.0'
  • jquery-rails undefined
  • jbuilder '~> 2.2'
  • sdoc '>= 2'
  • slim-rails '~> 3.2'
  • puma '~> 6.3', '>= 6.0.2'
  • date_validator '0.12'
  • will_paginate undefined
  • paranoia undefined
  • paper_trail undefined
  • simple_encryptable undefined
  • gtm_on_rails undefined
  • chartkick undefined
  • ckeditor '~> 5.1'
  • groupdate undefined
  • nokogiri undefined
  • pg_search undefined
  • rest-client undefined
  • rubyzip undefined
  • virtus undefined
  • rexml '>= 3.3.6'
  • govuk_notify_rails undefined
  • rack-livereload undefined
  • terminal-notifier-guard undefined
  • web-console undefined
  • better_errors undefined
  • binding_of_caller undefined
  • bullet undefined
  • bundler-audit undefined
  • byebug undefined
  • climate_control undefined
  • factory_bot_rails undefined
  • guard-rspec undefined
  • guard-rubocop undefined
  • listen undefined
  • parallel_tests undefined
  • pry-rails undefined
  • rspec-rails undefined
  • rubocop undefined
  • rubocop-performance undefined
  • rubocop-rails undefined
  • rubocop-rspec undefined
  • rubocop-capybara undefined
  • rubocop-factory_bot undefined
  • rubocop-rspec_rails undefined
  • simplecov '~> 0.21'
  • spring undefined
  • spring-watcher-listen '~> 2.0'
  • timecop undefined
  • brakeman undefined
  • capybara undefined
  • capybara-screenshot undefined
  • codeclimate-test-reporter undefined
  • cucumber undefined
  • cucumber-rails undefined
  • database_cleaner-active_record undefined
  • faker undefined
  • launchy undefined
  • mock_redis undefined
  • rails-controller-testing undefined
  • rspec_junit_formatter undefined
  • shoulda-matchers undefined
  • site_prism undefined
  • test-prof "~> 1.0"
  • webdrivers undefined
  • webmock undefined
dockerfile
Dockerfile
  • ruby 3.3.5-alpine3.20
performance-tests/Dockerfile
  • java 8-jdk-alpine
helm-values
charts/help-with-fees-staffapp/values.yaml
helmv3
charts/help-with-fees-staffapp/Chart.yaml
  • base 1.3.0
npm
package.json
  • accessible-autocomplete ^3.0.0
  • govuk-frontend ^5.5.0
  • node >=0.18.x
ruby-version
.ruby-version
  • ruby 3.3.5

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.