package com.mvrent.carrental.model;

import jakarta.persistence.*;
import lombok.*;

/** A gallery photo for a car (URL/path based for v1). */
@Entity
@Table(name = "car_photos")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CarPhoto {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "car_id")
    private Car car;

    @Column(nullable = false)
    private String url;

    @Builder.Default
    private int sortOrder = 0;
}
