Files
energy_dist/dist/model/financial_product.model.js
2026-04-21 23:31:33 +08:00

77 lines
3.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FinancialProductModel = void 0;
const openapi = require("@nestjs/swagger");
const typeorm_1 = require("typeorm");
const _base_model_1 = require("./_base_model");
const swagger_1 = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
const is_number_or_number_str_1 = require("../app/common/decorator/is_number_or_number_str");
let FinancialProductModel = class FinancialProductModel extends _base_model_1.BaseModel {
name;
period;
principal;
yieldRate;
static _OPENAPI_METADATA_FACTORY() {
return { name: { required: true, type: () => String }, period: { required: true, type: () => Number }, principal: { required: true, type: () => String }, yieldRate: { required: true, type: () => String } };
}
};
exports.FinancialProductModel = FinancialProductModel;
__decorate([
(0, swagger_1.ApiProperty)({ description: '名称' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsNotEmpty)(),
(0, typeorm_1.Column)({
type: 'varchar',
comment: '名称',
}),
__metadata("design:type", String)
], FinancialProductModel.prototype, "name", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '周期(单位:天)' }),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
(0, class_validator_1.IsNotEmpty)(),
(0, typeorm_1.Column)({
type: 'int',
comment: '周期(单位:天)',
}),
__metadata("design:type", Number)
], FinancialProductModel.prototype, "period", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '本金' }),
(0, class_validator_1.IsDecimal)(),
(0, class_validator_1.IsNotEmpty)(),
(0, typeorm_1.Column)({
type: 'decimal',
precision: 20,
scale: 6,
comment: '本金',
}),
__metadata("design:type", String)
], FinancialProductModel.prototype, "principal", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '收益率(%' }),
(0, class_validator_1.IsDecimal)(),
(0, typeorm_1.Column)({
type: 'decimal',
precision: 10,
scale: 4,
comment: '收益率(%',
}),
__metadata("design:type", String)
], FinancialProductModel.prototype, "yieldRate", void 0);
exports.FinancialProductModel = FinancialProductModel = __decorate([
(0, typeorm_1.Entity)({
comment: '理财产品',
})
], FinancialProductModel);
//# sourceMappingURL=financial_product.model.js.map