Merge pull request #193 from Hestia-Homes/main

Live tracking
This commit is contained in:
KhalimCK 2026-03-03 16:53:14 +00:00 committed by GitHub
commit e9c17d44e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5743 additions and 10 deletions

View file

@ -0,0 +1,3 @@
CREATE TYPE "public"."source" AS ENUM('portfolio_id');--> statement-breakpoint
ALTER TABLE "tasks" ADD COLUMN "source" "source";--> statement-breakpoint
ALTER TABLE "tasks" ADD COLUMN "source_id" text;

File diff suppressed because it is too large Load diff

View file

@ -1079,6 +1079,13 @@
"when": 1771757665072,
"tag": "0153_large_machine_man",
"breakpoints": true
},
{
"idx": 154,
"version": "7",
"when": 1772194536121,
"tag": "0154_workable_stingray",
"breakpoints": true
}
]
}

View file

@ -1,4 +1,6 @@
import { pgTable, uuid, text, timestamp } from "drizzle-orm/pg-core";
import { pgTable, uuid, text, timestamp, pgEnum } from "drizzle-orm/pg-core";
export const sourceEnum = pgEnum("source", ["portfolio_id"]);
export const tasks = pgTable("tasks", {
id: uuid("id").defaultRandom().primaryKey(),
@ -12,6 +14,10 @@ export const tasks = pgTable("tasks", {
service: text("service"), // e.g. plan, wchg etc
source: sourceEnum("source"), // enum for task source type
sourceId: text("source_id"), // identifier for the source (e.g., portfolio_id value)
updatedAt: timestamp("updated_at", { precision: 6, withTimezone: true })
.defaultNow()
.$onUpdate(() => new Date())

View file

@ -24,15 +24,42 @@ import {
// Stage ID -> raw label mapping
// -----------------------------------------------------------------------
const STAGE_ID_MAP: Record<string, string> = {
"1617223910": "Scope & Planning",
"3583836399": "Scope & Planning",
"3589581001": "Booking in Progress",
"1984401629": "Assessment in Progress",
"2628233422": "AFTER_ASSESSMENT",
"2702650617": "AFTER_ASSESSMENT",
"2473886962": "AFTER_ASSESSMENT",
"1668803774": "AFTER_ASSESSMENT",
"1887735998": "Queries",
"1617223910": "Scope & Planning", //[Ops] Backlog
"3583836399": "Scope & Planning", //[Ops] Route Planning
"3589581001": "Booking in Progress", // [Bookings] Ready for Bookings Team
"3569878239": "Booking in Progress", //[Bookings] Send initial booking SMS
"1617223911": "Booking in Progress", // [Bookings] Send Email
"1984184569": "Booking in Progress", // [Bookings] Phone booking
"3569572028": "Booking in Progress", // [Bookings] Preferences received from Tenant
"3570936026": "Booking in Progress", // [Bookings] Send Confirmation Comms
"3680650446": "Booking in Progress", //[Bookings] Manual Confirmation Comms Required
"2663668937": "Queries", //[Bookings/Sales] Booking issues - needs HA support
"1984401629": "Queries", //[Bookings/Ops/Sales] No Contact Details - Ready for Route
"1617223912": "Assessment in Progress", //[Ops] Ready for Assignment to Route
"1617223913": "Assessment in Progress", //[Ops] Survey in Progress
"2558220518": "Assessment in Progress", // [Ops] Not attempted - needs reallocation
"3474594026": "Booking in Progress", //[Ops/Bookings] Rebooked - Needs updating
"3206388924": "Assessment in Progress", //[Ops] Surveyed - Pending Upload from Surveyor (Up to Khalim + Kev as debatable)
"1617223915": "Queries", //[Ops] No Access - Need Sign Off
"1617223917": "Queries", //[Ops] No Access - No Revisit
"1887735998": "Queries", //[Ops] Not Viable
"3061261536": "Queries", //[Sales/Tech] Major condition issue
"3948185842": "AFTER_ASSESSMENT", //[Admin] Admin to check all paperwork for external comms
"1617223914": "AFTER_ASSESSMENT",// [Ops]Surveyed in Pashub, Transit Job to Co-ordination
"1617223916": "Queries", // [Ops] Properties to Review Manually
"2628341989": "Assessment in Progress", //[Ops] Assessment needs correction
"3441170637": "AFTER_ASSESSMENT", //[Ops] Awaiting PV Design
"2628233422": "AFTER_ASSESSMENT", //[Coordination] Ready for coordination
"1887735999": "AFTER_ASSESSMENT", //[Ops] Needs HA Works
"1960060104": "Queries", //[Ops] HA Informed
"1960060105": "Queries", //[Ops] HA Works Scheduled
"1960060106": "AFTER_ASSESSMENT", //[Ops] HA Works Complete
// "1668803772": "", //[Ops] ERF Delivered to HA
// "1668803773": "", //[Ops] ERF Signed
// "2769407183": "", //[Ops] PV - Needs Heating Upgrade (Pre EPR D)
"2769407184": "Queries", //[Ops] Talk to client, Needs Heating Upgrade (Pre EPR C)
"2702650617": "AFTER_ASSESSMENT", //[Design] Ready for Design
"2473886962": "AFTER_ASSESSMENT", //[Design] Design in progress
};
// -----------------------------------------------------------------------