Example #1
0
 public MeteringPoint(GsrnNumber gsrnNumber, MeteringPointType meteringPointType)
 {
     GsrnNumber         = gsrnNumber;
     _meteringPointType = meteringPointType;
     _physicalState     = PhysicalState.New;
     AddDomainEvent(new MeteringPointCreated(GsrnNumber, _meteringPointType));
 }
Example #2
0
 private MeteringPoint(GsrnNumber gsrnNumber, MeteringPointType meteringPointType, bool isProductionObligated, List <Relationship> relationships, int id, int version, PhysicalState physicalState)
 {
     GsrnNumber             = gsrnNumber;
     _meteringPointType     = meteringPointType;
     _physicalState         = physicalState;
     _isProductionObligated = isProductionObligated;
     _relationships         = relationships;
     Id      = id;
     Version = version;
 }
Example #3
0
        public static MeteringPoint CreateFrom(MeteringPointSnapshot snapshot)
        {
            if (snapshot is null)
            {
                throw new ArgumentNullException(nameof(snapshot));
            }

            return(new MeteringPoint(
                       GsrnNumber.Create(snapshot.GsrnNumber),
                       MeteringPointType.FromValue <MeteringPointType>(snapshot.MeteringPointType),
                       snapshot.IsProductionObligated,
                       snapshot.Relationships.Select(r => Relationship.CreateFrom(r)).ToList(),
                       snapshot.Id,
                       snapshot.Version,
                       PhysicalState.FromValue <PhysicalState>(snapshot.PhysicalState)));
        }
Example #4
0
 private MeteringPoint(GsrnNumber gsrnNumber, MeteringPointType meteringPointType, bool isProductionObligated)
     : this(gsrnNumber, meteringPointType)
 {
     _isProductionObligated = isProductionObligated;
 }