public static List <RentalOverview> GenerateRentalOverviews (List <ProductionInformation> productionInformations, FmHouse houseType1, FmHouse houseType2, FmHouse houseType3) { return(new List <RentalOverview> { new RentalOverview { ProductionInformations = productionInformations.Where(pi => pi.House == houseType1).ToList(), PurchaseStatus = RentalOverview.PurchaseStatuses.ContractNotInitiated, SetupAddressTown = "Horsens", SetupAddressStreet = "SomeStreet 23", SetupAddressPostalCode = 8700, EstimatedPrice = 12000f, }, new RentalOverview { ProductionInformations = productionInformations.Where(pi => pi.House == houseType2).ToList(), PurchaseStatus = RentalOverview.PurchaseStatuses.Leased, SetupAddressTown = "Vejle", SetupAddressStreet = "SomeStreet 44", SetupAddressPostalCode = 8600, }, new RentalOverview { ProductionInformations = productionInformations.Where(pi => pi.House == houseType3).ToList(), PurchaseStatus = RentalOverview.PurchaseStatuses.Terminated, SetupAddressTown = "Horsens", SetupAddressStreet = "SomeStreet 55", SetupAddressPostalCode = 8700, EstimatedPrice = 33000f, }, }); }
public static IEnumerable <Rent> GenerateRents (IReadOnlyCollection <ProductionInformation> productionInformations, FmHouse houseType1, FmHouse houseType2, FmHouse houseType3) { return(new List <Rent> { new Rent { ProductionInformation = productionInformations.Single(pi => pi.House == houseType1), StartDate = DateTime.Now, EndDate = DateTime.Now, RentPrice = 10000f, }, new Rent { ProductionInformation = productionInformations.Single(pi => pi.House == houseType2), StartDate = DateTime.Now, EndDate = DateTime.Now, RentPrice = 15000f, }, new Rent { ProductionInformation = productionInformations.Single(pi => pi.House == houseType3), StartDate = DateTime.Now, EndDate = DateTime.Now, RentPrice = 9000f, }, }); }
public static FmHouseResponse FmHouseToHouseResponse(FmHouse fmHouse) { return(new FmHouseResponse { Id = fmHouse.Id, HouseType = fmHouse.HouseType.HouseType, SquareMeters = fmHouse.SquareMeters, MaterialsOnHouse = fmHouse.HouseType.MaterialsOnHouse }); }
public static ProductionInformation GenerateProductionInformation( Customer customer, FmHouse house, IdentityUser updatedBy, DateTime productionDate, float productionPrice = 100000f, bool isActive = true) { return(new ProductionInformation { Customer = customer, House = house, LastUpdatedDate = DateTime.Now, LastUpdatedBy = updatedBy, ProductionPrice = productionPrice, ProductionDate = productionDate, IsActive = isActive }); }
public async Task <IActionResult> Create([FromBody] FmHouseRequest fmHouseRequest) { var fmHouse = new FmHouse { HouseType = fmHouseRequest.HouseType, SquareMeters = fmHouseRequest.SquareMeters }; await _fmHouseService.CreateAsync(fmHouse); var baseurl = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host.ToUriComponent()}"; var locationuri = baseurl + "/" + ApiRoutes.FmHouses.Get.Replace("{fmHouseId}", fmHouse.Id.ToString()); var response = FmHouseToHouseResponse(fmHouse); return(Created(locationuri, response)); }