@withpotter/domain — module reference

HTTP routes this module mounts, plus its internal use-cases, entities, and repositories. The exhaustive request/response contract is the engine’s OpenAPI document at /docs; the layered structure below follows the package internal architecture.

HTTP routes

DomainController /domains

MethodPathAuthDescription
GET/domains/:idYesGet domain
GET/domains/checkCheck availability
GET/domains/dns-previewPreview dns records
GET/domains/exchange-rateGet exchange rate
GET/domains/priceYesGet domain price
GET/domains/pricingGet tld pricing
GET/domains/tenant/:tenantIdYesGet tenant domains
POST/domains/:id/verifyYesVerify domain
POST/domains/connectYesConnect external domain
POST/domains/purchaseYesInitiate purchase
PATCH/domains/:id/auto-renewYesSet auto renew
PATCH/domains/:id/primaryYesSet primary domain
DELETE/domains/:idYesDelete domain

Internals

Use-cases

Application operations. Each is a single-purpose class with one execute() method.

Use-caseSignature
CheckDomainAvailabilityUseCaseexecute(domain: string, limit = 10): Promise<EnhancedAvailabilityResponse>
CompleteDomainPurchaseUseCaseexecute(transactionId: string, paymentReference: string, customerEmail?: string): Promise<TenantDomainResponse>
ConfigureDomainProjectUseCaseexecute(domainId: string): Promise<void>
ConnectExternalDomainUseCaseexecute(tenantId: string, domain: string): Promise<ConnectExternalDomainResponse>
DeleteDomainUseCaseexecute(domainId: string, tenantId: string): Promise<{ success: boolean; message: string }>
GetDomainByIdUseCaseexecute(domainId: string): Promise<TenantDomainResponse>
GetDomainByNameUseCaseexecute(domainName: string): Promise<TenantDomain | null>
GetDomainPriceUseCaseexecute(domain: string, tenantId: string): Promise<DomainPriceResponse>
GetTenantDomainsUseCaseexecute(tenantId: string): Promise<TenantDomainResponse[]>
InitiateDomainPurchaseUseCaseexecute(tenantId: string, domain: string, callbackUrl: string, email: string): Promise<InitiatePurchaseResponse>
PreviewDomainDnsUseCaseexecute(domain: string): Promise<DnsPreviewResponse>
RenewDomainUseCaseexecute(transactionId: string, paymentReference: string): Promise<TenantDomainResponse>
SetDomainAutoRenewUseCaseexecute(domainId: string, enabled: boolean): Promise<TenantDomainResponse>
SetPrimaryDomainUseCaseexecute(tenantId: string, domainId: string): Promise<TenantDomainResponse>
VerifyDomainUseCaseexecute(domainId: string): Promise<TenantDomainResponse>

Entities

Sequelize models owned by this module.

DomainPricing — table domain_pricing

FieldType
idstring
createdAtDate
updatedAtDate

DomainTransaction — table domain_transactions

FieldType
idstring
createdAtDate
updatedAtDate

TenantDomain — table tenant_domains

FieldType
idstring
createdAtDate
updatedAtDate

TenantDomainPricing — table tenant_domain_pricing

FieldType
idstring
createdAtDate
updatedAtDate

Repositories

Data-access classes wrapping the entities.

DomainTransactionRepository

findByPaymentReference · findPendingByPaymentReference · findByTenantAndDomain · listByTenant · markCompleted · markFailed

TenantDomainRepository

findByDomain · findByTenantAndDomain · findPrimaryByTenant · listByTenant · listByStatus · listExpiringSoon · clearPrimaryForTenant · setAsPrimary

Services

  • DomainPricingEngine
  • SimpleExchangeRateService

Providers

  • PlatformDomainProvider

Generated from the module’s source. Routes are relative to the engine root (default http://localhost:3001). For full request/response schemas use the live OpenAPI document.