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
content = CSV.generate do |csv| | |
csv << ["Program ID", "Program Name", "Organization ID", "Organization Name", "Schedule", "Credit Limit", "Credit Limit Note", "Last Invoice Created At", "Last Invoice Number", "Last Invoice Amount"] | |
InvoiceAccount | |
.joins(organization: :program) | |
.commercial | |
.active | |
.order("programs.name", "organizations.name") | |
.includes(:invoices) | |
.each do |invoice_account| |
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
decrypt! | |
organization = ff('<team ID>') | |
integration = organization.integrations.find_by(provider: 'typeform') | |
with_write_connection do | |
integration.reward_integrations.each do |r| | |
r.mark_deleted | |
r.destroy! | |
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
# Xoxoday, Tillo tokens (in that order) | |
product_tokens = { | |
flipkart: %w(GYBBFQT9VVE2 TRI1BRZSKN7P), | |
nykaa: %w(BY1L4C8B8DN5 SH1PWSYC61F3) | |
} | |
product_tokens.each do |product_name, (xoxoday_token, tillo_token)| | |
xoxoday_product = Product.find_by(public_token: xoxoday_token) | |
tillo_product = Product.find_by(public_token: tillo_token) |