import { PublicOrganizationView } from "./Company.model";

export type FindServicesParams = {
    _id?: string;
    name?: string;
    description?: string;
    companyId?: string;
    categoryId?: number;
    length?: number;
    price?: number;
    limit?: number;
};

export type CreateServiceParams = {
    companyId: string;
    categoryId?: number;
    name: string;
    description: string;
    length: number;
    originalPrice: number;
    limit: number;
    sessionUser: string;
};

export type UpdateServiceParams = {
    id: string;
    companyId: string;
    categoryId?: number;
    name?: string;
    description?: string;
    length?: number;
    originalPrice?: number;
    limit?: number;
    image?: string;
    color?: string;
    fontColor?: string;
    fontShadowColor?: string;
    sessionUser: string;
};

export type PaginateServicesParams = {
    query?: string;
    categoryId?: number;
    companyId?: string;
    priceFrom?: number;
    priceTo?: number;
    lengthFrom?: number;
    lengthTo?: number;
    block?: string;
    city?: string;
    state?: string;
    page: number;
    limit: number;
    published?: SERVICE_PUBLISHED_STATUS;
};

export type PaginatePublicServicesParams = FindServicesParams & {
    page: number;
    limit: number;
};

export type PublicServicesResults = {
    data: PublicServiceView[];
    page: number;
    pages: number;
};

export enum SERVICE_PUBLISHED_STATUS {
    PUBLISHED = "published",
    PRIVATE = "private",
}

export type SetPublishedStatusParams = {
    serviceId: string;
    published: SERVICE_PUBLISHED_STATUS;
    sessionUser: string;
};

export type ApplyDiscountParams = {
    companyId: string;
    serviceId: string;
    discountId: string;
    sessionUser: string;
};

export type DeleteDiscountParams = {
    companyId: string;
    serviceId: string;
    sessionUser: string;
};

export interface PublicServiceView {
    id: string;
    name: string;
    description: string;
    length: number;
    price: number;
    originalPrice: number;
    discountId?: string;
    discountName?: string;
    discountCode?: string;
    discountType?: string;
    discountValue?: number;
    limit: number;
    image: string;
    organizationId: string;
    organizationName: string;
    categoryId: number;
    color: string;
    fontColor: string;
    fontShadowColor: string;
    banned?: boolean;
}

export interface PublicOrganizationServiceView {
    service: PublicServiceView;
    organization: PublicOrganizationView;
}

export interface IService {
    id?: string;
    companyId: string;
    categoryId: number;
    name: string;
    description: string;
    length: number;
    price: number;
    originalPrice: number;
    limit: number;
    image: string;
    color: string;
    fontColor: string;
    fontShadowColor: string;
    banned?: boolean;
}

export interface CompanyServiceView {
    id: string;
    name: string;
    description: string;
    length: number;
    price: number;
    originalPrice: number;
    discountId?: string;
    discountName?: string;
    discountCode?: string;
    discountType?: string;
    discountValue?: number;
    limit: number;
    image: string;
    color: string;
    fontColor: string;
    fontShadowColor: string;
    published: SERVICE_PUBLISHED_STATUS;
    banned?: boolean;
}
