import { pgTable, uuid, bigint, text, timestamp } from "drizzle-orm/pg-core";
import { portfolio } from "./portfolio";
import { property } from "./property";

export const filesFromSurveyor = pgTable("files_from_surveyor", {
  id: uuid("id").defaultRandom().primaryKey(),
  portfolioId: bigint("portfolio_id", { mode: "bigint" })
    .notNull()
    .references(() => portfolio.id),
  propertyId: bigint("property_id", { mode: "bigint" })
    .notNull()
    .references(() => property.id),
  s3JsonUrl: text("s3_json_url").notNull(),
  uploadedAt: timestamp("uploaded_at").notNull().defaultNow(),
});

export type FilesFromSurveyor = typeof filesFromSurveyor.$inferSelect;
