Compare commits

...

44 Commits

Author SHA1 Message Date
Maikel Linke
4658a53aeb Update translations from Transifex 2020-04-17 15:37:54 +10:00
Maikel
3bc834435d Merge pull request #5152 from Matt-Yorkley/missing-indexes
Add missing indexes to spree_orders and spree_products
2020-04-17 15:16:03 +10:00
Maikel
9111ff1a38 Merge pull request #5211 from openfoodfoundation/transifex
Transifex
2020-04-17 14:24:26 +10:00
Maikel
b0eac1ecaa Merge branch 'master' into missing-indexes 2020-04-17 14:17:32 +10:00
Maikel
2e31f234d6 Merge pull request #5196 from Matt-Yorkley/customers-performance
Admin Customers performance
2020-04-17 13:28:39 +10:00
Maikel
e29a81cacc Merge pull request #5186 from oeoeaio/customer-totals-inventory-sku
Take sku overrides into account in customer totals report
2020-04-17 13:27:43 +10:00
Maikel
a672af1a79 Merge pull request #5237 from luisramos0/master_with_change
Clone of #5176
2020-04-17 13:27:14 +10:00
Maikel
f282ff805d Merge pull request #5172 from kristinalim/feature/5170-increase_locale_chars_in_spree_users
Increase max characters for locale in spree_users
2020-04-16 18:18:45 +10:00
Transifex-Openfoodnetwork
2f7dc9a578 Updating translations for config/locales/es.yml 2020-04-16 17:09:44 +10:00
Luis Ramos
8532fa16cd Merge pull request #5202 from luisramos0/improve_checkout_js
Improve Checkout error handling in JS
2020-04-15 22:25:05 +01:00
chrishil1
c3f01be580 Fixed display all required tag 2020-04-15 19:00:35 +01:00
Luis Ramos
cedf1b26f2 If no flash is sent from the server, show the generic error 2020-04-14 14:31:34 +01:00
Luis Ramos
47a93568dc Make code simpler by extracting methods 2020-04-14 13:55:20 +01:00
Luis Ramos
62471bf2ab Clear Loading spinner when exception is caught 2020-04-14 13:50:38 +01:00
Luis Ramos
cdf5bcb7eb Improve unexpected error handling and add test cases for it 2020-04-14 13:44:58 +01:00
Luis Ramos
7414047b92 Switch from old success/error to modern then/catch structure
Catch() will get a few more errors then errors()

Also, add try/catch inside catch to detect any errors parsing the
response error payload
2020-04-14 13:04:28 +01:00
Pau Pérez Fabregat
4ef5dfe430 Merge pull request #5199 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.5.2
Bump rubocop-rails from 2.5.1 to 2.5.2
2020-04-14 10:17:59 +02:00
Pau Pérez Fabregat
e58a1d080f Merge pull request #5205 from openfoodfoundation/dependabot/bundler/ddtrace-0.34.2
Bump ddtrace from 0.34.1 to 0.34.2
2020-04-14 10:17:06 +02:00
Luis Ramos
357a88fa22 Merge pull request #4786 from luisramos0/stripe_sca_extra_subs_fix
Make StripeSCA (with new authorize/purchase workflow) work with Subscriptions again
2020-04-13 17:21:53 +01:00
Rob H
f71045b3f2 Improve naming of variables in VariantOverridesIndexed for readability 2020-04-13 22:24:25 +10:00
Rob H
dcdd3f2444 Modify interface of VariantOverridesIndexed#indexed
Stop using keyword args and accept variant_ids instead of line_items
2020-04-13 22:11:58 +10:00
Rob H
6820919552 Rename VariantOverrides class to VariantOverridesIndexed 2020-04-13 21:56:37 +10:00
Rob H
4a4173bdc0 Move VariantOverrides class to app/services 2020-04-13 21:54:10 +10:00
Rob H
9a7e782102 Only load up variant overrides for relevant hubs 2020-04-13 12:07:17 +10:00
Transifex-Openfoodnetwork
9fa892346e Updating translations for config/locales/es_CR.yml 2020-04-13 10:30:00 +10:00
Transifex-Openfoodnetwork
7341912390 Updating translations for config/locales/pt_BR.yml 2020-04-12 07:14:21 +10:00
Transifex-Openfoodnetwork
d0c797b797 Updating translations for config/locales/es_CR.yml 2020-04-12 07:12:21 +10:00
Transifex-Openfoodnetwork
cb2e17d7dc Updating translations for config/locales/es_CR.yml 2020-04-12 07:09:21 +10:00
Transifex-Openfoodnetwork
147654df41 Updating translations for config/locales/es_CR.yml 2020-04-12 07:05:59 +10:00
Rob H
14cf168e3b Take sku overrides into account in customer totals report 2020-04-11 16:05:15 +10:00
dependabot-preview[bot]
c3ee7b7c64 Bump ddtrace from 0.34.1 to 0.34.2
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.34.1 to 0.34.2.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.34.1...v0.34.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-10 19:19:13 +00:00
Matt-Yorkley
a6414b6dbe Make sure taggable_type is 'Customer' when querying customer tags 2020-04-10 20:14:14 +02:00
Matt-Yorkley
4c41c84cc1 Refactor tag rules loading for customers
Fixes N+1 queries on customer tags
2020-04-10 10:12:32 +02:00
Matt-Yorkley
e53f733966 Eager-load addresses in customer serializer 2020-04-10 08:20:15 +02:00
Matt-Yorkley
2a8809e6e8 Eager-load default card in customer serializer 2020-04-10 08:20:15 +02:00
Matt-Yorkley
31a54e49c5 Allow User#default_card to work with eager-loading 2020-04-10 08:20:13 +02:00
dependabot-preview[bot]
0fabde8849 Bump rubocop-rails from 2.5.1 to 2.5.2
Bumps [rubocop-rails](https://github.com/rubocop-hq/rubocop-rails) from 2.5.1 to 2.5.2.
- [Release notes](https://github.com/rubocop-hq/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-rails/compare/v2.5.1...v2.5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-09 19:21:30 +00:00
Matt-Yorkley
cf712e9478 Select only enterprise id 2020-04-09 17:41:13 +02:00
Kristina Lim
e6cd33ee57 Increase max characters for locale in spree_users
There are many locales that have six (6) characters.
2020-04-07 15:08:49 +08:00
Matt-Yorkley
8a544f3ab3 Add missing indexes to spree_orders and spree_products 2020-04-04 10:12:15 +02:00
Luis Ramos
26769b4150 Add StripeSCA payment authorize and use it both subs_confirm job as well as on teh checkout stripe redirect 2020-03-16 20:04:59 +00:00
Luis Ramos
84745e4ccb Add stripe payment setup spec and make minor tweaks to the code itself.
Also, add a missing . to card_set? that eanbles it! If the card was
already set, it would anyway set the default card. Now it will use the
defined card if there is one already.
2020-03-16 20:03:12 +00:00
Luis Ramos
aac7a5e559 Adapt PaymentSetup spec to new version and remove some private method testing (payment) as well as some tests testing order.pending_payments logic 2020-03-16 20:03:12 +00:00
Luis Ramos
0a2941ed96 Extract StripePaymentSetup from PaymentSetup 2020-03-16 20:03:12 +00:00
35 changed files with 4287 additions and 368 deletions

View File

@@ -680,7 +680,6 @@ Metrics/ModuleLength:
- engines/order_management/spec/services/order_management/subscriptions/estimator_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/form_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/payment_setup_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/summarizer_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/variants_list_spec.rb

View File

@@ -198,7 +198,7 @@ GEM
activerecord (>= 3.2.0, < 5.0)
fog (~> 1.0)
rails (>= 3.2.0, < 5.0)
ddtrace (0.34.1)
ddtrace (0.34.2)
msgpack
debugger-linecache (1.2.0)
deface (1.0.2)
@@ -483,7 +483,7 @@ GEM
parallel (1.19.1)
paranoia (1.3.4)
activerecord (~> 3.1)
parser (2.7.0.5)
parser (2.7.1.0)
ast (~> 2.4.0)
paypal-sdk-core (0.2.10)
multi_json (~> 1.0)
@@ -596,7 +596,7 @@ GEM
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-rails (2.5.1)
rubocop-rails (2.5.2)
activesupport
rack (>= 1.1)
rubocop (>= 0.72.0)

View File

@@ -14,15 +14,28 @@ Darkswarm.factory 'Checkout', ($injector, CurrentOrder, ShippingMethods, StripeE
submit: =>
Loading.message = t 'submitting_order'
$http.put('/checkout.json', {order: @preprocess()}).success (data, status)=>
Navigation.go data.path
.error (response, status)=>
if response.path
Navigation.go response.path
else
Loading.clear()
@errors = response.errors
RailsFlashLoader.loadFlash(response.flash)
$http.put('/checkout.json', {order: @preprocess()})
.then (response) =>
Navigation.go response.data.path
.catch (response) =>
try
@handle_checkout_error_response(response)
catch error
@loadFlash(error: t("checkout.failed")) # inform the user about the unexpected error
throw error # generate a BugsnagJS alert
handle_checkout_error_response: (response) =>
if response.data.path
Navigation.go response.data.path
else
throw response unless response.data.flash
@errors = response.data.errors
@loadFlash(response.data.flash)
loadFlash: (flash) =>
Loading.clear()
RailsFlashLoader.loadFlash(flash)
# Rails wants our Spree::Address data to be provided with _attributes
preprocess: ->

View File

@@ -17,8 +17,9 @@ module Admin
respond_to do |format|
format.html
format.json do
tag_rule_mapping = TagRule.mapping_for(Enterprise.where(id: params[:enterprise_id]))
render_as_json @collection, tag_rule_mapping: tag_rule_mapping
render_as_json @collection,
tag_rule_mapping: tag_rule_mapping,
customer_tags: customer_tags_by_id
end
end
end
@@ -64,8 +65,13 @@ module Admin
def collection
return Customer.where("1=0") unless json_request? && params[:enterprise_id].present?
enterprise = Enterprise.managed_by(spree_current_user).find_by_id(params[:enterprise_id])
Customer.of(enterprise)
Customer.of(managed_enterprise_id).
includes(:bill_address, :ship_address, user: :credit_cards)
end
def managed_enterprise_id
@managed_enterprise_id ||= Enterprise.managed_by(spree_current_user).
select('enterprises.id').find_by_id(params[:enterprise_id])
end
def load_managed_shops
@@ -80,5 +86,26 @@ module Admin
def ams_prefix_whitelist
[:subscription]
end
def tag_rule_mapping
TagRule.mapping_for(Enterprise.where(id: managed_enterprise_id))
end
# Fetches tags for all customers of the enterprise and returns a hash indexed by customer_id
def customer_tags_by_id
customer_tags = ::ActsAsTaggableOn::Tag.
joins(:taggings).
includes(:taggings).
where(taggings:
{ taggable_type: 'Customer',
taggable_id: Customer.of(managed_enterprise_id),
context: 'tags' })
customer_tags.each_with_object({}) do |tag, indexed_hash|
customer_id = tag.taggings.first.taggable_id
indexed_hash[customer_id] ||= []
indexed_hash[customer_id] << tag.name
end
end
end
end

View File

@@ -57,16 +57,28 @@ class SubscriptionConfirmJob
return true unless order.payment_required?
setup_payment!(order)
return false if order.errors.present?
return false if order.errors.any?
authorize_payment!(order)
return false if order.errors.any?
order.process_payments!
return false if order.errors.present?
return false if order.errors.any?
true
end
def setup_payment!(order)
OrderManagement::Subscriptions::PaymentSetup.new(order).call!
return if order.errors.any?
OrderManagement::Subscriptions::StripePaymentSetup.new(order).call!
end
def authorize_payment!(order)
return if order.subscription.payment_method.class != Spree::Gateway::StripeSCA
OrderManagement::Subscriptions::StripeScaPaymentAuthorize.new(order).call!
end
def send_confirmation_email(order)

View File

@@ -125,7 +125,12 @@ module Spree
end
def default_card
credit_cards.where(is_default: true).first
# Don't re-fetch associated cards from the DB if they're already eager-loaded
if credit_cards.loaded?
credit_cards.to_a.find(&:is_default)
else
credit_cards.where(is_default: true).first
end
end
# Checks whether the specified user is a superadmin, with full control of the

View File

@@ -6,7 +6,7 @@ class Api::Admin::CustomerSerializer < ActiveModel::Serializer
has_one :bill_address, serializer: Api::AddressSerializer
def tag_list
object.tag_list.join(",")
customer_tag_list.join(",")
end
def name
@@ -14,7 +14,7 @@ class Api::Admin::CustomerSerializer < ActiveModel::Serializer
end
def tags
object.tag_list.map do |tag|
customer_tag_list.map do |tag|
tag_rule_map = options[:tag_rule_mapping].andand[tag]
tag_rule_map || { text: tag, rules: nil }
end
@@ -25,4 +25,12 @@ class Api::Admin::CustomerSerializer < ActiveModel::Serializer
object.user.default_card.present?
end
private
def customer_tag_list
return object.tag_list unless options[:customer_tags]
options[:customer_tags].andand[object.id] || []
end
end

View File

@@ -12,11 +12,8 @@ module Checkout
def path
return unless stripe_payment_method?
payment = @order.pending_payments.last
return unless payment&.checkout?
payment.authorize!
raise unless payment.pending?
payment = OrderManagement::Subscriptions::StripeScaPaymentAuthorize.new(@order).call!
raise if @order.errors.any?
field_with_url(payment) if url?(field_with_url(payment))
end

View File

@@ -0,0 +1,36 @@
# frozen_string_literal: true
# Produces mappings of variant overrides by distributor id and variant id
# The primary use case for data structured in this way is for injection into
# the initializer of the OpenFoodNetwork::ScopeVariantToHub class
class VariantOverridesIndexed
def initialize(variant_ids, distributor_ids)
@variant_ids = variant_ids
@distributor_ids = distributor_ids
end
def indexed
scoped_variant_overrides.each_with_object(hash_of_hashes) do |variant_override, indexed|
indexed[variant_override.hub_id][variant_override.variant] = variant_override
end
end
private
attr_reader :variant_ids, :distributor_ids
def scoped_variant_overrides
VariantOverride
.joins(:variant)
.preload(:variant)
.where(
hub_id: distributor_ids,
variant_id: variant_ids,
)
end
def hash_of_hashes
Hash.new { |hash, key| hash[key] = {} }
end
end

View File

@@ -1,4 +1,5 @@
.three.columns.omega{ "ng-if" => "product.variant_unit_with_scale != 'items'" }
= f.field_container :display_as do
= f.label :product_display_as, t('.display_as')
%span.required *
%input#product_display_as.fullwidth{name: "product[display_as]", placeholder: "{{ placeholder_text }}", type: "text"}

View File

@@ -38,6 +38,7 @@
.three.columns.omega{ 'ng-show' => "product.variant_unit_with_scale == 'items'" }
= f.field_container :unit_name do
= f.label :product_variant_unit_name, t(".unit_name")
%span.required *
%input.fullwidth{ id: 'product_variant_unit_name','ng-model' => 'product.variant_unit_name', :name => 'product[variant_unit_name]', :placeholder => t('admin.products.unit_name_placeholder'), :type => 'text' }
.twelve.columns.alpha
.six.columns.alpha

View File

@@ -1456,13 +1456,13 @@ ca:
email_payment_summary: Resum del pagament
email_payment_method: "Pagament a través de:"
email_so_placement_intro_html: "Tens una nova comanda amb <strong> %{distributor} </ strong>"
email_so_placement_details_html: "Aquests són els detalls de la comanda de <strong> %{distributor} </ strong>:"
email_so_placement_details_html: "Aquests són els detalls de la comanda de <strong>%{distributor}</strong> :"
email_so_placement_changes: "Malauradament, no tots els productes que has demanat estaven disponibles. Les quantitats originals que has sol·licitat apareixen ratllades a sota."
email_so_payment_success_intro_html: "S'ha processat un pagament automàtic per a la vostra comanda des de <strong> %{distributor} </ strong>."
email_so_placement_explainer_html: "Aquesta comanda s'ha creat automàticament per tu."
email_so_edit_true_html: "Potd <a href='%{order_url}'> fer canvis </ a> fins que les comandes es tanquin el %{orders_close_at}."
email_so_edit_true_html: "Pots <a href='%{order_url}'>fer canvis</a> fins que les comandes es tanquin el %{orders_close_at}."
email_so_edit_false_html: "Pots <a href='%{order_url}'> veure detalls d'aquesta comanda </a> en qualsevol moment."
email_so_contact_distributor_html: "Si tens alguna pregunta pots contactar amb <strong> %{distributor} </ strong> a través d'%{email}."
email_so_contact_distributor_html: "Si tens alguna pregunta pots contactar amb <strong>%{distributor}</strong> a través d'%{email}."
email_so_contact_distributor_to_change_order_html: "Aquesta comanda s'ha creat automàticament per a vostè. Podeu fer canvis fins que les comandes es tanquin a %{orders_close_at} contactant a <strong> %{distributor} </ strong> a través d'%{email}."
email_so_confirmation_intro_html: "La teva comanda amb <strong> %{distributor} </ strong> ja està confirmada"
email_so_confirmation_explainer_html: "Vas realitzar aquesta comanda automàticament i ara s'ha finalitzat."

View File

@@ -31,6 +31,10 @@ es:
taken: "Ya existe una cuenta con este email. Inicie sesión o restablezca tu contraseña."
spree/order:
no_card: No hay tarjetas de crédito autorizadas disponibles para cargar
spree/credit_card:
attributes:
base:
card_expired: "ha expirado"
order_cycle:
attributes:
orders_close_at:
@@ -52,6 +56,8 @@ es:
shipping_method_ids: "Métodos de envío"
payment_method_ids: "Métodos de Pago"
errors:
messages:
inclusion: "no está incluido en la lista"
models:
order_management/subscriptions/validator:
attributes:
@@ -246,6 +252,8 @@ es:
notes: Notas
error: Error
processing_payment: "Procesando el pago..."
no_pending_payments: "No tiene pagos pendientes"
invalid_payment_state: "Estado de pago no válido"
filter_results: Filtrar resultados
quantity: Cantidad
pick_up: Recogida
@@ -438,9 +446,12 @@ es:
infinity: "infinito"
to_order_tip: "Los artículos hechos según demanda no tienen un nivel de stock, como por ejemplo panes hechos según demanda."
back_to_products_list: "Volver a la lista de productos"
editing_product: "Editando producto"
tabs:
product_details: "Detalles del Producto"
group_buy_options: "Opciones de compra grupales"
images: "Imágenes"
variants: "variaciones"
product_properties: "Propiedades del producto"
product_import:
title: Importación de productos
@@ -699,6 +710,11 @@ es:
enable_subscriptions_false: "Deshabilitado"
enable_subscriptions_true: "Habilitado"
shopfront_message: "Mensaje de la Tienda"
shopfront_message_placeholder: >
Mensaje de bienvenida opcional para compradores, explica como comprar
en el sitio. si el texto se agrega en este campo, va a ser mostrado
en la pestaña de inicio cuando los clientes ingresen por primera vez
a la tienda.
shopfront_message_link_tooltip: "Insertar / editar enlace"
shopfront_message_link_prompt: "Por favor introduzca una URL para insertar"
shopfront_closed_message: "Mensaje de tienda cerrada"
@@ -836,25 +852,38 @@ es:
new:
create: "Crear"
cancel: "Cancelar"
back_to_list: "Regresar a la lista"
edit:
advanced_settings: "Configuración Avanzada"
save: "Guardar"
save_and_next: "Salvar y continuar"
next: "Siguiente"
cancel: "Cancelar"
back_to_list: "Regresar a la lista"
save_and_back_to_list: "Salvar y volver a lista"
choose_products_from: "Escoger Productos desde:"
incoming:
save: "Guardar"
save_and_next: "Salvar y continuar"
next: "Siguiente"
cancel: "Cancelar"
back_to_list: "Regresar a la lista"
outgoing:
outgoing: "Saliente"
distributor: "Distribuidora"
products: "Productos"
tags: "Tags"
delivery_details: "Detalles de entrega"
fees: "Comisiones"
previous: "Anterior"
save: "Guardar"
save_and_back_to_list: "Salvar y volver a lista"
cancel: "Cancelar"
back_to_list: "Regresar a la lista"
wizard_progress:
edit: "1. Configuración general"
incoming: "2. Productos entrantes"
outgoing: "3. Productos salientes"
exchange_form:
pickup_time_tip: Cuando los pedidos de este ciclo de pedido estarán listos para la consumidora
pickup_instructions_placeholder: "Instrucciones de recogida"
@@ -1092,10 +1121,13 @@ es:
destroy_attachment_does_not_exist: "El logotipo no existe"
enterprise_promo_image:
destroy_attachment_does_not_exist: "La imagen promocional no existe"
orders:
failed_to_update: "Error al actualizar pedido"
checkout:
already_ordered:
cart: "carrito"
message_html: "Ya realizó un pedido para este ciclo de pedido. Compruebe el %{cart}para ver los artículos que pidió. También puede cancelar artículos mientras el ciclo de pedido siga abierto."
failed: "La finalización de compra falló, por favor comunicate con nosotros para procesar la orden."
shops:
hubs:
show_closed_shops: "Mostrar tiendas cerradas"
@@ -1266,6 +1298,7 @@ es:
saving_credit_card: Guardando tarjeta de crédito...
card_has_been_removed: "Su tarjeta ha sido eliminada (número: %{number})"
card_could_not_be_removed: Lo sentimos, la tarjeta no se pudo quitar
invalid_credit_card: "Tarjeta de crédito inválida"
ie_warning_headline: "Su navegador está desactualizado :-("
ie_warning_text: "Para la mejor esperiencia de Open Food Network, recomendamos actualizar su navegador:"
ie_warning_chrome: Descargar Chrome
@@ -1467,6 +1500,7 @@ es:
shopping_oc_closed_description: "Por favor espere hasta que el próximo ciclo abra (o contactanos de forma directa para ver si podemos aceptar algunos pedidos tardíos)"
shopping_oc_last_closed: "El último ciclo cerró hace %{distance_of_time}"
shopping_oc_next_open: "El próximo ciclo abrirá en %{distance_of_time}"
shopping_oc_select: "Seleccionar"
shopping_tabs_home: "Inicio"
shopping_tabs_shop: "Tienda"
shopping_tabs_about: "Acerca de"
@@ -1840,6 +1874,7 @@ es:
headline: "¡Terminado!"
thanks: "Gracias por llenar los detalles de %{enterprise}."
login: "Puede cambiar o actualizar su negocio en cualquier etapa iniciando sesión en Open Food Network y yendo a Admin."
action: "Ir al Panel de Organización"
back: "Atrás"
continue: "Continuar"
action_or: "Ó"
@@ -1925,6 +1960,7 @@ es:
tax_category: "Categoría del impuesto"
calculator: "Calculadora"
calculator_values: "Calculadora de valores"
calculator_settings_warning: "Si está cambiando el tipo de calculadora, debe de salvar primero antes de editar las configuraciones de la calculadora"
flat_percent_per_item: "Porcentaje fijo (por artículo)"
flat_rate_per_item: "Tarifa plana (por artículo)"
flat_rate_per_order: "Tarifa plana (por pedido)"
@@ -2255,6 +2291,7 @@ es:
enterprise_register_success_notice: "¡Felicidades! ¡Se ha completado el registro de %{enterprise}!"
enterprise_bulk_update_success_notice: "Organizaciones actualizadas con éxito"
enterprise_bulk_update_error: 'Error en la actualización'
enterprise_shop_show_error: "La tienda que busca no existe o esta inactiva en OFN. por favor visita otras tiendas."
order_cycles_create_notice: 'Se ha creado el ciclo de pedido.'
order_cycles_update_notice: 'Se ha actualizado su ciclo de pedido.'
order_cycles_bulk_update_notice: 'Los ciclos de pedido han sido actualizados.'
@@ -2410,6 +2447,12 @@ es:
severity: Gravedad
description: Descripción
resolve: Resolver
exchange_products:
load_more_variants: "Cargar mas variantes"
load_all_variants: "cargar todas las variantes"
select_all_variants: "Seleccionar todo"
variants_loaded: "%{num_of_variants_loaded} de %{total_number_of_variants} variantes cargadas"
loading_variants: "Cargando variantes"
tag_rules:
shipping_method_tagged_top: "Métodos de envío etiquetados"
shipping_method_tagged_bottom: "son:"
@@ -2492,6 +2535,7 @@ es:
customer_placeholder: "customer@example.org"
valid_email_error: "Introduce un email válido"
subscriptions:
error_saving: "Error al salvar suscripción "
new:
please_select_a_shop: "Por favor seleccione una tienda"
insufficient_stock: "Stock insuficiente disponible, solo quedan %{on_hand}"
@@ -2567,6 +2611,79 @@ es:
signup_or_login: "Empieza registrándose (o iniciando sesión)"
have_an_account: "¿Ya tiene una cuenta?"
action_login: "Inicie sesión ahora."
inflections:
each:
one: "each"
other: "cada"
bunch:
one: "manojo"
other: "manojos"
pack:
one: "paquete"
other: "paquetes"
box:
one: "caja"
other: "cajas"
bottle:
one: "botella"
other: "botellas"
jar:
one: "frasco"
other: "frascos"
head:
one: "cabeza"
other: "cabezas"
bag:
one: "bolsa"
other: "bolsas"
loaf:
one: "hogaza"
other: "hogazas"
single:
one: "single"
other: "individuales"
tub:
one: "tub"
other: "recipientes"
punnet:
one: "canastilla"
other: "canastillas"
packet:
one: "paquete"
other: "paquetes"
item:
one: "elemento"
other: "elementos"
dozen:
one: "docena"
other: "docenas"
unit:
one: "unidad"
other: "unidades"
serve:
one: "serve"
other: "porción"
tray:
one: "bandeja"
other: "bandejas"
piece:
one: "pieza"
other: "piezas"
pot:
one: "maceta"
other: "contenedores"
bundle:
one: "haz"
other: "paquetes"
flask:
one: "flask"
other: "frascos"
basket:
one: "canasta"
other: "canastas"
sack:
one: "sacos"
other: "sacos"
producers:
signup:
start_free_profile: "Empieze con un perfil gratuito, y amplíelo cuando esté preparado!"
@@ -2792,6 +2909,12 @@ es:
minimal_amount: "Cantidad mínima"
normal_amount: "Cantidad normal"
discount_amount: "Importe de descuento"
no_images_found: "No se encontraron imágenes "
new_image: "Nueva Imagen"
filename: "Nombre de archivo"
alt_text: "Texto Alternativo"
thumbnail: "Miniatura"
back_to_images_list: "Volver a lista de imágenes "
email: Email
account_updated: "Cuenta actualizada!"
email_updated: "La cuenta se actualizará una vez que se confirme el nuevo correo electrónico."
@@ -2803,6 +2926,9 @@ es:
zipcode: Código Postal
weight: Peso (en kg)
error_user_destroy_with_orders: "Los usuarios con pedidos completados no pueden ser eliminados"
cannot_create_payment_without_payment_methods: "No se puede crear un pago para una orden sin un medio de pago definido"
please_define_payment_methods: "por favor definir métodos de pago"
options: "Opciones"
actions:
update: "Actualizar"
errors:
@@ -2834,27 +2960,53 @@ es:
product_properties:
index:
inherits_properties_checkbox_hint: "¿Heredar propiedades desde %{supplier}? (a menos que sea anulado arriba)"
add_product_properties: "Agregar Propiedades del producto"
select_from_prototype: "seleccionar de prototipo"
properties:
index:
properties: "Propiedades"
new_property: "Nueva propiedad"
name: "Nombre"
presentation: "presentación"
new:
new_property: "Nueva propiedad"
edit:
editing_property: "Editar Propiedad"
back_to_properties_list: "volver a lista de propiedades"
form:
name: "Nombre"
presentation: "presentación"
return_authorizations:
index:
new_return_authorization: "Nueva autorización de devolución"
return_authorizations: "Autorizaciones de devolución"
back_to_orders_list: "Volver a la lista de pedidos"
rma_number: "número RMA"
status: "Estado"
amount: "Cantidad"
cannot_create_returns: "No se pueden crear devoluciones ya que este pedido no tiene unidades enviadas."
continue: "Continuar"
new:
new_return_authorization: "Nueva autorización de devolución"
back_to_return_authorizations_list: "Back To Return Authorization List"
continue: "Continuar"
edit:
receive: "recibir"
are_you_sure: "¿Está seguro?"
return_authorization: "volver a autorización"
form:
product: "Producto"
quantity_shipped: "cantidad enviada"
quantity_returned: "Cantidad devuelta"
return_quantity: "cantidad a devolver"
amount: "Cantidad"
rma_value: "Valor RMA"
reason: "razón"
stock_location: "localización de inventario"
states:
authorized: "autorizado"
received: "recibido"
canceled: "cancelado"
orders:
index:
listing_orders: "Pedidos de listado"
@@ -2862,6 +3014,7 @@ es:
capture: "Captura"
ship: "Envío"
edit: "Editar"
order_not_updated: "El pedido no se pudo actualizar"
note: "Nota"
first: "primero"
last: "Último"
@@ -2884,6 +3037,8 @@ es:
tax_invoice: "FACTURA DE IMPUESTOS"
code: "Código"
from: "De"
to: "Facturar a"
shipping: "envío"
form:
distribution_fields:
title: "Distribución"
@@ -3044,12 +3199,23 @@ es:
index:
sku: "SKU"
price: "Precio"
options: "Opciones"
no_results: "No hay resultados"
to_add_variants_you_must_first_define: "para agregar variantes, se debe primero definir"
option_types: "Tipos de opciones"
option_values: "valores de opción"
and: "y"
new_variant: "Nueva Variante"
show_active: "mostrar activo"
show_deleted: "Mostrar eliminados"
new:
new_variant: "Nueva Variante"
form:
cost_price: "Precio de costo"
sku: "SKU"
price: "Precio"
display_as: "Mostrar como"
display_name: "Nombre para mostrar"
autocomplete:
producer_name: "Productora"
unit: "Unidad"
@@ -3195,3 +3361,19 @@ es:
allow_charges?: "¿Permitir cargos?"
localized_number:
invalid_format: tiene un formato invalido. Por favor introduzca un numero.
api:
invalid_api_key: "La llave de API especificada (%{key}) es inválida."
unauthorized: "No tiene autorización para realizar esta acción."
invalid_resource: "Recurso inválido. Por favor corrija los errores e intente nuevamente."
resource_not_found: "El recurso que buscaba no puede ser encontrado."
access: "acceso al API"
key: "Llave"
clear_key: "valor vacío"
regenerate_key: "Regenerar llave"
no_key: "sin valor"
generate_key: "Generar llave de API"
key_generated: "Llave generada"
key_cleared: "valor borrado"
shipment:
cannot_ready: "No se puede completar envío"
invalid_taxonomy_id: "El identificador de taxonomía es inválido."

3379
config/locales/es_CR.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1543,7 +1543,7 @@ fr:
products_loading: "Produits en cours de chargement..."
products_updating_cart: "Actualisation du panier..."
products_cart_empty: "Panier vide"
products_edit_cart: "Valider votre panier"
products_edit_cart: "Poursuivre"
products_from: de
products_change: "Aucun changement à sauvegarder."
products_update_error: "Échec de l'enregistrement dû à:"

View File

@@ -31,6 +31,10 @@ fr_BE:
taken: "Un compte existe déjà pour cette adresse électronique. Connectez-vous ou demandez un nouveau mot de passe."
spree/order:
no_card: Aucune carte de paiement autorisée disponible
spree/credit_card:
attributes:
base:
card_expired: "a expiré"
order_cycle:
attributes:
orders_close_at:
@@ -248,6 +252,8 @@ fr_BE:
notes: Commentaires
error: Erreur
processing_payment: "Paiement en cours..."
no_pending_payments: "Aucun paiement en attente"
invalid_payment_state: "État de paiement invalide"
filter_results: Filtrer les résultats
quantity: Quantité
pick_up: Retrait
@@ -867,6 +873,7 @@ fr_BE:
distributor: "Distributeur·trice"
products: "Produits"
tags: "Tags"
delivery_details: "Détails de la livraison"
fees: "Commission"
previous: "Précédent"
save: "Sauvergarder"
@@ -1129,11 +1136,11 @@ fr_BE:
shared:
menu:
cart:
cart: "Cart"
cart: "Panier"
signed_in:
profile: "Profil"
mobile_menu:
cart: "Carte"
cart: "Panier"
joyride:
checkout: "Passer la commande"
already_ordered_products: "Déjà commandé dans ce cycle de vente"
@@ -1291,6 +1298,7 @@ fr_BE:
saving_credit_card: Enregistrement de la carte de crédit...
card_has_been_removed: "Votre carte a été supprimée (numéro : %{number})"
card_could_not_be_removed: Désolée, la carte n'a pas pu être supprimée :-(
invalid_credit_card: "Carte de crédit non valable"
ie_warning_headline: "Votre navigateur n'est pas à jour :-("
ie_warning_text: "Pour une expérience optimale sur Open Food Network, nous vous recommandons fortement de mettre à jour votre navigateur:"
ie_warning_chrome: Télécharger Chrome
@@ -1492,6 +1500,7 @@ fr_BE:
shopping_oc_closed_description: "Veuillez attendre l'ouverture du prochain cycle de vente (ou contactez directement le comptoir pour voir si nous pouvons accepter une commande tardive)."
shopping_oc_last_closed: "Le dernier cycle de vente s'est terminé il y a %{distance_of_time}"
shopping_oc_next_open: "Le prochain cycle de vente ouvrira dans %{distance_of_time}"
shopping_oc_select: "Sélectionnez..."
shopping_tabs_home: "Accueil"
shopping_tabs_shop: "Comptoir"
shopping_tabs_about: "A propos"
@@ -1865,6 +1874,7 @@ fr_BE:
headline: "C'est terminé!"
thanks: "Merci d'avoir complété le profil de %{enterprise}"
login: "Vous pouvez modifier ou mettre à jour les détails de votre entreprise à tout moment en vous connectant sur Open Food Network, rubrique Admin."
action: "Aller au tableau de bord des entreprises"
back: "Retour"
continue: "Suivant"
action_or: "OU"
@@ -2283,6 +2293,7 @@ fr_BE:
enterprise_register_success_notice: "Bravo ! L'entreprise %{enterprise} est maintenant inscrite sur Open Food Network :-)"
enterprise_bulk_update_success_notice: "Entreprises mises à jour avec succès"
enterprise_bulk_update_error: 'Echec dans la mise à jour'
enterprise_shop_show_error: "Le comptoir que vous recherchez n'existe pas ou est inactif sur OFN. Veuillez vérifier les autres comptoirs."
order_cycles_create_notice: 'Votre cycle de vente a été créé.'
order_cycles_update_notice: 'Votre cycle de vente a été mis à jour.'
order_cycles_bulk_update_notice: 'Des cycles de vente ont été mis à jour.'
@@ -2444,6 +2455,12 @@ fr_BE:
severity: Rigueur
description: Description
resolve: Résoudre
exchange_products:
load_more_variants: "Charger plus de variantes"
load_all_variants: "Charger toutes les variantes"
select_all_variants: "Sélectionner toutes %{total_number_of_variants}les variantes"
variants_loaded: " %{num_of_variants_loaded}de %{total_number_of_variants}variantes chargées"
loading_variants: "Chargement des variantes"
tag_rules:
shipping_method_tagged_top: "Méthodes d'expédition étiquetées"
shipping_method_tagged_bottom: "sont:"
@@ -2956,6 +2973,8 @@ fr_BE:
tax_invoice: "FACTURE"
code: "Code"
from: "De"
to: "Facture à"
shipping: "Expédition"
form:
distribution_fields:
title: "Distribution"

View File

@@ -3030,6 +3030,7 @@ it:
tax_invoice: "FATTURA DELLE TASSE"
code: "Codice"
from: "Da"
shipping: "Spedizione"
form:
distribution_fields:
title: "Distribuzione"

View File

@@ -16,9 +16,11 @@ pt_BR:
spree/product:
primary_taxon: "Categoria de Produto"
supplier: "Fornecedor"
shipping_category_id: "Tipos de Envio"
shipping_category_id: "Tipos de Frete"
variant_unit: "Unidade variante"
variant_unit_name: "Nome da unidade variante"
spree/credit_card:
base: "Cartão de Crédito"
order_cycle:
orders_close_at: Dia de fechamento
errors:
@@ -29,6 +31,10 @@ pt_BR:
taken: "Já existe uma conta para este e-mail. Por favor, faça login ou redefina sua senha."
spree/order:
no_card: Não há cartões de crédito válidos disponíveis
spree/credit_card:
attributes:
base:
card_expired: "expirou"
order_cycle:
attributes:
orders_close_at:
@@ -204,7 +210,7 @@ pt_BR:
remove: Remover
or: ou
collapse_all: Recolher todos
expand_all: Aumentar tudo
expand_all: Expandir tudo
loading: Carregando...
show_more: Mostrar mais
show_all: Mostrar tudo
@@ -583,13 +589,13 @@ pt_BR:
actions_delete: "Deletar selecionado"
loading: "Carregando pedidos"
no_results: "Nenhum pedido encontrado. "
group_buy_unit_size: "Tamanho da Unidade para Grupo de Compras"
group_buy_unit_size: "Unidade de Medida para Grupo de Compras"
total_qtt_ordered: "Quantidade total do pedido"
max_qtt_ordered: "Quantidade máxima do pedido"
current_fulfilled_units: "Unidades completadas no momento"
max_fulfilled_units: "Máximo de unidades completadas "
order_error: "Alguns erros devem ser corrigidos antes de atualizar os pedidos.\nOs campos com bordas vermelhas contém erros."
variants_without_unit_value: "AVISO: Algumas variantes não possuem unidade de valor"
variants_without_unit_value: "AVISO: Algumas variantes não possuem unidade de medida"
select_variant: "Selecione uma variante"
enterprise:
select_outgoing_oc_products_from: 'Selecione a saída do ciclo de pedidos '
@@ -966,7 +972,7 @@ pt_BR:
not_visible: "%{enterprise} não está visível e, portanto, não pode ser encontrado no mapa ou em pesquisas"
reports:
hidden: ESCONDIDO
unitsize: TAMANHO DA UNIDADE
unitsize: Unidade de Medida
total: TOTAL
total_items: TOTAL DE ITEMS
supplier_totals: Total do fornecedor do ciclo de pedidos
@@ -1199,7 +1205,7 @@ pt_BR:
menu_4_title: "Grupos"
menu_4_url: "/groups"
menu_5_title: "Sobre"
menu_5_url: "https://about.openfoodnetwork.org.au/"
menu_5_url: "https://about.openfoodbrasil.com.br/"
menu_6_title: "Conectar"
menu_6_url: "https://openfoodnetwork.org/au/connect/"
menu_7_title: "Aprender"
@@ -1536,11 +1542,11 @@ pt_BR:
products_cart_empty: "Carrinho vazio"
products_edit_cart: "Edite seu carrinho"
products_from: de
products_change: "Nenhuma modificação a ser salva."
products_change: "Nenhuma alteração a ser salva."
products_update_error: "Falha ao salvar, com o seguinte erro:"
products_update_error_msg: "Falha ao salvar."
products_update_error_data: "Falha no salvamento devido a dados inválidos:"
products_changes_saved: "Modificações salvas."
products_changes_saved: "Alterações salvas."
search_no_results_html: "Sinto muito, nenhum resultado encontrado para %{query}. Que tal tentar outra busca?"
components_profiles_popover: "Perfis Simples não possuem uma loja virtual na Open Food Brasil, mas podem ter suas próprias lojas físicas ou online em outro endereço"
components_profiles_show: "Mostrar perfis"
@@ -1893,7 +1899,7 @@ pt_BR:
transaction_date: "DataData"
payment_state: "Status do Pagamento"
shipping_state: "Status da entrega"
value: "Valor"
value: "Quantidade"
balance_due: "saldo devedor"
credit: "Crédito"
Paid: "Pago"
@@ -1940,7 +1946,7 @@ pt_BR:
supplier: "Fornecedor"
product_name: "Nome do Produto"
product_description: "Descrição do Produto"
units: "O tamanho da unidade"
units: "Unidade de medida"
coordinator: "Coordenador"
distributor: "Distribuidor"
enterprise_fees: "Taxas da iniciativa"
@@ -2148,14 +2154,14 @@ pt_BR:
report_header_sells: Vende
report_header_visible: Visível
report_header_price: Preço
report_header_unit_size: Tamanho da Unidade
report_header_unit_size: Unidade de Medida
report_header_distributor: Distribuidor
report_header_distributor_address: Endereço do distribuidor
report_header_distributor_city: Cidade do distribuidor
report_header_distributor_postcode: CEP do distribuidor
report_header_delivery_address: Endereço para entrega
report_header_delivery_postcode: CEP para entrega
report_header_bulk_unit_size: Tamanho de unidade para atacado
report_header_bulk_unit_size: Unidade de Medida para atacado
report_header_weight: Peso
report_header_sum_total: Soma total
report_header_date_of_order: Data do pedido
@@ -2301,7 +2307,7 @@ pt_BR:
shipped: Enviado
js:
saving: 'Salvando...'
changes_saved: 'Mudanças salvas.'
changes_saved: 'Alterações salvas.'
save_changes_first: Salve as alterações primeiro.
all_changes_saved: Todas as alterações foram salvas
unsaved_changes: Você possui alterações não salvas
@@ -2567,7 +2573,7 @@ pt_BR:
visible: VISÍVEL
not_visible: NÃO VISÍVEL
services:
unsaved_changes_message: Existem mudanças não salvas, salvar agora ou ignorar?
unsaved_changes_message: Existem alterações não salvas. Salvar agora ou ignorar?
save: SALVAR
ignore: IGNORAR
add_to_order_cycle: "adicionar ao ciclo de pedidos"
@@ -2870,7 +2876,7 @@ pt_BR:
back_to_taxonomies_list: "Voltar à lista de taxonomias"
shipping_methods: "Métodos de envio"
shipping_categories: "Categorias de Remessa"
new_shipping_category: "Nova categoria de remessa"
new_shipping_category: "Nova categoria de frete"
back_to_shipping_categories: "Voltar para categorias de remessa"
analytics_trackers: "Rastreadores de análise"
no_trackers_found: "Nenhum rastreador encontrado"
@@ -3113,8 +3119,8 @@ pt_BR:
new_product: "Novo produto"
supplier: "Fornecedor"
product_name: "Nome do Produto"
units: "Tamanho da Unidade"
value: "Valor"
units: "Unidade de Medida"
value: "Quantidade"
unit_name: "Nome da Unidade"
price: "Preço"
on_hand: "Disponível"

View File

@@ -9,14 +9,14 @@ tr:
shipment_state: ' Teslimat Durumu'
completed_at: Oluşturulma Tarihi
number: Numara
state: Şehir
state: Durum
email: Müşteri E-postası
spree/payment:
amount: Tutar
spree/product:
primary_taxon: "Ürün Kategorisi"
supplier: "Tedarikçi"
shipping_category_id: "Nakliye Kategorisi"
shipping_category_id: "Teslimat Kategorisi"
variant_unit: "Varyant Birimi"
variant_unit_name: "Varyant Birim Adı"
spree/credit_card:
@@ -31,20 +31,24 @@ tr:
taken: "Bu e-posta adına kayıtlı bir hesap var. Lütfen giriş yapın veya şifrenizi sıfırlayın."
spree/order:
no_card: Ödeme alınabilecek kayıtlı bir kredi kartı bulunmamaktadır.
spree/credit_card:
attributes:
base:
card_expired: "süresi doldu"
order_cycle:
attributes:
orders_close_at:
after_orders_open_at: ılış tarihinden sonra olmalı
variant_override:
count_on_hand:
using_producer_stock_settings_but_count_on_hand_set: "Boş bırakılmalı çünkü üreticinin stokları kullanılıyor"
using_producer_stock_settings_but_count_on_hand_set: "Boş bırakılmalı çünkü üretici stok ayarları kullanılıyor"
on_demand_but_count_on_hand_set: "talep üzerine is boş bırakılmalıdır"
limited_stock_but_no_count_on_hand: "Sınırlı stok durumundan dolayı belirtilmeli"
activemodel:
attributes:
order_management/reports/enterprise_fee_summary/parameters:
start_at: "Başlangıç"
end_at: "Son"
end_at: "Bitiş"
distributor_ids: "Pazarlar"
producer_ids: "Üreticiler"
order_cycle_ids: "Sipariş Dönemleri"
@@ -67,12 +71,12 @@ tr:
schedule:
not_coordinated_by_shop: "%{shop} tarafından koordine edilmiyor"
payment_method:
not_available_to_shop: "%{shop} tarafından kullanılamıyor"
not_available_to_shop: "%{shop} için müsait değil"
invalid_type: "Nakit veya online ödeme yöntemi olmalıdır"
charges_not_allowed: "^ Bu müşteri tarafından kredi kartı ile ödeme yöntemi kabul edilmemektedir."
charges_not_allowed: "^ Bu müşteri tarafından kredi kartı ücretlendirme kabul edilmemektedir."
no_default_card: "^ Bu müşteri için kayıtlı kart bulunmuyor"
shipping_method:
not_available_to_shop: "%{shop} tarafından kullanılamıyor"
not_available_to_shop: "%{shop} için kullanıma uygun değil"
devise:
confirmations:
send_instructions: "Birkaç dakika içinde, hesabınızı nasıl doğrulayacağınız ile ilgili talimatları içeren bir e-posta alacaksınız."
@@ -118,7 +122,7 @@ tr:
welcome:
subject: "%{enterprise} şimdi %{sitename} 'de"
email_welcome: "Hoşgeldiniz"
email_registered: "şimdi şunun bir parçası"
email_registered: "şimdi bir parçası"
email_userguide_html: "Tezgah veya Pazar hesapları ayarları ile ilgili ayrıntılı desteğe sahip Kullanıcı Kılavuzu burada: %{link}"
userguide: "Açık Gıda Ağı Kullanıcı Kılavuzu"
email_admin_html: "%{link}'dan oturum açarak veya ana sayfanın sağ üst kısmındaki ayarlar simgesini tıkladıktan sonra Yönetim' butonu üzerinden hesabınızı yönetebilirsiniz."
@@ -137,8 +141,8 @@ tr:
shipment_summary: "Teslimat Özeti"
subject: "Teslimat Bildirimi"
thanks: "İş birliğiniz için teşekkür ederim."
track_information: "Kargo Takip Bilgileri: %{tracking}"
track_link: "Kargo Takip Bağlantısı: %{url}"
track_information: "Takip Bilgileri: %{tracking}"
track_link: "Takip Bağlantısı: %{url}"
subscription_mailer:
placement_summary_email:
subject: Yakın zamanda oluşturulan üye siparişlerinin bir özeti
@@ -149,7 +153,7 @@ tr:
greeting: "Merhaba %{name},"
intro: "Aşağıda, %{shop} için yeni tamamlanmış olan üye siparişlerinin bir özeti bulunmaktadır."
summary_overview:
total: Otomatik işlem için toplam %{count} üye işaretlendi.
total: Otomatik işlem için toplam %{count} üyelik işaretlendi.
success_zero: Bunlardan hiçbiri başarıyla işlenmedi.
success_some: Bunlardan %{count} işlem başarıyla tamamlandı.
success_all: Hepsi başarıyla işlendi.
@@ -176,10 +180,10 @@ tr:
explainer: Bu siparişlerin otomatik olarak işlenmesi bilinmeyen bir nedenden dolayı başarısız oldu. Bu gerçekleşmemesi gereken bir durum, bu hatayı alıyorsanız lütfen bizimle iletişime geçin.
home: "AGA"
title: ık Gıda Ağı
welcome_to: '''na Hoşgeldiniz'
site_meta_description: "Açık Gıda Ağı, farklı ülkelerdeki temiz gıda üreticileri ve yazılımcılar tarafından yeni bir gıda sistemi oluşturmak üzere tasarlandı. Üretici ve türeticilerin bir araya gelerek aracısız bir gıda düzeni ile her açıdan daha sağlıklı bir toplum yaratmaları için çözümler sunar. Toplum yararına çalışır ve tamamen şeffaftır."
welcome_to: 'Hoşgeldiniz'
site_meta_description: "Açık Gıda Ağı, adil ve temiz bir gıda sistemi oluşturmak için tasarlanan bir sosyal girişim projesidir. Üretici ve türeticilerin bir araya gelerek aracısız bir gıda düzeni ile her açıdan daha sağlıklı bir toplum yaratmaları için çözümler sunar. Toplum yararına çalışır, iletişim, dürüstlük ve dayanışmayı destekler."
search_by_name: İsim veya konuma göre arama yapın...
producers_join: Yerel ve temiz üreticiler şimdi Açık Gıda Ağı'na katılabilirler.
producers_join: Temiz gıda üreticileri!ık Gıda Ağı sizler için kullanıma açıldı.
charges_sales_tax: KDV Uyguluyor mu?
print_invoice: "Faturayı yazdır"
print_ticket: "Etiketi Yazdır"
@@ -188,7 +192,7 @@ tr:
resend_confirmation: "Onayı Tekrar Gönderin"
view_order: "Siparişi Görüntüle"
edit_order: "Siparişi Düzenle"
ship_order: "Siparişi Teslim Et"
ship_order: "Siparişi Gönder"
cancel_order: "Siparişi İptal Et"
confirm_send_invoice: "Bu siparişin faturası müşteriye gönderilecek. Devam etmek istiyor musunuz?"
confirm_resend_order_confirmation: "Sipariş onayı e-postasını tekrar göndermek istediğinizden emin misiniz?"
@@ -220,7 +224,7 @@ tr:
enterprise_groups: Gruplar
reports: Raporlar
variant_overrides: Stok
import: İçe Aktar
import: Aktar
spree_products: Spree Ürünleri
all: Hepsi
current: Güncel
@@ -237,20 +241,22 @@ tr:
items: Kalemler
summary: Özet
detailed: Detaylı
updated: Güncellenmiş
updated: Güncel
'yes': "Evet"
'no': "Hayır"
y: 'Y'
n: 'N'
powered_by: Tarafından desteklenmektedir
y: 'E'
n: 'H'
powered_by: Destekleyici
blocked_cookies_alert: "Tarayıcınız bu ekranı kullanmak için gereken çerezleri engelliyor olabilir. Çerezlere izin vermek ve sayfayı yeniden yüklemek için aşağıya tıklayın."
allow_cookies: "Çerezlere izin ver"
notes: Notlar
error: Hata
processing_payment: "Ödeme İşlemi Gerçekleştiriliyor.."
no_pending_payments: "Bekleyen ödeme yok"
invalid_payment_state: "Geçersiz ödeme durumu"
filter_results: Sonuçları Filtrele
quantity: Miktar
pick_up: Teslimat Noktası
pick_up: Teslim Alma
copy: Kopyala
change_my_password: "Şifremi Değiştir"
update_password: "Şifreyi Güncelle"
@@ -258,8 +264,8 @@ tr:
reset_password_token: Şifre kodunu sıfırla
expired: Süresi doldu, lütfen yeni bir tane isteyin
back_to_payments_list: "Ödeme Listesine Geri Dön"
maestro_or_solo_cards: "Maestro / Solo kartları"
backordered: "Bekleyen Sipariş"
maestro_or_solo_cards: "Ödeme kartları"
backordered: "Bakiye Sipariş"
on hand: "Mevcut"
ship: "Teslimat"
actions:
@@ -272,13 +278,13 @@ tr:
delete: "Sil"
admin:
begins_at: Başlangıç
begins_on: Başlangıç
begins_on: Başlangıç vakti
customer: Müşteri
date: Tarih
email: E-posta
ends_at: Bitiş
ends_on: 'Bitiş '
name: Ad
ends_on: Bitiş vakti
name: İsim
on_hand: Mevcut
on_demand: Talep Üzerine
on_demand?: Talep Üzerine?
@@ -296,7 +302,7 @@ tr:
shipping_method: Teslimat Yöntemi
shop: Tezgah
sku: Stok Kodu
status_state: Şehir
status_state: Durum
tags: Etiketler
variant: Varyant
weight: ırlık
@@ -342,11 +348,11 @@ tr:
enable_receipt_printing?: "Sipariş listesinde termal yazıcılar kullanarak makbuz yazdırma seçeneklerini göster?"
stripe_connect_settings:
edit:
title: "Şerit Bağlantısı"
title: "Ödeme Bağlantısı"
settings: "Ayarlar"
stripe_connect_enabled: Satıcıların Stripe Connect kullanarak ödeme kabul etmesine izin verilsin mi?
no_api_key_msg: Bu işletme için Stripe hesabı yok.
configuration_explanation_html: Stripe Connect entegrasyonunu yapılandırma hakkında ayrıntılı talimatlar için lütfen <a href='https://github.com/openfoodfoundation/openfoodnetwork/wiki/Setting-up-Stripe-on-an-OFN-instance' target='_blank'>bu kılavuza bakın</a> .
stripe_connect_enabled: Satıcıların online ödeme kullanarak ödeme kabul etmesine izin verilsin mi?
no_api_key_msg: Bu işletme için online ödeme hesabı yok.
configuration_explanation_html: Online ödeme entegrasyonunu yapılandırma hakkında ayrıntılı talimatlar için lütfen <a href='https://github.com/openfoodfoundation/openfoodnetwork/wiki/Setting-up-Stripe-on-an-OFN-instance' target='_blank'>bu kılavuza bakın</a> .
status: Durum
ok: Tamam
instance_secret_key: Örnek Gizli Anahtarı
@@ -355,7 +361,7 @@ tr:
charges_enabled: Ücretlendirmeler Etkin
charges_enabled_warning: "Uyarı: Hesabınız için ücretlendirmeler etkin değil"
auth_fail_error: Girdiğiniz API anahtarı geçersiz
empty_api_key_error_html: Stripe API anahtarı sağlanmadı. API anahtarınızı ayarlamak için lütfen <a href="https://github.com/openfoodfoundation/openfoodnetwork/wiki/Setting-up-Stripe-on-an-OFN-instance" target="_blank">bu talimatları</a> izleyin
empty_api_key_error_html: Ödeme API anahtarı sağlanmadı. API anahtarınızı ayarlamak için lütfen <a href="https://github.com/openfoodfoundation/openfoodnetwork/wiki/Setting-up-Stripe-on-an-OFN-instance" target="_blank">bu talimatları</a> izleyin
matomo_settings:
edit:
title: "Matomo Ayarları"
@@ -390,12 +396,12 @@ tr:
header: Başlık
home_page: Ana Sayfa
producer_signup_page: Üretici kayıt sayfası
hub_signup_page: Pazar Yeri kayıt sayfası
hub_signup_page: Pazar kayıt sayfası
group_signup_page: Grup kayıt sayfası
main_links: Ana Menü Bağlantıları
footer_and_external_links: Altbilgi ve Dış Bağlantılar
your_content: İçeriğiniz
user_guide: Kullanici Rehberi
user_guide: Kullanici Kılavuzu
enterprise_fees:
index:
title: "İşletme Ücretleri"
@@ -470,8 +476,8 @@ tr:
index:
notice: "Dikkat"
beta_notice: "Bu özellik hala beta sürümündedir: kullanırken bazı hatalarla karşılaşabilirsiniz. Lütfen teknik destek için iletişime geçmekten çekinmeyin."
select_file: Yüklemek için bir çizelge seçin
spreadsheet: Çizelge
select_file: Yüklemek için bir dosya seçin
spreadsheet: Dosya
choose_import_type: İçe aktarım türünü seçin
import_into: İçe aktarım türü
product_list: Ürün listesi
@@ -484,7 +490,7 @@ tr:
category_values: Mevcut Kategori Değerleri
product_categories: Ürün Kategorileri
tax_categories: Vergi Kategorileri
shipping_categories: Nakliye Kategorileri
shipping_categories: Teslimat Kategorileri
import:
review: İncele
import: İçe Aktar
@@ -509,7 +515,7 @@ tr:
overwrite_empty: Boşsa üzerine yaz
default_stock: Stok seviyesini ayarla
default_tax_cat: Vergi kategorisini ayarla
default_shipping_cat: Nakliye kategorisi belirle
default_shipping_cat: Teslimat kategorisi belirle
default_available_date: Tarih belirle
validation_overview: İçe aktarım doğrulaması gözden geçirme
entries_found: İçe aktarılan dosyada bulunan girişler
@@ -592,7 +598,7 @@ tr:
variants_without_unit_value: "UYARI: Bazı varyantların birim değeri yok"
select_variant: "Bir varyant seçin"
enterprise:
select_outgoing_oc_products_from: sipariş döneminde dıları gidecek ürünleri şurdan seçin
select_outgoing_oc_products_from: Sipariş dönemi giden ürünleri şurdan seçin
enterprises:
index:
title: İşletmeler
@@ -635,7 +641,7 @@ tr:
promo_image_placeholder: 'Bu görsel ''Hakkımızda'' kısmında görüntülenir'
promo_image_note1: 'DİKKAT:'
promo_image_note2: Kapak resmi 1200 x 260 formatına göre kırpılacaktır.
promo_image_note3: Kapak resmi, bir işletmenin profil sayfasının üstünde görüntülenir.
promo_image_note3: Kapak resmi, işletmenin profil sayfasının üstünde görüntülenir.
inventory_settings:
text1: Stok seviyelerini ve fiyatları şuradan yönetebilirsiniz
inventory: Stok
@@ -644,8 +650,8 @@ tr:
ürünün satış listenize eklenmeden önce Stok listenize eklenip eklenmemesi
gerektiğini seçebilirsiniz. Eğer ürünlerinizi yönetmek için Stok sistemini
kullanmıyorsanız 'tavsiye edilen' seçeneği ile devam etmeniz gerekir.
preferred_product_selection_from_inventory_only_yes: Tezgahınıza yeni ürünler eklenebilir (önerilir)
preferred_product_selection_from_inventory_only_no: Yeni ürünler tezgahınıza eklemeden önce Stok listesine girilmelidir
preferred_product_selection_from_inventory_only_yes: Vitrininize yeni ürünler eklenebilir (önerilir)
preferred_product_selection_from_inventory_only_no: Yeni ürünler vitrininize eklemeden önce Stok listesine girilmelidir
payment_methods:
name: Ad
applies: Uygulanma?
@@ -670,13 +676,13 @@ tr:
visible_in_search: Haritada görünsün mü?
visible_in_search_tip: Sitede arama yapılırken bu işletmenin müşteriler tarafından görünür olup olmayacağını belirler.
visible: Görünür
not_visible: Görünmez
not_visible: Gizli
permalink: Bağlantı Adı (boşluk yok)
permalink_tip: "Bağlantı adı, mağazanızın bağlantı URL'sini oluşturmak için kullanılır: %{link}sectiginiz-ad/tezgah"
link_to_front: Tezgah linkiniz
link_to_front_tip: ık Gıda Ağındaki tezgahınıza doğrudan bağlantı linki
ofn_uid: AGA KN
ofn_uid_tip: ık Gıda Topluluğu'na kayıtlı işletmenize özel tanımlanan kimlik numarası
ofn_uid_tip: ık Gıda ı'na kayıtlı işletmenize özel tanımlanan kimlik numarası
shipping_methods:
name: Ad
applies: Uygulanma?
@@ -702,16 +708,16 @@ tr:
enable_subscriptions_tip: "Üyelik işlevselliği etkinleştirilsin mi?"
enable_subscriptions_false: "Kapalı"
enable_subscriptions_true: "Etkin"
shopfront_message: "Tezgah Mesajınız"
shopfront_message: "Vitrin Mesajınız"
shopfront_message_placeholder: >
Müşterilerinize merhaba diyebilir, tezgahınız ve alışveriş şartlarınız
ile ilgili bilgi verebilirsiniz. Yazdıklarınız, müşteriler tezgahınızı
ile ilgili bilgi verebilirsiniz. Yazdıklarınız, müşteriler vitrininizi
ziyaret ettiğinde görünür olacak.
shopfront_message_link_tooltip: "Bağlantı ekle / düzenle"
shopfront_message_link_prompt: "Lütfen eklemek için bir URL girin"
shopfront_closed_message: "Kapalı Tezgah Mesajı"
shopfront_closed_message: "Kapalı Vitrin Mesajı"
shopfront_closed_message_placeholder: >
Tezgahınızın neden satışa kapalı olduğunu ve ne zaman açılacağını müşterilerinize
Vitrininizin neden satışa kapalı olduğunu ve ne zaman açılacağını müşterilerinize
ıklayan bir mesaj yazın. Bu mesaj, açık sipariş döneminiz olmadığında
sizi ziyaret edenler tarafından görülecek.
shopfront_category_ordering: "Vitrin Kategori Sıralaması"
@@ -723,15 +729,15 @@ tr:
facebook_placeholder: "Örn: www.facebook.com/TurkiyeKoop"
linkedin_placeholder: "Örn: www.linkedin.com/in/adınızsoyadınız"
stripe_connect:
connect_with_stripe: "Stripe ile bağlan"
stripe_connect_intro: "Kredi kartı ile ödeme kabul etmek için, şerit hesabınızıık Gıda Ağına bağlamanız gerekir. Başlamak için sağdaki düğmeyi kullanın."
stripe_account_connected: "Stripe hesabı bağlı."
connect_with_stripe: "Iyzico sistemi ile bağlan"
stripe_connect_intro: "Kredi kartı ile ödeme kabul etmek için, Iyzico hesabınızıık Gıda Ağına bağlamanız gerekir. Başlamak için sağdaki düğmeyi kullanın."
stripe_account_connected: "Iyzico hesabı bağlı."
disconnect: ıkış yap"
confirm_modal:
title: Stripe ile bağlan
part1: Stripe, AGA'ya kayıtlı satıcıların, müşterilerinden kredi kartı ödemelerini kabul etmelerine imkan veren bir hizmet sağlayıcıdır.
part2: Bu özelliği kullanmak için Stripe hesabınızı AGA'ya bağlamanız gerekir. Aşağıdaki 'Kabul Ediyorum' butonunu tıkladığınızda, mevcut bir Stripe hesabını bağlayabileceğiniz Stripe web sitesine yönlendirilir veya hesabınız yoksa yeni bir tane oluşturabilirsiniz.
part3: AGA'nın müşterilerden sizin adınıza kredi kartı ödemelerini kabul etmesini sağlayacaktır. Kendi Stripe hesabınızı korumanız, Stripe ücretlerini ödemeniz ve ters ibrazları ve müşteri hizmetlerini kendiniz ele almanız gerektiğini lütfen unutmayın.
title: Iyzico ile bağlan
part1: Iyzico, AGA'ya kayıtlı satıcıların, müşterilerinden kredi kartı ödemelerini kabul etmelerine imkan veren bir hizmet sağlayıcıdır.
part2: Bu özelliği kullanmak için Iyzico hesabınızı AGA'ya bağlamanız gerekir. Aşağıdaki 'Kabul Ediyorum' butonunu tıkladığınızda, mevcut bir Iyzico hesabını bağlayabileceğiniz Iyzico web sitesine yönlendirilir veya hesabınız yoksa yeni bir tane oluşturabilirsiniz.
part3: AGA'nın müşterilerden sizin adınıza kredi kartı ödemelerini kabul etmesini sağlayacaktır. Kendi Iyzico hesabınızı korumanız, Iyzico ücretlerini ödemeniz ve ters ibrazları ve müşteri hizmetlerini kendiniz ele almanız gerektiğini lütfen unutmayın.
i_agree: Onaylıyorum
cancel: İptal Et
tag_rules:
@@ -782,7 +788,7 @@ tr:
producer_profile: Üretici Profili
connect_ofn: AGA üzerinden bağlan
always_free: HER ZAMAN ÜCRETSİZ
producer_description_text: Ürünlerinizi Açık Gıda Ağı'na yükleyin. Böylece ürünleriniz ortak hesaplar üzerinden satışa sunulabilir.
producer_description_text: Ürünlerinizi Açık Gıda Ağı'na yükleyin. Böylece ürünleriniz pazar hesapları üzerinden satışa sunulabilir.
producer_shop: Üretici Tezgahı
sell_your_produce: Kendi ürününü sat
producer_shop_description_text: ık Gıda Ağı üzerinden açtığınız bireysel tezgahınız ile ürünlerinizi doğrudan müşterilere ulaştırabilirsiniz.
@@ -864,6 +870,7 @@ tr:
distributor: "Dağıtımcı"
products: "Ürünler"
tags: "Etiketler"
delivery_details: "Teslimat Detayları"
fees: "Ücretler"
previous: "Önceki"
save: "Kaydet"
@@ -916,8 +923,8 @@ tr:
schedules: Takvimler
new_schedule: Yeni Takvim
name_and_timing_form:
name: ad
orders_open: 'Siparişler şu zamanda açık:'
name: Ad
orders_open: 'Siparişılma vakti:'
coordinator: Koordinatör
orders_close: Siparişler kapalı
row:
@@ -950,7 +957,7 @@ tr:
could_not_resume_the_order: Sipariş sürdürülemedi
shared:
user_guide_link:
user_guide: Kullanici rehberi
user_guide: Kullanıcı Kılavuzu
enterprises_hubs_tabs:
has_no_payment_methods: "%{enterprise} için bir ödeme yöntemi yok"
has_no_shipping_methods: "%{enterprise} için bir teslimat yöntemi yok"
@@ -1030,7 +1037,7 @@ tr:
enable_subscriptions_step_1_html: 1. %{enterprises_link} sayfasına gidin, tezgahınızı bulun ve Yöneti tıklayın
enable_subscriptions_step_2: '''Tezgah Tercihleri'' altındaki Üyelikler seçeneğini etkinleştirin'
set_up_shipping_and_payment_methods_html: '%{shipping_link} ve %{payment_link} yöntemlerini ayarlayın'
set_up_shipping_and_payment_methods_note_html: Yalnızca Nakit ve Şerit ödeme yöntemlerinin <br />'ü üyeliklerle kullanılabilir
set_up_shipping_and_payment_methods_note_html: Yalnızca Nakit ve Online ödeme yöntemlerinin <br />'ü üyeliklerle kullanılabilir
ensure_at_least_one_customer_html: En az bir %{customer_link} bulunduğundan emin olun
create_at_least_one_schedule: En az bir Takvim oluşturun
create_at_least_one_schedule_step_1_html: 1. %{order_cycles_link} sayfasına gidin
@@ -1055,7 +1062,7 @@ tr:
details:
details: Bilgi
invalid_error: Hata! Lütfen zorunlu alanların tümünü doldurun ...
allowed_payment_method_types_tip: Şu anda yalnızca Nakit ve Stripe ödeme yöntemleri kullanılabilir
allowed_payment_method_types_tip: Şu anda yalnızca belirli ödeme yöntemleri kullanılabilir
credit_card: Kredi kartı
charges_not_allowed: Bu müşteri ücret yansıtılmasına izin vermiyor
no_default_card: Müşterinin tahsilat yapılabilecek bir kartı yok
@@ -1101,11 +1108,11 @@ tr:
associated_subscriptions_error: Bağlantılı üyelikler olduğu için bu takvim silinemiyor
controllers:
enterprises:
stripe_connect_cancelled: "Stripe bağlantısı iptal edildi"
stripe_connect_success: "Stripe hesabı başarıyla bağlandı"
stripe_connect_fail: Maalesef, Stripe hesabınızın bağlantısı başarısız oldu
stripe_connect_cancelled: "Iyzico bağlantısı iptal edildi"
stripe_connect_success: "Iyzico hesabı başarıyla bağlandı"
stripe_connect_fail: Maalesef, Iyzico hesabınızın bağlantısı başarısız oldu
stripe_connect_settings:
resource: Stripe Connect yapılandırması
resource: Iyzico yapılandırması
api:
enterprise_logo:
destroy_attachment_does_not_exist: "Logo mevcut değil"
@@ -1120,8 +1127,8 @@ tr:
failed: "Ödeme başarısız oldu. Siparişinizi işleme koyabilmemiz için lütfen bizimle iletişime geçin."
shops:
hubs:
show_closed_shops: "Kapalı pazarları göster"
hide_closed_shops: "Kapalı pazarları gizle"
show_closed_shops: "Kapalı dükkanları göster"
hide_closed_shops: "Kapalı dükkanları gizle"
show_on_map: "Tümünü haritada göster"
shared:
menu:
@@ -1185,24 +1192,24 @@ tr:
invoice_issued_on: "Fatura Düznleme Tarihi"
order_number: "Fatura numarası:"
date_of_transaction: "İşlem tarihi:"
ticket_column_qty: "miktar"
ticket_column_item: "ürün"
ticket_column_qty: "Miktar"
ticket_column_item: "Ürün"
ticket_column_unit_price: "Birim fiyat"
ticket_column_total_price: "Toplam tutar"
menu_1_title: "Pazarlar"
menu_1_url: "/pazarlar"
menu_1_url: "/shops"
menu_2_title: "harita"
menu_2_url: "/harita"
menu_2_url: "/map"
menu_3_title: "üreticiler"
menu_3_url: "/ üreticiler"
menu_3_url: "/producers"
menu_4_title: "Gruplar"
menu_4_url: "/ gruplar"
menu_5_title: "hakkında"
menu_5_url: "https://about.openfoodnetwork.org.au/"
menu_5_url: "https://acikgida.com"
menu_6_title: "Bağlan"
menu_6_url: "https://openfoodnetwork.org/au/connect/"
menu_6_url: "https://acikgida.com"
menu_7_title: "öğren"
menu_7_url: "https://openfoodnetwork.org/au/learn/"
menu_7_url: "https://acikgida.com"
logo: "Logo (640x130)"
logo_mobile: "Cep telefonu logosu (75x26)"
logo_mobile_svg: "Cep Telefonu logo (SVG)"
@@ -1277,7 +1284,7 @@ tr:
card_securitycode: "Güvenlik Kodu"
card_expiry_date: Son kullanma tarihi
card_masked_digit: "X"
card_expiry_abbreviation: "Tecrübe"
card_expiry_abbreviation: "Son kullanma tarihi"
new_credit_card: "Yeni kredi kartı"
my_credit_cards: Kredi kartlarım
add_new_credit_card: Yeni kredi kartı ekle
@@ -1490,6 +1497,7 @@ tr:
shopping_oc_closed_description: "Lütfen bir sonraki dönem açılana kadar bekleyin (veya geç siparişleri kabul edip edemeyeceğimizi görmek için doğrudan bizimle iletişime geçin)"
shopping_oc_last_closed: "Son dönem %{distance_of_time} önce kapandı"
shopping_oc_next_open: "Bir sonraki dönem %{distance_of_time}'da açılıyor"
shopping_oc_select: "Seçin..."
shopping_tabs_home: "Ana sayfa"
shopping_tabs_shop: "Alışveriş yap"
shopping_tabs_about: "hakkında"
@@ -1539,7 +1547,7 @@ tr:
products_update_error_msg: "Kaydetme başarısız oldu."
products_update_error_data: "Geçersiz veriler nedeniyle kaydetme başarısız oldu:"
products_changes_saved: "Değişiklikler kaydedildi."
search_no_results_html: "Üzgünüz, %{query} için sonuç bulunamadı. Başka bir arama yapmak ister misiniz?"
search_no_results_html: "Üzgünüz, %{query} sonuç bulunamadı. Başka bir arama yapmak ister misiniz?"
components_profiles_popover: "Açık Gıda Ağında bir vitrini olmayan ancak başka bir sitede kendi satış siteleri olan hesaplar"
components_profiles_show: "Profilleri göster"
components_filters_nofilters: "Filtresiz"
@@ -1635,9 +1643,9 @@ tr:
sell_listing_price: "AGA üzerinde görünür olmak ücretsizdir. OFN&#39;de bir mağaza açmak ve işletmek aylık 500 dolara kadar ücretsizdir. Daha fazla satıyorsanız, satışların% 1&#39;i ile% 3&#39;ü arasında topluluk katkınızı seçebilirsiniz. Fiyatlandırma hakkında daha fazla bilgi için, üst menüdeki Hakkında bağlantısını kullanarak Yazılım Platformu bölümünü ziyaret edin."
sell_embed: "Açık Gıda Ağı üzerinden oluşturduğunuz tezgahınızı kendi web siteniz üzerinden de kullanmanıza yardımcı olabiliriz. Müşterileriniz mevcut internet siteniz üzerinden de aynı şekilde sipariş verebilirler. "
sell_ask_services: "Bize AGA hizmetleri hakkında soru sorun."
shops_title: Mağazalar
shops_title: Dükkanlar
shops_headline: Alışveriş biçim değiştiriyor
shops_text: Gıdalar döngüler halinde büyür, çiftçiler döngüler halinde hasat eder ve döngüler halinde yiyecek sipariş ederiz. Sipariş döngüsünün kapalı olduğunu fark ederseniz, kısa süre sonra tekrar kontrol edin.
shops_text: Gıda dönemsel yetişir, dönemsel hasat edilir ve dönemsel sipariş edilir. Aradığınız sipariş dönemi kapalı ise kısa süre sonra tekrar kontrol edin.
shops_signup_title: Pazar olarak kaydolun
shops_signup_headline: Gıda pazarları, sınır yok.
shops_signup_motivation: Her türlü gıda işletmesi/topluluğu modelini destekliyoruz. Bağımsız ve şeffaf bir sosyal girişimiz. İşlerinizi kolaylaştırmaya çalışan yol arkadaşlarıyız.
@@ -1863,6 +1871,7 @@ tr:
headline: "Tamamlandı!"
thanks: "%{enterprise} ile ilgili ayrıntıları doldurduğunuz için teşekkür ederiz."
login: "Dilediğiniz zaman Açık Gıda Ağı üzerinden giriş yapıp Yönetici paneline giderek işletmenizin ayarlarını güncelleyebilirsiniz."
action: "İşletme Paneline Git"
back: "Geri"
continue: "Devam et"
action_or: "VEYA"
@@ -2279,6 +2288,7 @@ tr:
enterprise_register_success_notice: "Tebrikler! %{enterprise}için kayıt tamamlandı!"
enterprise_bulk_update_success_notice: "İşletmeler başarıyla güncellendi"
enterprise_bulk_update_error: 'Güncelleştirme başarısız'
enterprise_shop_show_error: "Aradığınız dükkan AGA üzerinde bulunamıyor veya gizli durumda. Lütfen diğerlerini kontrol edin."
order_cycles_create_notice: 'Sipariş döneminiz oluşturuldu.'
order_cycles_update_notice: 'Sipariş döneminiz güncellendi.'
order_cycles_bulk_update_notice: 'Sipariş dönemleri güncellendi.'
@@ -2859,7 +2869,7 @@ tr:
shipping_methods: "Teslimat Yöntemleri"
shipping_categories: "Nakliye Kategorileri"
new_shipping_category: "Yeni Nakliye Kategorisi"
back_to_shipping_categories: "Nakliye Kategorilerine Geri Dön"
back_to_shipping_categories: "Teslimat Kategorilerine Geri Dön"
analytics_trackers: "Analitik İzleyiciler"
no_trackers_found: "İzleyici Bulunamadı"
new_tracker: "Yeni İzleyici"
@@ -3017,6 +3027,8 @@ tr:
tax_invoice: "VERGİ FATURASI"
code: "Kod"
from: "İtibaren"
to: "Fatura Adresi"
shipping: "Teslimat"
form:
distribution_fields:
title: "Dağıtım"
@@ -3219,7 +3231,7 @@ tr:
enter_new_card: Yeni bir kart için bilgileri girin
used_saved_card: "Kayıtlı bir kart kullanın:"
or_enter_new_card: "Veya yeni bir kart için bilgileri girin:"
remember_this_card: Bu kartı hatırlıyor musunuz?
remember_this_card: Bu kart hatırlansın mı?
date_picker:
format: '% Y-% A-%d'
js_format: 'yy-aa-gg'

View File

@@ -0,0 +1,5 @@
class AddUserIdIndexToSpreeOrders < ActiveRecord::Migration
def change
add_index :spree_orders, :user_id
end
end

View File

@@ -0,0 +1,5 @@
class AddSupplierIdIndexToSpreeProducts < ActiveRecord::Migration
def change
add_index :spree_products, :supplier_id
end
end

View File

@@ -0,0 +1,9 @@
class IncreaseCharactersOfLocaleInSpreeUsers < ActiveRecord::Migration
def up
change_column :spree_users, :locale, :string, limit: 6
end
def down
change_column :spree_users, :locale, :string, limit: 5
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20200327105910) do
ActiveRecord::Schema.define(:version => 20200406085833) do
create_table "adjustment_metadata", :force => true do |t|
t.integer "adjustment_id"
@@ -575,6 +575,7 @@ ActiveRecord::Schema.define(:version => 20200327105910) do
add_index "spree_orders", ["distributor_id"], :name => "index_spree_orders_on_distributor_id"
add_index "spree_orders", ["number"], :name => "index_orders_on_number"
add_index "spree_orders", ["order_cycle_id"], :name => "index_spree_orders_on_order_cycle_id"
add_index "spree_orders", ["user_id"], :name => "index_spree_orders_on_user_id"
create_table "spree_payment_methods", :force => true do |t|
t.string "type"
@@ -724,6 +725,7 @@ ActiveRecord::Schema.define(:version => 20200327105910) do
add_index "spree_products", ["permalink"], :name => "index_products_on_permalink"
add_index "spree_products", ["permalink"], :name => "permalink_idx_unique", :unique => true
add_index "spree_products", ["primary_taxon_id"], :name => "index_spree_products_on_primary_taxon_id"
add_index "spree_products", ["supplier_id"], :name => "index_spree_products_on_supplier_id"
create_table "spree_products_promotion_rules", :id => false, :force => true do |t|
t.integer "product_id"
@@ -1045,7 +1047,7 @@ ActiveRecord::Schema.define(:version => 20200327105910) do
t.datetime "reset_password_sent_at"
t.string "api_key", :limit => 40
t.integer "enterprise_limit", :default => 5, :null => false
t.string "locale", :limit => 5
t.string "locale", :limit => 6
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"

View File

@@ -8,62 +8,23 @@ module OrderManagement
end
def call!
create_payment
ensure_payment_source
return if order.errors.any?
payment = create_payment
return if @order.errors.any?
payment.update_attributes(amount: order.outstanding_balance)
payment.update_attributes(amount: @order.outstanding_balance)
payment
end
private
attr_reader :order
def payment
@payment ||= order.pending_payments.last
end
def create_payment
return if payment.present?
payment = @order.pending_payments.last
return payment if payment.present?
@payment = order.payments.create(
payment_method_id: order.subscription.payment_method_id,
amount: order.outstanding_balance
@order.payments.create(
payment_method_id: @order.subscription.payment_method_id
)
end
def card_required?
[Spree::Gateway::StripeConnect,
Spree::Gateway::StripeSCA].include? payment.payment_method.class
end
def card_set?
payment.source is_a? Spree::CreditCard
end
def ensure_payment_source
return unless card_required? && !card_set?
ensure_credit_card || order.errors.add(:base, :no_card)
end
def ensure_credit_card
return false if saved_credit_card.blank? || !allow_charges?
payment.update_attributes(source: saved_credit_card)
end
def allow_charges?
order.customer.allow_charges?
end
def saved_credit_card
order.user.default_card
end
def errors_present?
order.errors.any?
end
end
end
end

View File

@@ -0,0 +1,52 @@
# frozen_string_literal: true
module OrderManagement
module Subscriptions
class StripePaymentSetup
def initialize(order)
@order = order
@payment = @order.pending_payments.last
end
def call!
return if @payment.blank?
ensure_payment_source
@payment
end
private
def ensure_payment_source
return unless stripe_payment_method? && !card_set?
if saved_credit_card.present? && allow_charges?
use_saved_credit_card
else
@order.errors.add(:base, :no_card)
end
end
def stripe_payment_method?
[Spree::Gateway::StripeConnect,
Spree::Gateway::StripeSCA].include? @payment.payment_method.class
end
def card_set?
@payment.source.is_a? Spree::CreditCard
end
def saved_credit_card
@order.user.default_card
end
def allow_charges?
@order.customer.allow_charges?
end
def use_saved_credit_card
@payment.update_attributes(source: saved_credit_card)
end
end
end
end

View File

@@ -0,0 +1,22 @@
# frozen_string_literal: true
module OrderManagement
module Subscriptions
class StripeScaPaymentAuthorize
def initialize(order)
@order = order
@payment = @order.pending_payments.last
end
def call!
return unless @payment&.checkout?
@payment.authorize!
@order.errors.add(:base, I18n.t('authorization_failure')) unless @payment.pending?
@payment
end
end
end
end

View File

@@ -8,44 +8,6 @@ module OrderManagement
let(:order) { create(:order) }
let(:payment_setup) { OrderManagement::Subscriptions::PaymentSetup.new(order) }
describe "#payment" do
context "when only one payment exists on the order" do
let!(:payment) { create(:payment, order: order) }
context "where the payment is pending" do
it { expect(payment_setup.__send__(:payment)).to eq payment }
end
context "where the payment is failed" do
before { payment.update_attribute(:state, 'failed') }
it { expect(payment_setup.__send__(:payment)).to be nil }
end
end
context "when more that one payment exists on the order" do
let!(:payment1) { create(:payment, order: order) }
let!(:payment2) { create(:payment, order: order) }
context "where more than one payment is pending" do
it { expect([payment1, payment2]).to include payment_setup.__send__(:payment) }
end
context "where only one payment is pending" do
before { payment1.update_attribute(:state, 'failed') }
it { expect(payment_setup.__send__(:payment)).to eq payment2 }
end
context "where no payments are pending" do
before do
payment1.update_attribute(:state, 'failed')
payment2.update_attribute(:state, 'failed')
end
it { expect(payment_setup.__send__(:payment)).to be nil }
end
end
end
describe "#call!" do
let!(:payment){ create(:payment, amount: 10) }
@@ -68,161 +30,35 @@ module OrderManagement
context "when a payment is present" do
before { allow(order).to receive(:pending_payments).once { [payment] } }
context "when a credit card is not required" do
before do
allow(payment_setup).to receive(:card_required?) { false }
expect(payment_setup).to_not receive(:card_available?)
expect(payment_setup).to_not receive(:ensure_credit_card)
end
context "when the payment total doesn't match the outstanding balance on the order" do
before { allow(order).to receive(:outstanding_balance) { 5 } }
it "updates the payment total to reflect the outstanding balance" do
expect{ payment_setup.call! }.to change(payment, :amount).from(10).to(5)
end
end
context "when the payment total matches the outstanding balance on the order" do
before { allow(order).to receive(:outstanding_balance) { 10 } }
it "does nothing" do
expect{ payment_setup.call! }.to_not change(payment, :amount).from(10)
end
context "when the payment total doesn't match the outstanding balance on the order" do
before { allow(order).to receive(:outstanding_balance) { 5 } }
it "updates the payment total to reflect the outstanding balance" do
expect{ payment_setup.call! }.to change(payment, :amount).from(10).to(5)
end
end
context "when a credit card is required" do
before do
expect(payment_setup).to receive(:card_required?) { true }
end
context "when the payment total matches the outstanding balance on the order" do
before { allow(order).to receive(:outstanding_balance) { 10 } }
context "and the payment source is not a credit card" do
before { expect(payment_setup).to receive(:card_set?) { false } }
context "and no default credit card has been set by the customer" do
before do
allow(order).to receive(:user) { instance_double(Spree::User, default_card: nil) }
end
it "adds an error to the order and does not update the payment" do
expect(payment).to_not receive(:update_attributes)
expect{ payment_setup.call! }.to change(order.errors[:base], :count).from(0).to(1)
end
end
context "and the customer has not authorised the shop to charge to credit cards" do
before do
allow(order).to receive(:user) {
instance_double(Spree::User, default_card: create(:credit_card))
}
allow(order).to receive(:customer) {
instance_double(Customer, allow_charges?: false)
}
end
it "adds an error to the order and does not update the payment" do
expect(payment).to_not receive(:update_attributes)
expect{ payment_setup.call! }.to change(order.errors[:base], :count).from(0).to(1)
end
end
context "and an authorised default credit card is available to charge" do
before do
allow(order).to receive(:user) {
instance_double(Spree::User, default_card: create(:credit_card))
}
allow(order).to receive(:customer) {
instance_double(Customer, allow_charges?: true)
}
end
context "when the payment total doesn't match the order's outstanding balance" do
before { allow(order).to receive(:outstanding_balance) { 5 } }
it "updates the payment total to reflect the outstanding balance" do
expect{ payment_setup.call! }.to change(payment, :amount).from(10).to(5)
end
end
context "when the payment total matches the outstanding balance on the order" do
before { allow(order).to receive(:outstanding_balance) { 10 } }
it "does nothing" do
expect{ payment_setup.call! }.to_not change(payment, :amount).from(10)
end
end
end
end
context "and the payment source is already a credit card" do
before { expect(payment_setup).to receive(:card_set?) { true } }
context "when the payment total doesn't match the outstanding balance on the order" do
before { allow(order).to receive(:outstanding_balance) { 5 } }
it "updates the payment total to reflect the outstanding balance" do
expect{ payment_setup.call! }.to change(payment, :amount).from(10).to(5)
end
end
context "when the payment total matches the outstanding balance on the order" do
before { allow(order).to receive(:outstanding_balance) { 10 } }
it "does nothing" do
expect{ payment_setup.call! }.to_not change(payment, :amount).from(10)
end
end
it "does nothing" do
expect{ payment_setup.call! }.to_not change(payment, :amount).from(10)
end
end
end
end
describe "#ensure_credit_card" do
let!(:payment) { create(:payment, source: nil) }
before { allow(payment_setup).to receive(:payment) { payment } }
context "when more that one payment exists on the order" do
let!(:payment1) { create(:payment, order: order) }
let!(:payment2) { create(:payment, order: order) }
context "when no default credit card is found" do
before do
allow(order).to receive(:user) { instance_double(Spree::User, default_card: nil) }
allow(order).to receive(:outstanding_balance) { 7 }
allow(order).to receive(:pending_payments).once { [payment1, payment2] }
end
it "returns false and down not update the payment source" do
expect do
expect(payment_setup.__send__(:ensure_credit_card)).to be false
end.to_not change(payment, :source).from(nil)
end
end
context "when a default credit card is found" do
let(:credit_card) { create(:credit_card) }
before do
allow(order).to receive(:user) {
instance_double(Spree::User, default_card: credit_card)
}
end
context "and charge have not been authorised by the customer" do
before do
allow(order).to receive(:customer) {
instance_double(Customer, allow_charges?: false)
}
end
it "returns false and does not update the payment source" do
expect do
expect(payment_setup.__send__(:ensure_credit_card)).to be false
end.to_not change(payment, :source).from(nil)
end
end
context "and charges have been authorised by the customer" do
before do
allow(order).to receive(:customer) { instance_double(Customer, allow_charges?: true) }
end
it "returns true and stores the credit card as the payment source" do
expect do
expect(payment_setup.__send__(:ensure_credit_card)).to be true
end.to change(payment, :source_id).from(nil).to(credit_card.id)
end
it "updates the amount of the last payment to reflect the outstanding balance" do
payment_setup.call!
expect(payment1.amount).to eq 45.75
expect(payment2.amount).to eq 7
end
end
end

View File

@@ -0,0 +1,109 @@
# frozen_string_literal: true
require 'spec_helper'
module OrderManagement
module Subscriptions
describe StripePaymentSetup do
let(:order) { create(:order) }
let(:payment_setup) { OrderManagement::Subscriptions::StripePaymentSetup.new(order) }
describe "#call!" do
context "when no pending payments are present" do
before do
allow(order).to receive(:pending_payments).once { [] }
end
it "does nothing" do
expect(payment_setup.call!).to eq nil
end
end
context "when a payment is present" do
let(:payment) { create(:payment, payment_method: payment_method, amount: 10) }
before { allow(order).to receive(:pending_payments).once { [payment] } }
context "when the payment method is not a stripe payment method" do
let(:payment_method) { create(:payment_method) }
it "returns the pending payment with no change" do
expect(payment).to_not receive(:update_attributes)
expect(payment_setup.call!).to eq payment
end
end
context "when the payment method is a stripe payment method" do
let(:payment_method) { create(:stripe_payment_method) }
context "and the card is already set (the payment source is a credit card)" do
it "returns the pending payment with no change" do
expect(payment).to_not receive(:update_attributes)
expect(payment_setup.call!).to eq payment
end
end
context "and the card is not set (the payment source is not a credit card)" do
before { payment.update_attribute :source, nil }
context "and no default credit card has been saved by the customer" do
before do
allow(order).to receive(:user) { instance_double(Spree::User, default_card: nil) }
end
it "adds an error to the order and does not update the payment" do
payment_setup.call!
expect(payment).to_not receive(:update_attributes)
expect(payment_setup.call!).to eq payment
expect(order.errors[:base].first).to eq "There are no authorised "\
"credit cards available to charge"
end
end
context "and a default credit card has been saved by the customer" do
let(:saved_credit_card) { create(:credit_card) }
before do
allow(order).to receive(:user) {
instance_double(Spree::User, default_card: saved_credit_card)
}
end
context "but the customer has not authorised the shop to charge credit cards" do
before do
allow(order).to receive(:customer) {
instance_double(Customer, allow_charges?: false)
}
end
it "adds an error to the order and does not update the payment" do
payment_setup.call!
expect(payment).to_not receive(:update_attributes)
expect(payment_setup.call!).to eq payment
expect(order.errors[:base].first).to eq "There are no authorised "\
"credit cards available to charge"
end
end
context "and the customer has authorised the shop to charge credit cards" do
before do
allow(order).to receive(:customer) {
instance_double(Customer, allow_charges?: true)
}
end
it "uses the saved credit card as the source for the payment" do
payment_setup.call!
expect(payment.source).to eq saved_credit_card
end
end
end
end
end
end
end
end
end
end

View File

@@ -0,0 +1,65 @@
# frozen_string_literal: true
require 'spec_helper'
module OrderManagement
module Subscriptions
describe StripeScaPaymentAuthorize do
let(:order) { create(:order) }
let(:payment_authorize) {
OrderManagement::Subscriptions::StripeScaPaymentAuthorize.new(order)
}
describe "#call!" do
context "when no pending payments are present" do
before { allow(order).to receive(:pending_payments).once { [] } }
it "does nothing" do
expect(payment_authorize.call!).to eq nil
end
end
context "when a payment is present" do
let(:payment) { create(:payment, amount: 10) }
before { allow(order).to receive(:pending_payments).once { [payment] } }
context "in a state that is not checkout" do
before { payment.state = "processing" }
it "does nothing" do
payment_authorize.call!
expect(payment.state).to eq "processing"
expect(order.errors.size).to eq 0
end
end
context "in the checkout state" do
before { payment.state = "checkout" }
context "and payment authorize moves the payment state to pending" do
before { expect(payment).to receive(:authorize!) { payment.state = "pending" } }
it "does nothing" do
payment_authorize.call!
expect(order.errors.size).to eq 0
end
end
context "and payment authorize does not move the payment state to pending" do
before { allow(payment).to receive(:authorize!) { payment.state = "failed" } }
it "adds an error to the order indicating authorization failure" do
payment_authorize.call!
expect(order.errors[:base].first).to eq "Authorization Failure"
end
end
end
end
end
end
end
end

View File

@@ -18,6 +18,7 @@ module OpenFoodNetwork
@options = options
@report_type = options[:report_type]
@render_table = render_table
@variant_scopers_by_distributor_id = {}
end
def search
@@ -45,6 +46,14 @@ module OpenFoodNetwork
proc { |line_items| line_items.first.variant.product.name }
end
def variant_scoper_for(distributor_id)
@variant_scopers_by_distributor_id[distributor_id] ||=
OpenFoodNetwork::ScopeVariantToHub.new(
distributor_id,
report_variant_overrides[distributor_id] || {},
)
end
private
def report
@@ -89,5 +98,13 @@ module OpenFoodNetwork
def report_line_items
@report_line_items ||= Reports::LineItems.new(order_permissions, options)
end
def report_variant_overrides
@report_variant_overrides ||=
VariantOverridesIndexed.new(
order_permissions.visible_line_items.select('DISTINCT variant_id'),
report_line_items.orders.result.select('DISTINCT distributor_id'),
).indexed
end
end
end

View File

@@ -7,9 +7,11 @@ module OpenFoodNetwork
attr_reader :context
delegate :line_item_name, to: :context
delegate :variant_scoper_for, to: :context
def initialize(context)
@context = context
@scopers_by_distributor_id = {}
end
# rubocop:disable Metrics/AbcSize
@@ -159,7 +161,11 @@ module OpenFoodNetwork
},
proc { |_line_items| "" },
proc { |line_items| line_items.first.variant.sku },
proc do |line_items|
line_item = line_items.first
variant_scoper_for(line_item.order.distributor_id).scope(line_item.variant)
line_item.variant.sku
end,
proc { |line_items| line_items.first.order.order_cycle.andand.name },
proc { |line_items|

View File

@@ -3,10 +3,13 @@ describe 'Checkout service', ->
orderData = null
$httpBackend = null
Navigation = null
navigationSpy = null
flash = null
scope = null
FlashLoaderMock =
loadFlash: (arg)->
loadFlash: (arg) ->
Loading =
clear: (arg)->
paymentMethods = [{
id: 99
test: "foo"
@@ -48,6 +51,7 @@ describe 'Checkout service', ->
module 'Darkswarm'
module ($provide)->
$provide.value "RailsFlashLoader", FlashLoaderMock
$provide.value "Loading", Loading
$provide.value "currentOrder", orderData
$provide.value "shippingMethods", shippingMethods
$provide.value "paymentMethods", paymentMethods
@@ -61,7 +65,7 @@ describe 'Checkout service', ->
scope.Checkout = Checkout
Navigation = $injector.get("Navigation")
flash = $injector.get("flash")
spyOn(Navigation, "go") # Stubbing out writes to window.location
navigationSpy = spyOn(Navigation, "go") # Stubbing out writes to window.location
it "defaults to no shipping method", ->
expect(Checkout.order.shipping_method_id).toEqual null
@@ -116,12 +120,46 @@ describe 'Checkout service', ->
$httpBackend.flush()
expect(FlashLoaderMock.loadFlash).toHaveBeenCalledWith {error: "frogs"}
it "puts errors into the scope", ->
$httpBackend.expectPUT("/checkout.json").respond 400, {errors: {error: "frogs"}}
it "puts errors into the scope when there is a flash messages", ->
$httpBackend.expectPUT("/checkout.json").respond 400, {errors: {error: "frogs"}, flash: {error: "flash frogs"}}
Checkout.submit()
$httpBackend.flush()
expect(Checkout.errors).toEqual {error: "frogs"}
it "throws exception and sends generic flash message when there are errors but no flash message", ->
$httpBackend.expectPUT("/checkout.json").respond 400, {errors: {error: "broken response"}}
try
Checkout.submit()
$httpBackend.flush()
catch error
expect(error.data.errors.error).toBe("broken response")
expect(Checkout.errors).toEqual {}
it "throws an exception and sends a flash message to the flash service when reponse doesnt contain errors nor a flash message", ->
spyOn(FlashLoaderMock, "loadFlash") # Stubbing out writes to window.location
$httpBackend.expectPUT("/checkout.json").respond 400, "broken response"
try
Checkout.submit()
$httpBackend.flush()
catch error
expect(error.data).toBe("broken response")
expect(FlashLoaderMock.loadFlash).toHaveBeenCalledWith({ error: t("checkout.failed") })
it "throws an exception and sends a flash message to the flash service when an exception is thrown while handling the error", ->
spyOn(FlashLoaderMock, "loadFlash") # Stubbing out writes to window.location
navigationSpy.and.callFake(-> throw "unexpected error")
$httpBackend.expectPUT("/checkout.json").respond 400, {path: 'path'}
try
Checkout.submit()
$httpBackend.flush()
catch error
expect(error).toBe("unexpected error")
expect(FlashLoaderMock.loadFlash).toHaveBeenCalledWith({ error: t("checkout.failed") })
describe "when using the Stripe Connect gateway", ->
beforeEach inject ($injector, StripeElements) ->
Checkout.order.payment_method_id = 666

View File

@@ -62,4 +62,26 @@ RSpec.describe OpenFoodNetwork::OrdersAndFulfillmentsReport::CustomerTotalsRepor
expect(shipping_method_name_field).to eq shipping_method2.name
end
end
context 'when a variant override applies' do
let!(:order) do
create(:completed_order_with_totals, line_items_count: 1, user: customer.user,
customer: customer, distributor: distributor)
end
let(:overidden_sku) { 'magical_sku' }
before do
create(
:variant_override,
hub: distributor,
variant: order.line_items.first.variant,
sku: overidden_sku
)
end
it 'uses the sku from the variant override' do
sku_field = report_table.first[23]
expect(sku_field).to eq overidden_sku
end
end
end

View File

@@ -1,12 +1,16 @@
require 'spec_helper'
describe Api::Admin::CustomerSerializer do
let(:customer) { create(:customer, tag_list: "one, two, three") }
let(:tag_list) { ["one", "two", "three"] }
let(:customer) { create(:customer, tag_list: tag_list) }
let!(:tag_rule) { create(:tag_rule, enterprise: customer.enterprise, preferred_customer_tags: "two") }
it "serializes a customer with tags" do
tag_rule_mapping = TagRule.mapping_for(Enterprise.where(id: customer.enterprise_id))
serializer = Api::Admin::CustomerSerializer.new customer, tag_rule_mapping: tag_rule_mapping
customer_tag_list = { customer.id => tag_list }
serializer = Api::Admin::CustomerSerializer.new customer,
tag_rule_mapping: tag_rule_mapping,
customer_tags: customer_tag_list
result = JSON.parse(serializer.to_json)
expect(result['email']).to eq customer.email
tags = result['tags']
@@ -27,4 +31,11 @@ describe Api::Admin::CustomerSerializer do
expect(tag['rules']).to be nil
end
end
it 'serializes a customer without customer_tags' do
serializer = Api::Admin::CustomerSerializer.new customer
result = JSON.parse(serializer.to_json)
expect(result['tags'].first['text']).to eq tag_list.first
end
end

View File

@@ -0,0 +1,61 @@
require 'spec_helper'
describe VariantOverridesIndexed do
subject(:variant_overrides) { described_class.new([variant.id],[distributor.id]) }
let(:distributor) { create(:distributor_enterprise) }
let(:variant) { create(:variant) }
let!(:variant_override) do
create(
:variant_override,
hub: vo_distributor,
variant: vo_variant,
)
end
describe '#indexed' do
let(:result) { variant_overrides.indexed }
context 'when variant overrides exist for variants of specified variants' do
let(:vo_variant) { variant }
context 'when variant overrides apply to one of the specified distributors' do
let(:vo_distributor) { distributor }
it 'they are included in the mapping' do
expect(result).to eq(
distributor.id => { variant => variant_override }
)
end
end
context 'when variant overrides don\'t apply to one of the specified distributors' do
let(:vo_distributor) { create(:distributor_enterprise) }
it 'they are not included in the mapping' do
expect(result).to eq({})
end
end
end
context 'when variant overrides exist for other variants' do
let(:vo_variant) { create(:variant) }
context 'when variant overrides apply to one of the specified distributors' do
let(:vo_distributor) { distributor }
it 'they are not included in the mapping' do
expect(result).to eq({})
end
end
context 'when variant overrides don\'t apply to one of the specified distributors' do
let(:vo_distributor) { create(:distributor_enterprise) }
it 'they are not included in the mapping' do
expect(result).to eq({})
end
end
end
end
end