-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
230 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Copyright (c) 2012-2017, Fairmondo eG. This file is | ||
# licensed under the GNU Affero General Public License version 3 or later. | ||
# See the COPYRIGHT file for details. | ||
|
||
module ArticleParams | ||
extend ActiveSupport::Concern | ||
|
||
ARTICLE_CREATE_PARAMS = [ | ||
# Common attrs | ||
:title, :content, :condition, :condition_extra, :quantity, | ||
:borrowable, :swappable, | ||
# :business_transaction_attributes, dont think they are needed right now | ||
# Money attrs | ||
:price_cents, :price, :vat, | ||
# Payment attrs | ||
:payment_details, :payment_bank_transfer, :payment_cash, | ||
:payment_paypal, :payment_invoice, :payment_voucher, | ||
:payment_cash_on_delivery, :payment_cash_on_delivery_price, | ||
:payment_cash_on_delivery_price_cents, :payment_debit, :subscription, # should we change the name to :payment_subscription ? | ||
# Basic price attrs | ||
:basic_price, :basic_price_cents, :basic_price_amount, | ||
# Transport attrs | ||
:transport_pickup, | ||
:transport_type1, :transport_type1_price_cents, | ||
:transport_type1_price, :transport_type1_provider, | ||
:transport_type1_number, | ||
:transport_type2, :transport_type2_price_cents, | ||
:transport_type2_price, :transport_type2_provider, | ||
:transport_type2_number, | ||
:transport_details, | ||
:unified_transport, | ||
:transport_time, | ||
# Category attrs | ||
{ category_ids: [] }, | ||
# Commendation attrs | ||
:fair, :ecologic, :fair_kind, :fair_seal, :ecologic_seal, | ||
:ecologic_kind, :upcycling_reason, :small_and_precious, | ||
:small_and_precious_eu_small_enterprise, :small_and_precious_reason, | ||
:small_and_precious_handmade, | ||
{ fair_trust_questionnaire_attributes: [ | ||
# Question 1: supports marginalized workers (req) | ||
:support, :support_explanation, :support_other, { support_checkboxes: [] }, | ||
# Question 2: labor conditions acceptable? (req) | ||
:labor_conditions, { labor_conditions_checkboxes: [] }, | ||
:labor_conditions_explanation, :labor_conditions_other, | ||
# Question 3: is production environmentally friendly (opt) | ||
:environment_protection, { environment_protection_checkboxes: [] }, | ||
:environment_protection_explanation, :environment_protection_other, | ||
# Question 4: does controlling of these standards exist (req) | ||
:controlling, { controlling_checkboxes: [] }, :controlling_explanation, | ||
:controlling_other, | ||
# Question 5: awareness raising programs supported? (opt) | ||
:awareness_raising, { awareness_raising_checkboxes: [] }, | ||
:awareness_raising_explanation, :awareness_raising_other | ||
] }, | ||
{ social_producer_questionnaire_attributes: [ | ||
:nonprofit_association, { nonprofit_association_checkboxes: [] }, | ||
:social_businesses_muhammad_yunus, | ||
{ social_businesses_muhammad_yunus_checkboxes: [] }, | ||
:social_entrepreneur, { social_entrepreneur_checkboxes: [] }, | ||
:social_entrepreneur_explanation | ||
] }, | ||
# Image attrs | ||
{ images_attributes: ImageParams::NESTED_IMAGE_PARAMS }, | ||
:image_2_url, | ||
# Legal Entity attrs | ||
:custom_seller_identifier, :gtin, | ||
# Fees and Donations attrs | ||
:friendly_percent, :friendly_percent_organisation_id, | ||
# edit_as_new attr | ||
:original_id, | ||
# Template attrs | ||
:save_as_template, | ||
:article_template_name | ||
].freeze | ||
|
||
ARTICLE_UPDATE_PARAMS = (ARTICLE_CREATE_PARAMS + %i[tos_accepted]).freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) 2012-2017, Fairmondo eG. This file is | ||
# licensed under the GNU Affero General Public License version 3 or later. | ||
# See the COPYRIGHT file for details. | ||
|
||
module BusinessTransactionParams | ||
extend ActiveSupport::Concern | ||
|
||
BUSINESS_TRANSACTION_PARAMS = %i( | ||
selected_transport | ||
selected_payment | ||
quantity_bought | ||
bike_courier_message | ||
bike_courier_time | ||
tos_bike_courier_accepte | ||
).freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) 2012-2017, Fairmondo eG. This file is | ||
# licensed under the GNU Affero General Public License version 3 or later. | ||
# See the COPYRIGHT file for details. | ||
|
||
module UserParams | ||
extend ActiveSupport::Concern | ||
|
||
USER_CREATE_PARAMS = %i( | ||
email password new_terms_confirmed nickname type newsletter legal privacy | ||
voluntary_contribution referral).freeze | ||
USER_UPDATE_PARAMS = [ | ||
:current_password, # <- update specific | ||
:email, :password, :password_confirmation, :remember_me, :type, | ||
:nickname, :legal, :paypal_account, :banned, | ||
:about_me, :phone, :mobile, :fax, | ||
:company_name, :max_value_of_goods_cents_bonus, | ||
:fastbill_profile_update, :vacationing, :newsletter, :receive_comments_notification, | ||
:iban, :bic, :bank_name, :bank_account_owner, :direct_debit_confirmation, | ||
:unified_transport_provider, :unified_transport_maximum_articles, :unified_transport_price, | ||
:free_transport_available, :free_transport_at_price, | ||
{ image_attributes: ImageParams::IMAGE_PARAMS } | ||
].freeze | ||
USER_UPDATE_LEGAL_ENTITY_PARAMS = %i( | ||
terms cancellation about cancellation_form invoicing_email order_notifications_email | ||
).freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.