package com.atlassian.bitbucket.internal.audit.dao;

import net.java.ao.Accessor;
import net.java.ao.Preload;
import net.java.ao.RawEntity;
import net.java.ao.schema.*;

import java.util.Date;

@Table(AoProjectAuditEvent.TABLE_NAME)
@Preload
public interface AoProjectAuditEvent extends RawEntity<Integer>, DaoAuditEvent {
    String TABLE_NAME = "PROJECT_AUDIT";
    String PROJECT_ID_COLUMN = "PROJECT_ID";
    String ID_COLUMN = "AUDIT_ITEM_ID";
    String USER_COLUMN = "USER";
    String ACTION_COLUMN = "ACTION";
    String DATE_COLUMN = "DATE";
    String DETAILS_COLUMN = "DETAILS";

    @AutoIncrement
    @NotNull
    @PrimaryKey(ID_COLUMN)
    Integer getId();

    @NotNull
    @Accessor(PROJECT_ID_COLUMN)
    @Indexed
    Integer getProjectId();

    @Accessor(USER_COLUMN)
    Integer getUserId();

    @NotNull
    @Accessor(ACTION_COLUMN)
    String getAction();

    @NotNull
    @Accessor(DATE_COLUMN)
    Date getTimestamp();

    @Accessor(DETAILS_COLUMN)
    @StringLength(StringLength.UNLIMITED)
    String getDetails();


}
