-- =====================================================================
-- Kapitano Logistic integration - edit guard (an order the captain has
-- collected, or is delivering, cannot have its products changed from the shop)
--
-- The screen text shown to staff who try. The English row is also created by
-- the shop's own translate() the first time the message is shown; it is here
-- too so both languages exist from the start. Arabic is not created by anything
-- automatic, which is why this file exists.
--
-- Safe to run more than once (each row is inserted only if it is missing).
-- Afterwards clear the translations cache (php artisan cache:clear).
-- =====================================================================

SET NAMES utf8mb4;

INSERT INTO `translations` (`lang`, `lang_key`, `lang_value`, `created_at`, `updated_at`)
SELECT 'en', 'the_captain_has_already_collected_this_order_so_its_products_can_no_longer_be_changed_here_contact_kapitano_dispatch',
       'The captain has already collected this order, so its products can no longer be changed here. Contact Kapitano dispatch.', NOW(), NOW()
FROM DUAL
WHERE NOT EXISTS (
    SELECT 1 FROM `translations` WHERE `lang` = 'en' AND `lang_key` = 'the_captain_has_already_collected_this_order_so_its_products_can_no_longer_be_changed_here_contact_kapitano_dispatch'
);

INSERT INTO `translations` (`lang`, `lang_key`, `lang_value`, `created_at`, `updated_at`)
SELECT 'ar', 'the_captain_has_already_collected_this_order_so_its_products_can_no_longer_be_changed_here_contact_kapitano_dispatch',
       'استلم الكابتن الطلب، لذلك لا يمكن تغيير منتجاته من هنا. تواصل مع عمليات كابيتانو.', NOW(), NOW()
FROM DUAL
WHERE NOT EXISTS (
    SELECT 1 FROM `translations` WHERE `lang` = 'ar' AND `lang_key` = 'the_captain_has_already_collected_this_order_so_its_products_can_no_longer_be_changed_here_contact_kapitano_dispatch'
);
