import { Injectable } from '@angular/core';
import {Registration} from "./event.service";

@Injectable({
  providedIn: 'root'
})
export class RegistrationService {

  constructor() { }

  public isDeleted(registration: Registration){
    return  registration.deleted_at != null;
  }
  public isCanceled(registration: Registration){
    return !this.isDeleted(registration) &&  registration.canceled_at != null;
  }


  public isActive(registration: Registration){
    return  !this.isDeleted(registration) && !this.isCanceled(registration)
  }

  public mayCancel(registration: Registration) {
    return this.isActive(registration);
  }

}
