mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
17 lines
464 B
TypeScript
17 lines
464 B
TypeScript
import { model, Schema, Types } from 'mongoose';
|
|
|
|
export type TAppsumoCode = {
|
|
_id: Schema.Types.ObjectId,
|
|
code: string,
|
|
used_at: Date,
|
|
created_at?: Date,
|
|
}
|
|
|
|
const AppsumoCodeSchema = new Schema<TAppsumoCode>({
|
|
code: { type: String, index: 1 },
|
|
created_at: { type: Date, default: () => Date.now() },
|
|
used_at: { type: Date, required: false },
|
|
});
|
|
|
|
export const AppsumoCodeModel = model<TAppsumoCode>('appsumo_codes', AppsumoCodeSchema);
|