"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuickbooksAccount = exports.QuickbooksAccountSchema = exports.QuickbooksAccountValidationSchema = void 0;
const joi_1 = __importDefault(require("joi"));
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
exports.QuickbooksAccountValidationSchema = joi_1.default.object({
    _id: joi_1.default.string(),
    uiId: joi_1.default.string(),
    companyId: joi_1.default.string(),
    order: joi_1.default.number(),
    accountCode: joi_1.default.string().required(),
    fullName: joi_1.default.string().required(),
    description: joi_1.default.string().required(),
});
exports.QuickbooksAccountSchema = new mongoose_1.default.Schema({
    companyId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.companies,
        required: true,
    },
    uiId: {
        type: String,
        required: true,
    },
    order: {
        type: Number,
    },
    accountCode: {
        type: String,
        trim: true,
        required: true,
    },
    fullName: {
        type: String,
        trim: true,
        required: true,
    },
    description: {
        type: String,
        trim: true,
        required: true,
    },
}, { timestamps: true });
exports.QuickbooksAccount = mongoose_1.default.model(_models_1.MODEL_NAMES.quickbooksAccounts, exports.QuickbooksAccountSchema);
