import { TextObjectFilterResult } from "../TextObjectFilter.model"; import { ICompanyDocument } from "./Companies.Adapter.Mongoose"; export enum COMPANY_PUBLISHED_STATUS { PUBLISHED = "published", PRIVATE = "private", } export type CreateCompanyParams = { name: string; description: string; categoryId: number; ownerId: string; onboardingStep?: number; }; export type UpdateCompanyParams = { id: string; name?: string; description?: string; categoryId?: number; headerFile?: string; iconFile?: string; logoFile?: string; headerColor?: string; headerFontColor?: string; headerFontShadowColor?: string; street?: string; streetNumber?: string; builingFloor?: string; buildingApartament?: string; block?: string; city?: string; state?: string; country?: string; zipCode?: string; latitude?: number; longitude?: number; phoneCountryCode?: string; phoneAreaCode?: string; phoneNumber?: string; heatMapFraction?: number; appointmentTime?: number; cancellationTime?: number; wapServerId?: string; appointmentAlert?: string; sessionUser: string; templateWapNotifId?: string; templateWapAltaId?: string; templateWapCancellationId?: string; templateEmailNotifId?: string; templateEmailAltaId?: string; templateEmailCancellationId?: string; onboardingStep?: number; onboardingCompleted?: boolean; banned?: boolean; }; export type SetCompanyFileParams = { companyId: string; sessionUser: string; file: Express.Multer.File; }; export type DeleteCompanyFileParams = { companyId: string; sessionUser: string; }; export type DeleteCompanyParams = { companyId: string; sessionUser: string; }; export type FindCompaniesParams = { _id?: string; name?: string; slug?: string; categoryId?: number; street?: string; streetNumber?: string; builingFloor?: string; buildingApartament?: string; block?: string; city?: string; state?: string; country?: string; zipCode?: string; latitude?: number; longitude?: number; phoneCountryCode?: string; phoneAreaCode?: string; phoneNumber?: string; heatMapFraction?: number; appointmentTime?: number; cancellationTime?: number; ownerId?: string; wapServerId?: string; }; export type SetOrganizationPublishedStatusParams = { companyId: string; published: COMPANY_PUBLISHED_STATUS; sessionUser: string; }; export type SetNotificationAutoParams = { companyId: string; status?: boolean; sessionUser: string; }; export interface ICompany { id?: string; name: string; slug: string; description: string; categoryId: number; ownerId: string; headerFile?: string; iconFile?: string; logoFile?: string; headerColor?: string; headerFontColor?: string; headerFontShadowColor?: string; street?: string; streetNumber?: string; builingFloor?: string; buildingApartament?: string; block?: string; city?: string; state?: string; country?: string; zipCode?: string; latitude?: number; longitude?: number; phoneCountryCode?: string; phoneAreaCode?: string; phoneNumber?: string; heatMapFraction?: number; appointmentTime?: number; cancellationTime?: number; wapServerId?: string; appointmentAlert?: string; published?: COMPANY_PUBLISHED_STATUS; automaticNotifications?: boolean; templateWapNotifId?: string; templateWapAltaId?: string; templateWapCancellationId?: string; templateEmailNotifId?: string; templateEmailAltaId?: string; templateEmailCancellationId?: string; onboardingStep?: number; onboardingCompleted?: boolean; fixedPostIds?: Array; banned?: boolean; } export interface MyOranizationsView { id: string; name: string; slug: string; description: string; categoryId: number; ownerId: string; employeeId: string; isOwner: boolean; isAdmin: boolean; hostOk: boolean; guestOk: boolean; fullOk: boolean; headerFile?: string; headerColor?: string; headerFontColor?: string; headerFontShadowColor?: string; iconFile?: string; logoFile?: string; phoneAreaCode?: string; phoneNumber?: string; heatMapFraction?: number; appointmentTime?: number; cancellationTime?: number; block?: string; street?: string; streetNumber?: string; builingFloor?: string; buildingApartament?: string; city?: string; state?: string; country?: string; zipCode?: string; latitude?: number; longitude?: number; published?: COMPANY_PUBLISHED_STATUS; automaticNotifications?: boolean; appointmentAlert?: string; templateWapNotifId?: string; templateWapAltaId?: string; templateWapCancellationId?: string; templateEmailNotifId?: string; templateEmailAltaId?: string; templateEmailCancellationId?: string; onboardingStep?: number; onboardingCompleted?: boolean; banned?: boolean; } export interface ClientOrganizationView { id: string; name: string; description: string; slug: string; iconFile: string; logoFile: string; } export interface MyOranizationsViewParams { sessionUser: string; } export interface ClientOranizationsViewParams { clientId: string; sessionUser: string; } export interface OranizationsViewByIdParams { id: string; sessionUser: string; } export type PaginateCompaniesParams = FindCompaniesParams & { page: number; limit: number; }; export type PaginateCompaniesResults = { data: ICompany[]; page: number; pages: number; }; export type SysAdminPaginateCompaniesParams = PaginateCompaniesParams & { banned?: boolean; }; export type SysAdminUpdateCompanyParams = { id: string; name?: string; description?: string; categoryId?: number; }; export type SysAdminSetCompanyBannedParams = { id: string; banned: boolean; }; export type FixCompanyPostParams = { companyId: string; postId: string; sessionUser: string; }; export type MoveCompanyFixedPostParams = { companyId: string; postId: string; moveLength: number; sessionUser: string; }; export interface ICompaniesAdapter { create(company: ICompany): Promise; delete(id: string): Promise; find(filters: FindCompaniesParams): Promise; findOne(filters: FindCompaniesParams): Promise; paginate(filters: PaginateCompaniesParams): Promise; sysAdminPaginate(data: SysAdminPaginateCompaniesParams): Promise; paginateFilterAll(data: PaginateCompaniesParams): Promise; update(data: UpdateCompanyParams): Promise; } export interface ICompaniesManager { companies: ICompaniesAdapter; createCompany(data: CreateCompanyParams): Promise; isValidName(data: FindCompaniesParams): Promise; updateCompany(data: UpdateCompanyParams): Promise; setCompanyHeader(data: SetCompanyFileParams): Promise; setCompanyIcon(data: SetCompanyFileParams): Promise; deleteCompanyHeader(data: DeleteCompanyFileParams): Promise; deleteCompanyIcon(data: DeleteCompanyFileParams): Promise; getByUserId(data: MyOranizationsViewParams): Promise; getByClientId(data: ClientOranizationsViewParams): Promise; getById(data: OranizationsViewByIdParams): Promise; filterAll(data: PaginateCompaniesParams): Promise; getCompanyAddress(data: ICompany): string; deleteCompany(data: DeleteCompanyParams): Promise; setPublishedStatus(data: SetOrganizationPublishedStatusParams): Promise; setNotificationAuto(data: SetNotificationAutoParams): Promise; toggleFixedPost(data: FixCompanyPostParams): Promise; moveFixedPost(data: MoveCompanyFixedPostParams): Promise; sysAdminPaginate(data: SysAdminPaginateCompaniesParams): Promise; sysAdminUpdate(data: SysAdminUpdateCompanyParams): Promise; sysAdminSetBanned(data: SysAdminSetCompanyBannedParams): Promise; }