won-dto
Version:
Won DTO For WonCore
33 lines • 1.58 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomerHook = exports.customerSchema = void 0;
const mongoose_1 = require("mongoose");
const baseModel_1 = require("../base/baseModel");
const customer_enum_1 = require("./customer.enum");
exports.customerSchema = new mongoose_1.Schema({
username: { type: String },
address: { type: String },
activedAt: { type: Date },
referral: { type: String },
shortUrl: { type: String },
role: { type: String },
nonce: { type: String },
addressIp: { type: String },
bannerUrl: { type: String, default: "/images/customer/banner.png" },
avatarUrl: {
type: String,
default: `/images/customer/avatar${Math.floor(Math.random() * 9) + 1}.png`,
},
walletType: { type: String, enum: customer_enum_1.CustomerWalletTypes },
status: { type: String, enum: customer_enum_1.CustomerStatus, default: customer_enum_1.CustomerStatus.ACTIVE },
telegram: { type: String, default: "" },
pendingAddress: { type: String },
pendingAddressVerified: { type: Boolean },
email: { type: String, default: "" },
emailVerifyToken: { type: String },
invitationCode: { type: String },
parentCustomerId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Customer" },
}, { timestamps: true });
exports.customerSchema.index({ id: "text", address: "text", addressIp: "text" }, { weights: { id: 1, address: 2, addressIp: 3 } });
exports.CustomerHook = new baseModel_1.ModelHook(exports.customerSchema);
//# sourceMappingURL=customer.schema.js.map