feat(07-02): InboxProvider interface + config/vehicle/history DTOs
Tessera CI/CD / Build & Deploy (push) Blocked by required conditions
Tessera CI/CD / Lint & Type Check (push) Successful in 40s
Tessera CI/CD / Tests (push) Waiting to run

- inbox-provider.interface.ts: InboxProvider contract with fetchPdfAttachments + testConnection; re-exports InboxConfig/InboxEmail/InboxAttachment with export type (isolatedModules)
- dkv-config.dto.ts: DkvConfigDto with @IsEmail() senderFilter/exportRecipient, @Min(5) pollIntervalMin, @IsIn() protocol/encryption (T-07-04)
- dkv-vehicle.dto.ts: CreateVehicleDto (all required @IsNotEmpty) + UpdateVehicleDto (all optional)
- dkv-history.dto.ts: DkvHistoryQueryDto with @IsInt @Min(1) page/limit pagination (T-07-06)
- Fix: export type re-exports required for isolatedModules TypeScript setting
This commit is contained in:
2026-06-27 00:00:14 +02:00
parent 6bf032ef94
commit 86ec8966d0
4 changed files with 248 additions and 0 deletions
@@ -0,0 +1,32 @@
import { InboxAttachment, InboxConfig, InboxEmail } from '../dkv.types';
// Re-export types for downstream consumers that import from this module
export type { InboxAttachment, InboxConfig, InboxEmail };
/**
* Abstract inbox provider contract — implemented by ImapProvider and
* ExchangeInboxProvider. Consumers (DkvService, DkvSchedulerService) depend
* only on this interface, not on the concrete implementations.
*
* Security:
* - T-07-03: Implementations MUST NOT log credential values
* - InboxConfig carries decrypted credentials — never persist, never serialize
*/
export interface InboxProvider {
/**
* Connects to the configured inbox, searches for emails from the configured
* sender filter, downloads PDF attachments, and returns all matching emails.
*
* @param config Decrypted inbox connection parameters
* @returns Array of emails with their PDF attachments as Buffers
*/
fetchPdfAttachments(config: InboxConfig): Promise<InboxEmail[]>;
/**
* Tests whether the inbox connection can be established.
*
* @param config Decrypted inbox connection parameters
* @returns true if connection succeeded, false on any auth/network error
*/
testConnection(config: InboxConfig): Promise<boolean>;
}