import { JsonApiDataInterface, JsonApiService } from "../../../core/jsonapi"; import { CompanyRepository } from "../../company/repositories/company.repository"; import { UserRepository } from "../../user/repositories/user.repository"; import { StripeCustomerRepository } from "../repositories/stripe-customer.repository"; import { StripeCustomerApiService } from "./stripe-customer-api.service"; import { StripeCustomerPostDTO, StripeCustomerPutDTO } from "../dtos/stripe-customer.dto"; /** * Stripe Customer Admin Service * * Provides business logic for customer management, orchestrating between * Stripe API calls and Neo4j persistence. Returns JSON:API formatted responses. * * @example * ```typescript * const result = await stripeCustomerAdminService.createCustomer(companyId, dto); * ``` */ export declare class StripeCustomerAdminService { private readonly stripeCustomerApiService; private readonly stripeCustomerRepository; private readonly companyRepository; private readonly userRepository; private readonly jsonApiService; constructor(stripeCustomerApiService: StripeCustomerApiService, stripeCustomerRepository: StripeCustomerRepository, companyRepository: CompanyRepository, userRepository: UserRepository, jsonApiService: JsonApiService); /** * Get customer for a company * * @param companyId - The company ID * @returns JSON:API formatted customer or null if not found */ getCustomerByCompanyId(companyId: string): Promise; /** * Get customer by ID * * @param id - The internal customer ID * @returns JSON:API formatted customer or null if not found */ getCustomerById(id: string): Promise; /** * Get customer by Stripe customer ID * * @param stripeCustomerId - The Stripe customer ID * @returns JSON:API formatted customer or null if not found */ getCustomerByStripeId(stripeCustomerId: string): Promise; /** * Create a new customer * * Creates customer in both Stripe and Neo4j, establishing company relationship. * If no attributes provided, auto-fetches company name and user email as defaults. * * @param companyId - The company ID to associate with the customer * @param userId - The user ID of the authenticated user (for email fallback) * @param dto - The JSON:API formatted customer creation data (optional) * @returns JSON:API formatted created customer */ createCustomer(companyId: string, userId: string, dto?: StripeCustomerPostDTO): Promise; /** * Update an existing customer * * Updates customer in both Stripe and Neo4j. * * @param id - The internal customer ID * @param dto - The JSON:API formatted customer update data * @returns JSON:API formatted updated customer */ updateCustomer(id: string, dto: StripeCustomerPutDTO): Promise; /** * Sync customer data from Stripe webhook * * Updates local Neo4j record to match Stripe's data. * * @param stripeCustomerId - The Stripe customer ID * @param data - The data from Stripe webhook * @returns Updated customer or null if not found */ syncFromStripe(stripeCustomerId: string, data: { email?: string; name?: string; defaultPaymentMethodId?: string; balance?: number; delinquent?: boolean; }): Promise; /** * Delete a customer * * Deletes customer from both Stripe and Neo4j. * * @param id - The internal customer ID */ deleteCustomer(id: string): Promise; } //# sourceMappingURL=stripe-customer-admin.service.d.ts.map