This file contains hidden or 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
| -- ============================================================ | |
| -- VISITS (High-volume, tenant-aware domain) | |
| -- ============================================================ | |
| CREATE TABLE public.visits ( | |
| id BIGSERIAL PRIMARY KEY, | |
| hotel_id BIGINT NOT NULL, | |
| user_id BIGINT, | |
| arrival_date DATE, | |
| departure_date DATE, |
This file contains hidden or 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
| class InitializeShopService | |
| require 'yaml' | |
| def self.testing(shop_info = {shop_session: nil, shop: nil}) | |
| raise StandardError, "Invalid Shop" if shop_info[:shop_session].try(:[], :token).blank? && shop_info[:shop].blank? | |
| # for add/update files in shopify | |
| new(shop_info).add_store_front_functionality | |
| end | |
| def self.set_store_front(shop_info = {shop_session: nil, shop: nil, theme_id: nil}) |
This file contains hidden or 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
| class StaffConsoleQuery | |
| def initialize(relation:, user: nil) | |
| @relation = relation | |
| @user = user | |
| end | |
| def sort(order = :unresolved_requests) | |
| @relation = REQUIRE_GUESTS.include?(order) ? relation.joins(:guest) : relation | |
| join_associations(order).order(SORTING[order] ? Arel.sql(SORTING[order]) : SORTING[order]) | |
| end |
This file contains hidden or 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
| class MerchantWebhooks::TriggerMerchantWebhook | |
| def initialize(webhook, klass, id) | |
| @webhook = webhook | |
| @klass = klass | |
| @record = klass.constantize.find(id) | |
| end | |
| def self.call(webhook, klass, id) | |
| new(webhook, klass, id).perform | |
| end |