Ignore:
Timestamp:
01/06/23 19:17:05 (23 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
cab5859
Parents:
d4b888e
Message:

Added full functionality for changing delivery status,
added bootstrap for some pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/autopartz/service/impl/DeliveryServiceImpl.java

    rd4b888e r9dcbf44  
    33import com.example.autopartz.model.Delivery;
    44import com.example.autopartz.model.Deliveryman;
     5import com.example.autopartz.model.Order;
    56import com.example.autopartz.repository.DeliveryRepository;
    67import com.example.autopartz.service.DeliveryService;
     
    2122        return deliveryRepository.findAllByDeliveryman(dm);
    2223    }
     24
     25    @Override
     26    public Delivery findById(Integer id) {
     27        return deliveryRepository.findById(id).get();
     28    }
     29
     30    @Override
     31    public void update(Delivery d) {
     32        deliveryRepository.save(d);
     33    }
     34
     35    @Override
     36    public Delivery findByOrder(Order o) {
     37        return deliveryRepository.findAllByOrder(o).stream().findFirst().orElseThrow(RuntimeException::new);
     38    }
    2339}
Note: See TracChangeset for help on using the changeset viewer.