@bisondesk/documents-sdk 1.0.617 → 1.0.619
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/types/documents.d.ts +2 -0
- package/lib/types/documents.d.ts.map +1 -1
- package/lib/types/documents.js.map +1 -1
- package/lib/types/leasing.d.ts +2 -0
- package/lib/types/leasing.d.ts.map +1 -1
- package/lib/types/leasing.js +2 -0
- package/lib/types/leasing.js.map +1 -1
- package/lib/types/prefill.d.ts +3 -1
- package/lib/types/prefill.d.ts.map +1 -1
- package/lib/types/prefill.js +1 -0
- package/lib/types/prefill.js.map +1 -1
- package/package.json +1 -1
- package/src/types/documents.ts +2 -0
- package/src/types/leasing.ts +2 -0
- package/src/types/prefill.ts +4 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/constants/search.d.ts +0 -476
- package/lib/constants/search.d.ts.map +0 -1
- package/lib/constants/search.js +0 -240
- package/lib/constants/search.js.map +0 -1
- package/src/constants/index.js +0 -45
- package/src/constants/index.js.map +0 -1
- package/src/constants/search.js +0 -240
- package/src/constants/search.js.map +0 -1
- package/src/types/bank-accounts.js +0 -2
- package/src/types/bank-accounts.js.map +0 -1
- package/src/types/booking.js +0 -2
- package/src/types/booking.js.map +0 -1
- package/src/types/document-categories.js +0 -11
- package/src/types/document-categories.js.map +0 -1
- package/src/types/documents.js +0 -68
- package/src/types/documents.js.map +0 -1
- package/src/types/legacy.js +0 -2
- package/src/types/legacy.js.map +0 -1
- package/src/types/rules.js +0 -15
- package/src/types/rules.js.map +0 -1
- package/src/types/search.js +0 -13
- package/src/types/search.js.map +0 -1
- package/src/types/vat.js +0 -2
- package/src/types/vat.js.map +0 -1
- package/src/utils/previews.js +0 -2
- package/src/utils/previews.js.map +0 -1
package/lib/types/documents.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AttachmentValue, PhoneNumberValue } from '@bisondesk/commons-sdk/types'
|
|
|
3
3
|
import { BankAccountData } from './bank-accounts.js';
|
|
4
4
|
import { DocumentCategoryVisibility } from './document-categories.js';
|
|
5
5
|
import { FinanceDocumentV1 } from './legacy.js';
|
|
6
|
+
import type { ContractPrefillType } from './prefill.js';
|
|
6
7
|
export type FinanceDocument = FinanceDocumentV1 | FinanceDocumentV2;
|
|
7
8
|
export type Association = {
|
|
8
9
|
businessEntityId: BusinessEntityIds;
|
|
@@ -230,6 +231,7 @@ export type FinanceDocumentGenerateRequest = Omit<FinanceDocumentV2, 'id' | 'att
|
|
|
230
231
|
relatedContract?: {
|
|
231
232
|
contractId: string;
|
|
232
233
|
period: number;
|
|
234
|
+
prefillType?: ContractPrefillType;
|
|
233
235
|
};
|
|
234
236
|
};
|
|
235
237
|
export type DocumentGenerateRequestEvent = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.d.ts","sourceRoot":"/","sources":["types/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"documents.d.ts","sourceRoot":"/","sources":["types/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CA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,iBAAiB,GAAG,CAC/B,GAAgG,EACxE,EAAE;IAC1B,OAAO,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAE,GAAuB,CAAC,IAAI,CAAC,CAAC;AACtF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,KAAuC,EACoD,EAAE,CAC7F,KAAK,CAAC,YAAY,KAAK,YAAY,CAAC,cAAc,CAAC;AAErD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,GAAqC,EAC0C,EAAE;IACjF,OAAO,GAAG,CAAC,YAAY,KAAK,YAAY,CAAC,OAAO,CAAC;AACnD,CAAC,CAAC;AA6EF,MAAM,CAAN,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,6CAAmB,CAAA;IACnB,oDAA0B,CAAA;IAC1B,+CAAqB,CAAA;IACrB,0DAAgC,CAAA;AAClC,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC;AAED,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,uEAA6C,CAAA;IAC7C,6EAAmD,CAAA;AACrD,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;AAED,MAAM,CAAN,IAAY,6BAEX;AAFD,WAAY,6BAA6B;IACvC,2FAA0D,CAAA;AAC5D,CAAC,EAFW,6BAA6B,KAA7B,6BAA6B,QAExC","sourcesContent":["import { BusinessEntityIds } from '@bisondesk/commons-sdk/constants';\nimport { AttachmentValue, PhoneNumberValue } from '@bisondesk/commons-sdk/types';\nimport { BankAccountData } from './bank-accounts.js';\nimport { DocumentCategoryVisibility } from './document-categories.js';\nimport { FinanceDocumentV1 } from './legacy.js';\n\nexport type FinanceDocument = FinanceDocumentV1 | FinanceDocumentV2;\n\nexport type Association = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n title: string;\n description: string;\n tags?: string[];\n linkTo?: {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n };\n};\n\nexport type FinanceDocumentLine = {\n id: string;\n category: string; // abstraction used to map lines to GL accounts (e.g., deposit, insurance)\n amount: string;\n amountExcl: string; // quantity * unit price\n description: string;\n foreign?: {\n amount: string;\n amountExcl: string;\n unitPriceExcl: string;\n vatAmount: string;\n };\n invoiceLineId?: string; // used by credit notes\n quantity: string;\n associations?: Association[];\n unitPriceExcl: string;\n vatAmount: string;\n vatCode: string;\n vatPercentage: string;\n vatReason?: string;\n\n costCenterId?: string; // optional override of the category's cost center\n externalId?: string; // id used by external systems (e.g., accounting integration)\n};\n\ntype OrgSummary = {\n id: string;\n code: number;\n name: string;\n vatNumber?: string;\n\n addressLine1?: string;\n addressLine2?: string;\n postcode?: string;\n city?: string;\n country: string;\n\n emails?: string[];\n phone?: PhoneNumberValue;\n\n // TODO person name?\n contact?: {\n name: string;\n username: string;\n };\n};\n\nexport enum FinanceDocType {\n Sale = 'Sale Finance',\n Purchase = 'Purchase Finance',\n}\n\ntype BaseDocument = {\n id: string;\n branchId: string;\n attachment: AttachmentValue;\n createdAt: string;\n createdBy: string;\n};\n\nexport type FinanceDocumentV2 = BaseDocument & {\n version: 2.0;\n language?: string;\n autoGenerated?: boolean;\n reference: string;\n subtype: FinanceDocumentSubtype;\n type: FinanceDocType;\n category: string;\n visibility?: DocumentCategoryVisibility;\n organizationSummary: OrgSummary;\n\n dueDate?: string;\n transferDescription?: string; // we ask clients to put this as description of the transfer\n invoiceId?: string; // mandatory in credit notes but optional in invoices on invoices represents a reissued invoice\n issueDate: string;\n lines: FinanceDocumentLine[];\n accountingLines?: FinanceDocumentLine[];\n notes?: string;\n salesperson?: {\n name: string;\n username: string;\n };\n tags: string[]; // optional values used to improve document search\n total: {\n amountExcl: string;\n amount: string;\n currencyCode: string; // from the branch\n foreign?: {\n amount: string;\n amountExcl: string;\n vatAmount: string;\n currencyCode: string;\n exchangeRate: string;\n };\n vatAmount: string;\n };\n\n paidAt?: string; // ONLY for when accounting integration is not used. Otherwise ALWAYS look at the Finance Booking paidAt\n\n reportingPeriod?: string;\n reportingYear?: string;\n accountingDescription?: string;\n\n // mostly for the case we want to regenerate the document pdf again\n bankAccounts?: BankAccountData[];\n\n externalQrCodeUrl?: string; // QR code data to be rendered on the document\n externalId?: string; // id used by external systems (e.g., accounting integration, storecove)\n\n peppol?: {\n extraAttachments?: AttachmentValue[];\n // per-line snapshot of what was sent to Peppol via Storecove; keyed by FinanceDocumentLine.id\n additionalItemProperties?: {\n lineId: string;\n properties: { name: string; value: string }[];\n }[];\n };\n};\n\nexport type NewFinanceDocumentV2 = Omit<\n FinanceDocumentV2,\n 'id' | 'createdAt' | 'createdBy' | 'lines'\n> & {\n lines: Omit<FinanceDocumentLine, 'id'>[];\n};\n\nexport type AdministrativeDocument = BaseDocument & {\n tags?: string[];\n category: string;\n associations?: Association[];\n displayName?: string;\n};\n\nexport type NewAdministrativeDocument = Omit<\n AdministrativeDocument,\n 'id' | 'createdAt' | 'createdBy'\n>;\n\nexport enum DraftProcessStatus {\n Prefill = 'Prefill',\n Unprocessed = 'Unprocessed',\n Processed = 'Processed',\n BusinessValid = 'BusinessValid',\n AccountingValid = 'AccountingValid',\n Completed = 'Completed',\n}\n\nexport enum DraftProcessStage {\n AIProcessing = 'aiProcessing',\n Processing = 'processing',\n BusinessValidation = 'businessValidation',\n AccountingValidation = 'accountingValidation',\n DocumentCreation = 'documentCreation',\n Edit = 'edit',\n}\n\nexport type ValidationRulesResult = {\n failed?: string[];\n passed?: string[];\n skipped?: string[];\n details?: Record<string, string[]>;\n};\n\nexport type DocumentValidationRulesResults = {\n [DraftProcessStatus.BusinessValid]: ValidationRulesResult | undefined;\n [DraftProcessStatus.AccountingValid]: ValidationRulesResult | undefined;\n};\n\nexport type NewDraftRemarks = {\n accounting?: string;\n business?: string;\n};\n\nexport type DraftRemarks = NewDraftRemarks & {\n at: string;\n by: string;\n};\n\ntype DraftProcessing = {\n status: DraftProcessStatus;\n documentType?: DocumentType;\n vatTotalCheck?: string;\n totalCheck?: string;\n rejectedAt?: string;\n rejectedBy?: string;\n rejectionReason?: string;\n lastCompletedAt?: string;\n\n validationRulesResult?: ValidationRulesResult;\n remarks?: DraftRemarks;\n};\n\nexport enum DocumentType {\n Finance = 'Finance Document',\n Administrative = 'Administrative Document',\n}\n\nexport type DocumentStatusLogEntry = {\n status: DraftProcessStatus;\n at: string;\n by: string;\n\n rejectionReason?: string;\n validationRulesResult?: ValidationRulesResult;\n};\n\nexport type DocumentStatusLogEntryWithDraft = DocumentStatusLogEntry & {\n draftData: DocumentDraft;\n};\n\ntype AssociationSuggestion = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n};\n\ntype BaseDocumentDraft = (BaseDocument & DraftProcessing) & {\n associationSuggestions?: AssociationSuggestion[];\n};\n\nexport type DocumentDraft<T = FinanceDocumentV2 | AdministrativeDocument> = Partial<T> &\n BaseDocumentDraft;\n\nexport type DocumentDraftListMeta = { status: DraftProcessStatus; count: number }[];\n\nexport enum DraftActions {\n Delete = 'delete',\n Validate = 'validate',\n Reject = 'reject',\n SaveChanges = 'save_changes',\n Submit = 'submit',\n ValidateBusinessRules = 'validate_business_rules',\n ValidateAccountingRules = 'validate_accounting_rules',\n}\n\nexport type RejectDraftRequest = {\n reason?: string;\n};\n\nexport type NewDocumentDraft<T = NewFinanceDocumentV2 | NewAdministrativeDocument> = Partial<T> &\n Omit<BaseDocumentDraft, 'id' | 'createdAt' | 'createdBy' | 'subtype'> & {\n subtype?: string;\n documentType?: DocumentType;\n };\n\nexport const isFinanceDocumentV2 = (\n arg: FinanceDocumentV2 | FinanceDocumentV1,\n): arg is FinanceDocumentV2 => {\n return (arg as FinanceDocumentV2).version == 2;\n};\n\nexport const isFinanceDocumentV1 = (\n arg: FinanceDocumentV2 | FinanceDocumentV1,\n): arg is FinanceDocumentV1 => {\n return (arg as FinanceDocumentV2).version == null;\n};\n\nexport const isFinanceDocument = (\n arg: FinanceDocument | AdministrativeDocument | NewAdministrativeDocument | NewFinanceDocumentV2,\n): arg is FinanceDocument => {\n return ['Sale Finance', 'Purchase Finance'].includes((arg as FinanceDocument).type);\n};\n\nexport const isAdministrativeDocumentDraft = (\n draft: DocumentDraft | NewDocumentDraft,\n): draft is DocumentDraft<AdministrativeDocument> | NewDocumentDraft<AdministrativeDocument> =>\n draft.documentType === DocumentType.Administrative;\n\nexport const isFinanceDocumentDraft = (\n arg: DocumentDraft | NewDocumentDraft,\n): arg is DocumentDraft<FinanceDocumentV2> | NewDocumentDraft<FinanceDocumentV2> => {\n return arg.documentType === DocumentType.Finance;\n};\n\nexport type NewFinanceDocumentLine = Omit<FinanceDocumentLine, 'id'>;\n\nexport type FinanceDocumentGenerateRequest = Omit<\n FinanceDocumentV2,\n | 'id'\n | 'attachment'\n | 'createdAt'\n | 'createdBy'\n | 'version'\n | 'reference'\n | 'lines'\n | 'accountingLines'\n> & {\n lines: NewFinanceDocumentLine[];\n accountingLines?: NewFinanceDocumentLine[];\n bankAccounts: BankAccountData[];\n\n relatedContract?: {\n contractId: string;\n period: number;\n };\n};\n\nexport type DocumentGenerateRequestEvent = {\n tenantId: string;\n userId: string;\n docId: string;\n request: FinanceDocumentGenerateRequest;\n};\n\nexport type GenerateFinanceDocumentResult = {\n docId: string;\n completedPartially?: boolean;\n};\n\nexport type FinanceDocumentGeneratePDFEvent = {\n tenantId: string;\n doc: FinanceDocumentV2;\n request: FinanceDocumentGenerateRequest;\n};\n\nexport type FinanceDocumentSettings<M = {}> = {\n provider: string;\n // whether the provider enforces credit notes to be linked to an invoice\n // lines. Eg can't change description of line values\n strictCreditNotes?: boolean;\n // whether the companies from the same country of the branch must provide\n // a vat number to generate sale finance documents\n mandatoryLocalOrganizationVatNumber?: boolean;\n meta: M;\n};\n\nexport type BisondeskMetaFinanceDocumentSettings = {\n [key in FinanceDocumentSubtype]: {\n templateId: string;\n };\n};\n\nexport type FinanceDocumentBisondeskSettings = {\n [FinanceDocumentSubtype.Invoice]: {\n prefix: string;\n templateId: string;\n };\n [FinanceDocumentSubtype.CreditNote]: {\n prefix: string;\n templateId: string;\n };\n};\n\nexport type FinanceDocumentPayment = {\n documentId: string;\n reference: string;\n attachment: AttachmentValue;\n} & ({ paid: true; paidAt: string } | { paid: false; paidAt?: undefined });\n\nexport enum FinanceDocumentSubtype {\n Invoice = 'Invoice',\n CreditNote = 'Credit Note',\n Proforma = 'Proforma',\n PurchaseOrder = 'Purchase Order',\n}\n\nexport enum FinanceDocumentActions {\n PAY_FINANCE_DOCUMENT = 'pay_finance_document',\n DELETE_FINANCE_DOCUMENT = 'delete_finance_document',\n}\n\nexport enum AdministrativeDocumentActions {\n DELETE_ADMINISTRATIVE_DOCUMENT = 'delete_finance_document',\n}\n\nexport type AdministrativeUpdateOperation =\n | {\n association?: undefined;\n doc: AdministrativeDocument;\n op: 'replace';\n }\n | {\n association?: undefined;\n doc: NewAdministrativeDocument;\n op: 'add';\n }\n | {\n association: {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n documentId: string;\n };\n doc?: undefined;\n op: 'remove-association';\n };\n"]}
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"/","sources":["types/documents.ts"],"names":[],"mappings":"AAoEA,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,+CAA6B,CAAA;AAC/B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAwFD,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,iDAA2B,CAAA;IAC3B,6CAAuB,CAAA;IACvB,qDAA+B,CAAA;IAC/B,yDAAmC,CAAA;IACnC,6CAAuB,CAAA;AACzB,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B;AAED,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,kDAA6B,CAAA;IAC7B,8CAAyB,CAAA;IACzB,8DAAyC,CAAA;IACzC,kEAA6C,CAAA;IAC7C,0DAAqC,CAAA;IACrC,kCAAa,CAAA;AACf,CAAC,E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;IACrB,0DAAgC,CAAA;AAClC,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC;AAED,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,uEAA6C,CAAA;IAC7C,6EAAmD,CAAA;AACrD,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;AAED,MAAM,CAAN,IAAY,6BAEX;AAFD,WAAY,6BAA6B;IACvC,2FAA0D,CAAA;AAC5D,CAAC,EAFW,6BAA6B,KAA7B,6BAA6B,QAExC","sourcesContent":["import { BusinessEntityIds } from '@bisondesk/commons-sdk/constants';\nimport { AttachmentValue, PhoneNumberValue } from '@bisondesk/commons-sdk/types';\nimport { BankAccountData } from './bank-accounts.js';\nimport { DocumentCategoryVisibility } from './document-categories.js';\nimport { FinanceDocumentV1 } from './legacy.js';\nimport type { ContractPrefillType } from './prefill.js';\n\nexport type FinanceDocument = FinanceDocumentV1 | FinanceDocumentV2;\n\nexport type Association = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n title: string;\n description: string;\n tags?: string[];\n linkTo?: {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n };\n};\n\nexport type FinanceDocumentLine = {\n id: string;\n category: string; // abstraction used to map lines to GL accounts (e.g., deposit, insurance)\n amount: string;\n amountExcl: string; // quantity * unit price\n description: string;\n foreign?: {\n amount: string;\n amountExcl: string;\n unitPriceExcl: string;\n vatAmount: string;\n };\n invoiceLineId?: string; // used by credit notes\n quantity: string;\n associations?: Association[];\n unitPriceExcl: string;\n vatAmount: string;\n vatCode: string;\n vatPercentage: string;\n vatReason?: string;\n\n costCenterId?: string; // optional override of the category's cost center\n externalId?: string; // id used by external systems (e.g., accounting integration)\n};\n\ntype OrgSummary = {\n id: string;\n code: number;\n name: string;\n vatNumber?: string;\n\n addressLine1?: string;\n addressLine2?: string;\n postcode?: string;\n city?: string;\n country: string;\n\n emails?: string[];\n phone?: PhoneNumberValue;\n\n // TODO person name?\n contact?: {\n name: string;\n username: string;\n };\n};\n\nexport enum FinanceDocType {\n Sale = 'Sale Finance',\n Purchase = 'Purchase Finance',\n}\n\ntype BaseDocument = {\n id: string;\n branchId: string;\n attachment: AttachmentValue;\n createdAt: string;\n createdBy: string;\n};\n\nexport type FinanceDocumentV2 = BaseDocument & {\n version: 2.0;\n language?: string;\n autoGenerated?: boolean;\n reference: string;\n subtype: FinanceDocumentSubtype;\n type: FinanceDocType;\n category: string;\n visibility?: DocumentCategoryVisibility;\n organizationSummary: OrgSummary;\n\n dueDate?: string;\n transferDescription?: string; // we ask clients to put this as description of the transfer\n invoiceId?: string; // mandatory in credit notes but optional in invoices on invoices represents a reissued invoice\n issueDate: string;\n lines: FinanceDocumentLine[];\n accountingLines?: FinanceDocumentLine[];\n notes?: string;\n salesperson?: {\n name: string;\n username: string;\n };\n tags: string[]; // optional values used to improve document search\n total: {\n amountExcl: string;\n amount: string;\n currencyCode: string; // from the branch\n foreign?: {\n amount: string;\n amountExcl: string;\n vatAmount: string;\n currencyCode: string;\n exchangeRate: string;\n };\n vatAmount: string;\n };\n\n paidAt?: string; // ONLY for when accounting integration is not used. Otherwise ALWAYS look at the Finance Booking paidAt\n\n reportingPeriod?: string;\n reportingYear?: string;\n accountingDescription?: string;\n\n // mostly for the case we want to regenerate the document pdf again\n bankAccounts?: BankAccountData[];\n\n externalQrCodeUrl?: string; // QR code data to be rendered on the document\n externalId?: string; // id used by external systems (e.g., accounting integration, storecove)\n\n peppol?: {\n extraAttachments?: AttachmentValue[];\n // per-line snapshot of what was sent to Peppol via Storecove; keyed by FinanceDocumentLine.id\n additionalItemProperties?: {\n lineId: string;\n properties: { name: string; value: string }[];\n }[];\n };\n};\n\nexport type NewFinanceDocumentV2 = Omit<\n FinanceDocumentV2,\n 'id' | 'createdAt' | 'createdBy' | 'lines'\n> & {\n lines: Omit<FinanceDocumentLine, 'id'>[];\n};\n\nexport type AdministrativeDocument = BaseDocument & {\n tags?: string[];\n category: string;\n associations?: Association[];\n displayName?: string;\n};\n\nexport type NewAdministrativeDocument = Omit<\n AdministrativeDocument,\n 'id' | 'createdAt' | 'createdBy'\n>;\n\nexport enum DraftProcessStatus {\n Prefill = 'Prefill',\n Unprocessed = 'Unprocessed',\n Processed = 'Processed',\n BusinessValid = 'BusinessValid',\n AccountingValid = 'AccountingValid',\n Completed = 'Completed',\n}\n\nexport enum DraftProcessStage {\n AIProcessing = 'aiProcessing',\n Processing = 'processing',\n BusinessValidation = 'businessValidation',\n AccountingValidation = 'accountingValidation',\n DocumentCreation = 'documentCreation',\n Edit = 'edit',\n}\n\nexport type ValidationRulesResult = {\n failed?: string[];\n passed?: string[];\n skipped?: string[];\n details?: Record<string, string[]>;\n};\n\nexport type DocumentValidationRulesResults = {\n [DraftProcessStatus.BusinessValid]: ValidationRulesResult | undefined;\n [DraftProcessStatus.AccountingValid]: ValidationRulesResult | undefined;\n};\n\nexport type NewDraftRemarks = {\n accounting?: string;\n business?: string;\n};\n\nexport type DraftRemarks = NewDraftRemarks & {\n at: string;\n by: string;\n};\n\ntype DraftProcessing = {\n status: DraftProcessStatus;\n documentType?: DocumentType;\n vatTotalCheck?: string;\n totalCheck?: string;\n rejectedAt?: string;\n rejectedBy?: string;\n rejectionReason?: string;\n lastCompletedAt?: string;\n\n validationRulesResult?: ValidationRulesResult;\n remarks?: DraftRemarks;\n};\n\nexport enum DocumentType {\n Finance = 'Finance Document',\n Administrative = 'Administrative Document',\n}\n\nexport type DocumentStatusLogEntry = {\n status: DraftProcessStatus;\n at: string;\n by: string;\n\n rejectionReason?: string;\n validationRulesResult?: ValidationRulesResult;\n};\n\nexport type DocumentStatusLogEntryWithDraft = DocumentStatusLogEntry & {\n draftData: DocumentDraft;\n};\n\ntype AssociationSuggestion = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n};\n\ntype BaseDocumentDraft = (BaseDocument & DraftProcessing) & {\n associationSuggestions?: AssociationSuggestion[];\n};\n\nexport type DocumentDraft<T = FinanceDocumentV2 | AdministrativeDocument> = Partial<T> &\n BaseDocumentDraft;\n\nexport type DocumentDraftListMeta = { status: DraftProcessStatus; count: number }[];\n\nexport enum DraftActions {\n Delete = 'delete',\n Validate = 'validate',\n Reject = 'reject',\n SaveChanges = 'save_changes',\n Submit = 'submit',\n ValidateBusinessRules = 'validate_business_rules',\n ValidateAccountingRules = 'validate_accounting_rules',\n}\n\nexport type RejectDraftRequest = {\n reason?: string;\n};\n\nexport type NewDocumentDraft<T = NewFinanceDocumentV2 | NewAdministrativeDocument> = Partial<T> &\n Omit<BaseDocumentDraft, 'id' | 'createdAt' | 'createdBy' | 'subtype'> & {\n subtype?: string;\n documentType?: DocumentType;\n };\n\nexport const isFinanceDocumentV2 = (\n arg: FinanceDocumentV2 | FinanceDocumentV1,\n): arg is FinanceDocumentV2 => {\n return (arg as FinanceDocumentV2).version == 2;\n};\n\nexport const isFinanceDocumentV1 = (\n arg: FinanceDocumentV2 | FinanceDocumentV1,\n): arg is FinanceDocumentV1 => {\n return (arg as FinanceDocumentV2).version == null;\n};\n\nexport const isFinanceDocument = (\n arg: FinanceDocument | AdministrativeDocument | NewAdministrativeDocument | NewFinanceDocumentV2,\n): arg is FinanceDocument => {\n return ['Sale Finance', 'Purchase Finance'].includes((arg as FinanceDocument).type);\n};\n\nexport const isAdministrativeDocumentDraft = (\n draft: DocumentDraft | NewDocumentDraft,\n): draft is DocumentDraft<AdministrativeDocument> | NewDocumentDraft<AdministrativeDocument> =>\n draft.documentType === DocumentType.Administrative;\n\nexport const isFinanceDocumentDraft = (\n arg: DocumentDraft | NewDocumentDraft,\n): arg is DocumentDraft<FinanceDocumentV2> | NewDocumentDraft<FinanceDocumentV2> => {\n return arg.documentType === DocumentType.Finance;\n};\n\nexport type NewFinanceDocumentLine = Omit<FinanceDocumentLine, 'id'>;\n\nexport type FinanceDocumentGenerateRequest = Omit<\n FinanceDocumentV2,\n | 'id'\n | 'attachment'\n | 'createdAt'\n | 'createdBy'\n | 'version'\n | 'reference'\n | 'lines'\n | 'accountingLines'\n> & {\n lines: NewFinanceDocumentLine[];\n accountingLines?: NewFinanceDocumentLine[];\n bankAccounts: BankAccountData[];\n\n relatedContract?: {\n contractId: string;\n period: number;\n prefillType?: ContractPrefillType;\n };\n};\n\nexport type DocumentGenerateRequestEvent = {\n tenantId: string;\n userId: string;\n docId: string;\n request: FinanceDocumentGenerateRequest;\n};\n\nexport type GenerateFinanceDocumentResult = {\n docId: string;\n completedPartially?: boolean;\n};\n\nexport type FinanceDocumentGeneratePDFEvent = {\n tenantId: string;\n doc: FinanceDocumentV2;\n request: FinanceDocumentGenerateRequest;\n};\n\nexport type FinanceDocumentSettings<M = {}> = {\n provider: string;\n // whether the provider enforces credit notes to be linked to an invoice\n // lines. Eg can't change description of line values\n strictCreditNotes?: boolean;\n // whether the companies from the same country of the branch must provide\n // a vat number to generate sale finance documents\n mandatoryLocalOrganizationVatNumber?: boolean;\n meta: M;\n};\n\nexport type BisondeskMetaFinanceDocumentSettings = {\n [key in FinanceDocumentSubtype]: {\n templateId: string;\n };\n};\n\nexport type FinanceDocumentBisondeskSettings = {\n [FinanceDocumentSubtype.Invoice]: {\n prefix: string;\n templateId: string;\n };\n [FinanceDocumentSubtype.CreditNote]: {\n prefix: string;\n templateId: string;\n };\n};\n\nexport type FinanceDocumentPayment = {\n documentId: string;\n reference: string;\n attachment: AttachmentValue;\n} & ({ paid: true; paidAt: string } | { paid: false; paidAt?: undefined });\n\nexport enum FinanceDocumentSubtype {\n Invoice = 'Invoice',\n CreditNote = 'Credit Note',\n Proforma = 'Proforma',\n PurchaseOrder = 'Purchase Order',\n}\n\nexport enum FinanceDocumentActions {\n PAY_FINANCE_DOCUMENT = 'pay_finance_document',\n DELETE_FINANCE_DOCUMENT = 'delete_finance_document',\n}\n\nexport enum AdministrativeDocumentActions {\n DELETE_ADMINISTRATIVE_DOCUMENT = 'delete_finance_document',\n}\n\nexport type AdministrativeUpdateOperation =\n | {\n association?: undefined;\n doc: AdministrativeDocument;\n op: 'replace';\n }\n | {\n association?: undefined;\n doc: NewAdministrativeDocument;\n op: 'add';\n }\n | {\n association: {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n documentId: string;\n };\n doc?: undefined;\n op: 'remove-association';\n };\n"]}
|
package/lib/types/leasing.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export declare const LEASING_DOCUMENT_CATEGORY_ID = "leasing_sale";
|
|
|
6
6
|
export declare const LEASING_COST_CENTER_ID = "leasing_cost_center";
|
|
7
7
|
export declare enum LeasingFinanceLineCode {
|
|
8
8
|
Capital = "LEASING_CAPITAL",
|
|
9
|
+
CapitalShortTerm = "LEASING_CAPITAL_SHORT_TERM",
|
|
10
|
+
CapitalLongTerm = "LEASING_CAPITAL_LONG_TERM",
|
|
9
11
|
Deposit = "LEASING_DEPOSIT",
|
|
10
12
|
Fees = "LEASING_FEES",
|
|
11
13
|
LateFees = "LEASING_LATE_FEES",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leasing.d.ts","sourceRoot":"/","sources":["types/leasing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,MAAM,iCAAiC,GAAG,wBAAwB,GAAG;IACzE,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAC5D,oBAAY,sBAAsB;IAChC,OAAO,oBAAoB;IAC3B,OAAO,oBAAoB;IAC3B,IAAI,iBAAiB;IACrB,QAAQ,sBAAsB;IAC9B,SAAS,sBAAsB;IAC/B,QAAQ,qBAAqB;IAC7B,KAAK,kBAAkB;IACvB,IAAI,iBAAiB;IACrB,QAAQ,qBAAqB;IAC7B,KAAK,kBAAkB;IACvB,YAAY,0BAA0B;CACvC"}
|
|
1
|
+
{"version":3,"file":"leasing.d.ts","sourceRoot":"/","sources":["types/leasing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,MAAM,iCAAiC,GAAG,wBAAwB,GAAG;IACzE,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAC5D,oBAAY,sBAAsB;IAChC,OAAO,oBAAoB;IAC3B,gBAAgB,+BAA+B;IAC/C,eAAe,8BAA8B;IAC7C,OAAO,oBAAoB;IAC3B,IAAI,iBAAiB;IACrB,QAAQ,sBAAsB;IAC9B,SAAS,sBAAsB;IAC/B,QAAQ,qBAAqB;IAC7B,KAAK,kBAAkB;IACvB,IAAI,iBAAiB;IACrB,QAAQ,qBAAqB;IAC7B,KAAK,kBAAkB;IACvB,YAAY,0BAA0B;CACvC"}
|
package/lib/types/leasing.js
CHANGED
|
@@ -3,6 +3,8 @@ export const LEASING_COST_CENTER_ID = 'leasing_cost_center';
|
|
|
3
3
|
export var LeasingFinanceLineCode;
|
|
4
4
|
(function (LeasingFinanceLineCode) {
|
|
5
5
|
LeasingFinanceLineCode["Capital"] = "LEASING_CAPITAL";
|
|
6
|
+
LeasingFinanceLineCode["CapitalShortTerm"] = "LEASING_CAPITAL_SHORT_TERM";
|
|
7
|
+
LeasingFinanceLineCode["CapitalLongTerm"] = "LEASING_CAPITAL_LONG_TERM";
|
|
6
8
|
LeasingFinanceLineCode["Deposit"] = "LEASING_DEPOSIT";
|
|
7
9
|
LeasingFinanceLineCode["Fees"] = "LEASING_FEES";
|
|
8
10
|
LeasingFinanceLineCode["LateFees"] = "LEASING_LATE_FEES";
|
package/lib/types/leasing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leasing.js","sourceRoot":"/","sources":["types/leasing.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,4BAA4B,GAAG,cAAc,CAAC;AAC3D,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAC5D,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"leasing.js","sourceRoot":"/","sources":["types/leasing.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,4BAA4B,GAAG,cAAc,CAAC;AAC3D,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAC5D,MAAM,CAAN,IAAY,sBAcX;AAdD,WAAY,sBAAsB;IAChC,qDAA2B,CAAA;IAC3B,yEAA+C,CAAA;IAC/C,uEAA6C,CAAA;IAC7C,qDAA2B,CAAA;IAC3B,+CAAqB,CAAA;IACrB,wDAA8B,CAAA;IAC9B,yDAA+B,CAAA;IAC/B,uDAA6B,CAAA;IAC7B,iDAAuB,CAAA;IACvB,+CAAqB,CAAA;IACrB,uDAA6B,CAAA;IAC7B,iDAAuB,CAAA;IACvB,gEAAsC,CAAA;AACxC,CAAC,EAdW,sBAAsB,KAAtB,sBAAsB,QAcjC","sourcesContent":["import { NewManualFinanceDocument } from './manual-invoice.js';\n\nexport type NewExistingLeasingFinanceDocument = NewManualFinanceDocument & {\n period: string;\n};\n\nexport const LEASING_DOCUMENT_CATEGORY_ID = 'leasing_sale';\nexport const LEASING_COST_CENTER_ID = 'leasing_cost_center';\nexport enum LeasingFinanceLineCode {\n Capital = 'LEASING_CAPITAL',\n CapitalShortTerm = 'LEASING_CAPITAL_SHORT_TERM',\n CapitalLongTerm = 'LEASING_CAPITAL_LONG_TERM',\n Deposit = 'LEASING_DEPOSIT',\n Fees = 'LEASING_FEES',\n LateFees = 'LEASING_LATE_FEES',\n Insurance = 'LEASING_INSURANCE',\n Interest = 'LEASING_INTEREST',\n Other = 'LEASING_OTHER',\n Rent = 'LEASING_RENT',\n Residual = 'LEASING_RESIDUAL',\n Taxes = 'LEASING_TAXES',\n OwnFinancing = 'LEASING_OWN_FINANCING',\n}\n"]}
|
package/lib/types/prefill.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { FinanceDocumentSubtype, NewFinanceDocumentLine } from './documents.js';
|
|
|
5
5
|
export declare enum ContractPrefillType {
|
|
6
6
|
Deposit = "deposit",
|
|
7
7
|
FirstRent = "firstRent",
|
|
8
|
-
Residual = "residual"
|
|
8
|
+
Residual = "residual",
|
|
9
|
+
BuyOff = "buyOff"
|
|
9
10
|
}
|
|
10
11
|
export declare enum OpportunityPrefillType {
|
|
11
12
|
Client = "client",
|
|
@@ -53,6 +54,7 @@ export type FinanceDocumentPrefillValues = {
|
|
|
53
54
|
salespersonId?: string;
|
|
54
55
|
salesperson?: UserSummary;
|
|
55
56
|
lines: NewFinanceDocumentLine[];
|
|
57
|
+
accountingLines?: NewFinanceDocumentLine[];
|
|
56
58
|
contractId?: string;
|
|
57
59
|
contractPeriod?: number;
|
|
58
60
|
contractPrefillType?: ContractPrefillType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefill.d.ts","sourceRoot":"/","sources":["types/prefill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEhF,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"prefill.d.ts","sourceRoot":"/","sources":["types/prefill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEhF,oBAAY,mBAAmB;IAC7B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AC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAGhC,eAAe,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B,CAAC"}
|
package/lib/types/prefill.js
CHANGED
|
@@ -3,6 +3,7 @@ export var ContractPrefillType;
|
|
|
3
3
|
ContractPrefillType["Deposit"] = "deposit";
|
|
4
4
|
ContractPrefillType["FirstRent"] = "firstRent";
|
|
5
5
|
ContractPrefillType["Residual"] = "residual";
|
|
6
|
+
ContractPrefillType["BuyOff"] = "buyOff";
|
|
6
7
|
})(ContractPrefillType || (ContractPrefillType = {}));
|
|
7
8
|
export var OpportunityPrefillType;
|
|
8
9
|
(function (OpportunityPrefillType) {
|
package/lib/types/prefill.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefill.js","sourceRoot":"/","sources":["types/prefill.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"prefill.js","sourceRoot":"/","sources":["types/prefill.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8CAAuB,CAAA;IACvB,4CAAqB,CAAA;IACrB,wCAAiB,CAAA;AACnB,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAED,MAAM,CAAN,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,+DAAqC,CAAA;IACrC,yDAA+B,CAAA;AACjC,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,QAIjC;AAED,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,uCAAqB,CAAA;AACvB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AA2BD,MAAM,CAAN,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,wEAAkD,CAAA;AACpD,CAAC,EAFW,kBAAkB,KAAlB,kBAAkB,QAE7B","sourcesContent":["import { BusinessEntityIds } from '@bisondesk/commons-sdk/constants';\nimport { TransactionType } from '@bisondesk/commons-sdk/types';\nimport { UserSummary } from '@bisondesk/core-sdk/types/users';\nimport { FinanceDocumentSubtype, NewFinanceDocumentLine } from './documents.js';\n\nexport enum ContractPrefillType {\n Deposit = 'deposit',\n FirstRent = 'firstRent',\n Residual = 'residual',\n BuyOff = 'buyOff',\n}\n\nexport enum OpportunityPrefillType {\n Client = 'client',\n FinancingPartner = 'financingPartner',\n SelfFinancing = 'selfFinancing',\n}\n\nexport enum OrgPrefillType {\n LateFees = 'lateFees',\n}\n\nexport type FinanceDocumentPrefillRequest = {\n branchId: string;\n transactionType: TransactionType;\n subtype: FinanceDocumentSubtype;\n businessEntityId:\n | BusinessEntityIds.Opportunities\n | BusinessEntityIds.LeasingContracts\n | BusinessEntityIds.FinanceDocuments\n | BusinessEntityIds.Organizations;\n recordId?: string;\n opportunityOptions?: {\n prefillType?: OpportunityPrefillType;\n };\n contractOptions?: {\n prefillType?: ContractPrefillType;\n period?: number;\n };\n relatedInvoiceOptions?: {\n relatedInvoiceId?: string;\n };\n organizationOptions?: {\n prefillType?: OrgPrefillType;\n };\n};\n\nexport enum PrefillWarningCode {\n VatNumberNotValidated = 'VAT_NUMBER_NOT_VALIDATED',\n}\n\nexport type PrefillWarning = {\n code: PrefillWarningCode;\n messageKey: string;\n level: 'info' | 'warning' | 'error';\n metadata?: Record<string, string | undefined>;\n};\n\nexport type FinanceDocumentPrefillValues = {\n branchId: string;\n organizationId: string;\n contactId: string;\n category: string;\n notes?: string;\n salespersonId?: string;\n salesperson?: UserSummary;\n lines: NewFinanceDocumentLine[];\n // Preview of how `lines` will be booked in accounting, when it differs from `lines`.\n // Computed from the same logic as document generation; recomputed at generation time.\n accountingLines?: NewFinanceDocumentLine[];\n contractId?: string;\n contractPeriod?: number;\n contractPrefillType?: ContractPrefillType;\n warnings?: PrefillWarning[];\n};\n"]}
|
package/package.json
CHANGED
package/src/types/documents.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AttachmentValue, PhoneNumberValue } from '@bisondesk/commons-sdk/types'
|
|
|
3
3
|
import { BankAccountData } from './bank-accounts.js';
|
|
4
4
|
import { DocumentCategoryVisibility } from './document-categories.js';
|
|
5
5
|
import { FinanceDocumentV1 } from './legacy.js';
|
|
6
|
+
import type { ContractPrefillType } from './prefill.js';
|
|
6
7
|
|
|
7
8
|
export type FinanceDocument = FinanceDocumentV1 | FinanceDocumentV2;
|
|
8
9
|
|
|
@@ -311,6 +312,7 @@ export type FinanceDocumentGenerateRequest = Omit<
|
|
|
311
312
|
relatedContract?: {
|
|
312
313
|
contractId: string;
|
|
313
314
|
period: number;
|
|
315
|
+
prefillType?: ContractPrefillType;
|
|
314
316
|
};
|
|
315
317
|
};
|
|
316
318
|
|
package/src/types/leasing.ts
CHANGED
|
@@ -8,6 +8,8 @@ export const LEASING_DOCUMENT_CATEGORY_ID = 'leasing_sale';
|
|
|
8
8
|
export const LEASING_COST_CENTER_ID = 'leasing_cost_center';
|
|
9
9
|
export enum LeasingFinanceLineCode {
|
|
10
10
|
Capital = 'LEASING_CAPITAL',
|
|
11
|
+
CapitalShortTerm = 'LEASING_CAPITAL_SHORT_TERM',
|
|
12
|
+
CapitalLongTerm = 'LEASING_CAPITAL_LONG_TERM',
|
|
11
13
|
Deposit = 'LEASING_DEPOSIT',
|
|
12
14
|
Fees = 'LEASING_FEES',
|
|
13
15
|
LateFees = 'LEASING_LATE_FEES',
|
package/src/types/prefill.ts
CHANGED
|
@@ -7,6 +7,7 @@ export enum ContractPrefillType {
|
|
|
7
7
|
Deposit = 'deposit',
|
|
8
8
|
FirstRent = 'firstRent',
|
|
9
9
|
Residual = 'residual',
|
|
10
|
+
BuyOff = 'buyOff',
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export enum OpportunityPrefillType {
|
|
@@ -64,6 +65,9 @@ export type FinanceDocumentPrefillValues = {
|
|
|
64
65
|
salespersonId?: string;
|
|
65
66
|
salesperson?: UserSummary;
|
|
66
67
|
lines: NewFinanceDocumentLine[];
|
|
68
|
+
// Preview of how `lines` will be booked in accounting, when it differs from `lines`.
|
|
69
|
+
// Computed from the same logic as document generation; recomputed at generation time.
|
|
70
|
+
accountingLines?: NewFinanceDocumentLine[];
|
|
67
71
|
contractId?: string;
|
|
68
72
|
contractPeriod?: number;
|
|
69
73
|
contractPrefillType?: ContractPrefillType;
|