WIP: Add Drafts, Templates, and Recurring Transactions #45
|
|
@ -0,0 +1,32 @@
|
|||
import type { Currency } from '@/api/data'
|
||||
import type { TransactionLineItemResponse, TransactionVendor } from '@/api/transaction'
|
||||
|
||||
/**
|
||||
* The set of all form fields on the transaction editor page. Note that some
|
||||
* fields may only be used in certain contexts.
|
||||
*/
|
||||
export interface TransactionEditorFormFields {
|
||||
timestamp: string | null
|
||||
amount: number | null
|
||||
templateName: string | null // Only for drafts, not transactions.
|
||||
currency: Currency | null
|
||||
description: string | null
|
||||
internalTransfer: boolean | null
|
||||
vendor: TransactionVendor | null
|
||||
categoryId: number | null
|
||||
creditedAccountId: number | null
|
||||
debitedAccountId: number | null
|
||||
lineItems: TransactionLineItemResponse[]
|
||||
tags: string[]
|
||||
attachmentsToUpload: File[]
|
||||
removedAttachmentIds: number[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Base class for transaction editor contexts.
|
||||
*/
|
||||
export abstract class TransactionEditorContextBase {}
|
||||
|
||||
export class TransactionEditorContext extends TransactionEditorContextBase {}
|
||||
|
||||
export class DraftEditorContext extends TransactionEditorContextBase {}
|
||||
|
|
@ -44,7 +44,7 @@ const router = createRouter({
|
|||
},
|
||||
{
|
||||
path: 'accounts/:id/edit',
|
||||
component: () => import('@/pages/forms/EditAccountPage.vue'),
|
||||
component: () => import('@/pages/EditAccountPage.vue'),
|
||||
meta: { title: 'Edit Account' },
|
||||
},
|
||||
{
|
||||
|
|
@ -54,7 +54,7 @@ const router = createRouter({
|
|||
},
|
||||
{
|
||||
path: 'add-account',
|
||||
component: () => import('@/pages/forms/EditAccountPage.vue'),
|
||||
component: () => import('@/pages/EditAccountPage.vue'),
|
||||
meta: { title: 'Add Account' },
|
||||
},
|
||||
{
|
||||
|
|
@ -64,7 +64,7 @@ const router = createRouter({
|
|||
},
|
||||
{
|
||||
path: 'transactions/:id/edit',
|
||||
component: () => import('@/pages/forms/EditTransactionPage.vue'),
|
||||
component: () => import('@/pages/transaction-editor/EditTransactionPage.vue'),
|
||||
meta: { title: 'Edit Transaction' },
|
||||
},
|
||||
{
|
||||
|
|
@ -74,7 +74,7 @@ const router = createRouter({
|
|||
},
|
||||
{
|
||||
path: 'add-transaction',
|
||||
component: () => import('@/pages/forms/EditTransactionPage.vue'),
|
||||
component: () => import('@/pages/transaction-editor/EditTransactionPage.vue'),
|
||||
meta: { title: 'Add Transaction' },
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue