DEV NOTE: Support for Ubuntu 18.04 was removed from Ondřej Surý's PPA on June 15, 2023 as that version of Ubuntu is no longer supported. As per the description on the PPA landing page
This file contains 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
# https://talent-hack.atlassian.net/browse/TAL-908 | |
client_email = '[email protected]' | |
talent_email = '[email protected]' | |
pass_title = 'Monthly Unlimited Virtual Classes - Reoccurring' | |
# References involved | |
client_user = User.find_by(email: client_email) | |
talent_user = User.find_by(email: talent_email) | |
pass = Pass.find_by(user_id: talent_user.id, title: pass_title) |
This file contains 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
def create_backend_admin(admin_email, admin_pass) | |
admin_exist = Admin.find_by(email: admin_email) | |
if not admin_exist | |
admin = Admin.create({ | |
email: admin_email, | |
password: admin_pass, | |
password_confirmation: admin_pass, | |
}) | |
pp admin |
This file contains 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
# TODO: include sessions | |
def remove_customer_pass(client_user_id, pass_customer_id, delete_pass_customer = false, expire_pass_customer = false) | |
user_client = User.find(client_user_id) | |
if user_client | |
pass_customer_classes = [] | |
customer_collection = nil | |
pass_customer = PassCustomer.find(pass_customer_id) | |
pass_applies_to = pass_customer.pass.pass_products.pluck(:applies_to) | |
talent = pass_customer.pass.user.talent |
This file contains 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
def remove_class(class_id, remove) | |
klass = TalentClass.find(class_id) | |
amount_class_customers_removed = 0 | |
if klass | |
zoon_meeting = ZoomMeeting.find_by(talent_class_id: class_id) | |
if remove | |
ActiveRecord::Base.transaction do | |
zoon_meeting.delete if zoon_meeting |
This file contains 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
def free_pack_access(pack_id, users_emails, finish_date=nil) | |
pack = Pack.find(pack_id) | |
users_emails.each do |email| | |
current_user = User.find_by(email: email) | |
ActiveRecord::Base.transaction do | |
order = Order.create!( | |
user_id: current_user.id, | |
date: Time.now, | |
status: 'success', |
This file contains 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
def free_on_demand_access (on_demand_collection_id, customers) | |
collection = OnDemandCollection.find(on_demand_collection_id) | |
return "Invalid collection" if collection.nil? | |
ActiveRecord::Base.transaction do | |
customers.each do |customer| | |
user = User.find_by(email: customer[:email]) | |
return "Invalid user email #{customer[:email]}" if user.nil? | |
return "Invalid finish date for #{customer[:email]}" if customer[:finish_date].nil? |
This file contains 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
def redeem_class_credit(customer_user_id, class_id) | |
# Validate customer | |
current_user = User.find(customer_user_id) | |
return "Invalide customer user id" if current_user.nil? | |
# Validate class | |
klass = TalentClass.find(class_id); | |
return "Invalide class id" if klass.nil? | |
This file contains 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
def add_pass_customers_to_program(passes_slugs, program_uid, include_cancelled: true) | |
ActiveRecord::Base.transaction do | |
passes_slugs.each do |slug| | |
pass = Pass.find_by_slug(slug) | |
pass_customers = pass.pass_customers.active_upcoming | |
pass_customers = pass_customers.not_cancelled unless include_cancelled | |
pass_customers.each do |pass_customer| | |
client = pass_customer.user | |
program_customer = ::Customers::Bundles::Program.active_upcoming.find_by(product_uid: program_uid, user_uuid: client.uuid) |
This file contains 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
import { Configuration as WebpackConfiguration } from "webpack"; | |
import { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server'; | |
import path from "path"; | |
import HtmlWebpackPlugin from "html-webpack-plugin"; | |
interface Configuration extends WebpackConfiguration { | |
devServer?: WebpackDevServerConfiguration; | |
} | |
const config = (): Configuration => ({ |
OlderNewer