# Remove Consumer Fee on GFO ### Some assumptions - The feature should be turned off, not fully removed from the code base. - If it's decided later on that the feature shoudl be permanently removed, we'll scope that then. ### Code Changes #### GFood Repo [Thanks to Ethan](https://github.com/slicelife/gfood/pull/341/files#diff-0ad74834be3ae917c491a9e21e88a745R455), this repo does *not* need to be touched. We only need to turn off the `gfood_order_service_fees` Flipper flag: ``` ruby def order_service_fees_enabled? Flipper[:gfood_order_service_fees].enabled? end ``` #### GFeed Repo 1. To avoid adding the fee to the shop's feed: Comment [this](https://github.com/slicelife/gfeed/blob/fa79db637a23ce84be17c5e2c6e6207c0b890ff0/app/models/gfeed_service.rb#L108) out to avoid addign the fee to the shop's feed. It also prevents the PaymentChargeSpecification from ever being hit. ``` ruby def delivery_offers arr = [] @zones.each do |delivery_zone| arr.push(Thing::Intangible::StructuredValue::PriceSpecification::DeliveryChargeSpecificationRepresenter.represent(delivery_zone)) end # arr.push(payment_charge_specification) if @shop.service_fee { "@type" => "Offer", "priceSpecification" => arr }.as_json end ``` 2. To avoid having the feed re-generate: Comment [this](https://github.com/slicelife/gfeed/blob/fa79db637a23ce84be17c5e2c6e6207c0b890ff0/app/services/feed_updates.rb#L41) out to make sure the feed doesn't regenerate unnecessarily if fee changes. ``` ruby def restaurant_updated return true if shop.updated_at > most_recent_update # return true if shop.service_fee && (shop.service_fee.updated_at > most_recent_update) schedule_update = (shop.hours.pluck(:updated_at) + shop.closings.pluck(:updated_at)).compact.max schedule_update && schedule_update > most_recent_update end ``` 3. Unit tests might also need to be updated to account for this change, but should be trivial. :::info :pushpin: Relevant PRs: [GFood PR](https://github.com/slicelife/gfood/pull/341) and [GFeed PR](https://github.com/slicelife/gfeed/pull/224) :::