Ignore:
Timestamp:
02/09/23 14:06:45 (21 months ago)
Author:
DenicaKj <dkorvezir@…>
Branches:
master
Children:
6a9006d, a9ffccd
Parents:
0ba5d1a
Message:

Reservation Implemented

File:
1 edited

Legend:

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

    r0ba5d1a r00fa72f  
    11package com.example.moviezone.service.Impl;
    22
    3 import com.example.moviezone.model.Customer;
    4 import com.example.moviezone.model.Ticket;
     3import com.example.moviezone.model.*;
    54import com.example.moviezone.repository.TicketRepository;
    65import com.example.moviezone.service.TicketService;
    76import org.springframework.stereotype.Service;
    87
     8import java.time.LocalDate;
    99import java.util.List;
    1010
     
    2828
    2929    @Override
     30    public Ticket saveWithDiscount(LocalDate date, Customer customer, Projection projection, Discount discount, Seat seat) {
     31        Ticket t=new Ticket(date,customer,projection,discount,seat);
     32        return ticketRepository.save(t);
     33    }
     34
     35    @Override
     36    public Ticket saveWithout(LocalDate date, Customer customer, Projection projection, Seat seat) {
     37        Ticket t=new Ticket(date,customer,projection,seat);
     38        return ticketRepository.save(t);
     39    }
     40
     41    @Override
    3042    public Ticket save(long price, Customer customer) {
    3143        return ticketRepository.save(new Ticket(price,customer));
    3244    }
     45
     46    @Override
     47    public Integer priceForTicket(int id) {
     48        return ticketRepository.getPriceForTicket(id);
     49    }
    3350}
Note: See TracChangeset for help on using the changeset viewer.