public bool Process(
            ExaminationEvent transactionEvent,
            ILog logger)
        {
            var p         = TflService.GetNflPlayer(transactionEvent.PlayerId);
            var eventDate = transactionEvent.EventDate
                            ?? transactionEvent.ExaminationDateTime;

            if (TflService.IsSameDay(p, eventDate))
            {
                logger.Info($@"Signing for {
					p.PlayerName
					} ignored: Same day contract rule"                    );
                return(false);
            }

            if (!string.IsNullOrEmpty(p.TeamCode))
            {
                //  end his previous team contract
                TflService.EndContract(
                    p,
                    when: eventDate,
                    isRetirement: false);
            }

            // start new contract
            return(transactionEvent.EventDate != null &&
                   TflService.RecordSigning(
                       p,
                       teamCode: transactionEvent.TeamId,
                       when: (DateTime)transactionEvent.EventDate,
                       how: "FA"));
        }
Beispiel #2
0
        public bool Process(
            ExaminationEvent transactionEvent,
            ILog logger)
        {
            var p = TflService.GetNflPlayer(
                transactionEvent.PlayerId);
            var eventDate = transactionEvent.EventDate
                            ?? transactionEvent.ExaminationDateTime;

            if (TflService.IsSameDay(p, eventDate))
            {
                logger.Info($@"Cut for {
					p.PlayerName
					} ignored: Same day contract rule"                    );
                return(false);
            }

            if (string.IsNullOrEmpty(p.TeamCode))
            {
                if (logger != null)
                {
                    logger.Info($"{p.PlayerName} is already a free agent");
                }
                return(true);
            }

            var result = TflService.EndContract(
                p,
                transactionEvent.EventDate ?? transactionEvent.ExaminationDateTime,
                isRetirement: false);

            return(result);
        }
Beispiel #3
0
        public bool Process(
            ExaminationEvent transactionEvent,
            ILog logger)
        {
            logger.Trace("Processing Retirement");

            var p = TflService.GetNflPlayer(
                transactionEvent.PlayerId);

            return(TflService.EndContract(
                       p,
                       transactionEvent.EventDate ?? transactionEvent.ExaminationDateTime,
                       isRetirement: true));
        }
Beispiel #4
0
        public bool Process(
            ExaminationEvent transactionEvent,
            ILog logger)
        {
            var p = TflService.GetNflPlayer(transactionEvent.PlayerId);

            if (!string.IsNullOrEmpty(p.TeamCode))
            {
                TflService.EndContract(
                    p,
                    transactionEvent.EventDate
                    ?? transactionEvent.ExaminationDateTime,
                    isRetirement: false);
            }

            return(transactionEvent.EventDate != null &&
                   (TflService.RecordSigning(
                        p,
                        transactionEvent.TeamId,
                        (DateTime)transactionEvent.EventDate,
                        how: "T")));
        }