@things-factory/accounting 10.1.208 → 10.1.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/account/account-match.d.ts +4 -5
- package/dist-server/service/account/account-match.js +7 -8
- package/dist-server/service/account/account-match.js.map +1 -1
- package/dist-server/service/expenditure-request/expenditure-request-mutation.d.ts +1 -1
- package/dist-server/service/expenditure-request/expenditure-request-mutation.js +5 -4
- package/dist-server/service/expenditure-request/expenditure-request-mutation.js.map +1 -1
- package/dist-server/service/expenditure-request/expenditure-request-service.d.ts +2 -0
- package/dist-server/service/expenditure-request/expenditure-request-service.js +17 -0
- package/dist-server/service/expenditure-request/expenditure-request-service.js.map +1 -1
- package/dist-server/service/expenditure-request/index.d.ts +2 -2
- package/dist-server/service/financial-statement/index.d.ts +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.d.ts +0 -1
- package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js +0 -17
- package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js.map +1 -1
- package/dist-server/service/recurring-cash-item/recurring-cash-item-service.d.ts +2 -9
- package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js +2 -39
- package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js.map +1 -1
- package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js +1 -1
- package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js.map +1 -1
- package/dist-server/service/recurring-cash-item/recurring-cash-item.d.ts +2 -2
- package/dist-server/service/recurring-cash-item/recurring-cash-item.js +5 -5
- package/dist-server/service/recurring-cash-item/recurring-cash-item.js.map +1 -1
- package/dist-server/service/recurring-cash-item/recurring-schedule.d.ts +6 -18
- package/dist-server/service/recurring-cash-item/recurring-schedule.js +13 -26
- package/dist-server/service/recurring-cash-item/recurring-schedule.js.map +1 -1
- package/dist-server/service/transaction/transaction-history.d.ts +1 -7
- package/dist-server/service/transaction/transaction-history.js +0 -25
- package/dist-server/service/transaction/transaction-history.js.map +1 -1
- package/dist-server/service/transaction/transaction-period.d.ts +0 -8
- package/dist-server/service/transaction/transaction-period.js +0 -30
- package/dist-server/service/transaction/transaction-period.js.map +1 -1
- package/dist-server/service/transaction/transaction-query.d.ts +0 -2
- package/dist-server/service/transaction/transaction-query.js +2 -16
- package/dist-server/service/transaction/transaction-query.js.map +1 -1
- package/dist-server/service/transaction/transaction-service.d.ts +1 -4
- package/dist-server/service/transaction/transaction-service.js +6 -31
- package/dist-server/service/transaction/transaction-service.js.map +1 -1
- package/dist-server/service/transaction/transaction-type.d.ts +1 -15
- package/dist-server/service/transaction/transaction-type.js +2 -58
- package/dist-server/service/transaction/transaction-type.js.map +1 -1
- package/dist-server/service/transaction/transaction.d.ts +6 -15
- package/dist-server/service/transaction/transaction.js +13 -52
- package/dist-server/service/transaction/transaction.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/translations/en.json +4 -5
- package/translations/es.json +4 -5
- package/translations/ja.json +4 -1
- package/translations/ko.json +4 -5
- package/translations/ms.json +4 -1
- package/translations/zh.json +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAkF;AAElF,iDAA2D;AAC3D,yDAAgD;AAChD,uDAAuD;AAEvD,gDAA4C;AAC5C,+DAA0D;AAC1D,qEAAgE;AAChE,sDAAgD;AAChD,gDAA4C;AAC5C,oFAA+E;AAC/E,oFAA8E;AAE9E,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,4CAAqB,CAAA;AACvB,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;AAED,IAAA,+BAAgB,EAAC,mBAAmB,EAAE;IACp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AAC,OAAO,CAAC;;8CAC5C;sBArNP,WAAW;IAlBvB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,uEAAuE,EAAE,CAAC;IACpG,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,EAAE;QAC1G,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,yDAAyD;KACjE,CAAC;IACD,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC;QACvD,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,WAAW;QACvB,WAAW,CAAC,eAAe;KAC5B,CAAC;IACD,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC;QACvD,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,QAAQ;QACpB,WAAW,CAAC,IAAI;QAChB,WAAW,CAAC,KAAK;KAClB,CAAC;IACD,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;GAC9F,WAAW,CAsNvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Float, ID, Int, registerEnumType } from 'type-graphql'\n\nimport { Domain, moneyColumn } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Counterparty } from '@things-factory/biz-base'\n\nimport { Account } from '../account/account'\nimport { BankAccount } from '../bank-account/bank-account'\nimport { BankStatement } from '../bank-statement/bank-statement'\nimport { CashFlowType } from '../cash-flow-type'\nimport { Payment } from '../payment/payment'\nimport { AccountingDocument } from '../accounting-document/accounting-document'\nimport { RecurringCashItem } from '../recurring-cash-item/recurring-cash-item'\n\nexport enum TransactionCategory {\n CONFIRMED = 'CONFIRMED',\n FORECAST = 'FORECAST'\n}\n\nregisterEnumType(TransactionCategory, {\n name: 'TransactionCategory',\n description: 'Whether a transaction happened on the bank account (confirmed) or is a plan someone made (forecast)'\n})\n\nexport enum TransactionSource {\n BANK_STATEMENT = 'BANK_STATEMENT',\n LEGACY = 'LEGACY',\n MANUAL = 'MANUAL'\n}\n\nregisterEnumType(TransactionSource, {\n name: 'TransactionSource',\n description:\n 'Where the facts of a confirmed transaction come from - a bank statement file, an old ledger, or a person'\n})\n\nexport enum ForecastStatus {\n PLANNED = 'PLANNED',\n DONE = 'DONE',\n CANCELLED = 'CANCELLED'\n}\n\nregisterEnumType(ForecastStatus, {\n name: 'ForecastStatus',\n description: 'State of a forecast - still expected, happened, dropped'\n})\n\n/**\n * Money that moves in or out of the business: a line on a bank account (confirmed), or a plan someone made of money\n * still to come or go (forecast).\n *\n * What a transaction paid - a contract round, a tax invoice, a VAT period - is its payments (§`Payment`). The facts\n * of a bank line are kept as the bank gave them, beside what a person wrote about it.\n */\n@ObjectType({ description: 'Money moving in or out - a bank line (confirmed) or a plan (forecast)' })\n@Entity()\n@Index('ix_transaction_0', (transaction: Transaction) => [transaction.domain, transaction.bankFingerprint], {\n unique: true,\n where: '\"deleted_at\" IS NULL AND \"bank_fingerprint\" IS NOT NULL'\n})\n@Index('ix_transaction_1', (transaction: Transaction) => [\n transaction.domain,\n transaction.bankAccount,\n transaction.transactionDate\n])\n@Index('ix_transaction_2', (transaction: Transaction) => [\n transaction.domain,\n transaction.category,\n transaction.year,\n transaction.month\n])\n@Index('ix_transaction_3', (transaction: Transaction) => [transaction.domain, transaction.transactionDate])\nexport class Transaction {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the transaction' })\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number for optimistic locking' })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain in which this transaction belongs' })\n domain?: Domain\n\n @RelationId((transaction: Transaction) => transaction.domain)\n domainId?: string\n\n @Column({ default: TransactionCategory.CONFIRMED })\n @Field(type => TransactionCategory, { description: 'Confirmed (on the bank account) or forecast (a plan)' })\n category: TransactionCategory\n\n @Column({ default: CashFlowType.INCOME })\n @Field(type => CashFlowType, { description: 'Money in or money out' })\n type: CashFlowType\n\n @ManyToOne(type => BankAccount, { nullable: true })\n @Field(type => BankAccount, { nullable: true, description: 'The account the money moved in or out of' })\n bankAccount?: BankAccount\n\n @RelationId((transaction: Transaction) => transaction.bankAccount)\n bankAccountId?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description:\n \"YYYY-MM-DD - the day in the account's time zone; for a forecast, the day its timing names, empty when it names none\"\n })\n transactionDate?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Bank timestamp with UTC offset; empty when only a date is known' })\n transactionAt?: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Year of the transaction date - for a forecast, the year it is planned in' })\n year: number\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Month of the transaction date - for a forecast, the month it is planned in' })\n month: number\n\n @Column(moneyColumn())\n @Field(type => Float, { description: 'Amount, in the currency' })\n amount: number\n\n @Column({ default: 'KRW' })\n @Field({ description: 'ISO 4217 code - the currency of the account' })\n currency: string\n\n @Column(moneyColumn({ nullable: true, default: null }))\n @Field(type => Float, {\n nullable: true,\n description: 'Account balance after this transaction, as the bank statement says'\n })\n balance?: number\n\n @ManyToOne(type => Account, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Account, { nullable: true, description: 'The account subject it is booked to' })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What a person wrote about it - for a forecast, what is planned' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The classifying word of the ledger it was kept in' })\n ledgerCategory?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The counterparty name as a person wrote it' })\n counterpartyName?: string\n\n @ManyToOne(type => Counterparty, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Counterparty, {\n nullable: true,\n description: 'The registered counterparty, when the name is one the domain knows'\n })\n counterparty?: Counterparty\n\n @RelationId((transaction: Transaction) => transaction.counterparty)\n counterpartyId?: string\n\n @Column({ default: TransactionSource.MANUAL })\n @Field(type => TransactionSource, { description: 'Where the facts of the line come from' })\n source: TransactionSource\n\n @ManyToOne(type => BankStatement, { nullable: true, onDelete: 'RESTRICT' })\n @Field(type => BankStatement, { nullable: true, description: 'The bank statement file the line was read from' })\n bankStatement?: BankStatement\n\n @RelationId((transaction: Transaction) => transaction.bankStatement)\n bankStatementId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The file the line was read from, for lines from before statements were kept' })\n sourceFile?: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The row of the source file' })\n sourceRow?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'Chronological order within the source statement' })\n bankSequence?: number\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'What makes the bank line itself unique in the domain - the same line read twice is refused'\n })\n bankFingerprint?: string\n\n @Column({ type: 'simple-json', nullable: true })\n bankReconciliationBefore?: Record<string, any>\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Description as the bank wrote it' })\n bankDescription?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Kind of the line as the bank wrote it' })\n bankKind?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Counterparty name as the bank wrote it' })\n bankCounterpartyName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's account number as the bank wrote it\" })\n bankCounterpartyAccount?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's bank as the bank wrote it\" })\n bankCounterpartyBank?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Memo as the bank wrote it' })\n bankMemo?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'When in the month a forecast falls, as a person wrote it - 15th, end of month'\n })\n timing?: string\n\n @Column({ nullable: true })\n @Field(type => ForecastStatus, {\n nullable: true,\n description: 'State of a forecast; empty on a confirmed transaction'\n })\n status?: ForecastStatus\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The probability of a forecast being realized (0 to 100)' })\n probability?: number\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @ManyToOne(type => RecurringCashItem, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => RecurringCashItem, { nullable: true, description: 'The recurring item a forecast was made from' })\n recurringItem?: RecurringCashItem\n\n @RelationId((transaction: Transaction) => transaction.recurringItem)\n recurringItemId?: string\n\n @OneToMany(type => Payment, payment => payment.transaction)\n @Field(type => [Payment], { nullable: true, description: 'What this transaction paid' })\n payments?: Payment[]\n\n @OneToMany(type => AccountingDocument, document => document.transaction)\n @Field(type => [AccountingDocument], { nullable: true, description: 'Documents linked to this transaction' })\n documents?: AccountingDocument[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was created' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was last updated' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When it was deleted - financial rows are kept, not erased' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created the transaction record' })\n creator?: User\n\n @RelationId((transaction: Transaction) => transaction.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated the transaction record' })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.updater)\n updaterId?: string\n}\n"]}
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAkF;AAElF,iDAA2D;AAC3D,yDAAgD;AAChD,uDAAuD;AAEvD,gDAA4C;AAC5C,+DAA0D;AAC1D,qEAAgE;AAChE,sDAAgD;AAChD,gDAA4C;AAC5C,oFAA+E;AAE/E;;;GAGG;AACH,IAAY,mBAEX;AAFD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;AACzB,CAAC,EAFW,mBAAmB,mCAAnB,mBAAmB,QAE9B;AAED,IAAA,+BAAgB,EAAC,mBAAmB,EAAE;IACpC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,6DAA6D;CAC3E,CAAC,CAAA;AAEF,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sDAAiC,CAAA;IACjC,sCAAiB,CAAA;IACjB,sCAAiB,CAAA;AACnB,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AAED,IAAA,+BAAgB,EAAC,iBAAiB,EAAE;IAClC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACT,0GAA0G;CAC7G,CAAC,CAAA;AAEF;;;;;GAKG;AAmBI,IAAM,WAAW,GAAjB,MAAM,WAAW;IAAjB;QAOL,YAAO,GAAY,CAAC,CAAA;IAsLtB,CAAC;CAAA,CAAA;AA7LY,kCAAW;AAGb;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;;uCACzD;AAInB;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;;4CAC5D;AAIpB;IAFC,IAAA,mBAAS,EA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AAC,CAAC;GAC9F,WAAW,CA6LvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Float, ID, Int, registerEnumType } from 'type-graphql'\n\nimport { Domain, moneyColumn } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Counterparty } from '@things-factory/biz-base'\n\nimport { Account } from '../account/account'\nimport { BankAccount } from '../bank-account/bank-account'\nimport { BankStatement } from '../bank-statement/bank-statement'\nimport { CashFlowType } from '../cash-flow-type'\nimport { Payment } from '../payment/payment'\nimport { AccountingDocument } from '../accounting-document/accounting-document'\n\n/**\n * What a transaction is: a line that happened on the bank account. Money still to come is read from the records that\n * owe it, never written as a transaction (ADR-0157) - the category is the one kind left.\n */\nexport enum TransactionCategory {\n CONFIRMED = 'CONFIRMED'\n}\n\nregisterEnumType(TransactionCategory, {\n name: 'TransactionCategory',\n description: 'That a transaction happened on the bank account (confirmed)'\n})\n\nexport enum TransactionSource {\n BANK_STATEMENT = 'BANK_STATEMENT',\n LEGACY = 'LEGACY',\n MANUAL = 'MANUAL'\n}\n\nregisterEnumType(TransactionSource, {\n name: 'TransactionSource',\n description:\n 'Where the facts of a confirmed transaction come from - a bank statement file, an old ledger, or a person'\n})\n\n/**\n * Money that moved in or out of the business: a line on a bank account.\n *\n * What a transaction paid - a contract round, a tax invoice, a VAT period - is its payments (§`Payment`). The facts\n * of a bank line are kept as the bank gave them, beside what a person wrote about it.\n */\n@ObjectType({ description: 'Money that moved in or out - a bank line' })\n@Entity()\n@Index('ix_transaction_0', (transaction: Transaction) => [transaction.domain, transaction.bankFingerprint], {\n unique: true,\n where: '\"deleted_at\" IS NULL AND \"bank_fingerprint\" IS NOT NULL'\n})\n@Index('ix_transaction_1', (transaction: Transaction) => [\n transaction.domain,\n transaction.bankAccount,\n transaction.transactionDate\n])\n@Index('ix_transaction_2', (transaction: Transaction) => [\n transaction.domain,\n transaction.category,\n transaction.year,\n transaction.month\n])\n@Index('ix_transaction_3', (transaction: Transaction) => [transaction.domain, transaction.transactionDate])\nexport class Transaction {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the transaction' })\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number for optimistic locking' })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain in which this transaction belongs' })\n domain?: Domain\n\n @RelationId((transaction: Transaction) => transaction.domain)\n domainId?: string\n\n @Column({ default: TransactionCategory.CONFIRMED })\n @Field(type => TransactionCategory, { description: 'Confirmed - on the bank account' })\n category: TransactionCategory\n\n @Column({ default: CashFlowType.INCOME })\n @Field(type => CashFlowType, { description: 'Money in or money out' })\n type: CashFlowType\n\n @ManyToOne(type => BankAccount, { nullable: true })\n @Field(type => BankAccount, { nullable: true, description: 'The account the money moved in or out of' })\n bankAccount?: BankAccount\n\n @RelationId((transaction: Transaction) => transaction.bankAccount)\n bankAccountId?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description:\n \"YYYY-MM-DD - the day in the account's time zone\"\n })\n transactionDate?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Bank timestamp with UTC offset; empty when only a date is known' })\n transactionAt?: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Year of the transaction date' })\n year: number\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Month of the transaction date' })\n month: number\n\n @Column(moneyColumn())\n @Field(type => Float, { description: 'Amount, in the currency' })\n amount: number\n\n @Column({ default: 'KRW' })\n @Field({ description: 'ISO 4217 code - the currency of the account' })\n currency: string\n\n @Column(moneyColumn({ nullable: true, default: null }))\n @Field(type => Float, {\n nullable: true,\n description: 'Account balance after this transaction, as the bank statement says'\n })\n balance?: number\n\n @ManyToOne(type => Account, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Account, { nullable: true, description: 'The account subject it is booked to' })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What a person wrote about it' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The classifying word of the ledger it was kept in' })\n ledgerCategory?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The counterparty name as a person wrote it' })\n counterpartyName?: string\n\n @ManyToOne(type => Counterparty, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Counterparty, {\n nullable: true,\n description: 'The registered counterparty, when the name is one the domain knows'\n })\n counterparty?: Counterparty\n\n @RelationId((transaction: Transaction) => transaction.counterparty)\n counterpartyId?: string\n\n @Column({ default: TransactionSource.MANUAL })\n @Field(type => TransactionSource, { description: 'Where the facts of the line come from' })\n source: TransactionSource\n\n @ManyToOne(type => BankStatement, { nullable: true, onDelete: 'RESTRICT' })\n @Field(type => BankStatement, { nullable: true, description: 'The bank statement file the line was read from' })\n bankStatement?: BankStatement\n\n @RelationId((transaction: Transaction) => transaction.bankStatement)\n bankStatementId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The file the line was read from, for lines from before statements were kept' })\n sourceFile?: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The row of the source file' })\n sourceRow?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'Chronological order within the source statement' })\n bankSequence?: number\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'What makes the bank line itself unique in the domain - the same line read twice is refused'\n })\n bankFingerprint?: string\n\n @Column({ type: 'simple-json', nullable: true })\n bankReconciliationBefore?: Record<string, any>\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Description as the bank wrote it' })\n bankDescription?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Kind of the line as the bank wrote it' })\n bankKind?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Counterparty name as the bank wrote it' })\n bankCounterpartyName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's account number as the bank wrote it\" })\n bankCounterpartyAccount?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's bank as the bank wrote it\" })\n bankCounterpartyBank?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Memo as the bank wrote it' })\n bankMemo?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @OneToMany(type => Payment, payment => payment.transaction)\n @Field(type => [Payment], { nullable: true, description: 'What this transaction paid' })\n payments?: Payment[]\n\n @OneToMany(type => AccountingDocument, document => document.transaction)\n @Field(type => [AccountingDocument], { nullable: true, description: 'Documents linked to this transaction' })\n documents?: AccountingDocument[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was created' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was last updated' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When it was deleted - financial rows are kept, not erased' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created the transaction record' })\n creator?: User\n\n @RelationId((transaction: Transaction) => transaction.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated the transaction record' })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.updater)\n updaterId?: string\n}\n"]}
|