"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.WalletBillModel = exports.WalletBillType = void 0; const openapi = require("@nestjs/swagger"); const typeorm_1 = require("typeorm"); const _base_model_1 = require("./_base_model"); const user_model_1 = require("./user.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"); var WalletBillType; (function (WalletBillType) { WalletBillType[WalletBillType["Recharge"] = 601] = "Recharge"; WalletBillType[WalletBillType["WithdrawReject"] = 602] = "WithdrawReject"; WalletBillType[WalletBillType["Transfer"] = 603] = "Transfer"; WalletBillType[WalletBillType["FinancialProfit"] = 604] = "FinancialProfit"; WalletBillType[WalletBillType["FinancialPrincipalReturn"] = 605] = "FinancialPrincipalReturn"; WalletBillType[WalletBillType["Withdrawal"] = 901] = "Withdrawal"; WalletBillType[WalletBillType["FinancialBuy"] = 902] = "FinancialBuy"; })(WalletBillType || (exports.WalletBillType = WalletBillType = {})); let WalletBillModel = class WalletBillModel extends _base_model_1.BaseModel { type; before; after; amount; remark; userId; user; static _OPENAPI_METADATA_FACTORY() { return { type: { required: true, enum: require("./wallet_bill.model").WalletBillType }, before: { required: true, type: () => String }, after: { required: true, type: () => String }, amount: { required: true, type: () => String }, remark: { required: false, type: () => String }, userId: { required: true, type: () => Number }, user: { required: false, type: () => require("./user.model").UserModel } }; } }; exports.WalletBillModel = WalletBillModel; __decorate([ (0, class_validator_1.IsNotEmpty)(), (0, is_enum_mumber_string_1.IsEnumNumberString)(WalletBillType), (0, swagger_1.ApiProperty)({ description: '账单类型:Recharge=充值(601),WithdrawReject=提现驳回(602),Transfer=宣传金划转到余额(603),FinancialProfit=理财产品收益(604),FinancialPrincipalReturn=理财产品本金退回(605),Withdrawal=提现(901),FinancialBuy=购买理财产品(902)', enum: WalletBillType, }), (0, typeorm_1.Column)({ type: 'int', comment: '账单类型:601=充值,602=提现驳回,603=宣传金划转到余额,604=理财产品收益,605=理财产品本金退回,901=提现,902=购买理财产品', }), __metadata("design:type", Number) ], WalletBillModel.prototype, "type", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: '动账前现金余额' }), (0, typeorm_1.Column)({ type: 'decimal', precision: 20, scale: 6, default: 0, comment: '动账前现金余额', }), __metadata("design:type", String) ], WalletBillModel.prototype, "before", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: '动账后余额' }), (0, typeorm_1.Column)({ type: 'decimal', precision: 20, scale: 6, default: 0, comment: '动账后余额', }), __metadata("design:type", String) ], WalletBillModel.prototype, "after", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: '动账金额,有正负' }), (0, class_validator_1.IsDecimal)(), (0, typeorm_1.Column)({ type: 'decimal', precision: 20, scale: 6, comment: '动账金额,有正负', }), __metadata("design:type", String) ], WalletBillModel.prototype, "amount", void 0); __decorate([ (0, class_validator_1.IsString)(), (0, api_optional_decorator_1.ApiOptional)({ description: '备注', nullable: true }), (0, typeorm_1.Column)({ type: 'varchar', comment: '备注', nullable: true, }), __metadata("design:type", String) ], WalletBillModel.prototype, "remark", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: '用户ID' }), (0, class_validator_1.IsInt)(), (0, typeorm_1.Column)({ type: 'int', unsigned: true, comment: '用户ID', }), __metadata("design:type", Number) ], WalletBillModel.prototype, "userId", 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) ], WalletBillModel.prototype, "user", void 0); exports.WalletBillModel = WalletBillModel = __decorate([ (0, typeorm_1.Entity)({ comment: '钱包账单', }) ], WalletBillModel); //# sourceMappingURL=wallet_bill.model.js.map