import { gql } from '@apollo/client/core';
import type { EntityStatus } from './team';

export const CUSTOMER_PROFILES_QUERY = gql`
	query CustomerProfiles {
		customerProfiles {
			id
			firstName
			lastName
			fullName
			email
			phone
			status
			notes
			createdAt
			updatedAt
		}
	}
`;

export const CUSTOMER_PROFILE_QUERY = gql`
	query CustomerProfile($id: UUID!) {
		customerProfile(id: $id) {
			id
			firstName
			lastName
			fullName
			email
			phone
			status
			notes
			createdAt
			updatedAt
			customers {
				id
				name
			}
		}
	}
`;

export interface CustomerInfo {
	id: string;
	name: string;
}

export interface CustomerProfile {
	id: string;
	firstName: string;
	lastName: string;
	fullName: string;
	email: string | null;
	phone: string | null;
	status: EntityStatus;
	notes: string | null;
	createdAt: string;
	updatedAt: string;
	customers?: CustomerInfo[];
}

export interface CustomerProfilesQueryResult {
	customerProfiles: CustomerProfile[];
}

export interface CustomerProfileQueryResult {
	customerProfile: CustomerProfile;
}
