Skip to content

Instantly share code, notes, and snippets.

@avidas
Last active August 11, 2017 15:38
Show Gist options
  • Save avidas/a3d454a33ff3e1446aae50ee9c800926 to your computer and use it in GitHub Desktop.
Save avidas/a3d454a33ff3e1446aae50ee9c800926 to your computer and use it in GitHub Desktop.
Cancel Move In / Move Out for Finalized SD Invoice Reservations https://jira.we.co/browse/REVENG-121
# JIRA: REVENG-121
# cancel move in for Office 16-116 in Tower 49 for Gimbal EUAETK
begin
Rails.logger.info "JIRA REVENG-121 starting to cancel move in for Office 16-116 in Tower 49 for Gimbal EUAETK"
TenantService.switch_to_rest_of_world_tenant
pr = PrimaryReservation.find(600203682)
pr.canceled_at = DateTime.new
pr.save!
Rails.logger.info "JIRA REVENG-121 done canceling move in for Office 16-116 in Tower 49 for Gimbal EUAETK "
end
# cancel move out for office 337 in Yangping Luy for 上海唐艾文化传播有限公司 - KIB7YC
begin
Rails.logger.info "JIRA REVENG-121 starting to cancel move out for Office 337 for Gimbal EUAETK"
TenantService.switch_to_apac_tenant
reservable = Account.find_by_short_code("KIB7YC").primary_reservations.map(&:reservable).select { |res| res.type == "Office" && res.name == "337" }.first
pr = Account.find_by_short_code("KIB7YC").primary_reservations.where("reservable_id = #{reservable.id}").first
pr.ended_on = nil
pr.save!
Rails.logger.info "JIRA REVENG-121 done canceling move out for Office 337 for Gimbal EUAETK "
end
@novasponge
Copy link

@jhjwind what about the other one with cancel move out? Has billing fixed everything manually?

@avidas
Copy link
Author

avidas commented Aug 11, 2017

For the cancel move out case, I talked to Michelle about it and it did not seem like a concern to have the cms offer them discounts as need be. We should certainly consider the impact on our systems, but does not seem like an issue from ops perspective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment