forked from Shared/esg
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:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user