This commit is contained in:
Mateusz Gruszczyński
2026-04-06 14:37:42 +02:00
parent 237596bd52
commit 80e181ea3f
41 changed files with 14959 additions and 1023 deletions

View File

@@ -4,6 +4,9 @@ import { Proof } from './Proof.js';
import { User } from './User.js';
import { decimalTransformer } from '../utils/decimal.js';
export type ExpenseStatus = 'DRAFT' | 'PENDING' | 'APPROVED' | 'REJECTED';
export type DuplicateReviewStatus = 'OPEN' | 'CONFIRMED' | 'DISMISSED';
@Entity('expenses')
export class Expense {
@PrimaryGeneratedColumn('uuid')
@@ -30,9 +33,27 @@ export class Expense {
@Column({ type: 'varchar', length: 12, default: 'PLN' })
currency!: string;
@Column({ type: 'varchar', length: 20, default: 'PENDING' })
status!: ExpenseStatus;
@Column({ type: 'simple-json', nullable: true })
tags!: string[] | null;
@Column({ type: 'simple-json', nullable: true })
customFields!: Record<string, string> | null;
@Column({ type: 'boolean', default: false })
possibleDuplicate!: boolean;
@Column({ type: 'varchar', length: 20, nullable: true })
duplicateStatus!: DuplicateReviewStatus | null;
@Column({ type: 'datetime', nullable: true })
duplicateReviewedAt!: Date | null;
@Column({ type: 'varchar', length: 36, nullable: true })
recurringSourceId!: string | null;
@CreateDateColumn({ type: 'datetime' })
createdAt!: Date;