Initial commit: monorepo Match Live TV.

Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-26 17:45:37 +02:00
commit bba6df52c0
381 changed files with 20599 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
class TeamInvitation < ApplicationRecord
STAFF_KINDS = %w[transmission regia].freeze
belongs_to :team
validates :email, presence: true, format: { with: URI::MailTo::EMAIL_REGEXP }
validates :token_digest, presence: true, uniqueness: true
validates :role, inclusion: { in: UserTeam::ROLES }
validates :staff_kind, inclusion: { in: STAFF_KINDS }
scope :pending, -> { where(accepted_at: nil).where("expires_at > ?", Time.current) }
def self.generate_token
SecureRandom.urlsafe_base64(32)
end
def accept!(user)
ut = UserTeam.find_or_initialize_by(user: user, team: team)
ut.role = role
ut.staff_kind = staff_kind
ut.save!
update!(accepted_at: Time.current)
end
def expired?
expires_at.past?
end
end