@things-factory/accounting 10.1.233 → 10.1.234

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.
Files changed (90) hide show
  1. package/dist-client/tsconfig.tsbuildinfo +1 -1
  2. package/dist-server/service/account/account-mutation.js +7 -53
  3. package/dist-server/service/account/account-mutation.js.map +1 -1
  4. package/dist-server/service/account/account-service.d.ts +15 -0
  5. package/dist-server/service/account/account-service.js +40 -0
  6. package/dist-server/service/account/account-service.js.map +1 -1
  7. package/dist-server/service/bank-account/bank-account-history.d.ts +7 -0
  8. package/dist-server/service/bank-account/bank-account-history.js +29 -0
  9. package/dist-server/service/bank-account/bank-account-history.js.map +1 -1
  10. package/dist-server/service/bank-account/bank-account-mutation.js +4 -4
  11. package/dist-server/service/bank-account/bank-account-mutation.js.map +1 -1
  12. package/dist-server/service/bank-account/bank-account-query.d.ts +3 -0
  13. package/dist-server/service/bank-account/bank-account-query.js +23 -0
  14. package/dist-server/service/bank-account/bank-account-query.js.map +1 -1
  15. package/dist-server/service/bank-account/bank-account-service.d.ts +27 -0
  16. package/dist-server/service/bank-account/bank-account-service.js +55 -0
  17. package/dist-server/service/bank-account/bank-account-service.js.map +1 -1
  18. package/dist-server/service/bank-account/bank-account-type.d.ts +9 -0
  19. package/dist-server/service/bank-account/bank-account-type.js +33 -0
  20. package/dist-server/service/bank-account/bank-account-type.js.map +1 -1
  21. package/dist-server/service/bank-account/bank-account.d.ts +7 -0
  22. package/dist-server/service/bank-account/bank-account.js +29 -0
  23. package/dist-server/service/bank-account/bank-account.js.map +1 -1
  24. package/dist-server/service/bank-account/card-query.d.ts +24 -0
  25. package/dist-server/service/bank-account/card-query.js +140 -0
  26. package/dist-server/service/bank-account/card-query.js.map +1 -0
  27. package/dist-server/service/bank-account/card-rules.d.ts +21 -0
  28. package/dist-server/service/bank-account/card-rules.js +30 -0
  29. package/dist-server/service/bank-account/card-rules.js.map +1 -0
  30. package/dist-server/service/bank-account/card-summary.d.ts +29 -0
  31. package/dist-server/service/bank-account/card-summary.js +42 -0
  32. package/dist-server/service/bank-account/card-summary.js.map +1 -0
  33. package/dist-server/service/bank-account/index.d.ts +2 -1
  34. package/dist-server/service/bank-account/index.js +2 -1
  35. package/dist-server/service/bank-account/index.js.map +1 -1
  36. package/dist-server/service/expenditure-request/card-charge-query.d.ts +10 -0
  37. package/dist-server/service/expenditure-request/card-charge-query.js +54 -0
  38. package/dist-server/service/expenditure-request/card-charge-query.js.map +1 -0
  39. package/dist-server/service/expenditure-request/expenditure-request-item.d.ts +4 -0
  40. package/dist-server/service/expenditure-request/expenditure-request-item.js +19 -1
  41. package/dist-server/service/expenditure-request/expenditure-request-item.js.map +1 -1
  42. package/dist-server/service/expenditure-request/expenditure-request-mutation.js +2 -1
  43. package/dist-server/service/expenditure-request/expenditure-request-mutation.js.map +1 -1
  44. package/dist-server/service/expenditure-request/expenditure-request-rules.d.ts +26 -2
  45. package/dist-server/service/expenditure-request/expenditure-request-rules.js +19 -2
  46. package/dist-server/service/expenditure-request/expenditure-request-rules.js.map +1 -1
  47. package/dist-server/service/expenditure-request/expenditure-request-service.d.ts +6 -0
  48. package/dist-server/service/expenditure-request/expenditure-request-service.js +35 -1
  49. package/dist-server/service/expenditure-request/expenditure-request-service.js.map +1 -1
  50. package/dist-server/service/expenditure-request/expenditure-request-type.d.ts +2 -0
  51. package/dist-server/service/expenditure-request/expenditure-request-type.js +8 -0
  52. package/dist-server/service/expenditure-request/expenditure-request-type.js.map +1 -1
  53. package/dist-server/service/expenditure-request/index.d.ts +2 -1
  54. package/dist-server/service/expenditure-request/index.js +2 -1
  55. package/dist-server/service/expenditure-request/index.js.map +1 -1
  56. package/dist-server/service/index.d.ts +4 -1
  57. package/dist-server/service/index.js +3 -0
  58. package/dist-server/service/index.js.map +1 -1
  59. package/dist-server/service/payment/card-bill-target.d.ts +2 -0
  60. package/dist-server/service/payment/card-bill-target.js +37 -0
  61. package/dist-server/service/payment/card-bill-target.js.map +1 -0
  62. package/dist-server/service/payment/index.d.ts +1 -0
  63. package/dist-server/service/payment/index.js +1 -0
  64. package/dist-server/service/payment/index.js.map +1 -1
  65. package/dist-server/service/recurring-cash-item/recurring-cash-item-query.d.ts +2 -0
  66. package/dist-server/service/recurring-cash-item/recurring-cash-item-query.js +14 -0
  67. package/dist-server/service/recurring-cash-item/recurring-cash-item-query.js.map +1 -1
  68. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.d.ts +5 -0
  69. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js +22 -1
  70. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js.map +1 -1
  71. package/dist-server/service/recurring-cash-item/recurring-schedule.d.ts +5 -1
  72. package/dist-server/service/recurring-cash-item/recurring-schedule.js +10 -2
  73. package/dist-server/service/recurring-cash-item/recurring-schedule.js.map +1 -1
  74. package/dist-server/service/transaction/transaction-query.d.ts +5 -0
  75. package/dist-server/service/transaction/transaction-query.js +3 -3
  76. package/dist-server/service/transaction/transaction-query.js.map +1 -1
  77. package/dist-server/service/transaction/transaction-service.d.ts +5 -1
  78. package/dist-server/service/transaction/transaction-service.js +15 -10
  79. package/dist-server/service/transaction/transaction-service.js.map +1 -1
  80. package/dist-server/service/transaction/transaction.d.ts +5 -3
  81. package/dist-server/service/transaction/transaction.js +6 -4
  82. package/dist-server/service/transaction/transaction.js.map +1 -1
  83. package/dist-server/tsconfig.tsbuildinfo +1 -1
  84. package/package.json +11 -10
  85. package/translations/en.json +30 -1
  86. package/translations/es.json +30 -1
  87. package/translations/ja.json +30 -1
  88. package/translations/ko.json +30 -1
  89. package/translations/ms.json +30 -1
  90. package/translations/zh.json +30 -1
@@ -1 +1 @@
1
- {"version":3,"file":"expenditure-request-service.js","sourceRoot":"","sources":["../../../server/service/expenditure-request/expenditure-request-service.ts"],"names":[],"mappings":";;;AAwEA,gCAKC;AA8ID,kCAqDC;AAmBD,sCAiFC;AAGD,0CAUC;AAGD,sCAOC;AAMD,0BAqBC;AAGD,oC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,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACvH,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;QAAE,MAAM,IAAI,eAAO,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,0BAA0B,CAAC,CAAA;IACnI,MAAM,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;IAC/D,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { EntityManager, In, LessThan } from 'typeorm'\n\nimport { Refusal } from '@things-factory/shell'\nimport { accountKey, Counterparty, CounterpartyBankAccount } from '@things-factory/biz-base'\nimport { Employee } from '@things-factory/organization'\nimport { Category, TaxInvoice } from '@things-factory/tax-invoice'\nimport { abort, activityNamed, approvalLineRefusal, approvalLineStanding, issue } from '@things-factory/worklist'\nimport { Attachment, createAttachment, deleteAttachment } from '@things-factory/attachment-base'\n\nimport { activityOfKind } from '../../activities/expenditure-activity-names'\nimport { Account } from '../account/account'\nimport { accountMatcher } from '../account/account-match'\nimport { BankAccount } from '../bank-account/bank-account'\nimport { CashFlowType } from '../cash-flow-type'\nimport { Payment } from '../payment/payment'\nimport { TAX_INVOICE_TARGET } from '../payment/document-targets'\nimport { paidOfTarget } from '../payment/payment-currency'\nimport { savePayments } from '../payment/payment-service'\nimport { Transaction, TransactionCategory, TransactionSource } from '../transaction/transaction'\nimport { saveTransactions } from '../transaction/transaction-service'\nimport { ExpenditureKind, ExpenditureRequest, ExpenditureRequestStatus } from './expenditure-request'\nimport { ExpenditurePaymentMethod, ExpenditureRequestItem } from './expenditure-request-item'\nimport { EXPENDITURE_TARGET, paymentStatesOf, type PaymentState } from './expenditure-payment-state'\nimport {\n canEdit,\n dayOf,\n isPayable,\n monthOf,\n payeeAccountDrift,\n requestForLine,\n submitRefusal,\n totalsOf,\n type RequestKind,\n type RequestStatus\n} from './expenditure-request-rules'\n\nexport const RECEIPT_REF_TYPE = 'ExpenditureRequestItem'\n\nconst won = (value: number) => `${Math.round(value || 0).toLocaleString()}원`\nconst KINDS = Object.values(ExpenditureKind) as string[]\nconst METHODS = Object.values(ExpenditurePaymentMethod) as string[]\n\nexport interface RequestHead {\n id?: string\n kind?: string\n title?: string\n month?: string\n dueDate?: string\n counterparty?: { id: string } | null\n payeeAccount?: { id: string } | null\n notes?: string\n}\n\nexport interface ItemPatch {\n id?: string\n cuFlag?: string\n spentDate?: string\n category?: string\n account?: { id: string } | null\n merchant?: string\n description?: string\n amount?: number\n vatAmount?: number\n paymentMethod?: string\n taxInvoice?: { id: string } | null\n}\n\n/** A request somebody is judging (or that is decided) - it changes only after it is withdrawn. */\nexport const lockedRequest = (status: string) =>\n new Refusal('expenditure-locked', { status: String(status).toLowerCase() }, `a ${String(status).toLowerCase()} request cannot be changed - withdraw it first`)\n\n/** The request of this domain, refusing one that is not the caller's own. */\nexport async function ownRequest(tx: EntityManager, id: string, domain: { id: string }, user: { id: string }): Promise<ExpenditureRequest> {\n const request = await tx.getRepository(ExpenditureRequest).findOne({ where: { id, domain: { id: domain.id } } as any, relations: ['requester'] })\n if (!request) throw new Refusal('expenditure-not-found', {}, `expenditure request '${id}' was not found`)\n if (request.requester?.id !== user.id) throw new Refusal('expenditure-not-yours', {}, 'only the requester can change this request')\n return request\n}\n\nasync function employeeOf(tx: EntityManager, domain: { id: string }, user: { id: string }) {\n return await tx.getRepository(Employee).findOne({ where: { domain: { id: domain.id }, user: { id: user.id } } as any, relations: ['department'] })\n}\n\nasync function linesOf(tx: EntityManager, requestId: string): Promise<ExpenditureRequestItem[]> {\n return await tx.getRepository(ExpenditureRequestItem).find({ where: { request: { id: requestId } } as any, order: { spentDate: 'ASC', createdAt: 'ASC' } as any })\n}\n\nasync function refreshTotals(tx: EntityManager, request: ExpenditureRequest): Promise<ExpenditureRequest> {\n const totals = totalsOf(await linesOf(tx, request.id))\n request.totalAmount = totals.total\n request.payableAmount = totals.payable\n return await tx.getRepository(ExpenditureRequest).save(request)\n}\n\nasync function inDomain<T>(tx: EntityManager, entity: new () => T, domain: { id: string }, ref: { id: string } | null | undefined, field: string): Promise<T | null> {\n if (!ref?.id) return null\n const row = await tx.getRepository(entity).findOne({ where: { domain: { id: domain.id }, id: ref.id } as any })\n if (!row) throw new Refusal('expenditure-reference-not-found', { field }, `${field} was not found - reload and try again`)\n return row\n}\n\n/** The counterparty and the account of it a counterparty payment names - the account must be that counterparty's. */\nasync function payeeOf(tx: EntityManager, domain: { id: string }, head: RequestHead, current?: ExpenditureRequest) {\n const counterparty = 'counterparty' in head ? await inDomain(tx, Counterparty, domain, head.counterparty, 'counterparty') : undefined\n const account = 'payeeAccount' in head ? await inDomain(tx, CounterpartyBankAccount, domain, head.payeeAccount, 'payeeAccount') : undefined\n const counterpartyId = counterparty === undefined ? current?.counterpartyId : counterparty?.id\n if (account && account.counterpartyId !== counterpartyId)\n throw new Refusal('expenditure-account-not-of-payee', {}, \"the account is not the counterparty's - choose one of its accounts\")\n return { counterparty, account }\n}\n\n/** Apply line patches to a request - checks each line's references and the tax invoice it cites. */\n/**\n * What the caller may cite. A tax invoice is the tax-invoice ledger's (ADR-0139): `accounting-self` writes the\n * caller's own request, and does not open someone else's ledger by naming a row of it.\n */\nexport interface Citing {\n taxInvoices: boolean\n /** Bulk preparation refuses partial/complete payments and amended evidence for individual review. */\n unpaidInvoicesOnly?: boolean\n}\n\nasync function saveItems(tx: EntityManager, domain: { id: string }, user: any, request: ExpenditureRequest, patches: ItemPatch[], citing: Citing) {\n const repo = tx.getRepository(ExpenditureRequestItem)\n\n const deletes = patches.filter(one => one.cuFlag === '-' && one.id).map(one => one.id!)\n if (deletes.length) {\n const own = await repo.find({ where: { request: { id: request.id }, id: In(deletes) } as any })\n if (own.length !== new Set(deletes).size) throw new Refusal('expenditure-line-not-found', {}, 'a line was not found - reload and try again')\n await repo.softDelete({ id: In(deletes) })\n }\n\n const writes = patches.filter(one => one.cuFlag !== '-')\n const accounts = writes.some(one => !('account' in one) && (one.category || one.description))\n ? await tx.getRepository(Account).find({ where: { domain: { id: domain.id }, active: true } as any })\n : []\n const match = accountMatcher(accounts)\n\n for (const patch of writes) {\n const isNew = !patch.id || patch.cuFlag === '+'\n const current = isNew ? undefined : await repo.findOne({ where: { request: { id: request.id }, id: patch.id } as any })\n if (!isNew && !current) throw new Refusal('expenditure-line-not-found', {}, 'a line was not found - reload and try again')\n\n const row: Record<string, any> = {}\n if ('spentDate' in patch) {\n row.spentDate = patch.spentDate ? dayOf(patch.spentDate) : null\n if (patch.spentDate && !row.spentDate) throw new Refusal('expenditure-line-day-invalid', { value: String(patch.spentDate) }, `'${patch.spentDate}' is not a day (use YYYY-MM-DD)`)\n }\n for (const field of ['category', 'merchant', 'description'] as const) if (field in patch) row[field] = patch[field]?.trim() || null\n if ('amount' in patch) row.amount = Number(patch.amount) || 0\n if ('vatAmount' in patch) row.vatAmount = patch.vatAmount === null || patch.vatAmount === undefined ? null : Number(patch.vatAmount)\n if ('paymentMethod' in patch && patch.paymentMethod) {\n if (!METHODS.includes(patch.paymentMethod)) throw new Refusal('expenditure-line-method-invalid', { value: patch.paymentMethod }, `'${patch.paymentMethod}' is not a way to pay`)\n row.paymentMethod = patch.paymentMethod\n } else if (isNew) row.paymentMethod = request.kind === ExpenditureKind.VENDOR ? ExpenditurePaymentMethod.TRANSFER : ExpenditurePaymentMethod.PERSONAL_CARD\n\n if ('account' in patch) row.account = await inDomain(tx, Account, domain, patch.account, 'account')\n else {\n /* A line that names no account is given the one its words mean, by its category then its description (§`accountMatcher`). */\n const words = [patch.category ?? current?.category, patch.description ?? current?.description]\n const found = (isNew || 'category' in patch || 'description' in patch) && accounts.length ? match(words, CashFlowType.EXPENSE) : undefined\n if (found) row.account = found\n }\n\n if ('taxInvoice' in patch) {\n if (patch.taxInvoice?.id && !citing.taxInvoices)\n throw new Refusal('expenditure-invoice-not-readable', {}, 'citing a tax invoice needs the tax-invoice ledger')\n // Serialize citation checks on PostgreSQL; SQLite already has the request write in this transaction.\n if (patch.taxInvoice?.id && tx.connection.options.type === 'postgres') {\n await tx.getRepository(TaxInvoice).findOne({ where: { id: patch.taxInvoice.id, domain: { id: domain.id } } as any, lock: { mode: 'pessimistic_write' } })\n }\n const invoice = await inDomain(tx, TaxInvoice, domain, patch.taxInvoice, 'taxInvoice')\n if (invoice) {\n if (request.kind !== ExpenditureKind.VENDOR) throw new Refusal('expenditure-invoice-on-reimbursement', {}, 'a reimbursement cites receipts, not tax invoices')\n if (invoice.category !== Category.IMPORT) throw new Refusal('expenditure-invoice-not-purchase', {}, 'cite a purchase tax invoice')\n if (citing.unpaidInvoicesOnly) {\n const party = await tx.getRepository(Counterparty).findOne({ where: { id: request.counterpartyId, domain: { id: domain.id } } as any })\n const digits = (value: unknown) => String(value ?? '').replace(/\\D/g, '')\n if (!party || !digits(party.businessNumber) || digits(party.businessNumber) !== digits(invoice.supplierBusinessRegistrationNumber))\n throw new Refusal('expenditure-bulk-party', {}, 'The supplier must match the selected counterparty; review this invoice individually')\n const payments = await tx.getRepository(Payment).find({ where: { domain: { id: domain.id }, targetType: TAX_INVOICE_TARGET, targetId: invoice.id } as any })\n if (payments.length)\n throw new Refusal('expenditure-bulk-paid', {}, 'This invoice already has payment links; review partial or completed payments individually')\n const negatives = await tx.getRepository(TaxInvoice).find({ where: { domain: { id: domain.id }, totalAmount: LessThan(0) } as any })\n const amended = negatives.some(one => one.originalApprovalNo === invoice.approvalNo || (invoice.approvalNo && [one.remark0, one.remark1, one.remark2].some(text => text?.includes(invoice.approvalNo))))\n if (!(Number(invoice.totalAmount) > 0) || invoice.originalApprovalNo || invoice.invoiceType?.startsWith('02') || amended)\n throw new Refusal('expenditure-bulk-amended', {}, 'Review amended or non-positive invoices individually before requesting payment')\n }\n const elsewhere = await repo.find({ where: { domain: { id: domain.id }, taxInvoice: { id: invoice.id } } as any, relations: ['request'] })\n if (elsewhere.some(one => one.id !== current?.id && one.request && !one.request.deletedAt))\n throw new Refusal('expenditure-invoice-cited-twice', { issueDate: invoice.issueDate }, 'another request already pays this tax invoice')\n if (!('amount' in patch) || !(row.amount > 0)) row.amount = Number(invoice.totalAmount)\n if (!('spentDate' in patch)) row.spentDate = invoice.issueDate\n }\n row.taxInvoice = invoice\n }\n\n /* What a line says of its money holds whenever it is written, not only when it is submitted. */\n const amount = 'amount' in row ? row.amount : Number(current?.amount ?? 0)\n if ('amount' in row && !(row.amount > 0)) throw new Refusal('expenditure-line-amount-missing', {}, 'every line needs an amount above zero')\n const vat = 'vatAmount' in row ? row.vatAmount : current?.vatAmount\n if (vat && amount && Number(vat) > amount) throw new Refusal('expenditure-line-vat-over-amount', {}, 'the VAT is more than the amount')\n\n /* A line that cites an invoice asks no more than the invoice - whichever of the two changed. */\n const citedId = 'taxInvoice' in patch ? row.taxInvoice?.id : current?.taxInvoiceId\n if (citedId && ('amount' in row || 'taxInvoice' in patch)) {\n const invoice = row.taxInvoice ?? (await tx.getRepository(TaxInvoice).findOne({ where: { id: citedId } as any, withDeleted: true }))\n if (invoice && amount > Number(invoice.totalAmount) + 0.005)\n throw new Refusal('expenditure-line-over-invoice', { total: won(Number(invoice.totalAmount)) }, 'a line asks more than the tax invoice it cites')\n }\n\n await repo.save({ ...(current ?? { domain, request, creator: user, amount: 0 }), ...row, updater: user } as any)\n }\n}\n\n/**\n * Save a request and its lines in one go - the head, then the lines. A new request belongs to the caller; an existing\n * one only to its requester, and only while it is editable.\n */\nexport async function saveRequest(tx: EntityManager, domain: any, user: any, head: RequestHead, items: ItemPatch[], citing: Citing): Promise<ExpenditureRequest> {\n const repo = tx.getRepository(ExpenditureRequest)\n\n let request: ExpenditureRequest\n if (head.id) {\n request = await ownRequest(tx, head.id, domain, user)\n if (!canEdit(request.status as RequestStatus)) throw lockedRequest(request.status)\n if (head.kind && head.kind !== request.kind) throw new Refusal('expenditure-kind-fixed', {}, 'a request keeps the kind it was written as')\n } else {\n if (!head.kind || !KINDS.includes(head.kind)) throw new Refusal('expenditure-kind-missing', {}, 'say whether it pays a counterparty or pays an employee back')\n const employee = await employeeOf(tx, domain, user)\n request = repo.create({\n domain,\n kind: head.kind as ExpenditureKind,\n requester: user,\n department: employee?.department ?? null,\n status: ExpenditureRequestStatus.DRAFT,\n currency: 'KRW',\n totalAmount: 0,\n payableAmount: 0,\n creator: user\n } as any) as unknown as ExpenditureRequest\n }\n\n const reimbursement = request.kind === ExpenditureKind.REIMBURSEMENT\n if ('month' in head || (!head.id && reimbursement)) {\n const month = monthOf(head.month)\n if (reimbursement && !month) throw new Refusal('expenditure-month-invalid', { value: String(head.month ?? '') }, `month: '${head.month ?? ''}' is not a month (use YYYY-MM)`)\n if (head.month && !month) throw new Refusal('expenditure-month-invalid', { value: String(head.month) }, `month: '${head.month}' is not a month (use YYYY-MM)`)\n request.month = month ?? null\n }\n if ('dueDate' in head) {\n request.dueDate = head.dueDate ? dayOf(head.dueDate) ?? null : null\n if (head.dueDate && !request.dueDate) throw new Refusal('expenditure-due-date-invalid', { value: String(head.dueDate) }, `'${head.dueDate}' is not a day (use YYYY-MM-DD)`)\n }\n if (reimbursement && ('counterparty' in head || 'payeeAccount' in head)) throw new Refusal('expenditure-reimbursement-pays-requester', {}, 'a reimbursement pays the employee who wrote it')\n const { counterparty, account } = await payeeOf(tx, domain, head, head.id ? request : undefined)\n if (counterparty !== undefined) request.counterparty = counterparty\n if (account !== undefined) request.payeeAccount = account\n /* A changed counterparty drops the account chosen of the former one. */\n if (counterparty !== undefined && account === undefined && request.payeeAccountId) {\n const kept = await tx.getRepository(CounterpartyBankAccount).findOne({ where: { id: request.payeeAccountId } as any })\n if (kept?.counterpartyId !== counterparty?.id) request.payeeAccount = null\n }\n\n if (head.title?.trim()) request.title = head.title.trim()\n else if (!request.title) request.title = reimbursement ? `${request.month} 경비` : `${counterparty?.name ?? ''} 지급`.trim()\n if (head.notes !== undefined) request.notes = head.notes\n request.updater = user\n request = await repo.save(request)\n\n if (items?.length) await saveItems(tx, domain, user, request, items, citing)\n return await refreshTotals(tx, request)\n}\n\n/** The payee's account as approvers will see it - written on the request when it is submitted (ADR-0135 §5). */\nasync function payeeSnapshot(tx: EntityManager, domain: { id: string }, request: ExpenditureRequest, user: any) {\n if (request.kind === ExpenditureKind.VENDOR) {\n const account = await tx.getRepository(CounterpartyBankAccount).findOne({ where: { domain: { id: domain.id }, id: request.payeeAccountId } as any })\n if (!account || account.counterpartyId !== request.counterpartyId)\n throw new Refusal('expenditure-payee-account-missing', {}, \"choose the counterparty's account to pay into\")\n return { payeeBankName: account.bankName ?? null, payeeAccountNumber: account.accountNumber, payeeHolderName: account.holderName ?? null }\n }\n const employee = await employeeOf(tx, domain, user)\n return {\n payeeBankName: employee?.bankName ?? null,\n payeeAccountNumber: employee?.bankAccount ? accountKey(employee.bankAccount) || null : null,\n payeeHolderName: user.name ?? null\n }\n}\n\n/** Put a request up for approval. The approval carries what the approver needs to judge it. */\nexport async function submitRequest(tx: EntityManager, domain: any, user: any, id: string, context: ResolverContext): Promise<ExpenditureRequest> {\n const request = await ownRequest(tx, id, domain, user)\n const items = await linesOf(tx, request.id)\n\n const refusal = submitRefusal(\n {\n kind: request.kind as RequestKind,\n status: request.status as RequestStatus,\n month: request.month,\n dueDate: request.dueDate,\n counterpartyId: request.counterpartyId,\n payeeAccountId: request.payeeAccountId\n },\n items\n )\n if (refusal) throw refusal\n Object.assign(request, await payeeSnapshot(tx, domain, request, user))\n\n const form = activityOfKind(request.kind)\n const carrier = await activityNamed(form, context)\n if (!carrier) throw new Refusal('expenditure-approval-not-installed', { form }, `the approval '${form}' is not installed in this domain`)\n const line = await approvalLineStanding(carrier, context)\n if (line.refusal) throw approvalLineRefusal(line.refusal)\n\n const totals = totalsOf(items)\n const who = user.name || user.email || ''\n const vendor = request.kind === ExpenditureKind.VENDOR\n const payee = vendor ? (await tx.getRepository(Counterparty).findOne({ where: { id: request.counterpartyId } as any }))?.name ?? '' : who\n const account = [request.payeeBankName, request.payeeAccountNumber, request.payeeHolderName].filter(Boolean).join(' ')\n\n const instance = await issue(\n {\n name: vendor ? `지출결의 ${payee} ${request.title}` : `경비 청구 ${who} ${request.month}`,\n description: `${won(totals.total)} · ${totals.count}건${totals.payable !== totals.total ? ` (지급할 금액 ${won(totals.payable)})` : ''}`,\n activityId: carrier.id,\n approvalLine: carrier.approvalLine,\n input: {\n requestId: request.id,\n month: request.month ?? request.dueDate?.slice(0, 7) ?? '',\n requester: who,\n payee,\n /*\n * Who is paid, as a reference: the approval screens draw a value with a __typename as a link to\n * its 360 (worklist decision-content) - the counterparty for a vendor payment, the employee for\n * a claim. `payee` and `requester` stay as the words the search keys find.\n */\n paidTo: vendor\n ? { __typename: 'Counterparty', id: request.counterpartyId, name: payee }\n : { __typename: 'User', id: user.id, name: who },\n /* The request itself, as a reference: the approval card opens it - the lines and their receipts and papers. */\n request: { __typename: 'ExpenditureRequest', id: request.id, name: request.title },\n headline: vendor\n ? `${payee} · ${request.title} ${won(totals.payable)}${request.dueDate ? ` — ${request.dueDate} 지급` : ''}`\n : `${who} · ${request.month} 경비 ${won(totals.total)} (${totals.count}건)`,\n total: totals.total,\n payable: totals.payable,\n account,\n lines: items.map(item =>\n `${item.spentDate ?? ''} ${item.category ?? ''} ${item.merchant ?? ''} ${won(item.amount)}${item.paymentMethod === ExpenditurePaymentMethod.CORPORATE_CARD ? ' (법인카드)' : ''}${item.taxInvoiceId ? ' (세금계산서)' : ''} — ${item.description ?? ''}`\n .replace(/\\s+/g, ' ')\n .trim()\n ),\n consequence:\n totals.payable > 0\n ? `승인하면 ${won(totals.payable)}을 ${payee}에게 지급할 대상이 됩니다${account ? ` (${account})` : ''}`\n : '법인카드 사용분만 있어 지급할 금액은 없습니다'\n },\n threadsMin: 1,\n threadsMax: 1,\n requireApproval: true\n } as any,\n context\n )\n\n request.status = ExpenditureRequestStatus.SUBMITTED\n request.activityInstanceId = instance.id\n request.submittedAt = new Date()\n request.decidedAt = null\n request.decidedBy = null\n request.updater = user\n return await tx.getRepository(ExpenditureRequest).save(request)\n}\n\n/** Take a request back from its approvers. worklist's abort does not call the activity back, so the request is set here. */\nexport async function withdrawRequest(tx: EntityManager, domain: any, user: any, id: string, context: ResolverContext): Promise<ExpenditureRequest> {\n const request = await ownRequest(tx, id, domain, user)\n if (request.status !== ExpenditureRequestStatus.SUBMITTED)\n throw new Refusal('expenditure-not-submitted', { status: String(request.status).toLowerCase() }, 'only a request waiting on approvers can be withdrawn')\n\n if (request.activityInstanceId) await abort({ id: request.activityInstanceId, reason: '작성자가 회수함' }, context)\n\n request.status = ExpenditureRequestStatus.WITHDRAWN\n request.updater = user\n return await tx.getRepository(ExpenditureRequest).save(request)\n}\n\n/** Delete one of the caller's requests that nobody is judging - with its lines. */\nexport async function deleteRequest(tx: EntityManager, domain: any, user: any, id: string): Promise<boolean> {\n const request = await ownRequest(tx, id, domain, user)\n if (!canEdit(request.status as RequestStatus))\n throw new Refusal('expenditure-cannot-delete', { status: request.status.toLowerCase() }, `a ${request.status.toLowerCase()} request cannot be deleted`)\n await tx.getRepository(ExpenditureRequestItem).softDelete({ request: { id } } as any)\n await tx.getRepository(ExpenditureRequest).softDelete({ id })\n return true\n}\n\n/**\n * Add one line from the phone. It joins the caller's editable reimbursement of that month (§`requestForLine`), or\n * starts one. The receipt photos and files picked with it are attached to the line.\n */\nexport async function addLine(tx: EntityManager, domain: any, user: any, line: ItemPatch & { month?: string; files?: any[] }, context: ResolverContext): Promise<ExpenditureRequest> {\n const spentDate = dayOf(line.spentDate)\n if (!spentDate) throw new Refusal('expenditure-line-day-missing', {}, 'every line needs its day')\n const month = monthOf(line.month) ?? spentDate.slice(0, 7)\n\n const mine = await tx.getRepository(ExpenditureRequest).find({\n where: { domain: { id: domain.id }, requester: { id: user.id }, kind: ExpenditureKind.REIMBURSEMENT, month } as any\n })\n const joinId = requestForLine(\n mine.map(one => ({ id: one.id, status: one.status as RequestStatus, month: one.month, updatedAt: one.updatedAt })),\n month\n )\n\n const { files, month: _month, ...fields } = line\n const request = await saveRequest(tx, domain, user, joinId ? { id: joinId } : { kind: ExpenditureKind.REIMBURSEMENT, month }, [{ ...fields, spentDate, cuFlag: '+' }], { taxInvoices: false })\n\n if (files?.length) {\n const [latest] = await tx.getRepository(ExpenditureRequestItem).find({ where: { request: { id: request.id } } as any, order: { createdAt: 'DESC' } as any, take: 1 })\n if (latest) for (const file of files) await attachFile(latest.id, file, context)\n }\n return request\n}\n\n/** A line of the caller's own request, while the request can still be changed. */\nexport async function editableLine(tx: EntityManager, domain: any, user: any, itemId: string): Promise<ExpenditureRequestItem> {\n const item = await tx.getRepository(ExpenditureRequestItem).findOne({ where: { id: itemId, domain: { id: domain.id } } as any, relations: ['request'] })\n if (!item?.request) throw new Refusal('expenditure-line-not-found', {}, 'a line was not found - reload and try again')\n const request = await ownRequest(tx, item.request.id, domain, user)\n if (!canEdit(request.status as RequestStatus)) throw lockedRequest(request.status)\n return item\n}\n\n/**\n * Attach files to a line and take others off it, in one go - only the requester, only while editable. A file taken\n * off is deleted: what approvers judge is what the line has when it is submitted.\n */\nexport async function saveLineFiles(\n tx: EntityManager,\n domain: any,\n user: any,\n itemId: string,\n change: { attach?: any[]; remove?: string[] },\n context: ResolverContext\n): Promise<ExpenditureRequestItem> {\n const item = await editableLine(tx, domain, user, itemId)\n\n const remove = [...new Set(change.remove ?? [])]\n if (remove.length) {\n const onLine = await tx.getRepository(Attachment).find({ where: { domain: { id: domain.id }, refType: RECEIPT_REF_TYPE, refBy: item.id, id: In(remove) } as any })\n if (onLine.length !== remove.length) throw new Refusal('expenditure-file-not-on-line', {}, 'a file is not on this line - reload and try again')\n for (const one of onLine) await deleteAttachment(null, { id: one.id }, context)\n }\n for (const file of change.attach ?? []) await attachFile(item.id, file, context)\n return item\n}\n\nasync function attachFile(itemId: string, file: any, context: ResolverContext) {\n await createAttachment(null, { attachment: { file, refType: RECEIPT_REF_TYPE, refBy: itemId, category: 'receipt' } } as any, context)\n}\n\n/** Approved requests with their lines and how far each is paid - what the payment queue and payments are made of. */\nexport async function approvedWithStates(tx: EntityManager, domain: { id: string }, ids?: string[]) {\n const requests = await tx.getRepository(ExpenditureRequest).find({\n where: { domain: { id: domain.id }, status: ExpenditureRequestStatus.APPROVED, ...(ids ? { id: In(ids) } : {}) } as any,\n relations: ['items', 'requester', 'counterparty', 'payeeAccount']\n })\n for (const request of requests) request.items = (request.items ?? []).filter(item => !item.deletedAt)\n const states = await paymentStatesOf(tx, domain, requests as any)\n return { requests, states }\n}\n\n/** Whether the account approvers saw is still the one on file (§`payeeAccountDrift`); `missing` when none was written. */\nexport async function driftOf(tx: EntityManager, request: ExpenditureRequest): Promise<string | undefined> {\n if (!request.payeeAccountNumber) return 'missing'\n if (request.kind !== ExpenditureKind.VENDOR) return undefined\n const current = request.payeeAccountId\n ? await tx.getRepository(CounterpartyBankAccount).findOne({ where: { id: request.payeeAccountId } as any, withDeleted: true })\n : null\n return payeeAccountDrift(request, current, accountKey)\n}\n\n/**\n * Put a part of a withdrawal on a request (ADR-0135 §2-5). A payable line that cites a tax invoice is paid on that\n * invoice; the rest on the request itself. A link the line already has to the same target is raised, not doubled.\n */\nasync function putOnLine(tx: EntityManager, domain: { id: string }, user: any, request: ExpenditureRequest, state: PaymentState, lineId: string, amount: number) {\n if (amount > state.outstanding + 0.005)\n throw new Refusal('expenditure-paid-over', { title: request.title }, `more is put on ${request.title} than it asks`)\n\n const existing = await tx.getRepository(Payment).find({ where: { domain: { id: domain.id }, transaction: { id: lineId } } as any })\n const patchFor = (targetType: string, targetId: string, put: number) => {\n const twin = existing.find(one => one.targetType === targetType && one.targetId === targetId)\n return twin ? { id: twin.id, cuFlag: 'M', amount: Number(twin.amount) + put } : { cuFlag: '+', transaction: { id: lineId }, targetType, targetId, amount: put }\n }\n\n let remaining = amount\n const patches: any[] = []\n const cited = (request.items ?? []).filter(item => isPayable(item) && item.taxInvoiceId)\n if (cited.length) {\n const onInvoices = await tx.getRepository(Payment).find({\n where: { domain: { id: domain.id }, targetType: TAX_INVOICE_TARGET, targetId: In(cited.map(item => item.taxInvoiceId)) } as any\n })\n for (const item of cited) {\n const paid = onInvoices.filter(one => one.targetId === item.taxInvoiceId).reduce((sum, one) => sum + paidOfTarget(one), 0)\n const put = Math.min(remaining, Math.max(0, Number(item.amount) - paid))\n if (put > 0) patches.push(patchFor(TAX_INVOICE_TARGET, item.taxInvoiceId!, put))\n remaining -= put\n }\n }\n const direct = Math.min(remaining, Math.max(0, state.settleable - state.settled))\n if (direct > 0) patches.push(patchFor(EXPENDITURE_TARGET, request.id, direct))\n remaining -= direct\n if (remaining > 0.005) throw new Refusal('expenditure-paid-over', { title: request.title }, `more is put on ${request.title} than it asks`)\n\n await savePayments(tx, domain, user, patches)\n}\n\nexport interface PaymentRecord {\n paidDate: string\n bankAccount?: { id: string } | null\n}\n\n/**\n * Pay approved requests - finance transferred the money at the bank and records it. Each request gets a withdrawal of\n * what it still asks, written as a person's line; the next bank statement import matches it, and then the payment is\n * reconciled (§`bank-reconcile`).\n */\nexport async function payRequests(tx: EntityManager, domain: any, user: any, ids: string[], record: PaymentRecord): Promise<ExpenditureRequest[]> {\n const paidDate = dayOf(record.paidDate)\n if (!paidDate) throw new Refusal('expenditure-paid-date-missing', {}, 'paidDate: the day the money went out')\n const bankAccount = await inDomain(tx, BankAccount, domain, record.bankAccount, 'bankAccount')\n\n const { requests, states } = await approvedWithStates(tx, domain, [...new Set(ids)])\n if (requests.length !== new Set(ids).size) {\n const found = await tx.getRepository(ExpenditureRequest).find({ where: { domain: { id: domain.id }, id: In(ids) } as any })\n const titles = found.filter(one => one.status !== ExpenditureRequestStatus.APPROVED).map(one => one.title).join(', ')\n if (titles) throw new Refusal('expenditure-not-approved', { title: titles }, `only an approved request is paid - ${titles}`)\n throw new Refusal('expenditure-not-found', {}, 'some requests were not found - reload and try again')\n }\n\n for (const request of requests) {\n const state = states.get(request.id)!\n if (!(state.outstanding > 0)) throw new Refusal('expenditure-paid-already', { title: request.title }, `${request.title} has nothing left to pay`)\n const payee = request.kind === ExpenditureKind.VENDOR ? request.counterparty?.name : request.requester?.name\n const [line] = await saveTransactions(tx, domain, user, [\n {\n cuFlag: '+',\n category: TransactionCategory.CONFIRMED,\n source: TransactionSource.MANUAL,\n type: CashFlowType.EXPENSE,\n transactionDate: paidDate,\n amount: state.outstanding,\n description: `지출 — ${request.title}`,\n counterpartyName: payee ?? undefined,\n ...(request.counterpartyId ? { counterparty: { id: request.counterpartyId } } : {}),\n ...(bankAccount ? { bankAccount: { id: bankAccount.id } } : { currency: request.currency })\n }\n ])\n await putOnLine(tx, domain, user, request, state, line.id, state.outstanding)\n }\n return requests\n}\n\n/**\n * Pay a request with a withdrawal already in the books - a bank statement brought it in first. The part put on the\n * request is what it still asks unless a smaller amount is given.\n */\nexport async function payWithLine(tx: EntityManager, domain: any, user: any, requestId: string, transactionId: string, amount?: number | null): Promise<ExpenditureRequest> {\n const { requests, states } = await approvedWithStates(tx, domain, [requestId])\n const [request] = requests\n if (!request) {\n const found = await tx.getRepository(ExpenditureRequest).findOne({ where: { domain: { id: domain.id }, id: requestId } as any })\n if (found) throw new Refusal('expenditure-not-approved', { title: found.title }, `only an approved request is paid - ${found.title}`)\n throw new Refusal('expenditure-not-found', {}, `expenditure request '${requestId}' was not found`)\n }\n const line = await tx.getRepository(Transaction).findOne({ where: { domain: { id: domain.id }, id: transactionId, category: TransactionCategory.CONFIRMED } as any })\n if (!line) throw new Refusal('expenditure-line-gone', {}, 'the bank line was not found - reload and try again')\n\n const state = states.get(request.id)!\n const put = amount === null || amount === undefined ? Math.min(state.outstanding, Number(line.amount)) : Number(amount)\n if (!(put > 0)) throw new Refusal('expenditure-paid-already', { title: request.title }, `${request.title} has nothing left to pay`)\n await putOnLine(tx, domain, user, request, state, line.id, put)\n return request\n}\n"]}
1
+ {"version":3,"file":"expenditure-request-service.js","sourceRoot":"","sources":["../../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CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACvH,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;QAAE,MAAM,IAAI,eAAO,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,0BAA0B,CAAC,CAAA;IACnI,MAAM,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;IAC/D,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { EntityManager, In, LessThan } from 'typeorm'\n\nimport { Refusal } from '@things-factory/shell'\nimport { accountKey, Counterparty, CounterpartyBankAccount } from '@things-factory/biz-base'\nimport { Employee } from '@things-factory/organization'\nimport { Category, TaxInvoice } from '@things-factory/tax-invoice'\nimport { abort, activityNamed, approvalLineRefusal, approvalLineStanding, issue } from '@things-factory/worklist'\nimport { Attachment, createAttachment, deleteAttachment } from '@things-factory/attachment-base'\n\nimport { activityOfKind } from '../../activities/expenditure-activity-names'\nimport { Account } from '../account/account'\nimport { accountMatcher } from '../account/account-match'\nimport { AccountType, BankAccount } from '../bank-account/bank-account'\nimport { CashFlowType } from '../cash-flow-type'\nimport { Payment } from '../payment/payment'\nimport { TAX_INVOICE_TARGET } from '../payment/document-targets'\nimport { paidOfTarget } from '../payment/payment-currency'\nimport { savePayments } from '../payment/payment-service'\nimport { Transaction, TransactionCategory, TransactionSource } from '../transaction/transaction'\nimport { saveTransactions } from '../transaction/transaction-service'\nimport { ExpenditureKind, ExpenditureRequest, ExpenditureRequestStatus } from './expenditure-request'\nimport { ExpenditurePaymentMethod, ExpenditureRequestItem } from './expenditure-request-item'\nimport { EXPENDITURE_TARGET, paymentStatesOf, type PaymentState } from './expenditure-payment-state'\nimport {\n canEdit,\n dayOf,\n explainCharge,\n isPayable,\n monthOf,\n payeeAccountDrift,\n requestForLine,\n submitRefusal,\n totalsOf,\n type RequestKind,\n type RequestStatus\n} from './expenditure-request-rules'\n\nexport const RECEIPT_REF_TYPE = 'ExpenditureRequestItem'\n\nconst won = (value: number) => `${Math.round(value || 0).toLocaleString()}원`\nconst KINDS = Object.values(ExpenditureKind) as string[]\nconst METHODS = Object.values(ExpenditurePaymentMethod) as string[]\n\nexport interface RequestHead {\n id?: string\n kind?: string\n title?: string\n month?: string\n dueDate?: string\n counterparty?: { id: string } | null\n payeeAccount?: { id: string } | null\n notes?: string\n}\n\nexport interface ItemPatch {\n id?: string\n cuFlag?: string\n spentDate?: string\n category?: string\n account?: { id: string } | null\n merchant?: string\n description?: string\n amount?: number\n vatAmount?: number\n paymentMethod?: string\n taxInvoice?: { id: string } | null\n cardTransaction?: { id: string } | null\n personalUse?: boolean\n}\n\n/** A request somebody is judging (or that is decided) - it changes only after it is withdrawn. */\nexport const lockedRequest = (status: string) =>\n new Refusal('expenditure-locked', { status: String(status).toLowerCase() }, `a ${String(status).toLowerCase()} request cannot be changed - withdraw it first`)\n\n/** The request of this domain, refusing one that is not the caller's own. */\nexport async function ownRequest(tx: EntityManager, id: string, domain: { id: string }, user: { id: string }): Promise<ExpenditureRequest> {\n const request = await tx.getRepository(ExpenditureRequest).findOne({ where: { id, domain: { id: domain.id } } as any, relations: ['requester'] })\n if (!request) throw new Refusal('expenditure-not-found', {}, `expenditure request '${id}' was not found`)\n if (request.requester?.id !== user.id) throw new Refusal('expenditure-not-yours', {}, 'only the requester can change this request')\n return request\n}\n\nasync function employeeOf(tx: EntityManager, domain: { id: string }, user: { id: string }) {\n return await tx.getRepository(Employee).findOne({ where: { domain: { id: domain.id }, user: { id: user.id } } as any, relations: ['department'] })\n}\n\nasync function linesOf(tx: EntityManager, requestId: string): Promise<ExpenditureRequestItem[]> {\n return await tx.getRepository(ExpenditureRequestItem).find({ where: { request: { id: requestId } } as any, order: { spentDate: 'ASC', createdAt: 'ASC' } as any })\n}\n\nasync function refreshTotals(tx: EntityManager, request: ExpenditureRequest): Promise<ExpenditureRequest> {\n const totals = totalsOf(await linesOf(tx, request.id))\n request.totalAmount = totals.total\n request.payableAmount = totals.payable\n return await tx.getRepository(ExpenditureRequest).save(request)\n}\n\nasync function inDomain<T>(tx: EntityManager, entity: new () => T, domain: { id: string }, ref: { id: string } | null | undefined, field: string): Promise<T | null> {\n if (!ref?.id) return null\n const row = await tx.getRepository(entity).findOne({ where: { domain: { id: domain.id }, id: ref.id } as any })\n if (!row) throw new Refusal('expenditure-reference-not-found', { field }, `${field} was not found - reload and try again`)\n return row\n}\n\n/** The counterparty and the account of it a counterparty payment names - the account must be that counterparty's. */\nasync function payeeOf(tx: EntityManager, domain: { id: string }, head: RequestHead, current?: ExpenditureRequest) {\n const counterparty = 'counterparty' in head ? await inDomain(tx, Counterparty, domain, head.counterparty, 'counterparty') : undefined\n const account = 'payeeAccount' in head ? await inDomain(tx, CounterpartyBankAccount, domain, head.payeeAccount, 'payeeAccount') : undefined\n const counterpartyId = counterparty === undefined ? current?.counterpartyId : counterparty?.id\n if (account && account.counterpartyId !== counterpartyId)\n throw new Refusal('expenditure-account-not-of-payee', {}, \"the account is not the counterparty's - choose one of its accounts\")\n return { counterparty, account }\n}\n\n/** Apply line patches to a request - checks each line's references and the tax invoice it cites. */\n/**\n * What the caller may cite. A tax invoice is the tax-invoice ledger's (ADR-0139): `accounting-self` writes the\n * caller's own request, and does not open someone else's ledger by naming a row of it.\n */\nexport interface Citing {\n taxInvoices: boolean\n /** Bulk preparation refuses partial/complete payments and amended evidence for individual review. */\n unpaidInvoicesOnly?: boolean\n /** Whoever keeps the bank book explains any card's charges; a holder only their own card's (ADR-0178 결정 5). */\n anyCard?: boolean\n}\n\nasync function saveItems(tx: EntityManager, domain: { id: string }, user: any, request: ExpenditureRequest, patches: ItemPatch[], citing: Citing) {\n const repo = tx.getRepository(ExpenditureRequestItem)\n\n const deletes = patches.filter(one => one.cuFlag === '-' && one.id).map(one => one.id!)\n if (deletes.length) {\n const own = await repo.find({ where: { request: { id: request.id }, id: In(deletes) } as any })\n if (own.length !== new Set(deletes).size) throw new Refusal('expenditure-line-not-found', {}, 'a line was not found - reload and try again')\n await repo.softDelete({ id: In(deletes) })\n }\n\n const writes = patches.filter(one => one.cuFlag !== '-')\n const accounts = writes.some(one => !('account' in one) && (one.category || one.description))\n ? await tx.getRepository(Account).find({ where: { domain: { id: domain.id }, active: true } as any })\n : []\n const match = accountMatcher(accounts)\n\n for (const patch of writes) {\n const isNew = !patch.id || patch.cuFlag === '+'\n const current = isNew ? undefined : await repo.findOne({ where: { request: { id: request.id }, id: patch.id } as any })\n if (!isNew && !current) throw new Refusal('expenditure-line-not-found', {}, 'a line was not found - reload and try again')\n\n const row: Record<string, any> = {}\n if ('spentDate' in patch) {\n row.spentDate = patch.spentDate ? dayOf(patch.spentDate) : null\n if (patch.spentDate && !row.spentDate) throw new Refusal('expenditure-line-day-invalid', { value: String(patch.spentDate) }, `'${patch.spentDate}' is not a day (use YYYY-MM-DD)`)\n }\n for (const field of ['category', 'merchant', 'description'] as const) if (field in patch) row[field] = patch[field]?.trim() || null\n if ('amount' in patch) row.amount = Number(patch.amount) || 0\n if ('vatAmount' in patch) row.vatAmount = patch.vatAmount === null || patch.vatAmount === undefined ? null : Number(patch.vatAmount)\n if ('paymentMethod' in patch && patch.paymentMethod) {\n if (!METHODS.includes(patch.paymentMethod)) throw new Refusal('expenditure-line-method-invalid', { value: patch.paymentMethod }, `'${patch.paymentMethod}' is not a way to pay`)\n row.paymentMethod = patch.paymentMethod\n } else if (isNew) row.paymentMethod = request.kind === ExpenditureKind.VENDOR ? ExpenditurePaymentMethod.TRANSFER : ExpenditurePaymentMethod.PERSONAL_CARD\n\n if ('account' in patch) row.account = await inDomain(tx, Account, domain, patch.account, 'account')\n else {\n /* A line that names no account is given the one its words mean, by its category then its description (§`accountMatcher`). */\n const words = [patch.category ?? current?.category, patch.description ?? current?.description]\n const found = (isNew || 'category' in patch || 'description' in patch) && accounts.length ? match(words, CashFlowType.EXPENSE) : undefined\n if (found) row.account = found\n }\n\n if ('taxInvoice' in patch) {\n if (patch.taxInvoice?.id && !citing.taxInvoices)\n throw new Refusal('expenditure-invoice-not-readable', {}, 'citing a tax invoice needs the tax-invoice ledger')\n // Serialize citation checks on PostgreSQL; SQLite already has the request write in this transaction.\n if (patch.taxInvoice?.id && tx.connection.options.type === 'postgres') {\n await tx.getRepository(TaxInvoice).findOne({ where: { id: patch.taxInvoice.id, domain: { id: domain.id } } as any, lock: { mode: 'pessimistic_write' } })\n }\n const invoice = await inDomain(tx, TaxInvoice, domain, patch.taxInvoice, 'taxInvoice')\n if (invoice) {\n if (request.kind !== ExpenditureKind.VENDOR) throw new Refusal('expenditure-invoice-on-reimbursement', {}, 'a reimbursement cites receipts, not tax invoices')\n if (invoice.category !== Category.IMPORT) throw new Refusal('expenditure-invoice-not-purchase', {}, 'cite a purchase tax invoice')\n if (citing.unpaidInvoicesOnly) {\n const party = await tx.getRepository(Counterparty).findOne({ where: { id: request.counterpartyId, domain: { id: domain.id } } as any })\n const digits = (value: unknown) => String(value ?? '').replace(/\\D/g, '')\n if (!party || !digits(party.businessNumber) || digits(party.businessNumber) !== digits(invoice.supplierBusinessRegistrationNumber))\n throw new Refusal('expenditure-bulk-party', {}, 'The supplier must match the selected counterparty; review this invoice individually')\n const payments = await tx.getRepository(Payment).find({ where: { domain: { id: domain.id }, targetType: TAX_INVOICE_TARGET, targetId: invoice.id } as any })\n if (payments.length)\n throw new Refusal('expenditure-bulk-paid', {}, 'This invoice already has payment links; review partial or completed payments individually')\n const negatives = await tx.getRepository(TaxInvoice).find({ where: { domain: { id: domain.id }, totalAmount: LessThan(0) } as any })\n const amended = negatives.some(one => one.originalApprovalNo === invoice.approvalNo || (invoice.approvalNo && [one.remark0, one.remark1, one.remark2].some(text => text?.includes(invoice.approvalNo))))\n if (!(Number(invoice.totalAmount) > 0) || invoice.originalApprovalNo || invoice.invoiceType?.startsWith('02') || amended)\n throw new Refusal('expenditure-bulk-amended', {}, 'Review amended or non-positive invoices individually before requesting payment')\n }\n const elsewhere = await repo.find({ where: { domain: { id: domain.id }, taxInvoice: { id: invoice.id } } as any, relations: ['request'] })\n if (elsewhere.some(one => one.id !== current?.id && one.request && !one.request.deletedAt))\n throw new Refusal('expenditure-invoice-cited-twice', { issueDate: invoice.issueDate }, 'another request already pays this tax invoice')\n if (!('amount' in patch) || !(row.amount > 0)) row.amount = Number(invoice.totalAmount)\n if (!('spentDate' in patch)) row.spentDate = invoice.issueDate\n }\n row.taxInvoice = invoice\n }\n\n if ('cardTransaction' in patch) {\n row.cardTransaction = null\n if (patch.cardTransaction?.id) {\n const charge = await tx.getRepository(Transaction).findOne({ where: { domain: { id: domain.id }, id: patch.cardTransaction.id } as any })\n if (!charge) throw new Refusal('expenditure-reference-not-found', { field: 'cardTransaction' }, 'cardTransaction was not found - reload and try again')\n const card = charge.bankAccountId ? await tx.getRepository(BankAccount).findOne({ where: { id: charge.bankAccountId } as any, relations: ['holder'] }) : null\n const taken = explainCharge(\n { ...charge, merchant: charge.counterpartyName ?? charge.bankCounterpartyName ?? charge.bankDescription, holderId: card?.holder?.userId },\n user,\n !!citing.anyCard\n )\n const elsewhere = await repo.find({ where: { domain: { id: domain.id }, cardTransaction: { id: charge.id } } as any, relations: ['request'] })\n if (elsewhere.some(one => one.id !== current?.id && one.request && !one.request.deletedAt))\n throw new Refusal('expenditure-card-charge-explained-twice', { day: charge.transactionDate ?? '' }, 'another line already explains this charge')\n if ('amount' in patch && Math.abs(Number(patch.amount) - taken.amount) > 0.005)\n throw new Refusal('expenditure-card-charge-amount', {}, 'a card line is the amount of its charge')\n row.cardTransaction = charge\n row.paymentMethod = ExpenditurePaymentMethod.CORPORATE_CARD\n row.amount = taken.amount\n row.spentDate = taken.spentDate\n if (!('merchant' in patch) || !row.merchant) row.merchant = taken.merchant\n }\n }\n if ('personalUse' in patch) row.personalUse = !!patch.personalUse\n /* A card's charge and its personal use belong to a corporate-card line only. */\n const method = row.paymentMethod ?? current?.paymentMethod\n const charged = 'cardTransaction' in row ? row.cardTransaction?.id : current?.cardTransactionId\n if (charged && method !== ExpenditurePaymentMethod.CORPORATE_CARD)\n throw new Refusal('expenditure-card-charge-method', {}, 'a line that explains a card charge was paid with the corporate card')\n if (charged && !('cardTransaction' in patch) && 'amount' in row && current && Math.abs(Number(row.amount) - Number(current.amount)) > 0.005)\n throw new Refusal('expenditure-card-charge-amount', {}, 'a card line is the amount of its charge')\n if ((row.personalUse ?? current?.personalUse) && method !== ExpenditurePaymentMethod.CORPORATE_CARD)\n throw new Refusal('expenditure-personal-not-card', {}, 'personal use is a corporate-card line')\n\n /* What a line says of its money holds whenever it is written, not only when it is submitted. */\n const amount = 'amount' in row ? row.amount : Number(current?.amount ?? 0)\n if ('amount' in row && !(row.amount > 0)) throw new Refusal('expenditure-line-amount-missing', {}, 'every line needs an amount above zero')\n const vat = 'vatAmount' in row ? row.vatAmount : current?.vatAmount\n if (vat && amount && Number(vat) > amount) throw new Refusal('expenditure-line-vat-over-amount', {}, 'the VAT is more than the amount')\n\n /* A line that cites an invoice asks no more than the invoice - whichever of the two changed. */\n const citedId = 'taxInvoice' in patch ? row.taxInvoice?.id : current?.taxInvoiceId\n if (citedId && ('amount' in row || 'taxInvoice' in patch)) {\n const invoice = row.taxInvoice ?? (await tx.getRepository(TaxInvoice).findOne({ where: { id: citedId } as any, withDeleted: true }))\n if (invoice && amount > Number(invoice.totalAmount) + 0.005)\n throw new Refusal('expenditure-line-over-invoice', { total: won(Number(invoice.totalAmount)) }, 'a line asks more than the tax invoice it cites')\n }\n\n await repo.save({ ...(current ?? { domain, request, creator: user, amount: 0 }), ...row, updater: user } as any)\n }\n}\n\n/**\n * Save a request and its lines in one go - the head, then the lines. A new request belongs to the caller; an existing\n * one only to its requester, and only while it is editable.\n */\nexport async function saveRequest(tx: EntityManager, domain: any, user: any, head: RequestHead, items: ItemPatch[], citing: Citing): Promise<ExpenditureRequest> {\n const repo = tx.getRepository(ExpenditureRequest)\n\n let request: ExpenditureRequest\n if (head.id) {\n request = await ownRequest(tx, head.id, domain, user)\n if (!canEdit(request.status as RequestStatus)) throw lockedRequest(request.status)\n if (head.kind && head.kind !== request.kind) throw new Refusal('expenditure-kind-fixed', {}, 'a request keeps the kind it was written as')\n } else {\n if (!head.kind || !KINDS.includes(head.kind)) throw new Refusal('expenditure-kind-missing', {}, 'say whether it pays a counterparty or pays an employee back')\n const employee = await employeeOf(tx, domain, user)\n request = repo.create({\n domain,\n kind: head.kind as ExpenditureKind,\n requester: user,\n department: employee?.department ?? null,\n status: ExpenditureRequestStatus.DRAFT,\n currency: 'KRW',\n totalAmount: 0,\n payableAmount: 0,\n creator: user\n } as any) as unknown as ExpenditureRequest\n }\n\n const reimbursement = request.kind === ExpenditureKind.REIMBURSEMENT\n if ('month' in head || (!head.id && reimbursement)) {\n const month = monthOf(head.month)\n if (reimbursement && !month) throw new Refusal('expenditure-month-invalid', { value: String(head.month ?? '') }, `month: '${head.month ?? ''}' is not a month (use YYYY-MM)`)\n if (head.month && !month) throw new Refusal('expenditure-month-invalid', { value: String(head.month) }, `month: '${head.month}' is not a month (use YYYY-MM)`)\n request.month = month ?? null\n }\n if ('dueDate' in head) {\n request.dueDate = head.dueDate ? dayOf(head.dueDate) ?? null : null\n if (head.dueDate && !request.dueDate) throw new Refusal('expenditure-due-date-invalid', { value: String(head.dueDate) }, `'${head.dueDate}' is not a day (use YYYY-MM-DD)`)\n }\n if (reimbursement && ('counterparty' in head || 'payeeAccount' in head)) throw new Refusal('expenditure-reimbursement-pays-requester', {}, 'a reimbursement pays the employee who wrote it')\n const { counterparty, account } = await payeeOf(tx, domain, head, head.id ? request : undefined)\n if (counterparty !== undefined) request.counterparty = counterparty\n if (account !== undefined) request.payeeAccount = account\n /* A changed counterparty drops the account chosen of the former one. */\n if (counterparty !== undefined && account === undefined && request.payeeAccountId) {\n const kept = await tx.getRepository(CounterpartyBankAccount).findOne({ where: { id: request.payeeAccountId } as any })\n if (kept?.counterpartyId !== counterparty?.id) request.payeeAccount = null\n }\n\n if (head.title?.trim()) request.title = head.title.trim()\n else if (!request.title) request.title = reimbursement ? `${request.month} 경비` : `${counterparty?.name ?? ''} 지급`.trim()\n if (head.notes !== undefined) request.notes = head.notes\n request.updater = user\n request = await repo.save(request)\n\n if (items?.length) await saveItems(tx, domain, user, request, items, citing)\n return await refreshTotals(tx, request)\n}\n\n/** The payee's account as approvers will see it - written on the request when it is submitted (ADR-0135 §5). */\nasync function payeeSnapshot(tx: EntityManager, domain: { id: string }, request: ExpenditureRequest, user: any) {\n if (request.kind === ExpenditureKind.VENDOR) {\n const account = await tx.getRepository(CounterpartyBankAccount).findOne({ where: { domain: { id: domain.id }, id: request.payeeAccountId } as any })\n if (!account || account.counterpartyId !== request.counterpartyId)\n throw new Refusal('expenditure-payee-account-missing', {}, \"choose the counterparty's account to pay into\")\n return { payeeBankName: account.bankName ?? null, payeeAccountNumber: account.accountNumber, payeeHolderName: account.holderName ?? null }\n }\n const employee = await employeeOf(tx, domain, user)\n return {\n payeeBankName: employee?.bankName ?? null,\n payeeAccountNumber: employee?.bankAccount ? accountKey(employee.bankAccount) || null : null,\n payeeHolderName: user.name ?? null\n }\n}\n\n/** Put a request up for approval. The approval carries what the approver needs to judge it. */\nexport async function submitRequest(tx: EntityManager, domain: any, user: any, id: string, context: ResolverContext): Promise<ExpenditureRequest> {\n const request = await ownRequest(tx, id, domain, user)\n const items = await linesOf(tx, request.id)\n\n const refusal = submitRefusal(\n {\n kind: request.kind as RequestKind,\n status: request.status as RequestStatus,\n month: request.month,\n dueDate: request.dueDate,\n counterpartyId: request.counterpartyId,\n payeeAccountId: request.payeeAccountId\n },\n items,\n (await tx.getRepository(BankAccount).count({ where: { domain: { id: domain.id }, accountType: AccountType.CARD } as any })) > 0\n )\n if (refusal) throw refusal\n Object.assign(request, await payeeSnapshot(tx, domain, request, user))\n\n const form = activityOfKind(request.kind)\n const carrier = await activityNamed(form, context)\n if (!carrier) throw new Refusal('expenditure-approval-not-installed', { form }, `the approval '${form}' is not installed in this domain`)\n const line = await approvalLineStanding(carrier, context)\n if (line.refusal) throw approvalLineRefusal(line.refusal)\n\n const totals = totalsOf(items)\n const who = user.name || user.email || ''\n const vendor = request.kind === ExpenditureKind.VENDOR\n const payee = vendor ? (await tx.getRepository(Counterparty).findOne({ where: { id: request.counterpartyId } as any }))?.name ?? '' : who\n const account = [request.payeeBankName, request.payeeAccountNumber, request.payeeHolderName].filter(Boolean).join(' ')\n\n const instance = await issue(\n {\n name: vendor ? `지출결의 ${payee} ${request.title}` : `경비 청구 ${who} ${request.month}`,\n description: `${won(totals.total)} · ${totals.count}건${totals.payable !== totals.total ? ` (지급할 금액 ${won(totals.payable)})` : ''}`,\n activityId: carrier.id,\n approvalLine: carrier.approvalLine,\n input: {\n requestId: request.id,\n month: request.month ?? request.dueDate?.slice(0, 7) ?? '',\n requester: who,\n payee,\n /*\n * Who is paid, as a reference: the approval screens draw a value with a __typename as a link to\n * its 360 (worklist decision-content) - the counterparty for a vendor payment, the employee for\n * a claim. `payee` and `requester` stay as the words the search keys find.\n */\n paidTo: vendor\n ? { __typename: 'Counterparty', id: request.counterpartyId, name: payee }\n : { __typename: 'User', id: user.id, name: who },\n /* The request itself, as a reference: the approval card opens it - the lines and their receipts and papers. */\n request: { __typename: 'ExpenditureRequest', id: request.id, name: request.title },\n headline: vendor\n ? `${payee} · ${request.title} ${won(totals.payable)}${request.dueDate ? ` — ${request.dueDate} 지급` : ''}`\n : `${who} · ${request.month} 경비 ${won(totals.total)} (${totals.count}건)`,\n total: totals.total,\n payable: totals.payable,\n account,\n lines: items.map(item =>\n `${item.spentDate ?? ''} ${item.category ?? ''} ${item.merchant ?? ''} ${won(item.amount)}${item.paymentMethod === ExpenditurePaymentMethod.CORPORATE_CARD ? ' (법인카드)' : ''}${item.taxInvoiceId ? ' (세금계산서)' : ''} — ${item.description ?? ''}`\n .replace(/\\s+/g, ' ')\n .trim()\n ),\n consequence:\n totals.payable > 0\n ? `승인하면 ${won(totals.payable)}을 ${payee}에게 지급할 대상이 됩니다${account ? ` (${account})` : ''}`\n : '법인카드 사용분만 있어 지급할 금액은 없습니다'\n },\n threadsMin: 1,\n threadsMax: 1,\n requireApproval: true\n } as any,\n context\n )\n\n request.status = ExpenditureRequestStatus.SUBMITTED\n request.activityInstanceId = instance.id\n request.submittedAt = new Date()\n request.decidedAt = null\n request.decidedBy = null\n request.updater = user\n return await tx.getRepository(ExpenditureRequest).save(request)\n}\n\n/** Take a request back from its approvers. worklist's abort does not call the activity back, so the request is set here. */\nexport async function withdrawRequest(tx: EntityManager, domain: any, user: any, id: string, context: ResolverContext): Promise<ExpenditureRequest> {\n const request = await ownRequest(tx, id, domain, user)\n if (request.status !== ExpenditureRequestStatus.SUBMITTED)\n throw new Refusal('expenditure-not-submitted', { status: String(request.status).toLowerCase() }, 'only a request waiting on approvers can be withdrawn')\n\n if (request.activityInstanceId) await abort({ id: request.activityInstanceId, reason: '작성자가 회수함' }, context)\n\n request.status = ExpenditureRequestStatus.WITHDRAWN\n request.updater = user\n return await tx.getRepository(ExpenditureRequest).save(request)\n}\n\n/** Delete one of the caller's requests that nobody is judging - with its lines. */\nexport async function deleteRequest(tx: EntityManager, domain: any, user: any, id: string): Promise<boolean> {\n const request = await ownRequest(tx, id, domain, user)\n if (!canEdit(request.status as RequestStatus))\n throw new Refusal('expenditure-cannot-delete', { status: request.status.toLowerCase() }, `a ${request.status.toLowerCase()} request cannot be deleted`)\n await tx.getRepository(ExpenditureRequestItem).softDelete({ request: { id } } as any)\n await tx.getRepository(ExpenditureRequest).softDelete({ id })\n return true\n}\n\n/**\n * Add one line from the phone. It joins the caller's editable reimbursement of that month (§`requestForLine`), or\n * starts one. The receipt photos and files picked with it are attached to the line.\n */\nexport async function addLine(tx: EntityManager, domain: any, user: any, line: ItemPatch & { month?: string; files?: any[] }, context: ResolverContext): Promise<ExpenditureRequest> {\n const spentDate = dayOf(line.spentDate)\n if (!spentDate) throw new Refusal('expenditure-line-day-missing', {}, 'every line needs its day')\n const month = monthOf(line.month) ?? spentDate.slice(0, 7)\n\n const mine = await tx.getRepository(ExpenditureRequest).find({\n where: { domain: { id: domain.id }, requester: { id: user.id }, kind: ExpenditureKind.REIMBURSEMENT, month } as any\n })\n const joinId = requestForLine(\n mine.map(one => ({ id: one.id, status: one.status as RequestStatus, month: one.month, updatedAt: one.updatedAt })),\n month\n )\n\n const { files, month: _month, ...fields } = line\n const request = await saveRequest(tx, domain, user, joinId ? { id: joinId } : { kind: ExpenditureKind.REIMBURSEMENT, month }, [{ ...fields, spentDate, cuFlag: '+' }], { taxInvoices: false })\n\n if (files?.length) {\n const [latest] = await tx.getRepository(ExpenditureRequestItem).find({ where: { request: { id: request.id } } as any, order: { createdAt: 'DESC' } as any, take: 1 })\n if (latest) for (const file of files) await attachFile(latest.id, file, context)\n }\n return request\n}\n\n/** A line of the caller's own request, while the request can still be changed. */\nexport async function editableLine(tx: EntityManager, domain: any, user: any, itemId: string): Promise<ExpenditureRequestItem> {\n const item = await tx.getRepository(ExpenditureRequestItem).findOne({ where: { id: itemId, domain: { id: domain.id } } as any, relations: ['request'] })\n if (!item?.request) throw new Refusal('expenditure-line-not-found', {}, 'a line was not found - reload and try again')\n const request = await ownRequest(tx, item.request.id, domain, user)\n if (!canEdit(request.status as RequestStatus)) throw lockedRequest(request.status)\n return item\n}\n\n/**\n * Attach files to a line and take others off it, in one go - only the requester, only while editable. A file taken\n * off is deleted: what approvers judge is what the line has when it is submitted.\n */\nexport async function saveLineFiles(\n tx: EntityManager,\n domain: any,\n user: any,\n itemId: string,\n change: { attach?: any[]; remove?: string[] },\n context: ResolverContext\n): Promise<ExpenditureRequestItem> {\n const item = await editableLine(tx, domain, user, itemId)\n\n const remove = [...new Set(change.remove ?? [])]\n if (remove.length) {\n const onLine = await tx.getRepository(Attachment).find({ where: { domain: { id: domain.id }, refType: RECEIPT_REF_TYPE, refBy: item.id, id: In(remove) } as any })\n if (onLine.length !== remove.length) throw new Refusal('expenditure-file-not-on-line', {}, 'a file is not on this line - reload and try again')\n for (const one of onLine) await deleteAttachment(null, { id: one.id }, context)\n }\n for (const file of change.attach ?? []) await attachFile(item.id, file, context)\n return item\n}\n\nasync function attachFile(itemId: string, file: any, context: ResolverContext) {\n await createAttachment(null, { attachment: { file, refType: RECEIPT_REF_TYPE, refBy: itemId, category: 'receipt' } } as any, context)\n}\n\n/** Approved requests with their lines and how far each is paid - what the payment queue and payments are made of. */\nexport async function approvedWithStates(tx: EntityManager, domain: { id: string }, ids?: string[]) {\n const requests = await tx.getRepository(ExpenditureRequest).find({\n where: { domain: { id: domain.id }, status: ExpenditureRequestStatus.APPROVED, ...(ids ? { id: In(ids) } : {}) } as any,\n relations: ['items', 'requester', 'counterparty', 'payeeAccount']\n })\n for (const request of requests) request.items = (request.items ?? []).filter(item => !item.deletedAt)\n const states = await paymentStatesOf(tx, domain, requests as any)\n return { requests, states }\n}\n\n/** Whether the account approvers saw is still the one on file (§`payeeAccountDrift`); `missing` when none was written. */\nexport async function driftOf(tx: EntityManager, request: ExpenditureRequest): Promise<string | undefined> {\n if (!request.payeeAccountNumber) return 'missing'\n if (request.kind !== ExpenditureKind.VENDOR) return undefined\n const current = request.payeeAccountId\n ? await tx.getRepository(CounterpartyBankAccount).findOne({ where: { id: request.payeeAccountId } as any, withDeleted: true })\n : null\n return payeeAccountDrift(request, current, accountKey)\n}\n\n/**\n * Put a part of a withdrawal on a request (ADR-0135 §2-5). A payable line that cites a tax invoice is paid on that\n * invoice; the rest on the request itself. A link the line already has to the same target is raised, not doubled.\n */\nasync function putOnLine(tx: EntityManager, domain: { id: string }, user: any, request: ExpenditureRequest, state: PaymentState, lineId: string, amount: number) {\n if (amount > state.outstanding + 0.005)\n throw new Refusal('expenditure-paid-over', { title: request.title }, `more is put on ${request.title} than it asks`)\n\n const existing = await tx.getRepository(Payment).find({ where: { domain: { id: domain.id }, transaction: { id: lineId } } as any })\n const patchFor = (targetType: string, targetId: string, put: number) => {\n const twin = existing.find(one => one.targetType === targetType && one.targetId === targetId)\n return twin ? { id: twin.id, cuFlag: 'M', amount: Number(twin.amount) + put } : { cuFlag: '+', transaction: { id: lineId }, targetType, targetId, amount: put }\n }\n\n let remaining = amount\n const patches: any[] = []\n const cited = (request.items ?? []).filter(item => isPayable(item) && item.taxInvoiceId)\n if (cited.length) {\n const onInvoices = await tx.getRepository(Payment).find({\n where: { domain: { id: domain.id }, targetType: TAX_INVOICE_TARGET, targetId: In(cited.map(item => item.taxInvoiceId)) } as any\n })\n for (const item of cited) {\n const paid = onInvoices.filter(one => one.targetId === item.taxInvoiceId).reduce((sum, one) => sum + paidOfTarget(one), 0)\n const put = Math.min(remaining, Math.max(0, Number(item.amount) - paid))\n if (put > 0) patches.push(patchFor(TAX_INVOICE_TARGET, item.taxInvoiceId!, put))\n remaining -= put\n }\n }\n const direct = Math.min(remaining, Math.max(0, state.settleable - state.settled))\n if (direct > 0) patches.push(patchFor(EXPENDITURE_TARGET, request.id, direct))\n remaining -= direct\n if (remaining > 0.005) throw new Refusal('expenditure-paid-over', { title: request.title }, `more is put on ${request.title} than it asks`)\n\n await savePayments(tx, domain, user, patches)\n}\n\nexport interface PaymentRecord {\n paidDate: string\n bankAccount?: { id: string } | null\n}\n\n/**\n * Pay approved requests - finance transferred the money at the bank and records it. Each request gets a withdrawal of\n * what it still asks, written as a person's line; the next bank statement import matches it, and then the payment is\n * reconciled (§`bank-reconcile`).\n */\nexport async function payRequests(tx: EntityManager, domain: any, user: any, ids: string[], record: PaymentRecord): Promise<ExpenditureRequest[]> {\n const paidDate = dayOf(record.paidDate)\n if (!paidDate) throw new Refusal('expenditure-paid-date-missing', {}, 'paidDate: the day the money went out')\n const bankAccount = await inDomain(tx, BankAccount, domain, record.bankAccount, 'bankAccount')\n if (bankAccount?.accountType === AccountType.CARD)\n throw new Refusal('expenditure-paid-from-card', {}, 'a request is paid from a bank account, not a card')\n\n const { requests, states } = await approvedWithStates(tx, domain, [...new Set(ids)])\n if (requests.length !== new Set(ids).size) {\n const found = await tx.getRepository(ExpenditureRequest).find({ where: { domain: { id: domain.id }, id: In(ids) } as any })\n const titles = found.filter(one => one.status !== ExpenditureRequestStatus.APPROVED).map(one => one.title).join(', ')\n if (titles) throw new Refusal('expenditure-not-approved', { title: titles }, `only an approved request is paid - ${titles}`)\n throw new Refusal('expenditure-not-found', {}, 'some requests were not found - reload and try again')\n }\n\n for (const request of requests) {\n const state = states.get(request.id)!\n if (!(state.outstanding > 0)) throw new Refusal('expenditure-paid-already', { title: request.title }, `${request.title} has nothing left to pay`)\n const payee = request.kind === ExpenditureKind.VENDOR ? request.counterparty?.name : request.requester?.name\n const [line] = await saveTransactions(tx, domain, user, [\n {\n cuFlag: '+',\n category: TransactionCategory.CONFIRMED,\n source: TransactionSource.MANUAL,\n type: CashFlowType.EXPENSE,\n transactionDate: paidDate,\n amount: state.outstanding,\n description: `지출 — ${request.title}`,\n counterpartyName: payee ?? undefined,\n ...(request.counterpartyId ? { counterparty: { id: request.counterpartyId } } : {}),\n ...(bankAccount ? { bankAccount: { id: bankAccount.id } } : { currency: request.currency })\n }\n ])\n await putOnLine(tx, domain, user, request, state, line.id, state.outstanding)\n }\n return requests\n}\n\n/**\n * Pay a request with a withdrawal already in the books - a bank statement brought it in first. The part put on the\n * request is what it still asks unless a smaller amount is given.\n */\nexport async function payWithLine(tx: EntityManager, domain: any, user: any, requestId: string, transactionId: string, amount?: number | null): Promise<ExpenditureRequest> {\n const { requests, states } = await approvedWithStates(tx, domain, [requestId])\n const [request] = requests\n if (!request) {\n const found = await tx.getRepository(ExpenditureRequest).findOne({ where: { domain: { id: domain.id }, id: requestId } as any })\n if (found) throw new Refusal('expenditure-not-approved', { title: found.title }, `only an approved request is paid - ${found.title}`)\n throw new Refusal('expenditure-not-found', {}, `expenditure request '${requestId}' was not found`)\n }\n const line = await tx.getRepository(Transaction).findOne({ where: { domain: { id: domain.id }, id: transactionId, category: TransactionCategory.CONFIRMED } as any })\n if (!line) throw new Refusal('expenditure-line-gone', {}, 'the bank line was not found - reload and try again')\n\n const state = states.get(request.id)!\n const put = amount === null || amount === undefined ? Math.min(state.outstanding, Number(line.amount)) : Number(amount)\n if (!(put > 0)) throw new Refusal('expenditure-paid-already', { title: request.title }, `${request.title} has nothing left to pay`)\n await putOnLine(tx, domain, user, request, state, line.id, put)\n return request\n}\n"]}
@@ -24,6 +24,8 @@ export declare class ExpenditureRequestItemPatch {
24
24
  vatAmount?: number;
25
25
  paymentMethod?: ExpenditurePaymentMethod;
26
26
  taxInvoice?: ObjectRef;
27
+ cardTransaction?: ObjectRef;
28
+ personalUse?: boolean;
27
29
  cuFlag?: string;
28
30
  }
29
31
  export declare class NewExpenditureLine {
@@ -89,6 +89,14 @@ tslib_1.__decorate([
89
89
  (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'The purchase tax invoice this line pays' }),
90
90
  tslib_1.__metadata("design:type", shell_1.ObjectRef)
91
91
  ], ExpenditureRequestItemPatch.prototype, "taxInvoice", void 0);
92
+ tslib_1.__decorate([
93
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'The corporate-card charge this line explains - its day, shop and amount' }),
94
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
95
+ ], ExpenditureRequestItemPatch.prototype, "cardTransaction", void 0);
96
+ tslib_1.__decorate([
97
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Spent on the corporate card for oneself' }),
98
+ tslib_1.__metadata("design:type", Boolean)
99
+ ], ExpenditureRequestItemPatch.prototype, "personalUse", void 0);
92
100
  tslib_1.__decorate([
93
101
  (0, type_graphql_1.Field)({ nullable: true, description: "Grid batch flag: '+' add, 'M' modify, '-' delete" }),
94
102
  tslib_1.__metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"expenditure-request-type.js","sourceRoot":"","sources":["../../../server/service/expenditure-request/expenditure-request-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAG3E,+FAA2D;AAE3D,iDAAiD;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E,WAAW,EAAE,2BAA2B,EAAE,CAAC;;kDACrD;6BAXH,kBAAkB;IAD9B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;GACpD,kBAAkB,CAY9B","sourcesContent":["import { Field, Float, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { ExpenditureKind, ExpenditureRequest } from './expenditure-request'\nimport { ExpenditurePaymentMethod } from './expenditure-request-item'\nimport { ExpenditurePaymentState } from './expenditure-payment-state'\n\n@InputType({ description: 'The head of an expenditure request - the lines are sent beside it' })\nexport class ExpenditureRequestInput {\n @Field(type => ID, { nullable: true, description: 'Empty for a new request' })\n id?: string\n\n @Field(type => ExpenditureKind, { nullable: true, description: 'Required for a new request; a request keeps its kind' })\n kind?: ExpenditureKind\n\n @Field({ nullable: true, description: \"Defaults to '<month> 경비', or '<counterparty> 지급'\" })\n title?: string\n\n @Field({ nullable: true, description: 'YYYY-MM a reimbursement belongs to' })\n month?: string\n\n @Field({ nullable: true, description: 'YYYY-MM-DD it is to be paid' })\n dueDate?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'Who is paid, for a counterparty payment' })\n counterparty?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true, description: \"The counterparty's account to pay into\" })\n payeeAccount?: ObjectRef\n\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n}\n\n@InputType({ description: 'A line of an expenditure request to add, change or delete' })\nexport class ExpenditureRequestItemPatch {\n @Field(type => ID, { nullable: true, description: 'The line to change or delete' })\n id?: string\n\n @Field({ nullable: true, description: 'YYYY-MM-DD' })\n spentDate?: string\n\n @Field({ nullable: true, description: \"What the requester calls it - '식대', '교통비'\" })\n category?: string\n\n @Field(type => ObjectRef, { nullable: true, description: '계정과목 - found from the category or description when not given' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'Where - the shop or company on the receipt' })\n merchant?: string\n\n @Field({ nullable: true, description: 'What for' })\n description?: string\n\n @Field(type => Float, { nullable: true, description: 'Amount, VAT included' })\n amount?: number\n\n @Field(type => Float, { nullable: true, description: 'VAT in the amount' })\n vatAmount?: number\n\n @Field(type => ExpenditurePaymentMethod, { nullable: true, description: 'How it was paid' })\n paymentMethod?: ExpenditurePaymentMethod\n\n @Field(type => ObjectRef, { nullable: true, description: 'The purchase tax invoice this line pays' })\n taxInvoice?: ObjectRef\n\n @Field({ nullable: true, description: \"Grid batch flag: '+' add, 'M' modify, '-' delete\" })\n cuFlag?: string\n}\n\n@InputType({ description: 'One expense added on the go - it joins the month’s editable reimbursement' })\nexport class NewExpenditureLine {\n @Field({ description: 'YYYY-MM-DD; the month is taken from it unless month is given' })\n spentDate: string\n\n @Field({ nullable: true, description: 'YYYY-MM - to file a late receipt under another month' })\n month?: string\n\n @Field({ description: \"What it was - '식대', '교통비'\" })\n category: string\n\n @Field(type => Float, { description: 'Amount, VAT included' })\n amount: number\n\n @Field(type => ObjectRef, { nullable: true, description: '계정과목 - found from the category or description when not given' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'Where' })\n merchant?: string\n\n @Field({ nullable: true, description: 'What for' })\n description?: string\n\n @Field(type => Float, { nullable: true, description: 'VAT in the amount' })\n vatAmount?: number\n\n @Field(type => ExpenditurePaymentMethod, { nullable: true, description: 'How it was paid' })\n paymentMethod?: ExpenditurePaymentMethod\n\n @Field(type => [GraphQLUpload], { nullable: true, description: 'Receipt photos and files the line is proven by' })\n files?: FileUpload[]\n}\n\n@InputType({ description: 'How approved requests were paid at the bank' })\nexport class ExpenditurePaymentInput {\n @Field({ description: 'YYYY-MM-DD the money went out' })\n paidDate: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'Our account it went out of' })\n bankAccount?: ObjectRef\n}\n\n@ObjectType({ description: 'A page of expenditure requests' })\nexport class ExpenditureRequestList {\n @Field(type => [ExpenditureRequest], { description: 'The requests on this page' })\n items: ExpenditureRequest[]\n\n @Field(type => Int, { description: 'How many there are in all' })\n total: number\n}\n\n@ObjectType({ description: 'How far an expenditure request is paid, read from the bank lines that paid it' })\nexport class ExpenditurePayment {\n @Field(type => ExpenditurePaymentState, { description: 'Nothing to pay, unpaid, partly or fully paid' })\n state: ExpenditurePaymentState\n\n @Field(type => Float, { description: 'What the company is to pay' })\n payable: number\n\n @Field(type => Float, { description: 'What bank lines paid of it' })\n paid: number\n\n @Field(type => Float, { description: 'What is still to pay' })\n outstanding: number\n\n @Field({ description: 'Every bank line that paid it was matched to the bank statement' })\n reconciled: boolean\n\n @Field(type => [String], { description: 'The bank lines that paid it' })\n transactionIds: string[]\n}\n\n@ObjectType({ description: 'An approved request in the payment queue' })\nexport class ExpenditureQueueRow {\n @Field(type => ExpenditureRequest, { description: 'The request' })\n request: ExpenditureRequest\n\n @Field(type => ExpenditurePayment, { description: 'How far it is paid' })\n payment: ExpenditurePayment\n\n @Field({ nullable: true, description: 'Who is paid - the counterparty, or the employee paid back' })\n payeeName?: string\n\n @Field({\n nullable: true,\n description: \"'gone' or 'changed' when the account approvers saw is no longer on file as it was, 'missing' when none was written\"\n })\n payeeAccountDrift?: string\n}\n\n@ObjectType({ description: 'The payment queue - what is approved and still to pay, and what was paid but not yet matched to the bank' })\nexport class ExpenditureQueue {\n @Field(type => [ExpenditureQueueRow], { description: 'Approved and not fully paid, by the day it is to be paid' })\n waiting: ExpenditureQueueRow[]\n\n @Field(type => [ExpenditureQueueRow], { description: 'Paid, with a bank line not yet matched to a statement' })\n unreconciled: ExpenditureQueueRow[]\n}\n\n@ObjectType({ description: 'Approved spending of one month, one requester, one category' })\nexport class ExpenditureSummaryRow {\n @Field({ description: 'YYYY-MM' })\n month: string\n\n @Field(type => ID, { description: 'Who requested' })\n requesterId: string\n\n @Field({ nullable: true, description: \"The requester's name\" })\n requesterName?: string\n\n @Field({ description: 'The category or account' })\n category: string\n\n @Field(type => Float, { description: 'Total of the lines' })\n total: number\n\n @Field(type => Float, { description: 'What the company pays of it' })\n payable: number\n\n @Field(type => Int, { description: 'How many lines' })\n count: number\n}\n\n@ObjectType({ description: 'How many requests stand in a status' })\nexport class ExpenditureStatusCount {\n @Field({ description: 'The status' })\n status: string\n\n @Field(type => Int, { description: 'How many' })\n count: number\n}\n\n@ObjectType({ description: 'Monthly summary of reimbursements' })\nexport class ExpenditureSummary {\n @Field(type => [ExpenditureSummaryRow], { description: 'Approved requests only' })\n rows: ExpenditureSummaryRow[]\n\n @Field(type => [ExpenditureStatusCount], { description: 'Every request of the period, by status - drafts and pending ones are counted, not summed' })\n statuses: ExpenditureStatusCount[]\n\n @Field(type => Float, { description: 'Approved in the period' })\n approvedTotal: number\n\n @Field(type => Float, { description: 'Approved but not yet paid' })\n unpaid: number\n}\n"]}
1
+ {"version":3,"file":"expenditure-request-type.js","sourceRoot":"","sources":["../../../server/service/expenditure-request/expenditure-request-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAG3E,+FAA2D;AAE3D,iDAAiD;AAEjD,+DAA2E;AAC3E,yEAAqE;AACrE,2EAAqE;AAG9D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAwBnC,CAAA;AAxBY,0DAAuB;AAElC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;mDACnE;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,qCAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC;;qDAClG;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;;sDAC7E;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oC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6D,EAAE,CAAC;GAC9E,qBAAqB,CAqBjC;AAGM,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAMlC,CAAA;AANY,wDAAsB;AAEjC;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;;sDACvB;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;qDACnC;iCALF,sBAAsB;IADlC,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;GACtD,sBAAsB,CAMlC;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAY9B,CAAA;AAZY,gDAAkB;AAE7B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;gDACrD;AAG7B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,sBAAsB,CAAC,EAAE,EAAE,WAAW,EAAE,0FAA0F,EAAE,CAAC;;oDACnH;AAGlC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;yDAC3C;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;kDACrD;6BAXH,kBAAkB;IAD9B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;GACpD,kBAAkB,CAY9B","sourcesContent":["import { Field, Float, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { ExpenditureKind, ExpenditureRequest } from './expenditure-request'\nimport { ExpenditurePaymentMethod } from './expenditure-request-item'\nimport { ExpenditurePaymentState } from './expenditure-payment-state'\n\n@InputType({ description: 'The head of an expenditure request - the lines are sent beside it' })\nexport class ExpenditureRequestInput {\n @Field(type => ID, { nullable: true, description: 'Empty for a new request' })\n id?: string\n\n @Field(type => ExpenditureKind, { nullable: true, description: 'Required for a new request; a request keeps its kind' })\n kind?: ExpenditureKind\n\n @Field({ nullable: true, description: \"Defaults to '<month> 경비', or '<counterparty> 지급'\" })\n title?: string\n\n @Field({ nullable: true, description: 'YYYY-MM a reimbursement belongs to' })\n month?: string\n\n @Field({ nullable: true, description: 'YYYY-MM-DD it is to be paid' })\n dueDate?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'Who is paid, for a counterparty payment' })\n counterparty?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true, description: \"The counterparty's account to pay into\" })\n payeeAccount?: ObjectRef\n\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n}\n\n@InputType({ description: 'A line of an expenditure request to add, change or delete' })\nexport class ExpenditureRequestItemPatch {\n @Field(type => ID, { nullable: true, description: 'The line to change or delete' })\n id?: string\n\n @Field({ nullable: true, description: 'YYYY-MM-DD' })\n spentDate?: string\n\n @Field({ nullable: true, description: \"What the requester calls it - '식대', '교통비'\" })\n category?: string\n\n @Field(type => ObjectRef, { nullable: true, description: '계정과목 - found from the category or description when not given' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'Where - the shop or company on the receipt' })\n merchant?: string\n\n @Field({ nullable: true, description: 'What for' })\n description?: string\n\n @Field(type => Float, { nullable: true, description: 'Amount, VAT included' })\n amount?: number\n\n @Field(type => Float, { nullable: true, description: 'VAT in the amount' })\n vatAmount?: number\n\n @Field(type => ExpenditurePaymentMethod, { nullable: true, description: 'How it was paid' })\n paymentMethod?: ExpenditurePaymentMethod\n\n @Field(type => ObjectRef, { nullable: true, description: 'The purchase tax invoice this line pays' })\n taxInvoice?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true, description: 'The corporate-card charge this line explains - its day, shop and amount' })\n cardTransaction?: ObjectRef\n\n @Field({ nullable: true, description: 'Spent on the corporate card for oneself' })\n personalUse?: boolean\n\n @Field({ nullable: true, description: \"Grid batch flag: '+' add, 'M' modify, '-' delete\" })\n cuFlag?: string\n}\n\n@InputType({ description: 'One expense added on the go - it joins the month’s editable reimbursement' })\nexport class NewExpenditureLine {\n @Field({ description: 'YYYY-MM-DD; the month is taken from it unless month is given' })\n spentDate: string\n\n @Field({ nullable: true, description: 'YYYY-MM - to file a late receipt under another month' })\n month?: string\n\n @Field({ description: \"What it was - '식대', '교통비'\" })\n category: string\n\n @Field(type => Float, { description: 'Amount, VAT included' })\n amount: number\n\n @Field(type => ObjectRef, { nullable: true, description: '계정과목 - found from the category or description when not given' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'Where' })\n merchant?: string\n\n @Field({ nullable: true, description: 'What for' })\n description?: string\n\n @Field(type => Float, { nullable: true, description: 'VAT in the amount' })\n vatAmount?: number\n\n @Field(type => ExpenditurePaymentMethod, { nullable: true, description: 'How it was paid' })\n paymentMethod?: ExpenditurePaymentMethod\n\n @Field(type => [GraphQLUpload], { nullable: true, description: 'Receipt photos and files the line is proven by' })\n files?: FileUpload[]\n}\n\n@InputType({ description: 'How approved requests were paid at the bank' })\nexport class ExpenditurePaymentInput {\n @Field({ description: 'YYYY-MM-DD the money went out' })\n paidDate: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'Our account it went out of' })\n bankAccount?: ObjectRef\n}\n\n@ObjectType({ description: 'A page of expenditure requests' })\nexport class ExpenditureRequestList {\n @Field(type => [ExpenditureRequest], { description: 'The requests on this page' })\n items: ExpenditureRequest[]\n\n @Field(type => Int, { description: 'How many there are in all' })\n total: number\n}\n\n@ObjectType({ description: 'How far an expenditure request is paid, read from the bank lines that paid it' })\nexport class ExpenditurePayment {\n @Field(type => ExpenditurePaymentState, { description: 'Nothing to pay, unpaid, partly or fully paid' })\n state: ExpenditurePaymentState\n\n @Field(type => Float, { description: 'What the company is to pay' })\n payable: number\n\n @Field(type => Float, { description: 'What bank lines paid of it' })\n paid: number\n\n @Field(type => Float, { description: 'What is still to pay' })\n outstanding: number\n\n @Field({ description: 'Every bank line that paid it was matched to the bank statement' })\n reconciled: boolean\n\n @Field(type => [String], { description: 'The bank lines that paid it' })\n transactionIds: string[]\n}\n\n@ObjectType({ description: 'An approved request in the payment queue' })\nexport class ExpenditureQueueRow {\n @Field(type => ExpenditureRequest, { description: 'The request' })\n request: ExpenditureRequest\n\n @Field(type => ExpenditurePayment, { description: 'How far it is paid' })\n payment: ExpenditurePayment\n\n @Field({ nullable: true, description: 'Who is paid - the counterparty, or the employee paid back' })\n payeeName?: string\n\n @Field({\n nullable: true,\n description: \"'gone' or 'changed' when the account approvers saw is no longer on file as it was, 'missing' when none was written\"\n })\n payeeAccountDrift?: string\n}\n\n@ObjectType({ description: 'The payment queue - what is approved and still to pay, and what was paid but not yet matched to the bank' })\nexport class ExpenditureQueue {\n @Field(type => [ExpenditureQueueRow], { description: 'Approved and not fully paid, by the day it is to be paid' })\n waiting: ExpenditureQueueRow[]\n\n @Field(type => [ExpenditureQueueRow], { description: 'Paid, with a bank line not yet matched to a statement' })\n unreconciled: ExpenditureQueueRow[]\n}\n\n@ObjectType({ description: 'Approved spending of one month, one requester, one category' })\nexport class ExpenditureSummaryRow {\n @Field({ description: 'YYYY-MM' })\n month: string\n\n @Field(type => ID, { description: 'Who requested' })\n requesterId: string\n\n @Field({ nullable: true, description: \"The requester's name\" })\n requesterName?: string\n\n @Field({ description: 'The category or account' })\n category: string\n\n @Field(type => Float, { description: 'Total of the lines' })\n total: number\n\n @Field(type => Float, { description: 'What the company pays of it' })\n payable: number\n\n @Field(type => Int, { description: 'How many lines' })\n count: number\n}\n\n@ObjectType({ description: 'How many requests stand in a status' })\nexport class ExpenditureStatusCount {\n @Field({ description: 'The status' })\n status: string\n\n @Field(type => Int, { description: 'How many' })\n count: number\n}\n\n@ObjectType({ description: 'Monthly summary of reimbursements' })\nexport class ExpenditureSummary {\n @Field(type => [ExpenditureSummaryRow], { description: 'Approved requests only' })\n rows: ExpenditureSummaryRow[]\n\n @Field(type => [ExpenditureStatusCount], { description: 'Every request of the period, by status - drafts and pending ones are counted, not summed' })\n statuses: ExpenditureStatusCount[]\n\n @Field(type => Float, { description: 'Approved in the period' })\n approvedTotal: number\n\n @Field(type => Float, { description: 'Approved but not yet paid' })\n unpaid: number\n}\n"]}
@@ -2,7 +2,8 @@ import { ExpenditureRequest } from './expenditure-request';
2
2
  import { ExpenditureRequestItem } from './expenditure-request-item';
3
3
  import { ExpenditureRequestItemQuery, ExpenditureRequestQuery } from './expenditure-request-query';
4
4
  import { ExpenditureRequestMutation } from './expenditure-request-mutation';
5
+ import { CardChargeQuery } from './card-charge-query';
5
6
  import './expenditure-target';
6
7
  export declare const entities: (typeof ExpenditureRequestItem | typeof ExpenditureRequest)[];
7
- export declare const resolvers: (typeof ExpenditureRequestQuery | typeof ExpenditureRequestItemQuery | typeof ExpenditureRequestMutation)[];
8
+ export declare const resolvers: (typeof ExpenditureRequestQuery | typeof ExpenditureRequestItemQuery | typeof ExpenditureRequestMutation | typeof CardChargeQuery)[];
8
9
  export declare const subscribers: any[];
@@ -5,8 +5,9 @@ const expenditure_request_1 = require("./expenditure-request");
5
5
  const expenditure_request_item_1 = require("./expenditure-request-item");
6
6
  const expenditure_request_query_1 = require("./expenditure-request-query");
7
7
  const expenditure_request_mutation_1 = require("./expenditure-request-mutation");
8
+ const card_charge_query_1 = require("./card-charge-query");
8
9
  require("./expenditure-target");
9
10
  exports.entities = [expenditure_request_1.ExpenditureRequest, expenditure_request_item_1.ExpenditureRequestItem];
10
- exports.resolvers = [expenditure_request_query_1.ExpenditureRequestQuery, expenditure_request_query_1.ExpenditureRequestItemQuery, expenditure_request_mutation_1.ExpenditureRequestMutation];
11
+ exports.resolvers = [expenditure_request_query_1.ExpenditureRequestQuery, expenditure_request_query_1.ExpenditureRequestItemQuery, expenditure_request_mutation_1.ExpenditureRequestMutation, card_charge_query_1.CardChargeQuery];
11
12
  exports.subscribers = [];
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/expenditure-request/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAC1D,yEAAmE;AACnE,2EAAkG;AAClG,iFAA2E;AAC3E,gCAA6B;AAEhB,QAAA,QAAQ,GAAG,CAAC,wCAAkB,EAAE,iDAAsB,CAAC,CAAA;AACvD,QAAA,SAAS,GAAG,CAAC,mDAAuB,EAAE,uDAA2B,EAAE,yDAA0B,CAAC,CAAA;AAC9F,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { ExpenditureRequest } from './expenditure-request'\nimport { ExpenditureRequestItem } from './expenditure-request-item'\nimport { ExpenditureRequestItemQuery, ExpenditureRequestQuery } from './expenditure-request-query'\nimport { ExpenditureRequestMutation } from './expenditure-request-mutation'\nimport './expenditure-target'\n\nexport const entities = [ExpenditureRequest, ExpenditureRequestItem]\nexport const resolvers = [ExpenditureRequestQuery, ExpenditureRequestItemQuery, ExpenditureRequestMutation]\nexport const subscribers = []\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/expenditure-request/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAC1D,yEAAmE;AACnE,2EAAkG;AAClG,iFAA2E;AAC3E,2DAAqD;AACrD,gCAA6B;AAEhB,QAAA,QAAQ,GAAG,CAAC,wCAAkB,EAAE,iDAAsB,CAAC,CAAA;AACvD,QAAA,SAAS,GAAG,CAAC,mDAAuB,EAAE,uDAA2B,EAAE,yDAA0B,EAAE,mCAAe,CAAC,CAAA;AAC/G,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { ExpenditureRequest } from './expenditure-request'\nimport { ExpenditureRequestItem } from './expenditure-request-item'\nimport { ExpenditureRequestItemQuery, ExpenditureRequestQuery } from './expenditure-request-query'\nimport { ExpenditureRequestMutation } from './expenditure-request-mutation'\nimport { CardChargeQuery } from './card-charge-query'\nimport './expenditure-target'\n\nexport const entities = [ExpenditureRequest, ExpenditureRequestItem]\nexport const resolvers = [ExpenditureRequestQuery, ExpenditureRequestItemQuery, ExpenditureRequestMutation, CardChargeQuery]\nexport const subscribers = []\n"]}
@@ -17,6 +17,9 @@ export * from './expenditure-request/expenditure-request-item';
17
17
  export * from './transaction/transaction-period';
18
18
  export * from './transaction/transaction-service';
19
19
  export * from './bank-account/bank-account-service';
20
+ export * from './bank-account/card-rules';
21
+ export * from './bank-account/card-summary';
22
+ export * from './payment/card-bill-target';
20
23
  export * from './payment/payment-targets';
21
24
  export * from './payment/payment-service';
22
25
  export * from './payment/payment-currency';
@@ -42,5 +45,5 @@ export * from './expenditure-request/expenditure-request-service';
42
45
  export declare const entities: any[];
43
46
  export declare const subscribers: any[];
44
47
  export declare const schema: {
45
- resolverClasses: (typeof import("./financial-statement/financial-statement-query").FinancialStatementQuery | typeof import("./financial-statement/financial-statement-query").FinancialStatementLineQuery | typeof import("./financial-statement/financial-statement-mutation").FinancialStatementMutation | typeof import("./accounting-category/accounting-category-query").AccountingCategoryQuery | typeof import("./accounting-category/accounting-category-mutation").AccountingCategoryMutation | typeof import("./transaction/transaction-query").TransactionQuery | typeof import("./transaction/transaction-mutation").TransactionMutation | typeof import("./bank-account/bank-account-query").BankAccountQuery | typeof import("./bank-account/bank-account-mutation").BankAccountMutation | typeof import("./bank-statement/bank-statement-query").BankStatementQuery | typeof import("./bank-statement/bank-import-mutation").BankImportMutation | typeof import("./payment/payment-query").PaymentQuery | typeof import("./payment/payment-mutation").PaymentMutation | typeof import("./account/account-query").AccountQuery | typeof import("./account/account-mutation").AccountMutation | typeof import("./accounting-document/accounting-document-query").AccountingDocumentQuery | typeof import("./accounting-document/accounting-document-mutation").AccountingDocumentMutation | typeof import("./recurring-cash-item/recurring-cash-item-query").RecurringCashItemQuery | typeof import("./recurring-cash-item/recurring-cash-item-mutation").RecurringCashItemMutation | typeof import("./financial-institution/financial-institution-query").FinancialInstitutionQuery | typeof import("./financial-institution/financial-institution-mutation").FinancialInstitutionMutation | typeof import("./fiscal-month/fiscal-month-query").FiscalMonthQuery | typeof import("./fiscal-month/fiscal-month-mutation").FiscalMonthMutation | typeof import("./fiscal-quarter/fiscal-quarter-query").FiscalQuarterQuery | typeof import("./fiscal-quarter/fiscal-quarter-mutation").FiscalQuarterMutation | typeof import("./fiscal-year/fiscal-year-query").FiscalYearQuery | typeof import("./fiscal-year/fiscal-year-mutation").FiscalYearMutation | typeof import("./counterparty-account/counterparty-account-query").CounterpartyAccountQuery | typeof import("./expenditure-request/expenditure-request-query").ExpenditureRequestQuery | typeof import("./expenditure-request/expenditure-request-query").ExpenditureRequestItemQuery | typeof import("./expenditure-request/expenditure-request-mutation").ExpenditureRequestMutation)[];
48
+ resolverClasses: (typeof import("./financial-statement/financial-statement-query").FinancialStatementQuery | typeof import("./financial-statement/financial-statement-query").FinancialStatementLineQuery | typeof import("./financial-statement/financial-statement-mutation").FinancialStatementMutation | typeof import("./accounting-category/accounting-category-query").AccountingCategoryQuery | typeof import("./accounting-category/accounting-category-mutation").AccountingCategoryMutation | typeof import("./transaction/transaction-query").TransactionQuery | typeof import("./transaction/transaction-mutation").TransactionMutation | typeof import("./bank-account/bank-account-query").BankAccountQuery | typeof import("./bank-account/bank-account-mutation").BankAccountMutation | typeof import("./bank-account/card-query").CardQuery | typeof import("./bank-statement/bank-statement-query").BankStatementQuery | typeof import("./bank-statement/bank-import-mutation").BankImportMutation | typeof import("./payment/payment-query").PaymentQuery | typeof import("./payment/payment-mutation").PaymentMutation | typeof import("./account/account-query").AccountQuery | typeof import("./account/account-mutation").AccountMutation | typeof import("./accounting-document/accounting-document-query").AccountingDocumentQuery | typeof import("./accounting-document/accounting-document-mutation").AccountingDocumentMutation | typeof import("./recurring-cash-item/recurring-cash-item-query").RecurringCashItemQuery | typeof import("./recurring-cash-item/recurring-cash-item-mutation").RecurringCashItemMutation | typeof import("./financial-institution/financial-institution-query").FinancialInstitutionQuery | typeof import("./financial-institution/financial-institution-mutation").FinancialInstitutionMutation | typeof import("./fiscal-month/fiscal-month-query").FiscalMonthQuery | typeof import("./fiscal-month/fiscal-month-mutation").FiscalMonthMutation | typeof import("./fiscal-quarter/fiscal-quarter-query").FiscalQuarterQuery | typeof import("./fiscal-quarter/fiscal-quarter-mutation").FiscalQuarterMutation | typeof import("./fiscal-year/fiscal-year-query").FiscalYearQuery | typeof import("./fiscal-year/fiscal-year-mutation").FiscalYearMutation | typeof import("./counterparty-account/counterparty-account-query").CounterpartyAccountQuery | typeof import("./expenditure-request/expenditure-request-query").ExpenditureRequestQuery | typeof import("./expenditure-request/expenditure-request-query").ExpenditureRequestItemQuery | typeof import("./expenditure-request/expenditure-request-mutation").ExpenditureRequestMutation | typeof import("./expenditure-request/card-charge-query").CardChargeQuery)[];
46
49
  };
@@ -23,6 +23,9 @@ tslib_1.__exportStar(require("./expenditure-request/expenditure-request-item"),
23
23
  tslib_1.__exportStar(require("./transaction/transaction-period"), exports);
24
24
  tslib_1.__exportStar(require("./transaction/transaction-service"), exports);
25
25
  tslib_1.__exportStar(require("./bank-account/bank-account-service"), exports);
26
+ tslib_1.__exportStar(require("./bank-account/card-rules"), exports);
27
+ tslib_1.__exportStar(require("./bank-account/card-summary"), exports);
28
+ tslib_1.__exportStar(require("./payment/card-bill-target"), exports);
26
29
  tslib_1.__exportStar(require("./payment/payment-targets"), exports);
27
30
  tslib_1.__exportStar(require("./payment/payment-service"), exports);
28
31
  tslib_1.__exportStar(require("./payment/payment-currency"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,2DAAgC;AAChC,oFAAyD;AACzD,oFAAyD;AACzD,oEAAyC;AACzC,sEAA2C;AAC3C,0EAA+C;AAC/C,4DAAi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4BAAwB;IAC3B,GAAG,qBAAkB;IACrB,GAAG,qBAAkB;IACrB,GAAG,iCAA6B;IAChC,GAAG,iCAA4B;IAC/B,GAAG,mCAA+B;IAClC,GAAG,0BAAsB;IACzB,GAAG,4BAAwB;IAC3B,GAAG,yBAAqB;IACxB,GAAG,kCAA8B;IACjC,GAAG,iCAA6B;CACjC,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,GAAG,+BAA2B;QAC9B,GAAG,+BAA2B;QAC9B,GAAG,uBAAoB;QACvB,GAAG,wBAAoB;QACvB,GAAG,0BAAsB;QACzB,GAAG,mBAAgB;QACnB,GAAG,mBAAgB;QACnB,GAAG,+BAA2B;QAC9B,GAAG,+BAA0B;QAC7B,GAAG,iCAA6B;QAChC,GAAG,wBAAoB;QACvB,GAAG,0BAAsB;QACzB,GAAG,uBAAmB;QACtB,GAAG,gCAA4B;QAC/B,GAAG,+BAA2B;KAC/B;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './cash-flow-type'\nexport * from './financial-statement/financial-statement'\nexport * from './accounting-category/accounting-category'\nexport * from './transaction/transaction'\nexport * from './bank-account/bank-account'\nexport * from './bank-statement/bank-statement'\nexport * from './payment/payment'\nexport * from './account/account'\nexport * from './accounting-document/accounting-document'\nexport * from './recurring-cash-item/recurring-cash-item'\nexport * from './financial-institution/financial-institution'\nexport * from './fiscal-month/fiscal-month'\nexport * from './fiscal-quarter/fiscal-quarter'\nexport * from './fiscal-year/fiscal-year'\nexport * from './expenditure-request/expenditure-request'\nexport * from './expenditure-request/expenditure-request-item'\n\n/* EXPORT SERVICES */\nexport * from './transaction/transaction-period'\nexport * from './transaction/transaction-service'\nexport * from './bank-account/bank-account-service'\nexport * from './payment/payment-targets'\nexport * from './payment/payment-service'\nexport * from './payment/payment-currency'\nexport * from './payment/document-targets'\nexport * from './financial-statement/financial-statement-line'\nexport * from './financial-statement/financial-statement-service'\nexport * from './recurring-cash-item/recurring-schedule'\nexport * from './recurring-cash-item/recurring-cash-item-service'\nexport * from './account/account-match'\nexport * from './account/default-accounts'\nexport * from './account/account-choice'\nexport * from './account/account-service'\nexport * from './bank-statement/bank-source'\nexport * from './bank-statement/bank-parser'\nexport * from './bank-statement/bank-reconcile'\nexport * from './bank-statement/bank-import-type'\nexport * from './bank-statement/bank-import'\nexport * from './counterparty-account/counterparty-account-rules'\nexport * from './counterparty-account/counterparty-account-service'\nexport * from './expenditure-request/expenditure-request-rules'\nexport * from './expenditure-request/expenditure-payment-state'\nexport * from './expenditure-request/expenditure-request-service'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport {\n entities as FinancialStatementEntities,\n resolvers as FinancialStatementResolvers,\n subscribers as FinancialStatementSubscribers\n} from './financial-statement'\nimport {\n entities as AccountingCategoryEntities,\n resolvers as AccountingCategoryResolvers,\n subscribers as AccountingCategorySubscribers\n} from './accounting-category'\nimport {\n entities as TransactionEntities,\n resolvers as TransactionResolvers,\n subscribers as TransactionSubscribers\n} from './transaction'\nimport {\n entities as BankAccountEntities,\n resolvers as BankAccountResolvers,\n subscribers as BankAccountSubscribers\n} from './bank-account'\nimport {\n entities as BankStatementEntities,\n resolvers as BankStatementResolvers,\n subscribers as BankStatementSubscribers\n} from './bank-statement'\nimport {\n entities as PaymentEntities,\n resolvers as PaymentResolvers,\n subscribers as PaymentSubscribers\n} from './payment'\nimport {\n entities as AccountEntities,\n resolvers as AccountResolvers,\n subscribers as AccountSubscribers\n} from './account'\nimport {\n entities as AccountingDocumentEntities,\n resolvers as AccountingDocumentResolvers,\n subscribers as AccountingDocumentSubscribers\n} from './accounting-document'\nimport {\n entities as RecurringCashItemEntities,\n resolvers as RecurringCashItemResolvers,\n subscribers as RecurringCashItemSubscribers\n} from './recurring-cash-item'\nimport {\n entities as FinancialInstitutionEntities,\n resolvers as FinancialInstitutionResolvers,\n subscribers as FinancialInstitutionSubscribers\n} from './financial-institution'\nimport {\n entities as FiscalMonthEntities,\n resolvers as FiscalMonthResolvers,\n subscribers as FiscalMonthSubscribers\n} from './fiscal-month'\nimport {\n entities as FiscalQuarterEntities,\n resolvers as FiscalQuarterResolvers,\n subscribers as FiscalQuarterSubscribers\n} from './fiscal-quarter'\nimport {\n entities as FiscalYearEntities,\n resolvers as FiscalYearResolvers,\n subscribers as FiscalYearSubscribers\n} from './fiscal-year'\nimport {\n entities as CounterpartyAccountEntities,\n resolvers as CounterpartyAccountResolvers,\n subscribers as CounterpartyAccountSubscribers\n} from './counterparty-account'\nimport {\n entities as ExpenditureRequestEntities,\n resolvers as ExpenditureRequestResolvers,\n subscribers as ExpenditureRequestSubscribers\n} from './expenditure-request'\n\nexport const entities = [\n ...FinancialStatementEntities,\n ...AccountingCategoryEntities,\n ...TransactionEntities,\n ...BankAccountEntities,\n ...BankStatementEntities,\n ...PaymentEntities,\n ...AccountEntities,\n ...AccountingDocumentEntities,\n ...RecurringCashItemEntities,\n ...FinancialInstitutionEntities,\n ...FiscalMonthEntities,\n ...FiscalQuarterEntities,\n ...FiscalYearEntities,\n ...CounterpartyAccountEntities,\n ...ExpenditureRequestEntities\n]\n\nexport const subscribers = [\n ...FinancialStatementSubscribers,\n ...AccountingCategorySubscribers,\n ...TransactionSubscribers,\n ...BankAccountSubscribers,\n ...BankStatementSubscribers,\n ...PaymentSubscribers,\n ...AccountSubscribers,\n ...AccountingDocumentSubscribers,\n ...RecurringCashItemSubscribers,\n ...FinancialInstitutionSubscribers,\n ...FiscalMonthSubscribers,\n ...FiscalQuarterSubscribers,\n ...FiscalYearSubscribers,\n ...CounterpartyAccountSubscribers,\n ...ExpenditureRequestSubscribers\n]\n\nexport const schema = {\n resolverClasses: [\n ...FinancialStatementResolvers,\n ...AccountingCategoryResolvers,\n ...TransactionResolvers,\n ...BankAccountResolvers,\n ...BankStatementResolvers,\n ...PaymentResolvers,\n ...AccountResolvers,\n ...AccountingDocumentResolvers,\n ...RecurringCashItemResolvers,\n ...FinancialInstitutionResolvers,\n ...FiscalMonthResolvers,\n ...FiscalQuarterResolvers,\n ...FiscalYearResolvers,\n ...CounterpartyAccountResolvers,\n ...ExpenditureRequestResolvers\n ]\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,2DAAgC;AAChC,oFAAyD;AACzD,oFAAyD;AACzD,oEAAyC;AACzC,sEAA2C;AAC3C,0EAA+C;AAC/C,4DAAiC;AACjC,4DAAiC;AACjC,oFAAyD;AACzD,oFAAyD;AACzD,wFAA6D;AAC7D,sEAA2C;AAC3C,0EAA+C;AAC/C,oEAAyC;AACzC,oFAAyD;AACzD,yFAA8D;AAE9D,qBAAqB;AACrB,2EAAgD;AAChD,4EAAiD;AACjD,8EAAmD;AACnD,oEAAyC;AACzC,sEAA2C;AAC3C,qEAA0C;AAC1C,oEAAyC;AACzC,oEAAyC;AACzC,qEAA0C;AAC1C,qEAA0C;AAC1C,yFAA8D;AAC9D,4FAAiE;AACjE,mFAAwD;AACxD,4FAAiE;AACjE,kEAAuC;AACvC,qEAA0C;AAC1C,mEAAwC;AACxC,oEAAyC;AACzC,uEAA4C;AAC5C,uEAA4C;AAC5C,0EAA+C;AAC/C,4EAAiD;AACjD,uEAA4C;AAC5C,4FAAiE;AACjE,8FAAmE;AACnE,0FAA+D;AAC/D,0FAA+D;AAC/D,4FAAiE;AAEjE,mCAAmC;AACnC,+DAI8B;AAC9B,+DAI8B;AAC9B,+CAIsB;AACtB,iDAIuB;AACvB,qDAIyB;AACzB,uCAIkB;AAClB,uCAIkB;AAClB,+DAI8B;AAC9B,+DAI8B;AAC9B,mEAIgC;AAChC,iDAIuB;AACvB,qDAIyB;AACzB,+CAIsB;AACtB,iEAI+B;AAC/B,+DAI8B;AAEjB,QAAA,QAAQ,GAAG;IACtB,GAAG,8BAA0B;IAC7B,GAAG,8BAA0B;IAC7B,GAAG,sBAAmB;IACtB,GAAG,uBAAmB;IACtB,GAAG,yBAAqB;IACxB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,8BAA0B;IAC7B,GAAG,8BAAyB;IAC5B,GAAG,gCAA4B;IAC/B,GAAG,uBAAmB;IACtB,GAAG,yBAAqB;IACxB,GAAG,sBAAkB;IACrB,GAAG,+BAA2B;IAC9B,GAAG,8BAA0B;CAC9B,CAAA;AAEY,QAAA,WAAW,GAAG;IACzB,GAAG,iCAA6B;IAChC,GAAG,iCAA6B;IAChC,GAAG,yBAAsB;IACzB,GAAG,0BAAsB;IACzB,GAAG,4BAAwB;IAC3B,GAAG,qBAAkB;IACrB,GAAG,qBAAkB;IACrB,GAAG,iCAA6B;IAChC,GAAG,iCAA4B;IAC/B,GAAG,mCAA+B;IAClC,GAAG,0BAAsB;IACzB,GAAG,4BAAwB;IAC3B,GAAG,yBAAqB;IACxB,GAAG,kCAA8B;IACjC,GAAG,iCAA6B;CACjC,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,GAAG,+BAA2B;QAC9B,GAAG,+BAA2B;QAC9B,GAAG,uBAAoB;QACvB,GAAG,wBAAoB;QACvB,GAAG,0BAAsB;QACzB,GAAG,mBAAgB;QACnB,GAAG,mBAAgB;QACnB,GAAG,+BAA2B;QAC9B,GAAG,+BAA0B;QAC7B,GAAG,iCAA6B;QAChC,GAAG,wBAAoB;QACvB,GAAG,0BAAsB;QACzB,GAAG,uBAAmB;QACtB,GAAG,gCAA4B;QAC/B,GAAG,+BAA2B;KAC/B;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './cash-flow-type'\nexport * from './financial-statement/financial-statement'\nexport * from './accounting-category/accounting-category'\nexport * from './transaction/transaction'\nexport * from './bank-account/bank-account'\nexport * from './bank-statement/bank-statement'\nexport * from './payment/payment'\nexport * from './account/account'\nexport * from './accounting-document/accounting-document'\nexport * from './recurring-cash-item/recurring-cash-item'\nexport * from './financial-institution/financial-institution'\nexport * from './fiscal-month/fiscal-month'\nexport * from './fiscal-quarter/fiscal-quarter'\nexport * from './fiscal-year/fiscal-year'\nexport * from './expenditure-request/expenditure-request'\nexport * from './expenditure-request/expenditure-request-item'\n\n/* EXPORT SERVICES */\nexport * from './transaction/transaction-period'\nexport * from './transaction/transaction-service'\nexport * from './bank-account/bank-account-service'\nexport * from './bank-account/card-rules'\nexport * from './bank-account/card-summary'\nexport * from './payment/card-bill-target'\nexport * from './payment/payment-targets'\nexport * from './payment/payment-service'\nexport * from './payment/payment-currency'\nexport * from './payment/document-targets'\nexport * from './financial-statement/financial-statement-line'\nexport * from './financial-statement/financial-statement-service'\nexport * from './recurring-cash-item/recurring-schedule'\nexport * from './recurring-cash-item/recurring-cash-item-service'\nexport * from './account/account-match'\nexport * from './account/default-accounts'\nexport * from './account/account-choice'\nexport * from './account/account-service'\nexport * from './bank-statement/bank-source'\nexport * from './bank-statement/bank-parser'\nexport * from './bank-statement/bank-reconcile'\nexport * from './bank-statement/bank-import-type'\nexport * from './bank-statement/bank-import'\nexport * from './counterparty-account/counterparty-account-rules'\nexport * from './counterparty-account/counterparty-account-service'\nexport * from './expenditure-request/expenditure-request-rules'\nexport * from './expenditure-request/expenditure-payment-state'\nexport * from './expenditure-request/expenditure-request-service'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport {\n entities as FinancialStatementEntities,\n resolvers as FinancialStatementResolvers,\n subscribers as FinancialStatementSubscribers\n} from './financial-statement'\nimport {\n entities as AccountingCategoryEntities,\n resolvers as AccountingCategoryResolvers,\n subscribers as AccountingCategorySubscribers\n} from './accounting-category'\nimport {\n entities as TransactionEntities,\n resolvers as TransactionResolvers,\n subscribers as TransactionSubscribers\n} from './transaction'\nimport {\n entities as BankAccountEntities,\n resolvers as BankAccountResolvers,\n subscribers as BankAccountSubscribers\n} from './bank-account'\nimport {\n entities as BankStatementEntities,\n resolvers as BankStatementResolvers,\n subscribers as BankStatementSubscribers\n} from './bank-statement'\nimport {\n entities as PaymentEntities,\n resolvers as PaymentResolvers,\n subscribers as PaymentSubscribers\n} from './payment'\nimport {\n entities as AccountEntities,\n resolvers as AccountResolvers,\n subscribers as AccountSubscribers\n} from './account'\nimport {\n entities as AccountingDocumentEntities,\n resolvers as AccountingDocumentResolvers,\n subscribers as AccountingDocumentSubscribers\n} from './accounting-document'\nimport {\n entities as RecurringCashItemEntities,\n resolvers as RecurringCashItemResolvers,\n subscribers as RecurringCashItemSubscribers\n} from './recurring-cash-item'\nimport {\n entities as FinancialInstitutionEntities,\n resolvers as FinancialInstitutionResolvers,\n subscribers as FinancialInstitutionSubscribers\n} from './financial-institution'\nimport {\n entities as FiscalMonthEntities,\n resolvers as FiscalMonthResolvers,\n subscribers as FiscalMonthSubscribers\n} from './fiscal-month'\nimport {\n entities as FiscalQuarterEntities,\n resolvers as FiscalQuarterResolvers,\n subscribers as FiscalQuarterSubscribers\n} from './fiscal-quarter'\nimport {\n entities as FiscalYearEntities,\n resolvers as FiscalYearResolvers,\n subscribers as FiscalYearSubscribers\n} from './fiscal-year'\nimport {\n entities as CounterpartyAccountEntities,\n resolvers as CounterpartyAccountResolvers,\n subscribers as CounterpartyAccountSubscribers\n} from './counterparty-account'\nimport {\n entities as ExpenditureRequestEntities,\n resolvers as ExpenditureRequestResolvers,\n subscribers as ExpenditureRequestSubscribers\n} from './expenditure-request'\n\nexport const entities = [\n ...FinancialStatementEntities,\n ...AccountingCategoryEntities,\n ...TransactionEntities,\n ...BankAccountEntities,\n ...BankStatementEntities,\n ...PaymentEntities,\n ...AccountEntities,\n ...AccountingDocumentEntities,\n ...RecurringCashItemEntities,\n ...FinancialInstitutionEntities,\n ...FiscalMonthEntities,\n ...FiscalQuarterEntities,\n ...FiscalYearEntities,\n ...CounterpartyAccountEntities,\n ...ExpenditureRequestEntities\n]\n\nexport const subscribers = [\n ...FinancialStatementSubscribers,\n ...AccountingCategorySubscribers,\n ...TransactionSubscribers,\n ...BankAccountSubscribers,\n ...BankStatementSubscribers,\n ...PaymentSubscribers,\n ...AccountSubscribers,\n ...AccountingDocumentSubscribers,\n ...RecurringCashItemSubscribers,\n ...FinancialInstitutionSubscribers,\n ...FiscalMonthSubscribers,\n ...FiscalQuarterSubscribers,\n ...FiscalYearSubscribers,\n ...CounterpartyAccountSubscribers,\n ...ExpenditureRequestSubscribers\n]\n\nexport const schema = {\n resolverClasses: [\n ...FinancialStatementResolvers,\n ...AccountingCategoryResolvers,\n ...TransactionResolvers,\n ...BankAccountResolvers,\n ...BankStatementResolvers,\n ...PaymentResolvers,\n ...AccountResolvers,\n ...AccountingDocumentResolvers,\n ...RecurringCashItemResolvers,\n ...FinancialInstitutionResolvers,\n ...FiscalMonthResolvers,\n ...FiscalQuarterResolvers,\n ...FiscalYearResolvers,\n ...CounterpartyAccountResolvers,\n ...ExpenditureRequestResolvers\n ]\n}\n"]}
@@ -0,0 +1,2 @@
1
+ /** What a card's bill pays: the card - its charges, spent before and paid now (ADR-0178 결정 4). */
2
+ export declare const CARD_BILL_TARGET = "BankAccount";