pl4y-data-library
Version:
This library contains the dtos, enums, schemas, and other data objects needed in the pl4y ecosystem.
62 lines • 1.56 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TenantSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const tenant_types_enum_1 = require("../enums/tenant-types.enum");
exports.TenantSchema = new mongoose_1.default.Schema({
name: {
type: String,
},
email: {
type: String,
required: true,
unique: true,
},
phone: {
type: String,
},
ownerId: {
type: String,
},
tenantId: {
type: String,
},
tenantType: {
type: String,
enum: [tenant_types_enum_1.TenantType.STORE, tenant_types_enum_1.TenantType.TEACHING, tenant_types_enum_1.TenantType.BLOG],
default: tenant_types_enum_1.TenantType.STORE,
},
hasShippingAddress: {
type: Boolean,
default: false,
},
membership: {
type: String,
default: "basic",
},
homePageOriginURL: {
type: String,
required: true,
},
user: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "User",
},
supportEmail: {
type: String,
},
businessAddress: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "Address",
},
}, {
timestamps: true,
toJSON: { virtuals: true },
toObject: {
virtuals: true,
},
});
//# sourceMappingURL=tenant.schema.js.map