Commit d7ec5f8e authored by Alonso Ibarra, Juncal's avatar Alonso Ibarra, Juncal

Added final releases for all the DECIDE tools

parent dd2fb5aa

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

[submodule "statemachine"]
path = statemachine
url =
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<Settings><!--This file was automatically generated by Ruby plugin.
You are allowed to:
1. Reorder generators
2. Remove generators
3. Add installed generators
To add new installed generators automatically delete this file and reload the project.
--><GeneratorsGroup><Generator name="active_record:migration" /><Generator name="active_record:model" /><Generator name="active_record:observer" /><Generator name="active_record:session_migration" /><Generator name="controller" /><Generator name="erb:controller" /><Generator name="erb:mailer" /><Generator name="erb:scaffold" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="mailer" /><Generator name="metal" /><Generator name="migration" /><Generator name="model" /><Generator name="model_subclass" /><Generator name="observer" /><Generator name="performance_test" /><Generator name="plugin" /><Generator name="resource" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="session_migration" /><Generator name="stylesheets" /><Generator name="test_unit:controller" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:observer" /><Generator name="test_unit:performance" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /></GeneratorsGroup></Settings>
--><GeneratorsGroup><Generator name="active_record:application_record" /><Generator name="application_record" /><Generator name="assets" /><Generator name="bootstrap:install" /><Generator name="bootstrap:layout" /><Generator name="bootstrap:partial" /><Generator name="bootstrap:themed" /><Generator name="channel" /><Generator name="coffee:assets" /><Generator name="controller" /><Generator name="delayed_job" /><Generator name="delayed_job:active_record" /><Generator name="delayed_job:upgrade" /><Generator name="erb:controller" /><Generator name="erb:mailer" /><Generator name="erb:scaffold" /><Generator name="generator" /><Generator name="haml:application_layout" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="jbuilder" /><Generator name="job" /><Generator name="js:assets" /><Generator name="less:assets" /><Generator name="mailer" /><Generator name="migration" /><Generator name="model" /><Generator name="resource" /><Generator name="rspec:controller" /><Generator name="rspec:feature" /><Generator name="rspec:helper" /><Generator name="rspec:install" /><Generator name="rspec:integration" /><Generator name="rspec:job" /><Generator name="rspec:mailer" /><Generator name="rspec:model" /><Generator name="rspec:observer" /><Generator name="rspec:request" /><Generator name="rspec:scaffold" /><Generator name="rspec:view" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="system_test" /><Generator name="task" /><Generator name="test_unit:controller" /><Generator name="test_unit:generator" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:job" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /><Generator name="test_unit:system" /></GeneratorsGroup></Settings>
This diff is collapsed.
......@@ -3,5 +3,5 @@
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
<component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 2.3.8" project-jdk-type="RUBY_SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.4.1" project-jdk-type="RUBY_SDK" />
\ No newline at end of file
......@@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<module fileurl="file://$PROJECT_DIR$/.idea/ACSmI_billing.iml" filepath="$PROJECT_DIR$/.idea/ACSmI_billing.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/src.iml" filepath="$PROJECT_DIR$/.idea/src.iml" />
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
--require spec_helper
\ No newline at end of file
......@@ -18,6 +18,10 @@ gem 'authlogic'
gem 'rest-client'
gem 'attr_encrypted'
gem 'will_paginate'
gem 'vault', '~> 0.1'
gem 'prawn'
gem 'prawn-table'
......@@ -31,6 +35,17 @@ gem 'bootstrap-generators', '~> 3.3.4'
gem 'haml-rails'
gem 'aws-sdk', '~> 3'
gem 'watir'
gem 'webdrivers'
gem 'headless'
gem 'two_captcha'
gem 'money'
gem 'eu_central_bank'
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
This diff is collapsed.
......@@ -8,7 +8,7 @@ The below steps should be followed to install this component:
1. Install ruby version 2.4.5 ( for Windows or for Unix). Please make sure ‘ruby -v’ returns the correct version in console.
2. Install dependencies. Go to project folder and run the following: ‘gem install bundler; bundle install’. Wait until all the gems are installed.
3. Please adjust confgiuration in:
- db/seeds.rb - specify your gmail credentials in 'smtp_email' and 'smtp_password' settings in order to enable component's mailing functionality. Also, please set 'billing_component_url' setting to match you billing component installation url.
- db/seeds.rb - specify your gmail credentials in 'smtp_email' and 'smtp_password' settings in order to enable component's mailing functionality. Also, please pay attention to BILLING_COMPONENT_URL environment variable to match you billing component installation url.
- config/initializers/acsmi_ext.rb - for security reasons it is best to update ACSMI_EMAIL and INITIAL_PASSWORD with arbitrary values. Those credentials are to be used by contracting component to make API calls to ACSmI Billing.
4. Create and configure the database. Go to project folder and run the following: ‘rake db:create; rake db:migrate; rake db:seed’
5. Start the server. Run “bin/rails server -b -p 3000 -e development”
class Api::V1::UsageRecordsController < ApplicationController
skip_before_action :verify_authenticity_token
before_action :check_user, except: %i[show index]
before_action :http_basic_authenticate, only: %i[index show]
include Exceptions
def created_contract
def cancelled_contract
def show
errors = validate_usage_records_request
((render json: { errors: errors}, status: 422) && return) unless errors.blank?
usage_record = UsageRecord.includes(:invoice, invoice: [:user]).find_by_id(params[:id])
if usage_record
response = usage_records_for(@user, usage_record)
status = 200
response = "'UsageRecord' with given id wasn't found"
status = 404
render json: { usage_records: response}, status: status
def index
if params[:userIds]
users = User.where('id IN (?)', params[:userIds])
invoices = Invoice.joins(:user).where(users:{id: users}) if users.any?
invoices = Invoice.all
if params[:from_date] && params[:until_date]
invoices ={|inv| inv.beginning >= params[:from_date].to_date && inv.ending <= params[:until_date].to_date} unless invoices.nil?
usage_records = UsageRecord.joins(:invoice).where(invoices:{id: invoices}).includes(:invoice, invoice: [:user]) if !invoices.nil? && invoices.any?
if !usage_records.nil? && usage_records.any?
if params[:page] && params[:per_page]
usage_records = usage_records.paginate(page: params[:page], per_page: params[:per_page])
rescue RangeError
response = usage_records_for(@user, usage_records, true)
status = 200
response = "'UsageRecords' for given users wasn't found"
status = 404
render json: { usage_records: response}, status: status
def create
contract = fetch_contract
if contract.nil?
state = { error: "'Contract' with given id wasn't found" }
status = 404
elsif @user.try(:admin)
user = User.find(contract.user_id)
usage_data = usage_record_params.merge(date:,
user: user,