import { TextObjectFilterResult } from "../TextObjectFilter.model"; export type FindServicesParams = { _id?: string; name?: string; description?: string; companyId?: string; categoryId?: number; length?: number; price?: number; limit?: number; }; export type SetServiceFileParams = { companyId: string; serviceId: string; sessionUser: string; file: Express.Multer.File; }; export type PaginateServicesParams = { query?: string; companyId?: string; serviceId?: string; categoryId?: number; priceFrom?: number; priceTo?: number; lengthFrom?: number; lengthTo?: number; block?: string; city?: string; state?: string; page: number; limit: number; published?: SERVICE_PUBLISHED_STATUS; }; export type PaginateServicesResults = { data: IService[]; page: number; pages: number; }; export type CreateServiceParams = { companyId: string; categoryId?: number; name: string; description: string; length: number; originalPrice: number; limit: number; block?: string; city?: string; state?: string; country?: string; zipCode?: string; latitude?: number; longitude?: number; sessionUser: string; showPublicScores?: boolean; showPublicOpinions?: boolean; }; 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; block?: string; city?: string; state?: string; country?: string; zipCode?: string; latitude?: number; longitude?: number; sessionUser: string; banned?: boolean; showPublicScores?: boolean; showPublicOpinions?: boolean; }; export type PaginatePublicServicesParams = FindServicesParams & { page: number; limit: number; }; export type PublicServicesResults = { data: PublicServiceView[]; page: number; pages: number; }; export type SysAdminPaginateServicesParams = PaginateServicesParams & { banned?: boolean; }; export type SysAdminSetServiceBannedParams = { id: string; banned: boolean; }; export type DeleteServicesByCompany = { companyId: string; }; 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 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; block?: string; city?: string; state?: string; country?: string; zipCode?: string; latitude?: number; longitude?: number; published?: SERVICE_PUBLISHED_STATUS; discountId?: string; banned?: boolean; showPublicScores?: boolean; showPublicOpinions?: 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; showPublicScores: boolean; showPublicOpinions: boolean; } 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; showPublicScores: boolean; showPublicOpinions: boolean; } export interface FindServicesByCompanyParams { companyId: string; } export interface FindServicesByIdParams { serviceId: string; } export interface IServicesAdapter { create(data: CreateServiceParams): Promise; update(data: UpdateServiceParams): Promise; delete(id: string): Promise; find(filters: FindServicesParams): Promise; findOne(filters: FindServicesParams): Promise; paginate(filters: PaginateServicesParams): Promise; sysAdminPaginate(data: SysAdminPaginateServicesParams): Promise; } export interface IServicesManager { services: IServicesAdapter; createService(data: CreateServiceParams): Promise; updateService(data: UpdateServiceParams): Promise; applyDiscount(data: ApplyDiscountParams): Promise; deleteDiscount(data: DeleteDiscountParams): Promise; setServiceImage(data: SetServiceFileParams): Promise; findByCompanyId(data: FindServicesByCompanyParams): Promise; findById(id: FindServicesByIdParams): Promise; publicServices(data: PaginateServicesParams): Promise; deleteServicesByCompany(data: DeleteServicesByCompany): Promise; setPublishedStatus(data: SetPublishedStatusParams): Promise; textObjectFilter(data: FindServicesParams): Promise; sysAdminPaginate(data: SysAdminPaginateServicesParams): Promise; sysAdminSetBanned(data: SysAdminSetServiceBannedParams): Promise; }