source: src/main/java/com/example/moviezone/service/Impl/DiscountServiceImpl.java@ 4158cac

Last change on this file since 4158cac was 1e7126f, checked in by DenicaKj <dkorvezir@…>, 15 months ago

fix

  • Property mode set to 100644
File size: 884 bytes
Line 
1package com.example.moviezone.service.Impl;
2
3import com.example.moviezone.model.Discount;
4import com.example.moviezone.repository.DiscountRepository;
5import com.example.moviezone.service.DiscountService;
6import org.springframework.stereotype.Service;
7
8import java.time.LocalDate;
9import java.util.List;
10
11@Service
12public class DiscountServiceImpl implements DiscountService {
13 private final DiscountRepository discountRepository;
14
15 public DiscountServiceImpl(DiscountRepository discountRepository) {
16 this.discountRepository = discountRepository;
17 }
18
19 @Override
20 public Discount save(String code, String type, LocalDate validity, Integer percent) {
21 return discountRepository.save(new Discount(validity,code,type,percent));
22 }
23
24 @Override
25 public List<Discount> getValidDiscounts() {
26 return discountRepository.getValidDiscounts();
27 }
28}
Note: See TracBrowser for help on using the repository browser.