package ru.vyatsu.qr_access_admin.unit.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.annotations.SourceType;
import org.hibernate.type.SqlTypes;

import java.time.LocalDateTime;

@Entity
@Table(name = "oauth2_registered_client")
@Getter
@Setter
@NoArgsConstructor
public class UnitEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    private String id;
    @Column
    private String clientId;
    @Column
    @CreationTimestamp(source = SourceType.DB)
    private LocalDateTime clientIdIssuedAt;
    @Column
    private String clientSecret;
    @Column
    private LocalDateTime clientSecretExpiresAt;
    @Column
    private String clientName;
    @Column
    private String clientAuthenticationMethods;
    @Column
    private String authorizationGrantTypes;
    @Column
    private String redirectUris;
    @Column
    private String postLogoutRedirectUris;
    @Column
    private String scopes;
    @Column
    @JdbcTypeCode(SqlTypes.JSON)
    private String clientSettings;
    @Column
    @JdbcTypeCode(SqlTypes.JSON)
    private String tokenSettings;
    @Column
    private Boolean adminEditable;
    @Column
    private String partnerId;
}
