feat: add car inquiries with resilience, ownership privacy, and retry visibility

Introduce plate, chassis, and third-party car endpoints, a wall-clock inquiry
deadline with transport-only retries, and ownership-safe no-match errors so
another person's identity never leaks.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-05 17:21:16 +03:30
co-authored by Cursor
parent b4be98b156
commit 61098f1bf4
40 changed files with 2595 additions and 374 deletions
@@ -3,9 +3,10 @@ import { HydratedDocument } from 'mongoose';
export type GeneralTokenDocument = HydratedDocument<GeneralToken>;
/** OAuth tokens for outbound provider APIs — credentials stay in env, not stored here. */
@Schema({ timestamps: { createdAt: true, updatedAt: false }, collection: 'general_tokens' })
export class GeneralToken {
@Prop({ required: true })
@Prop({ required: true, index: true })
serviceProvider!: string;
@Prop({ required: true })
@@ -17,9 +18,6 @@ export class GeneralToken {
@Prop({ required: true })
clientId!: string;
@Prop({ required: true })
clientSecret!: string;
@Prop({ required: true })
username!: string;
@@ -35,10 +33,12 @@ export class GeneralToken {
@Prop({ required: true })
expiresIn!: number;
@Prop({ required: true })
@Prop({ required: true, index: true })
expiresAt!: Date;
createdAt?: Date;
}
export const GeneralTokenSchema = SchemaFactory.createForClass(GeneralToken);
GeneralTokenSchema.index({ serviceProvider: 1, createdAt: -1 });