Skip to content

Instantly share code, notes, and snippets.

View victor-tremendous's full-sized avatar

Victor David Santos victor-tremendous

View GitHub Profile
@victor-tremendous
victor-tremendous / commercial_invoicing_data.rb
Created January 22, 2025 16:25
Pull commercial invoicing data
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|
@victor-tremendous
victor-tremendous / reset_typeform_integration.rb
Created January 21, 2025 19:36
Reset TypeForm integration
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
# 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)