Search in sources :

Example 11 with ProductDTO

use of com.ncedu.fooddelivery.api.v1.dto.product.ProductDTO in project 2021-msk-food-delivery by netcracker-edu.

the class ProductUtils method createProductUpdateDTO.

public static ProductUpdateDTO createProductUpdateDTO(Product p) {
    ProductUpdateDTO productDTO = new ProductUpdateDTO();
    productDTO.setDescription(p.getDescription());
    productDTO.setPrice(p.getPrice());
    productDTO.setName(p.getName());
    productDTO.setWeight(p.getWeight());
    productDTO.setExpirationDays(p.getExpirationDays());
    return productDTO;
}
Also used : ProductUpdateDTO(com.ncedu.fooddelivery.api.v1.dto.product.ProductUpdateDTO)

Aggregations

ProductDTO (com.ncedu.fooddelivery.api.v1.dto.product.ProductDTO)9 Product (com.ncedu.fooddelivery.api.v1.entities.Product)8 SearchProductDTO (com.ncedu.fooddelivery.api.v1.dto.product.SearchProductDTO)7 Test (org.junit.jupiter.api.Test)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 WarehouseInfoDTO (com.ncedu.fooddelivery.api.v1.dto.warehouseDTOs.WarehouseInfoDTO)5 Point (com.vividsolutions.jts.geom.Point)5 Pageable (org.springframework.data.domain.Pageable)5 CoordsDTO (com.ncedu.fooddelivery.api.v1.dto.CoordsDTO)3 ArrayList (java.util.ArrayList)2 ProductCreateDTO (com.ncedu.fooddelivery.api.v1.dto.product.ProductCreateDTO)1 ProductUpdateDTO (com.ncedu.fooddelivery.api.v1.dto.product.ProductUpdateDTO)1 OrderProductPosition (com.ncedu.fooddelivery.api.v1.entities.orderProductPosition.OrderProductPosition)1 PageImpl (org.springframework.data.domain.PageImpl)1