Files
2026-04-21 22:34:39 +08:00

184 lines
7.3 KiB
JavaScript

"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.WithdrawModel = exports.WithdrawStatus = 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_enum_mumber_string_1 = require("../app/common/decorator/is_enum_mumber_string");
const api_optional_decorator_1 = require("../app/common/decorator/api_optional.decorator");
const user_model_1 = require("./user.model");
const user_bank_model_1 = require("./user_bank.model");
var WithdrawStatus;
(function (WithdrawStatus) {
WithdrawStatus[WithdrawStatus["Pending"] = 0] = "Pending";
WithdrawStatus[WithdrawStatus["Success"] = 1] = "Success";
WithdrawStatus[WithdrawStatus["Rejected"] = 2] = "Rejected";
})(WithdrawStatus || (exports.WithdrawStatus = WithdrawStatus = {}));
let WithdrawModel = class WithdrawModel extends _base_model_1.BaseModel {
userId;
amount;
actualAmount;
status;
userBankId;
cardNo;
bankName;
phone;
rejectReason;
remark;
user;
userBank;
static _OPENAPI_METADATA_FACTORY() {
return { userId: { required: true, type: () => Number }, amount: { required: true, type: () => String }, actualAmount: { required: true, type: () => String }, status: { required: true, enum: require("./withdraw.model").WithdrawStatus }, userBankId: { required: true, type: () => Number }, cardNo: { required: true, type: () => String }, bankName: { required: true, type: () => String }, phone: { required: true, type: () => String }, rejectReason: { required: false, type: () => String }, remark: { required: false, type: () => String }, user: { required: false, type: () => require("./user.model").UserModel }, userBank: { required: false, type: () => require("./user_bank.model").UserBankModel } };
}
};
exports.WithdrawModel = WithdrawModel;
__decorate([
(0, swagger_1.ApiProperty)({ description: '用户 ID' }),
(0, class_validator_1.IsInt)(),
(0, class_validator_1.IsNotEmpty)(),
(0, typeorm_1.Column)({
type: 'int',
unsigned: true,
comment: '用户 ID',
}),
__metadata("design:type", Number)
], WithdrawModel.prototype, "userId", 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)
], WithdrawModel.prototype, "amount", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '实际到账金额' }),
(0, class_validator_1.IsDecimal)(),
(0, typeorm_1.Column)({
type: 'decimal',
precision: 20,
scale: 6,
default: 0,
comment: '实际到账金额',
}),
__metadata("design:type", String)
], WithdrawModel.prototype, "actualAmount", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: '提现状态:0=审核中,1=提现成功,2=提现驳回',
enum: WithdrawStatus,
}),
(0, is_enum_mumber_string_1.IsEnumNumberString)(WithdrawStatus),
(0, typeorm_1.Column)({
type: 'int',
default: WithdrawStatus.Pending,
comment: '提现状态:0=审核中,1=提现成功,2=提现驳回',
}),
__metadata("design:type", Number)
], WithdrawModel.prototype, "status", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '银行卡 ID' }),
(0, class_validator_1.IsInt)(),
(0, class_validator_1.IsNotEmpty)(),
(0, typeorm_1.Column)({
type: 'int',
unsigned: true,
comment: '银行卡 ID',
}),
__metadata("design:type", Number)
], WithdrawModel.prototype, "userBankId", void 0);
__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)
], WithdrawModel.prototype, "cardNo", void 0);
__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)
], WithdrawModel.prototype, "bankName", void 0);
__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)
], WithdrawModel.prototype, "phone", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '驳回原因', nullable: true }),
(0, class_validator_1.IsString)(),
(0, typeorm_1.Column)({
type: 'varchar',
comment: '驳回原因',
nullable: true,
}),
__metadata("design:type", String)
], WithdrawModel.prototype, "rejectReason", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '备注', nullable: true }),
(0, class_validator_1.IsString)(),
(0, typeorm_1.Column)({
type: 'varchar',
comment: '备注',
nullable: true,
}),
__metadata("design:type", String)
], WithdrawModel.prototype, "remark", void 0);
__decorate([
(0, swagger_1.ApiPropertyOptional)({
description: '用户',
type: user_model_1.UserModel,
nullable: true,
}),
(0, typeorm_1.OneToOne)(() => user_model_1.UserModel, {
createForeignKeyConstraints: false,
}),
(0, typeorm_1.JoinColumn)(),
__metadata("design:type", user_model_1.UserModel)
], WithdrawModel.prototype, "user", void 0);
__decorate([
(0, swagger_1.ApiPropertyOptional)({
description: '银行卡',
type: user_bank_model_1.UserBankModel,
nullable: true,
}),
(0, typeorm_1.OneToOne)(() => user_bank_model_1.UserBankModel, {
createForeignKeyConstraints: false,
}),
(0, typeorm_1.JoinColumn)(),
__metadata("design:type", user_bank_model_1.UserBankModel)
], WithdrawModel.prototype, "userBank", void 0);
exports.WithdrawModel = WithdrawModel = __decorate([
(0, typeorm_1.Entity)({
comment: '提现记录',
})
], WithdrawModel);
//# sourceMappingURL=withdraw.model.js.map