mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
Merge branch 'main' of https://github.com/Hestia-Homes/assessment-model into feature/installer-interaction
This commit is contained in:
commit
2aac0d2d8d
10 changed files with 12934 additions and 4 deletions
|
|
@ -1,6 +1,9 @@
|
|||
FROM library/python:3.12-bullseye
|
||||
|
||||
ARG USER=vscode
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=1000
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install system dependencies in a single layer
|
||||
|
|
@ -37,6 +40,15 @@ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
|||
# RUN apt-get install terraform
|
||||
# RUN terraform -install-autocomplete
|
||||
|
||||
# Install Claude
|
||||
USER ${USER}
|
||||
RUN curl -fsSL https://claude.ai/install.sh | bash \
|
||||
&& export PATH="/home/${USER}/.local/bin:${PATH}" \
|
||||
&& claude plugin marketplace add JuliusBrussee/caveman \
|
||||
&& claude plugin install caveman@caveman
|
||||
ENV PATH="/home/vscode/.local/bin:${PATH}"
|
||||
USER root
|
||||
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /workspaces/assessment-model
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
version: "3.8"
|
||||
|
||||
services:
|
||||
frontend:
|
||||
user: "${UID}:${GID}"
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: .devcontainer/Dockerfile
|
||||
args:
|
||||
USER_UID: ${UID:-1000}
|
||||
USER_GID: ${GID:-1000}
|
||||
command: sleep infinity
|
||||
ports:
|
||||
- "3000:3000"
|
||||
|
|
|
|||
|
|
@ -7,11 +7,13 @@ import {
|
|||
DocumentMagnifyingGlassIcon,
|
||||
ChevronDownIcon,
|
||||
DocumentPlusIcon,
|
||||
RectangleStackIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Dispatch, SetStateAction, useState } from "react";
|
||||
import BulkUploadComingSoonModal from "@/app/components/portfolio/BulkUploadComingSoonModal";
|
||||
|
||||
interface AddNewProps {
|
||||
portfolioId: string;
|
||||
|
|
@ -26,6 +28,7 @@ export default function AddNew({
|
|||
}: AddNewProps) {
|
||||
const router = useRouter();
|
||||
const [loadingRemote, setLoadingRemote] = useState(false);
|
||||
const [isBulkUploadOpen, setIsBulkUploadOpen] = useState(false);
|
||||
|
||||
function handleRemoteAssessment() {
|
||||
setLoadingRemote(true);
|
||||
|
|
@ -33,6 +36,12 @@ export default function AddNew({
|
|||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<BulkUploadComingSoonModal
|
||||
isOpen={isBulkUploadOpen}
|
||||
onClose={() => setIsBulkUploadOpen(false)}
|
||||
portfolioId={portfolioId}
|
||||
/>
|
||||
<Menu as="div" className="relative inline-block text-left">
|
||||
<MenuButton
|
||||
className="
|
||||
|
|
@ -98,7 +107,34 @@ export default function AddNew({
|
|||
File Import
|
||||
</span>
|
||||
<span className="text-xs text-gray-500 leading-snug">
|
||||
Upload an Excel or CSV file containing multiple units.
|
||||
For bulk uploads, please contact a Domna user.
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
)}
|
||||
</MenuItem>
|
||||
|
||||
{/* Bulk Upload (Coming Soon) */}
|
||||
<MenuItem>
|
||||
{({ active }) => (
|
||||
<button
|
||||
onClick={() => setIsBulkUploadOpen(true)}
|
||||
className={cn(
|
||||
"w-full p-3 rounded-lg text-left flex gap-3 transition-colors",
|
||||
active && "bg-gray-100"
|
||||
)}
|
||||
>
|
||||
<RectangleStackIcon className="h-5 w-5 text-gray-700 mt-[2px]" />
|
||||
|
||||
<div className="flex flex-col">
|
||||
<span className="text-sm font-medium text-gray-900 flex items-center gap-2">
|
||||
new: Bulk upload
|
||||
<span className="text-[10px] font-semibold text-amber-700 bg-amber-100 px-1.5 py-0.5 rounded-full leading-none">
|
||||
coming soon
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-xs text-gray-500 leading-snug">
|
||||
Upload multiple addresses in one go.
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
|
|
@ -107,5 +143,6 @@ export default function AddNew({
|
|||
</div>
|
||||
</MenuItems>
|
||||
</Menu>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { subTasks } from "@/app/db/schema/tasks/subtask";
|
|||
import * as CrmSchema from "@/app/db/schema/crm/hubspot_deal_table";
|
||||
import * as UploadedFilesSchema from "@/app/db/schema/uploaded_files";
|
||||
import * as PortfolioOrgSchema from "@/app/db/schema/portfolio_organisation";
|
||||
import * as BulkAddressUploadsSchema from "@/app/db/schema/bulk_address_uploads";
|
||||
|
||||
export const pool = new Pool({
|
||||
host: process.env.DB_HOST,
|
||||
|
|
@ -41,6 +42,7 @@ const schema = {
|
|||
...CrmSchema,
|
||||
...UploadedFilesSchema,
|
||||
...PortfolioOrgSchema,
|
||||
...BulkAddressUploadsSchema,
|
||||
};
|
||||
|
||||
export const db = drizzle(pool, {
|
||||
|
|
|
|||
11
src/app/db/migrations/0170_furry_moonstone.sql
Normal file
11
src/app/db/migrations/0170_furry_moonstone.sql
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
CREATE TABLE "bulk_address_uploads" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"portfolio_id" text NOT NULL,
|
||||
"user_id" text NOT NULL,
|
||||
"s3_bucket" text NOT NULL,
|
||||
"s3_key" text NOT NULL,
|
||||
"filename" text NOT NULL,
|
||||
"status" text DEFAULT 'ready_for_processing' NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
2
src/app/db/migrations/0171_chunky_wallow.sql
Normal file
2
src/app/db/migrations/0171_chunky_wallow.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE "bulk_address_uploads" ADD COLUMN "source_headers" text[] DEFAULT '{}' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "bulk_address_uploads" ADD COLUMN "column_mapping" jsonb;
|
||||
6410
src/app/db/migrations/meta/0170_snapshot.json
Normal file
6410
src/app/db/migrations/meta/0170_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
6423
src/app/db/migrations/meta/0171_snapshot.json
Normal file
6423
src/app/db/migrations/meta/0171_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1191,6 +1191,20 @@
|
|||
"when": 1776351792028,
|
||||
"tag": "0169_freezing_moonstone",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 170,
|
||||
"version": "7",
|
||||
"when": 1776357524564,
|
||||
"tag": "0170_furry_moonstone",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 171,
|
||||
"version": "7",
|
||||
"when": 1776361262258,
|
||||
"tag": "0171_chunky_wallow",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
19
src/app/db/schema/bulk_address_uploads.ts
Normal file
19
src/app/db/schema/bulk_address_uploads.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { pgTable, uuid, text, timestamp, jsonb } from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
export const bulkAddressUploads = pgTable("bulk_address_uploads", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
portfolioId: text("portfolio_id").notNull(),
|
||||
userId: text("user_id").notNull(),
|
||||
s3Bucket: text("s3_bucket").notNull(),
|
||||
s3Key: text("s3_key").notNull(),
|
||||
filename: text("filename").notNull(),
|
||||
status: text("status").notNull().default("ready_for_processing"),
|
||||
sourceHeaders: text("source_headers").array().notNull().default(sql`'{}'`),
|
||||
columnMapping: jsonb("column_mapping").$type<Record<string, string>>(),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
updatedAt: timestamp("updated_at", { withTimezone: true })
|
||||
.notNull()
|
||||
.defaultNow()
|
||||
.$onUpdate(() => new Date()),
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue