61 lines
2.5 KiB
JavaScript
61 lines
2.5 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.WalletTransaction = void 0;
|
|
const typeorm_1 = require("typeorm");
|
|
const wallet_entity_1 = require("./wallet.entity");
|
|
let WalletTransaction = class WalletTransaction {
|
|
id;
|
|
wallet;
|
|
type;
|
|
amount;
|
|
description;
|
|
createdAt;
|
|
};
|
|
exports.WalletTransaction = WalletTransaction;
|
|
__decorate([
|
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
__metadata("design:type", String)
|
|
], WalletTransaction.prototype, "id", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.ManyToOne)(() => wallet_entity_1.Wallet, (wallet) => wallet.transactions, {
|
|
onDelete: 'CASCADE',
|
|
}),
|
|
__metadata("design:type", wallet_entity_1.Wallet)
|
|
], WalletTransaction.prototype, "wallet", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ length: 30 }),
|
|
__metadata("design:type", String)
|
|
], WalletTransaction.prototype, "type", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({
|
|
type: 'numeric',
|
|
precision: 12,
|
|
scale: 2,
|
|
transformer: {
|
|
to: (value) => value,
|
|
from: (value) => Number(value),
|
|
},
|
|
}),
|
|
__metadata("design:type", Number)
|
|
], WalletTransaction.prototype, "amount", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
__metadata("design:type", Object)
|
|
], WalletTransaction.prototype, "description", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
__metadata("design:type", Date)
|
|
], WalletTransaction.prototype, "createdAt", void 0);
|
|
exports.WalletTransaction = WalletTransaction = __decorate([
|
|
(0, typeorm_1.Entity)({ name: 'wallet_transactions' })
|
|
], WalletTransaction);
|
|
//# sourceMappingURL=wallet-transaction.entity.js.map
|