refactor: distribute types from crm-types.ts to owning composables
Each composable now owns its types and exports them. Other composables import types from the owning composable. Deleted centralized crm-types.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,34 @@
|
||||
import { ref, computed, watch, type ComputedRef, type Ref } from "vue";
|
||||
import { useQuery } from "@vue/apollo-composable";
|
||||
import { DealsQueryDocument } from "~~/graphql/generated";
|
||||
import type { Deal, DealStep, CalendarEvent, Contact } from "~/composables/crm-types";
|
||||
import { safeTrim, formatDay } from "~/composables/crm-types";
|
||||
|
||||
import type { Contact } from "~/composables/useContacts";
|
||||
import type { CalendarEvent } from "~/composables/useCalendar";
|
||||
import { formatDay } from "~/composables/useCalendar";
|
||||
|
||||
export type DealStep = {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
status: "todo" | "in_progress" | "done" | "blocked" | string;
|
||||
dueAt: string;
|
||||
order: number;
|
||||
completedAt: string;
|
||||
};
|
||||
|
||||
export type Deal = {
|
||||
id: string;
|
||||
contact: string;
|
||||
title: string;
|
||||
stage: string;
|
||||
amount: string;
|
||||
nextStep: string;
|
||||
summary: string;
|
||||
currentStepId: string;
|
||||
steps: DealStep[];
|
||||
};
|
||||
|
||||
function safeTrim(value: unknown) { return String(value ?? "").trim(); }
|
||||
|
||||
export function useDeals(opts: {
|
||||
apolloAuthReady: ComputedRef<boolean>;
|
||||
|
||||
Reference in New Issue
Block a user