Ignore:
Timestamp:
08/24/23 02:28:14 (15 months ago)
Author:
DenicaKj <dkorvezir@…>
Branches:
master
Children:
bcb4acc
Parents:
40935d3
Message:

fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/service/Impl/DiscountServiceImpl.java

    r40935d3 r1e7126f  
    1 package com.example.moviezone.service.Impl;public class DiscountServiceImpl {
     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    }
    228}
Note: See TracChangeset for help on using the changeset viewer.