mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-06-02 07:59:01 +00:00
fix(server): resolve all TypeScript errors without unsafe type casts
Fix 20+ pre-existing TypeScript errors in the server package using proper type-safe solutions — no `as any`, `as unknown`, or `any` types. Key changes: - Replace R.curry with regular curried arrow functions for proper inference - Add return types to abstract methods (DynamicFilterRoleAbstractor) - Add field declarations to empty models (ItemWarehouseQuantity) - Add index signature to IMetadata for dynamic extra columns - Use explicit field construction instead of pick()+cast patterns - Convert moment format strings to Date objects where Date type expected - Make interface properties optional where payloads don't include them - Use native Array.reduce with proper typing instead of lodash chain Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -32,14 +32,14 @@ export class InvoicePaymentIntegrationSubscriber {
|
||||
|
||||
paymentMethods.map(
|
||||
async (paymentMethod: TransactionPaymentServiceEntry) => {
|
||||
const payload = {
|
||||
const payload: PaymentIntegrationTransactionLinkEventPayload = {
|
||||
...omit(paymentMethod, ['id']),
|
||||
saleInvoiceId: saleInvoice.id,
|
||||
trx,
|
||||
};
|
||||
await this.eventPublisher.emitAsync(
|
||||
events.paymentIntegrationLink.onPaymentIntegrationLink,
|
||||
payload as PaymentIntegrationTransactionLinkEventPayload,
|
||||
payload,
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -59,11 +59,11 @@ export class InvoicePaymentIntegrationSubscriber {
|
||||
|
||||
paymentMethods.map(
|
||||
async (paymentMethod: TransactionPaymentServiceEntry) => {
|
||||
const payload = {
|
||||
const payload: PaymentIntegrationTransactionLinkDeleteEventPayload = {
|
||||
...omit(paymentMethod, ['id']),
|
||||
oldSaleInvoiceId: oldSaleInvoice.id,
|
||||
trx,
|
||||
} as PaymentIntegrationTransactionLinkDeleteEventPayload;
|
||||
};
|
||||
|
||||
// Triggers `onPaymentIntegrationDeleteLink` event.
|
||||
await this.eventPublisher.emitAsync(
|
||||
|
||||
Reference in New Issue
Block a user