@bisondesk/documents-sdk 1.0.565 → 1.0.566
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/schemas.d.ts.map +1 -1
- package/lib/schemas.js +1 -0
- package/lib/schemas.js.map +1 -1
- package/lib/types/documents.d.ts +1 -0
- package/lib/types/documents.d.ts.map +1 -1
- package/lib/types/documents.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/index.js +45 -0
- package/src/constants/index.js.map +1 -0
- package/src/constants/search.js +240 -0
- package/src/constants/search.js.map +1 -0
- package/src/schemas.ts +1 -0
- package/src/types/bank-accounts.js +2 -0
- package/src/types/bank-accounts.js.map +1 -0
- package/src/types/booking.js +2 -0
- package/src/types/booking.js.map +1 -0
- package/src/types/document-categories.js +11 -0
- package/src/types/document-categories.js.map +1 -0
- package/src/types/documents.js +68 -0
- package/src/types/documents.js.map +1 -0
- package/src/types/documents.ts +1 -0
- package/src/types/legacy.js +2 -0
- package/src/types/legacy.js.map +1 -0
- package/src/types/rules.js +15 -0
- package/src/types/rules.js.map +1 -0
- package/src/types/search.js +13 -0
- package/src/types/search.js.map +1 -0
- package/src/types/vat.js +2 -0
- package/src/types/vat.js.map +1 -0
- package/src/utils/previews.js +2 -0
- package/src/utils/previews.js.map +1 -0
- package/tsconfig.tsbuildinfo +1 -1
package/lib/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"/","sources":["schemas.ts"],"names":[],"mappings":"AAOA,OAAO,GAAG,MAAM,KAAK,CAAC;AAqCtB,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"/","sources":["schemas.ts"],"names":[],"mappings":"AAOA,OAAO,GAAG,MAAM,KAAK,CAAC;AAqCtB,eAAO,MAAM,UAAU,uBAoBrB,CAAC;AAEH,eAAO,MAAM,qBAAqB,uBA4DhC,CAAC;AAEH,eAAO,MAAM,gCAAgC,uBAS3C,CAAC;AAEH,eAAO,MAAM,4BAA4B,uBAIvC,CAAC"}
|
package/lib/schemas.js
CHANGED
|
@@ -52,6 +52,7 @@ export const lineSchema = Joi.object({
|
|
|
52
52
|
vatCode: Joi.string().required(),
|
|
53
53
|
vatPercentage: Joi.number().min(0).cast('string').required(),
|
|
54
54
|
vatReason: Joi.string().empty(''),
|
|
55
|
+
costCenterId: Joi.string().empty(''),
|
|
55
56
|
});
|
|
56
57
|
export const newFinanceDocV2Schema = Joi.object({
|
|
57
58
|
id: Joi.string().uuid(),
|
package/lib/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"/","sources":["schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IAChC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IACjC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IACpC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAA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from '@bisondesk/commons/joi-schemas';\nimport { FinanceDocType } from '@bisondesk/documents-sdk/types/documents';\nimport Joi from 'joi';\n\nconst orgSummarySchema = Joi.object({\n id: Joi.string().required(),\n code: Joi.number().required(),\n name: Joi.string().empty('').required(),\n language: Joi.string().empty(''),\n vatNumber: Joi.string().empty(''),\n addressLine1: Joi.string().empty(''),\n addressLine2: Joi.string().empty(''),\n postcode: Joi.string().empty(''),\n city: Joi.string().empty(''),\n country: Joi.string().required(),\n emails: Joi.array().items(Joi.string().empty('').email()),\n phone: getPhoneSchema(),\n contact: Joi.object({\n name: Joi.string().empty('').required(),\n username: Joi.string().empty('').required(),\n }),\n});\n\nconst associationsSchema = Joi.array().items(\n Joi.object({\n businessEntityId: Joi.string()\n .valid(...Object.values(BusinessEntityIds))\n .required(),\n recordId: Joi.string().required(),\n title: Joi.string().required(),\n description: Joi.string().required(),\n tags: Joi.array().items(Joi.string().empty('')),\n linkTo: Joi.object({\n businessEntityId: Joi.string().required(),\n recordId: Joi.string().required(),\n }),\n })\n);\n\nexport const lineSchema = Joi.object({\n category: Joi.string().required(),\n amount: Joi.number().cast('string').required(),\n amountExcl: Joi.number().cast('string').required(),\n description: Joi.string().required(),\n foreign: Joi.object({\n amount: Joi.number().cast('string').required(),\n amountExcl: Joi.number().cast('string').required(),\n unitPriceExcl: Joi.number().cast('string').required(),\n vatAmount: Joi.number().cast('string').required(),\n }),\n invoiceLineId: Joi.string().empty('').uuid(),\n quantity: Joi.number().min(0).cast('string').required(),\n associations: associationsSchema,\n unitPriceExcl: Joi.number().cast('string').required(),\n vatAmount: Joi.number().cast('string').required(),\n vatCode: Joi.string().required(),\n vatPercentage: Joi.number().min(0).cast('string').required(),\n vatReason: Joi.string().empty(''),\n});\n\nexport const newFinanceDocV2Schema = Joi.object({\n id: Joi.string().uuid(),\n version: Joi.number().valid(2.0).default(2.0),\n reference: Joi.string().required(),\n type: Joi.string()\n .valid(...Object.values(FinanceDocType))\n .required(),\n subtype: Joi.string().required(),\n attachment: attachmentValueSchema.required(),\n branchId: Joi.string().required(),\n category: Joi.string().required(),\n organizationSummary: orgSummarySchema.required(),\n transferDescription: Joi.string().empty(''),\n invoiceId: Joi.string().uuid().empty(''),\n notes: Joi.string().empty(''),\n salesperson: Joi.object({\n name: Joi.string().required(),\n username: Joi.string().required(),\n }),\n paidAt: Joi.string().empty(''),\n tags: Joi.array().items(Joi.string().empty('')),\n total: Joi.object({\n amountExcl: Joi.number().min(0).cast('string').required(),\n amount: Joi.number().min(0).cast('string').required(),\n currencyCode: Joi.string().required(),\n foreign: Joi.object({\n amount: Joi.number().min(0).cast('string').required(),\n amountExcl: Joi.number().min(0).cast('string').required(),\n vatAmount: Joi.number().min(0).cast('string').required(),\n currencyCode: Joi.string().required(),\n exchangeRate: Joi.number().min(0).cast('string').required(),\n }),\n vatAmount: Joi.number().min(0).cast('string').required(),\n }),\n issueDate: isoDateSchema.required(),\n dueDate: isoDateSchema.empty(''),\n lines: Joi.array().items(lineSchema).required().default([]),\n reportingYear: Joi.number().min(0).cast('string'),\n reportingPeriod: Joi.number().min(0).cast('string'),\n accountingDescription: Joi.string().empty(''),\n peppol: Joi.object({\n extraAttachments: Joi.array()\n .items(\n attachmentValueSchema.keys({\n contentType: Joi.string().valid('application/pdf').required(),\n })\n )\n .max(9),\n additionalItemProperties: Joi.array().items(\n Joi.object({\n lineId: Joi.string().required(),\n properties: Joi.array().items(\n Joi.object({\n name: Joi.string().required(),\n value: Joi.string().required(),\n })\n ),\n })\n ),\n }),\n});\n\nexport const newAdministrativedDocumentSchema = Joi.object({\n id: Joi.string(),\n displayName: Joi.string().empty(''),\n branchId: Joi.string().required(),\n attachment: attachmentValueSchema.required(),\n category: Joi.string().empty(''),\n tags: Joi.array().items(Joi.string().empty('')),\n associations: associationsSchema,\n organizationSummary: orgSummarySchema,\n});\n\nexport const AdministrativeDocumentSchema = newAdministrativedDocumentSchema.keys({\n id: Joi.string().required(),\n createdAt: Joi.string().required(),\n createdBy: Joi.string().required(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MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,CAAC,MAAM,CAAC;IACzD,EAAE,EAAE,GAAG,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IAChC,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/C,YAAY,EAAE,kBAAkB;IAChC,mBAAmB,EAAE,gBAAgB;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,gCAAgC,CAAC,IAAI,CAAC;IAChF,EAAE,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC","sourcesContent":["import { BusinessEntityIds } from '@bisondesk/commons-sdk/constants';\nimport {\n attachmentValueSchema,\n getPhoneSchema,\n isoDateSchema,\n} from '@bisondesk/commons/joi-schemas';\nimport { FinanceDocType } from '@bisondesk/documents-sdk/types/documents';\nimport Joi from 'joi';\n\nconst orgSummarySchema = Joi.object({\n id: Joi.string().required(),\n code: Joi.number().required(),\n name: Joi.string().empty('').required(),\n language: Joi.string().empty(''),\n vatNumber: Joi.string().empty(''),\n addressLine1: Joi.string().empty(''),\n addressLine2: Joi.string().empty(''),\n postcode: Joi.string().empty(''),\n city: Joi.string().empty(''),\n country: Joi.string().required(),\n emails: Joi.array().items(Joi.string().empty('').email()),\n phone: getPhoneSchema(),\n contact: Joi.object({\n name: Joi.string().empty('').required(),\n username: Joi.string().empty('').required(),\n }),\n});\n\nconst associationsSchema = Joi.array().items(\n Joi.object({\n businessEntityId: Joi.string()\n .valid(...Object.values(BusinessEntityIds))\n .required(),\n recordId: Joi.string().required(),\n title: Joi.string().required(),\n description: Joi.string().required(),\n tags: Joi.array().items(Joi.string().empty('')),\n linkTo: Joi.object({\n businessEntityId: Joi.string().required(),\n recordId: Joi.string().required(),\n }),\n })\n);\n\nexport const lineSchema = Joi.object({\n category: Joi.string().required(),\n amount: Joi.number().cast('string').required(),\n amountExcl: Joi.number().cast('string').required(),\n description: Joi.string().required(),\n foreign: Joi.object({\n amount: Joi.number().cast('string').required(),\n amountExcl: Joi.number().cast('string').required(),\n unitPriceExcl: Joi.number().cast('string').required(),\n vatAmount: Joi.number().cast('string').required(),\n }),\n invoiceLineId: Joi.string().empty('').uuid(),\n quantity: Joi.number().min(0).cast('string').required(),\n associations: associationsSchema,\n unitPriceExcl: Joi.number().cast('string').required(),\n vatAmount: Joi.number().cast('string').required(),\n vatCode: Joi.string().required(),\n vatPercentage: Joi.number().min(0).cast('string').required(),\n vatReason: Joi.string().empty(''),\n costCenterId: Joi.string().empty(''),\n});\n\nexport const newFinanceDocV2Schema = Joi.object({\n id: Joi.string().uuid(),\n version: Joi.number().valid(2.0).default(2.0),\n reference: Joi.string().required(),\n type: Joi.string()\n .valid(...Object.values(FinanceDocType))\n .required(),\n subtype: Joi.string().required(),\n attachment: attachmentValueSchema.required(),\n branchId: Joi.string().required(),\n category: Joi.string().required(),\n organizationSummary: orgSummarySchema.required(),\n transferDescription: Joi.string().empty(''),\n invoiceId: Joi.string().uuid().empty(''),\n notes: Joi.string().empty(''),\n salesperson: Joi.object({\n name: Joi.string().required(),\n username: Joi.string().required(),\n }),\n paidAt: Joi.string().empty(''),\n tags: Joi.array().items(Joi.string().empty('')),\n total: Joi.object({\n amountExcl: Joi.number().min(0).cast('string').required(),\n amount: Joi.number().min(0).cast('string').required(),\n currencyCode: Joi.string().required(),\n foreign: Joi.object({\n amount: Joi.number().min(0).cast('string').required(),\n amountExcl: Joi.number().min(0).cast('string').required(),\n vatAmount: Joi.number().min(0).cast('string').required(),\n currencyCode: Joi.string().required(),\n exchangeRate: Joi.number().min(0).cast('string').required(),\n }),\n vatAmount: Joi.number().min(0).cast('string').required(),\n }),\n issueDate: isoDateSchema.required(),\n dueDate: isoDateSchema.empty(''),\n lines: Joi.array().items(lineSchema).required().default([]),\n reportingYear: Joi.number().min(0).cast('string'),\n reportingPeriod: Joi.number().min(0).cast('string'),\n accountingDescription: Joi.string().empty(''),\n peppol: Joi.object({\n extraAttachments: Joi.array()\n .items(\n attachmentValueSchema.keys({\n contentType: Joi.string().valid('application/pdf').required(),\n })\n )\n .max(9),\n additionalItemProperties: Joi.array().items(\n Joi.object({\n lineId: Joi.string().required(),\n properties: Joi.array().items(\n Joi.object({\n name: Joi.string().required(),\n value: Joi.string().required(),\n })\n ),\n })\n ),\n }),\n});\n\nexport const newAdministrativedDocumentSchema = Joi.object({\n id: Joi.string(),\n displayName: Joi.string().empty(''),\n branchId: Joi.string().required(),\n attachment: attachmentValueSchema.required(),\n category: Joi.string().empty(''),\n tags: Joi.array().items(Joi.string().empty('')),\n associations: associationsSchema,\n organizationSummary: orgSummarySchema,\n});\n\nexport const AdministrativeDocumentSchema = newAdministrativedDocumentSchema.keys({\n id: Joi.string().required(),\n createdAt: Joi.string().required(),\n createdBy: Joi.string().required(),\n});\n"]}
|
package/lib/types/documents.d.ts
CHANGED
|
@@ -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,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M,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;AAwEF,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 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 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":"AAmEA,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,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAsCD,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;I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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 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/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AppRoles, SYSTEM_USER_ID } from '@bisondesk/commons-sdk/constants';
|
|
2
|
+
import { getPdfPreviewSrc } from '../utils/previews.js';
|
|
3
|
+
export const DOCUMENT_PROCESSING_SETTINGS_ID = 'document-processing';
|
|
4
|
+
export const PRIVATE_DOCUMENT_ROLES = [
|
|
5
|
+
AppRoles.Board,
|
|
6
|
+
AppRoles.GeneralManager,
|
|
7
|
+
AppRoles.SeniorAccountant,
|
|
8
|
+
];
|
|
9
|
+
export const DEFAULT_DOCUMENT_ROLES = [
|
|
10
|
+
AppRoles.Accountant,
|
|
11
|
+
AppRoles.Admin,
|
|
12
|
+
AppRoles.Administrative,
|
|
13
|
+
AppRoles.Board,
|
|
14
|
+
AppRoles.GeneralManager,
|
|
15
|
+
AppRoles.SalesManager,
|
|
16
|
+
AppRoles.SeniorAccountant,
|
|
17
|
+
];
|
|
18
|
+
export const SALE_USED_VEHICLES_DOC_CATEGORY_ID = 'used_vehicles_sale';
|
|
19
|
+
export const SALE_USED_VEHICLES_COST_CENTER_ID = 'USED';
|
|
20
|
+
export const SALE_NEW_VEHICLES_DOC_CATEGORY_ID = 'new_vehicles_sale';
|
|
21
|
+
export const SALE_NEW_VEHICLES_COST_CENTER_ID = 'NEW';
|
|
22
|
+
export const SALE_OTHERS_DOC_CATEGORY_ID = 'others_sale';
|
|
23
|
+
export const SALE_OTHERS_COST_CENTER_ID = 'OTHERS';
|
|
24
|
+
export const HEAVY_VEHICLES_LINE_CATEGORY_ID = 'heavy_vehicles';
|
|
25
|
+
export const LIGHT_VEHICLES_LINE_CATEGORY_ID = 'light_vehicles';
|
|
26
|
+
export const ADMIN_IC_LINE_CATEGORY_ID = 'admin_ic';
|
|
27
|
+
export const ADMIN_NOT_IC_LINE_CATEGORY_ID = 'admin_not_ic';
|
|
28
|
+
export const DIVERSE_IC_LINE_CATEGORY_ID = 'diverse_ic';
|
|
29
|
+
export const DIVERSE_NOT_IC_LINE_CATEGORY_ID = 'diverse_not_ic';
|
|
30
|
+
export const OWN_WORK_LINE_CATEGORY_ID = 'own_work';
|
|
31
|
+
export const ENV_CONTRIBUTION_TYRES_LINE_CATEGORY_ID = 'env_contribution_tyres';
|
|
32
|
+
export const STANDARD_VAT_CODE_ID = 'standard';
|
|
33
|
+
export const SALE_EU_INTRA_COMMUNITY_VAT_CODE_ID = 'eu_ics_sale';
|
|
34
|
+
export const SALE_EU_EXTRA_COMMUNITY_VAT_CODE_ID = 'eu_ecs_sale';
|
|
35
|
+
export const GENERATING_PLACEHOLDER_ATTACHMENT = {
|
|
36
|
+
id: 'generating',
|
|
37
|
+
contentType: 'application/pdf',
|
|
38
|
+
fileName: 'generating.pdf',
|
|
39
|
+
uploadedBy: SYSTEM_USER_ID,
|
|
40
|
+
uploadedAt: '2024-04-08T14:51:55.785Z',
|
|
41
|
+
size: 95749,
|
|
42
|
+
url: '/storage/public/generating.pdf',
|
|
43
|
+
previewSrc: getPdfPreviewSrc('/storage/public/generating.pdf'),
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,CAAC,MAAM,+BAA+B,GAAG,qBAAqB,CAAC;AAErE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,QAAQ,CAAC,KAAK;IACd,QAAQ,CAAC,cAAc;IACvB,QAAQ,CAAC,gBAAgB;CAC1B,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,QAAQ,CAAC,UAAU;IACnB,QAAQ,CAAC,KAAK;IACd,QAAQ,CAAC,cAAc;IACvB,QAAQ,CAAC,KAAK;IACd,QAAQ,CAAC,cAAc;IACvB,QAAQ,CAAC,YAAY;IACrB,QAAQ,CAAC,gBAAgB;CAC1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CH_BOOST } from '@bisondesk/commons/es';
|
|
2
|
+
import { getTranslatedTitles } from '@bisondesk/commons/translations';
|
|
3
|
+
import { DateGranularity, FieldTypes } from '@bisondesk/core-sdk/types/fields';
|
|
4
|
+
import { AggregationType } from '@bisondesk/core-sdk/types/search';
|
|
5
|
+
import { UTCDate } from '@date-fns/utc';
|
|
6
|
+
import { getTime, parseISO, setHours, setMinutes, setSeconds } from 'date-fns';
|
|
7
|
+
const BASE_DOC_DRAFT_MAPPING_FIELDS = {
|
|
8
|
+
'doc.id': {
|
|
9
|
+
esMapping: { type: 'keyword', boost: DEFAULT_EXACT_MATCH_BOOST },
|
|
10
|
+
},
|
|
11
|
+
'doc.status': {
|
|
12
|
+
esMapping: { type: 'keyword' },
|
|
13
|
+
},
|
|
14
|
+
'doc.documentType': {
|
|
15
|
+
esMapping: { type: 'keyword' },
|
|
16
|
+
},
|
|
17
|
+
'doc.category': {
|
|
18
|
+
esMapping: { type: 'keyword' },
|
|
19
|
+
},
|
|
20
|
+
'doc.branchId': {
|
|
21
|
+
esMapping: { type: 'keyword' },
|
|
22
|
+
},
|
|
23
|
+
'doc.attachment': {
|
|
24
|
+
esMapping: { type: 'object', enabled: false },
|
|
25
|
+
},
|
|
26
|
+
'doc.createdAt': {
|
|
27
|
+
esMapping: { type: 'date' },
|
|
28
|
+
},
|
|
29
|
+
'doc.createdBy': {
|
|
30
|
+
esMapping: { type: 'keyword' },
|
|
31
|
+
},
|
|
32
|
+
'custom.stage': {
|
|
33
|
+
esMapping: { type: 'keyword' },
|
|
34
|
+
},
|
|
35
|
+
'custom.rejected': {
|
|
36
|
+
esMapping: { type: 'boolean' },
|
|
37
|
+
},
|
|
38
|
+
'custom.validationRulesStatus': {
|
|
39
|
+
esMapping: { type: 'keyword' },
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
const FINANCE_DOC_DRAFT_MAPPING_FIELDS = {
|
|
43
|
+
'doc.type': {
|
|
44
|
+
esMapping: { type: 'keyword' },
|
|
45
|
+
},
|
|
46
|
+
'doc.subtype': {
|
|
47
|
+
esMapping: { type: 'keyword' },
|
|
48
|
+
},
|
|
49
|
+
'doc.reference': {
|
|
50
|
+
esMapping: { type: 'keyword', boost: DEFAULT_EXACT_MATCH_BOOST },
|
|
51
|
+
},
|
|
52
|
+
'doc.issueDate': {
|
|
53
|
+
esMapping: { type: 'date', ignore_malformed: true },
|
|
54
|
+
},
|
|
55
|
+
'doc.dueDate': {
|
|
56
|
+
esMapping: { type: 'date', ignore_malformed: true },
|
|
57
|
+
},
|
|
58
|
+
'doc.organizationSummary.name': {
|
|
59
|
+
esMapping: { type: 'text' },
|
|
60
|
+
},
|
|
61
|
+
'doc.organizationSummary.id': {
|
|
62
|
+
esMapping: { type: 'keyword' },
|
|
63
|
+
},
|
|
64
|
+
'doc.organizationSummary.code': {
|
|
65
|
+
esMapping: { type: 'keyword' },
|
|
66
|
+
},
|
|
67
|
+
'doc.organizationSummary.vatNumber': {
|
|
68
|
+
esMapping: { type: 'text' },
|
|
69
|
+
},
|
|
70
|
+
'doc.lines.associations.businessEntityId': {
|
|
71
|
+
esMapping: { type: 'keyword' },
|
|
72
|
+
},
|
|
73
|
+
'doc.lines.associations.recordId': {
|
|
74
|
+
esMapping: { type: 'keyword' },
|
|
75
|
+
},
|
|
76
|
+
'doc.lines.associations.title': {
|
|
77
|
+
esMapping: { type: 'text' },
|
|
78
|
+
},
|
|
79
|
+
'doc.lines.associations.description': {
|
|
80
|
+
esMapping: { type: 'text' },
|
|
81
|
+
},
|
|
82
|
+
'doc.lines.associations.tags': {
|
|
83
|
+
esMapping: { type: 'keyword' },
|
|
84
|
+
},
|
|
85
|
+
'doc.invoiceId': {
|
|
86
|
+
esMapping: { type: 'keyword' },
|
|
87
|
+
},
|
|
88
|
+
'custom.validators': {
|
|
89
|
+
esMapping: { type: 'keyword' },
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
const ADMIN_DOC_DRAFT_MAPPING_FIELDS = {
|
|
93
|
+
'doc.tags': {
|
|
94
|
+
esMapping: { type: 'text' },
|
|
95
|
+
},
|
|
96
|
+
'doc.associations.businessEntityId': {
|
|
97
|
+
esMapping: { type: 'keyword' },
|
|
98
|
+
},
|
|
99
|
+
'doc.associations.recordId': {
|
|
100
|
+
esMapping: { type: 'keyword' },
|
|
101
|
+
},
|
|
102
|
+
'doc.associations.title': {
|
|
103
|
+
esMapping: { type: 'text' },
|
|
104
|
+
},
|
|
105
|
+
'doc.associations.description': {
|
|
106
|
+
esMapping: { type: 'text' },
|
|
107
|
+
},
|
|
108
|
+
'doc.associations.tags': {
|
|
109
|
+
esMapping: { type: 'keyword' },
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
export const DOC_DRAFT_MAPPING_FIELDS = {
|
|
113
|
+
...BASE_DOC_DRAFT_MAPPING_FIELDS,
|
|
114
|
+
...FINANCE_DOC_DRAFT_MAPPING_FIELDS,
|
|
115
|
+
...ADMIN_DOC_DRAFT_MAPPING_FIELDS,
|
|
116
|
+
};
|
|
117
|
+
export const DOC_DRAFT_DEFINITION_FIELDS = {
|
|
118
|
+
'doc.id': {
|
|
119
|
+
id: 'doc.id',
|
|
120
|
+
titles: getTranslatedTitles('id'),
|
|
121
|
+
type: FieldTypes.text,
|
|
122
|
+
},
|
|
123
|
+
'custom.stage': {
|
|
124
|
+
id: 'custom.stage',
|
|
125
|
+
titles: getTranslatedTitles('aggs.draft.stage'),
|
|
126
|
+
type: FieldTypes.text,
|
|
127
|
+
},
|
|
128
|
+
'doc.documentType': {
|
|
129
|
+
id: 'doc.documentType',
|
|
130
|
+
titles: getTranslatedTitles('aggs.draft.documentType'),
|
|
131
|
+
type: FieldTypes.text,
|
|
132
|
+
},
|
|
133
|
+
'doc.branchId': {
|
|
134
|
+
id: 'doc.branchId',
|
|
135
|
+
titles: getTranslatedTitles('branch'),
|
|
136
|
+
type: FieldTypes.text,
|
|
137
|
+
},
|
|
138
|
+
'doc.createdAt': {
|
|
139
|
+
id: 'doc.createdAt',
|
|
140
|
+
titles: getTranslatedTitles('aggs.creationDate'),
|
|
141
|
+
type: FieldTypes.date,
|
|
142
|
+
meta: {
|
|
143
|
+
granularity: DateGranularity.yearMonthDayTime,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
'custom.validationRulesStatus': {
|
|
147
|
+
id: 'custom.validationRulesStatus',
|
|
148
|
+
titles: getTranslatedTitles('aggs.draft.validationRules'),
|
|
149
|
+
type: FieldTypes.text,
|
|
150
|
+
},
|
|
151
|
+
'doc.createdBy': {
|
|
152
|
+
id: 'doc.createdBy',
|
|
153
|
+
titles: getTranslatedTitles('aggs.createdBy'),
|
|
154
|
+
type: FieldTypes.collaborator,
|
|
155
|
+
},
|
|
156
|
+
'doc.subtype': {
|
|
157
|
+
id: 'doc.subtype',
|
|
158
|
+
titles: getTranslatedTitles('type'),
|
|
159
|
+
type: FieldTypes.text,
|
|
160
|
+
},
|
|
161
|
+
'custom.rejected': {
|
|
162
|
+
id: 'custom.rejected',
|
|
163
|
+
titles: getTranslatedTitles('aggs.draft.rejected'),
|
|
164
|
+
type: FieldTypes.checkbox,
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
export const getSearchDocumentDraftsAggs = () => [
|
|
168
|
+
{
|
|
169
|
+
titles: getTranslatedTitles('aggs.draft.stage'),
|
|
170
|
+
fieldId: 'custom.stage',
|
|
171
|
+
fieldType: FieldTypes.text,
|
|
172
|
+
type: AggregationType.term,
|
|
173
|
+
orderBy: 'count',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
titles: getTranslatedTitles('aggs.draft.documentType'),
|
|
177
|
+
fieldId: 'doc.documentType',
|
|
178
|
+
fieldType: FieldTypes.text,
|
|
179
|
+
type: AggregationType.term,
|
|
180
|
+
orderBy: 'count',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
titles: getTranslatedTitles('type'),
|
|
184
|
+
fieldId: 'doc.subtype',
|
|
185
|
+
fieldType: FieldTypes.text,
|
|
186
|
+
type: AggregationType.term,
|
|
187
|
+
orderBy: 'count',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
titles: getTranslatedTitles('aggs.draft.rejected'),
|
|
191
|
+
fieldId: 'custom.rejected',
|
|
192
|
+
fieldType: FieldTypes.checkbox,
|
|
193
|
+
type: AggregationType.term,
|
|
194
|
+
orderBy: 'count',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
titles: getTranslatedTitles('aggs.draft.validationRules'),
|
|
198
|
+
fieldId: 'custom.validationRulesStatus',
|
|
199
|
+
fieldType: FieldTypes.text,
|
|
200
|
+
type: AggregationType.term,
|
|
201
|
+
orderBy: 'count',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
titles: getTranslatedTitles('aggs.creationDate'),
|
|
205
|
+
fieldId: 'doc.createdAt',
|
|
206
|
+
step: 1,
|
|
207
|
+
type: AggregationType.range,
|
|
208
|
+
ranges: [
|
|
209
|
+
{
|
|
210
|
+
start: getTime(parseISO('2015-01-01')),
|
|
211
|
+
end: getTime(setSeconds(setMinutes(setHours(new UTCDate(), 23), 59), 59)),
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
];
|
|
216
|
+
export const SEARCH_DOC_DRAFT_FULL_TEXT_FIELDS = [
|
|
217
|
+
() => 'doc.id',
|
|
218
|
+
() => 'doc.reference',
|
|
219
|
+
() => 'doc.tags',
|
|
220
|
+
() => 'doc.lines.associations.tags',
|
|
221
|
+
() => 'doc.tags',
|
|
222
|
+
() => 'doc.associations.tags',
|
|
223
|
+
() => 'doc.organizationSummary.name',
|
|
224
|
+
() => 'doc.organizationSummary.id',
|
|
225
|
+
() => 'doc.organizationSummary.code',
|
|
226
|
+
() => 'doc.organizationSummary.vatNumber',
|
|
227
|
+
];
|
|
228
|
+
export const SEARCH_DOC_DRAFTS_MAPPINGS = {
|
|
229
|
+
name: 'document_drafts',
|
|
230
|
+
nestedEsPaths: [],
|
|
231
|
+
fields: {
|
|
232
|
+
...DOC_DRAFT_MAPPING_FIELDS,
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
export const SEARCH_DOC_DRAFTS_DEFINITION = {
|
|
236
|
+
fields: {
|
|
237
|
+
...DOC_DRAFT_DEFINITION_FIELDS,
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAStE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/E,MAAM,6BAA6B,GAE/B;IACF,QAAQ,EAAE;QACR,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,yBAAyB,EAAE;KACjE;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B;IACD,kBAAkB,EAAE;QAClB,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B;IACD,cAAc,EAAE;QACd,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B;IACD,cAAc,EAAE;QACd,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;KAC9C;IACD,eAAe,EAAE;QACf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A+B;IAE3E,GAAG,EAAE,CAAC,QAAQ;IACd,GAAG,EAAE,CAAC,eAAe;IACrB,GAAG,EAAE,CAAC,UAAU;IAChB,GAAG,EAAE,CAAC,6BAA6B;IAEnC,GAAG,EAAE,CAAC,UAAU;IAChB,GAAG,EAAE,CAAC,uBAAuB;IAE7B,GAAG,EAAE,CAAC,8BAA8B;IACpC,GAAG,EAAE,CAAC,4BAA4B;IAClC,GAAG,EAAE,CAAC,8BAA8B;IACpC,GAAG,EAAE,CAAC,mCAAmC;CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAiB;IACtD,IAAI,EAAE,iBAAiB;IACvB,aAAa,EAAE,EAAE;IACjB,MAAM,EAAE;QACN,GAAG,wBAAwB;KAC5B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAqB;IAC5D,MAAM,EAAE;QACN,GAAG,2BAA2B;KAC/B;CACF,CAAC"}
|
package/src/schemas.ts
CHANGED
|
@@ -61,6 +61,7 @@ export const lineSchema = Joi.object({
|
|
|
61
61
|
vatCode: Joi.string().required(),
|
|
62
62
|
vatPercentage: Joi.number().min(0).cast('string').required(),
|
|
63
63
|
vatReason: Joi.string().empty(''),
|
|
64
|
+
costCenterId: Joi.string().empty(''),
|
|
64
65
|
});
|
|
65
66
|
|
|
66
67
|
export const newFinanceDocV2Schema = Joi.object({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bank-accounts.js","sourceRoot":"","sources":["bank-accounts.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking.js","sourceRoot":"","sources":["booking.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var DocumentCategoryVisibility;
|
|
2
|
+
(function (DocumentCategoryVisibility) {
|
|
3
|
+
DocumentCategoryVisibility["Standard"] = "standard";
|
|
4
|
+
DocumentCategoryVisibility["Private"] = "private";
|
|
5
|
+
})(DocumentCategoryVisibility || (DocumentCategoryVisibility = {}));
|
|
6
|
+
export var DocumentCategoryType;
|
|
7
|
+
(function (DocumentCategoryType) {
|
|
8
|
+
DocumentCategoryType["Administrative"] = "administrative";
|
|
9
|
+
DocumentCategoryType["Finance"] = "finance";
|
|
10
|
+
})(DocumentCategoryType || (DocumentCategoryType = {}));
|
|
11
|
+
//# sourceMappingURL=document-categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-categories.js","sourceRoot":"","sources":["document-categories.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,mDAAqB,CAAA;IACrB,iDAAmB,CAAA;AACrB,CAAC,EAHW,0BAA0B,KAA1B,0BAA0B,QAGrC;AAED,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,yDAAiC,CAAA;IACjC,2CAAmB,CAAA;AACrB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export var FinanceDocType;
|
|
2
|
+
(function (FinanceDocType) {
|
|
3
|
+
FinanceDocType["Sale"] = "Sale Finance";
|
|
4
|
+
FinanceDocType["Purchase"] = "Purchase Finance";
|
|
5
|
+
})(FinanceDocType || (FinanceDocType = {}));
|
|
6
|
+
export var DraftProcessStatus;
|
|
7
|
+
(function (DraftProcessStatus) {
|
|
8
|
+
DraftProcessStatus["Prefill"] = "Prefill";
|
|
9
|
+
DraftProcessStatus["Unprocessed"] = "Unprocessed";
|
|
10
|
+
DraftProcessStatus["Processed"] = "Processed";
|
|
11
|
+
DraftProcessStatus["BusinessValid"] = "BusinessValid";
|
|
12
|
+
DraftProcessStatus["AccountingValid"] = "AccountingValid";
|
|
13
|
+
DraftProcessStatus["Completed"] = "Completed";
|
|
14
|
+
})(DraftProcessStatus || (DraftProcessStatus = {}));
|
|
15
|
+
export var DraftProcessStage;
|
|
16
|
+
(function (DraftProcessStage) {
|
|
17
|
+
DraftProcessStage["AIProcessing"] = "aiProcessing";
|
|
18
|
+
DraftProcessStage["Processing"] = "processing";
|
|
19
|
+
DraftProcessStage["BusinessValidation"] = "businessValidation";
|
|
20
|
+
DraftProcessStage["AccountingValidation"] = "accountingValidation";
|
|
21
|
+
DraftProcessStage["DocumentCreation"] = "documentCreation";
|
|
22
|
+
DraftProcessStage["Edit"] = "edit";
|
|
23
|
+
})(DraftProcessStage || (DraftProcessStage = {}));
|
|
24
|
+
export var DocumentType;
|
|
25
|
+
(function (DocumentType) {
|
|
26
|
+
DocumentType["Finance"] = "Finance Document";
|
|
27
|
+
DocumentType["Administrative"] = "Administrative Document";
|
|
28
|
+
})(DocumentType || (DocumentType = {}));
|
|
29
|
+
export var DraftActions;
|
|
30
|
+
(function (DraftActions) {
|
|
31
|
+
DraftActions["Delete"] = "delete";
|
|
32
|
+
DraftActions["Validate"] = "validate";
|
|
33
|
+
DraftActions["Reject"] = "reject";
|
|
34
|
+
DraftActions["SaveChanges"] = "save_changes";
|
|
35
|
+
DraftActions["Submit"] = "submit";
|
|
36
|
+
DraftActions["ValidateBusinessRules"] = "validate_business_rules";
|
|
37
|
+
DraftActions["ValidateAccountingRules"] = "validate_accounting_rules";
|
|
38
|
+
})(DraftActions || (DraftActions = {}));
|
|
39
|
+
export const isFinanceDocumentV2 = (arg) => {
|
|
40
|
+
return arg.version == 2;
|
|
41
|
+
};
|
|
42
|
+
export const isFinanceDocumentV1 = (arg) => {
|
|
43
|
+
return arg.version == null;
|
|
44
|
+
};
|
|
45
|
+
export const isFinanceDocument = (arg) => {
|
|
46
|
+
return ['Sale Finance', 'Purchase Finance'].includes(arg.type);
|
|
47
|
+
};
|
|
48
|
+
export const isAdministrativeDocumentDraft = (draft) => draft.documentType === DocumentType.Administrative;
|
|
49
|
+
export const isFinanceDocumentDraft = (arg) => {
|
|
50
|
+
return arg.documentType === DocumentType.Finance;
|
|
51
|
+
};
|
|
52
|
+
export var FinanceDocumentSubtype;
|
|
53
|
+
(function (FinanceDocumentSubtype) {
|
|
54
|
+
FinanceDocumentSubtype["Invoice"] = "Invoice";
|
|
55
|
+
FinanceDocumentSubtype["CreditNote"] = "Credit Note";
|
|
56
|
+
FinanceDocumentSubtype["Proforma"] = "Proforma";
|
|
57
|
+
FinanceDocumentSubtype["PurchaseOrder"] = "Purchase Order";
|
|
58
|
+
})(FinanceDocumentSubtype || (FinanceDocumentSubtype = {}));
|
|
59
|
+
export var FinanceDocumentActions;
|
|
60
|
+
(function (FinanceDocumentActions) {
|
|
61
|
+
FinanceDocumentActions["PAY_FINANCE_DOCUMENT"] = "pay_finance_document";
|
|
62
|
+
FinanceDocumentActions["DELETE_FINANCE_DOCUMENT"] = "delete_finance_document";
|
|
63
|
+
})(FinanceDocumentActions || (FinanceDocumentActions = {}));
|
|
64
|
+
export var AdministrativeDocumentActions;
|
|
65
|
+
(function (AdministrativeDocumentActions) {
|
|
66
|
+
AdministrativeDocumentActions["DELETE_ADMINISTRATIVE_DOCUMENT"] = "delete_finance_document";
|
|
67
|
+
})(AdministrativeDocumentActions || (AdministrativeDocumentActions = {}));
|
|
68
|
+
//# sourceMappingURL=documents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["documents.ts"],"names":[],"mappings":"AAkEA,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,W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