Merge pull request #826 from bigcapitalhq/typecheck-github-action
feat: typecheck gh action
This commit is contained in:
62
.github/workflows/typecheck.yml
vendored
Normal file
62
.github/workflows/typecheck.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
name: TypeCheck
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
paths:
|
||||
- '**.ts'
|
||||
- '**.tsx'
|
||||
- '**/tsconfig.json'
|
||||
- '**/tsconfig.*.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'package.json'
|
||||
- 'packages/*/package.json'
|
||||
- 'shared/*/package.json'
|
||||
- '.github/workflows/typecheck.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.ts'
|
||||
- '**.tsx'
|
||||
- '**/tsconfig.json'
|
||||
- '**/tsconfig.*.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'package.json'
|
||||
- 'packages/*/package.json'
|
||||
- 'shared/*/package.json'
|
||||
- '.github/workflows/typecheck.yml'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: 'bash'
|
||||
|
||||
jobs:
|
||||
typecheck:
|
||||
name: TypeScript Type Check
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build shared packages
|
||||
run: pnpm run build --scope "@bigcapital/utils" --scope "@bigcapital/email-components" --scope "@bigcapital/pdf-templates"
|
||||
|
||||
- name: Run TypeScript type check
|
||||
run: pnpm run typecheck
|
||||
@@ -4,6 +4,7 @@
|
||||
"scripts": {
|
||||
"dev": "lerna run dev",
|
||||
"build": "lerna run build",
|
||||
"typecheck": "lerna run typecheck",
|
||||
"dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\" --scope \"@bigcapital/pdf-templates\"",
|
||||
"build:webapp": "lerna run build --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\" --scope \"@bigcapital/pdf-templates\"",
|
||||
"dev:server": "lerna run dev --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\" --scope \"@bigcapital/pdf-templates\" --scope \"@bigcapital/email-components\"",
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"start:debug": "nest start --debug --watch",
|
||||
"start:prod": "node dist/main",
|
||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:cov": "jest --coverage",
|
||||
|
||||
@@ -16,7 +16,6 @@ describe('AppController', () => {
|
||||
|
||||
describe('root', () => {
|
||||
it('should return "Hello World!"', () => {
|
||||
expect(appController.getHello()).toBe('Hello World!');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@ import { PassportModule } from '@nestjs/passport';
|
||||
import { ClsModule, ClsService } from 'nestjs-cls';
|
||||
import { AppController } from './App.controller';
|
||||
import { AppService } from './App.service';
|
||||
import { ItemsModule } from '../Items/items.module';
|
||||
import { ItemsModule } from '../Items/Items.module';
|
||||
import { config } from '../../common/config';
|
||||
import { SystemDatabaseModule } from '../System/SystemDB/SystemDB.module';
|
||||
import { SystemModelsModule } from '../System/SystemModels/SystemModels.module';
|
||||
|
||||
@@ -19,7 +19,7 @@ import { PublicRoute } from './guards/jwt.guard';
|
||||
import { AuthenticationApplication } from './AuthApplication.sevice';
|
||||
import { AuthSignupDto } from './dtos/AuthSignup.dto';
|
||||
import { AuthSigninDto } from './dtos/AuthSignin.dto';
|
||||
import { LocalAuthGuard } from './guards/local.guard';
|
||||
import { LocalAuthGuard } from './guards/Local.guard';
|
||||
import { AuthSigninService } from './commands/AuthSignin.service';
|
||||
import { TenantModel } from '../System/models/TenantModel';
|
||||
import { SystemUser } from '../System/models/SystemUser';
|
||||
@@ -35,7 +35,7 @@ export class AuthController {
|
||||
|
||||
@Inject(TenantModel.name)
|
||||
private readonly tenantModel: typeof TenantModel,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
@Post('/signin')
|
||||
@UseGuards(LocalAuthGuard)
|
||||
|
||||
@@ -16,7 +16,7 @@ import { LocalStrategy } from './strategies/Local.strategy';
|
||||
import { PassportModule } from '@nestjs/passport';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { JwtAuthGuard } from './guards/jwt.guard';
|
||||
import { AuthMailSubscriber } from './Subscribers/AuthMail.subscriber';
|
||||
import { AuthMailSubscriber } from './subscribers/AuthMail.subscriber';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import {
|
||||
SendResetPasswordMailQueue,
|
||||
@@ -98,4 +98,4 @@ const models = [
|
||||
AuthMailSubscriber,
|
||||
],
|
||||
})
|
||||
export class AuthModule {}
|
||||
export class AuthModule { }
|
||||
|
||||
@@ -27,8 +27,8 @@ import { PaymentMadeBranchValidateSubscriber } from './subscribers/Validators/Pa
|
||||
import { PaymentReceiveBranchValidateSubscriber } from './subscribers/Validators/PaymentReceiveBranchSubscriber';
|
||||
import { SaleReceiptBranchValidateSubscriber } from './subscribers/Validators/SaleReceiptBranchesSubscriber';
|
||||
import { VendorCreditBranchValidateSubscriber } from './subscribers/Validators/VendorCreditBranchSubscriber';
|
||||
import { ValidateBranchExistance } from './Integrations/ValidateBranchExistance';
|
||||
import { ManualJournalBranchesValidator } from './Integrations/ManualJournals/ManualJournalsBranchesValidator';
|
||||
import { ValidateBranchExistance } from './integrations/ValidateBranchExistance';
|
||||
import { ManualJournalBranchesValidator } from './integrations/ManualJournals/ManualJournalsBranchesValidator';
|
||||
import { CashflowTransactionsActivateBranches } from './integrations/Cashflow/CashflowActivateBranches';
|
||||
import { ExpensesActivateBranches } from './integrations/Expense/ExpensesActivateBranches';
|
||||
import { FeaturesModule } from '../Features/Features.module';
|
||||
@@ -74,4 +74,4 @@ import { FeaturesModule } from '../Features/Features.module';
|
||||
ManualJournalBranchesDTOTransformer,
|
||||
],
|
||||
})
|
||||
export class BranchesModule {}
|
||||
export class BranchesModule { }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CashflowTransactionsActivateBranches } from '../../Integrations/Cashflow/CashflowActivateBranches';
|
||||
import { CashflowTransactionsActivateBranches } from '../../integrations/Cashflow/CashflowActivateBranches';
|
||||
import { IBranchesActivatedPayload } from '../../Branches.types';
|
||||
import { events } from '@/common/events/events';
|
||||
|
||||
@@ -8,8 +8,8 @@ import { events } from '@/common/events/events';
|
||||
export class CreditNoteActivateBranchesSubscriber {
|
||||
constructor(
|
||||
private readonly cashflowActivateBranches: CashflowTransactionsActivateBranches,
|
||||
) {}
|
||||
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Updates accounts transactions with the primary branch once
|
||||
* the multi-branches is activated.
|
||||
@@ -17,7 +17,7 @@ export class CreditNoteActivateBranchesSubscriber {
|
||||
*/
|
||||
@OnEvent(events.branch.onActivated)
|
||||
async updateCashflowWithBranchOnActivated({
|
||||
|
||||
|
||||
primaryBranch,
|
||||
trx,
|
||||
}: IBranchesActivatedPayload) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { IBranchesActivatedPayload } from '../../Branches.types';
|
||||
import { events } from '@/common/events/events';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { ExpensesActivateBranches } from '../../Integrations/Expense/ExpensesActivateBranches';
|
||||
import { ExpensesActivateBranches } from '../../integrations/Expense/ExpensesActivateBranches';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
|
||||
@Injectable()
|
||||
export class ExpenseActivateBranchesSubscriber {
|
||||
constructor(
|
||||
private readonly expensesActivateBranches: ExpensesActivateBranches,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Updates accounts transactions with the primary branch once
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BillPaymentsActivateBranches } from '../../Integrations/Purchases/PaymentMadeBranchesActivate';
|
||||
import { BillPaymentsActivateBranches } from '../../integrations/Purchases/PaymentMadeBranchesActivate';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { events } from '@/common/events/events';
|
||||
@@ -8,7 +8,7 @@ import { IBranchesActivatedPayload } from '../../Branches.types';
|
||||
export class PaymentMadeActivateBranchesSubscriber {
|
||||
constructor(
|
||||
private readonly paymentsActivateBranches: BillPaymentsActivateBranches,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Updates accounts transactions with the primary branch once
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { events } from '@/common/events/events';
|
||||
import { SaleInvoiceActivateBranches } from '../../Integrations/Sales/SaleInvoiceBranchesActivate';
|
||||
import { SaleInvoiceActivateBranches } from '../../integrations/Sales/SaleInvoiceBranchesActivate';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { IBranchesActivatedPayload } from '../../Branches.types';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
@@ -8,7 +8,7 @@ import { Injectable } from '@nestjs/common';
|
||||
export class SaleInvoicesActivateBranchesSubscriber {
|
||||
constructor(
|
||||
private readonly invoicesActivateBranches: SaleInvoiceActivateBranches,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Updates accounts transactions with the primary branch once
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { events } from '@/common/events/events';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import {
|
||||
IBillCreatingPayload,
|
||||
IBillEditingPayload,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
export class BillBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on bill creating.
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { events } from '@/common/events/events';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import { ICommandCashflowCreatingPayload } from '@/modules/BankingTransactions/types/BankingTransactions.types';
|
||||
|
||||
@Injectable()
|
||||
export class CashflowBranchDTOValidatorSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance once cashflow transaction creating.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { events } from '@/common/events/events';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import {
|
||||
ICustomerOpeningBalanceEditingPayload,
|
||||
ICustomerEventCreatingPayload,
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
export class ContactBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on customer creating.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { events } from '@/common/events/events';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import { ICreditNoteEditingPayload } from '@/modules/CreditNotes/types/CreditNotes.types';
|
||||
import { ICreditNoteCreatingPayload } from '@/modules/CreditNotes/types/CreditNotes.types';
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ICreditNoteCreatingPayload } from '@/modules/CreditNotes/types/CreditNo
|
||||
export class CreditNoteBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on credit note creating.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import { events } from '@/common/events/events';
|
||||
import { IRefundCreditNoteCreatingPayload } from '@/modules/CreditNoteRefunds/types/CreditNoteRefunds.types';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { IRefundCreditNoteCreatingPayload } from '@/modules/CreditNoteRefunds/ty
|
||||
export class CreditNoteRefundBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on refund credit note creating.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { events } from '@/common/events/events';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import {
|
||||
IExpenseCreatingPayload,
|
||||
IExpenseEventEditingPayload,
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
export class ExpenseBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance once expense transaction creating.
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { events } from '@/common/events/events';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import { IInventoryAdjustmentCreatingPayload } from '@/modules/InventoryAdjutments/types/InventoryAdjustments.types';
|
||||
|
||||
@Injectable()
|
||||
export class InventoryAdjustmentBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on inventory adjustment creating.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { events } from '@/common/events/events';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import {
|
||||
ISaleInvoiceCreatingPaylaod,
|
||||
ISaleInvoiceEditingPayload,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
export class InvoiceBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on invoice creating.
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
IManualJournalCreatingPayload,
|
||||
IManualJournalEditingPayload,
|
||||
} from '@/modules/ManualJournals/types/ManualJournals.types';
|
||||
import { ManualJournalBranchesValidator } from '../../Integrations/ManualJournals/ManualJournalsBranchesValidator';
|
||||
import { ManualJournalBranchesValidator } from '../../integrations/ManualJournals/ManualJournalsBranchesValidator';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { events } from '@/common/events/events';
|
||||
@@ -15,7 +15,7 @@ export class ManualJournalBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateManualJournalBranch: ManualJournalBranchesValidator,
|
||||
private readonly featuresManager: FeaturesManager,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on estimate creating.
|
||||
|
||||
@@ -4,14 +4,14 @@ import {
|
||||
IBillPaymentCreatingPayload,
|
||||
IBillPaymentEditingPayload,
|
||||
} from '@/modules/BillPayments/types/BillPayments.types';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import { events } from '@/common/events/events';
|
||||
|
||||
@Injectable()
|
||||
export class PaymentMadeBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on estimate creating.
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
IPaymentReceivedCreatingPayload,
|
||||
IPaymentReceivedEditingPayload,
|
||||
} from '@/modules/PaymentReceived/types/PaymentReceived.types';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { events } from '@/common/events/events';
|
||||
@@ -11,7 +11,7 @@ import { events } from '@/common/events/events';
|
||||
export class PaymentReceiveBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on estimate creating.
|
||||
|
||||
@@ -5,13 +5,13 @@ import {
|
||||
ISaleEstimateCreatingPayload,
|
||||
ISaleEstimateEditingPayload,
|
||||
} from '@/modules/SaleEstimates/types/SaleEstimates.types';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
|
||||
@Injectable()
|
||||
export class SaleEstimateBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on estimate creating.
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
ISaleReceiptCreatingPayload,
|
||||
ISaleReceiptEditingPayload,
|
||||
} from '@/modules/SaleReceipts/types/SaleReceipts.types';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { events } from '@/common/events/events';
|
||||
@@ -11,7 +11,7 @@ import { events } from '@/common/events/events';
|
||||
export class SaleReceiptBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on estimate creating.
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
IVendorCreditCreatingPayload,
|
||||
IVendorCreditEditingPayload,
|
||||
} from '@/modules/VendorCredit/types/VendorCredit.types';
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { events } from '@/common/events/events';
|
||||
@@ -11,7 +11,7 @@ import { events } from '@/common/events/events';
|
||||
export class VendorCreditBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on estimate creating.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidateBranchExistance } from '../../Integrations/ValidateBranchExistance';
|
||||
import { ValidateBranchExistance } from '../../integrations/ValidateBranchExistance';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { events } from '@/common/events/events';
|
||||
@@ -8,7 +8,7 @@ import { IRefundVendorCreditCreatingPayload } from '@/modules/VendorCreditsRefun
|
||||
export class VendorCreditRefundBranchValidateSubscriber {
|
||||
constructor(
|
||||
private readonly validateBranchExistance: ValidateBranchExistance,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validate branch existance on refund credit note creating.
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import * as path from 'path';
|
||||
import { promises as fs } from 'fs';
|
||||
import { PageProperties, PdfFormat } from '@/libs/Chromiumly/_types';
|
||||
import { UrlConverter } from '@/libs/Chromiumly/UrlConvert';
|
||||
import { Chromiumly } from '@/libs/Chromiumly/Chromiumly';
|
||||
import { PageProperties, PdfFormat } from '@/libs/chromiumly/_types';
|
||||
import { UrlConverter } from '@/libs/chromiumly/UrlConvert';
|
||||
import { Chromiumly } from '@/libs/chromiumly/Chromiumly';
|
||||
import {
|
||||
PDF_FILE_EXPIRE_IN,
|
||||
getPdfFilePath,
|
||||
getPdfFilesStorageDir,
|
||||
} from './utils';
|
||||
@@ -20,7 +19,7 @@ export class ChromiumlyHtmlConvert {
|
||||
constructor(
|
||||
@Inject(Document.name)
|
||||
private documentModel: TenantModelProxy<typeof Document>,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Write HTML content to temporary file.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { PageProperties, PdfFormat } from '@/libs/Chromiumly/_types';
|
||||
import { PageProperties, PdfFormat } from '@/libs/chromiumly/_types';
|
||||
import { ChromiumlyHtmlConvert } from './ChromiumlyHtmlConvert.service';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class ChromiumlyTenancy {
|
||||
constructor(private htmlConvert: ChromiumlyHtmlConvert) {}
|
||||
constructor(private htmlConvert: ChromiumlyHtmlConvert) { }
|
||||
|
||||
/**
|
||||
* Converts the given HTML content to PDF.
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import { mixin } from 'objection';
|
||||
// import TenantModel from 'models/TenantModel';
|
||||
// import ModelSetting from './ModelSetting';
|
||||
// import ModelSearchable from './ModelSearchable';
|
||||
import { BaseModel } from '@/models/Model';
|
||||
|
||||
export class Document extends BaseModel {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { CreditNoteApplication } from './CreditNoteApplication.service';
|
||||
import { CreditNotesController } from './CreditNotes.controller';
|
||||
import { GetCreditNoteState } from './queries/GetCreditNoteState.service';
|
||||
import { GetCreditNotePdf } from './queries/GetCreditNotePdf.serivce';
|
||||
import { ItemsModule } from '../Items/items.module';
|
||||
import { ItemsModule } from '../Items/Items.module';
|
||||
import { BranchesModule } from '../Branches/Branches.module';
|
||||
import { WarehousesModule } from '../Warehouses/Warehouses.module';
|
||||
import { PdfTemplatesModule } from '../PdfTemplate/PdfTemplates.module';
|
||||
@@ -89,4 +89,4 @@ import { CreditNotesApplyInvoiceModule } from '../CreditNotesApplyInvoice/Credit
|
||||
],
|
||||
controllers: [CreditNotesController],
|
||||
})
|
||||
export class CreditNotesModule {}
|
||||
export class CreditNotesModule { }
|
||||
|
||||
@@ -24,9 +24,9 @@ import { CreateItemDto, EditItemDto } from './dtos/Item.dto';
|
||||
import { GetItemsQueryDto } from './dtos/GetItemsQuery.dto';
|
||||
import { ItemResponseDto } from './dtos/itemResponse.dto';
|
||||
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
||||
import { ItemInvoiceResponseDto } from './dtos/itemInvoiceResponse.dto';
|
||||
import { ItemInvoiceResponseDto } from './dtos/ItemInvoiceResponse.dto';
|
||||
import { ItemEstimatesResponseDto } from './dtos/ItemEstimatesResponse.dto';
|
||||
import { ItemBillsResponseDto } from './dtos/itemBillsResponse.dto';
|
||||
import { ItemBillsResponseDto } from './dtos/ItemBillsResponse.dto';
|
||||
import { ItemReceiptsResponseDto } from './dtos/ItemReceiptsResponse.dto';
|
||||
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import { AcceptType } from '@/constants/accept-type';
|
||||
import { SaleInvoiceResponseDto } from './dtos/SaleInvoiceResponse.dto';
|
||||
import { PaginatedResponseDto } from '@/common/dtos/PaginatedResults.dto';
|
||||
import { SaleInvoiceStateResponseDto } from './dtos/SaleInvoiceState.dto';
|
||||
import { GenerateSaleInvoiceSharableLinkResponseDto } from './dtos/generateSaleInvoiceSharableLinkResponse.dto';
|
||||
import { GenerateSaleInvoiceSharableLinkResponseDto } from './dtos/GenerateSaleInvoiceSharableLinkResponse.dto';
|
||||
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
||||
|
||||
@Controller('sale-invoices')
|
||||
@@ -48,7 +48,7 @@ import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
||||
@ApiExtraModels(GenerateSaleInvoiceSharableLinkResponseDto)
|
||||
@ApiCommonHeaders()
|
||||
export class SaleInvoicesController {
|
||||
constructor(private saleInvoiceApplication: SaleInvoiceApplication) {}
|
||||
constructor(private saleInvoiceApplication: SaleInvoiceApplication) { }
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'Create a new sale invoice.' })
|
||||
|
||||
@@ -8,7 +8,7 @@ import { DeleteSaleReceipt } from './commands/DeleteSaleReceipt.service';
|
||||
import { CloseSaleReceipt } from './commands/CloseSaleReceipt.service';
|
||||
import { SaleReceiptsPdfService } from './queries/SaleReceiptsPdf.service';
|
||||
import { GetSaleReceiptState } from './queries/GetSaleReceiptState.service';
|
||||
import { ItemsModule } from '../Items/items.module';
|
||||
import { ItemsModule } from '../Items/Items.module';
|
||||
import { SaleReceiptDTOTransformer } from './commands/SaleReceiptDTOTransformer.service';
|
||||
import { SaleReceiptValidators } from './commands/SaleReceiptValidators.service';
|
||||
import { ChromiumlyTenancyModule } from '../ChromiumlyTenancy/ChromiumlyTenancy.module';
|
||||
@@ -85,4 +85,4 @@ import { GetSaleReceiptMailTemplateService } from './queries/GetSaleReceiptMailT
|
||||
GetSaleReceiptMailTemplateService
|
||||
],
|
||||
})
|
||||
export class SaleReceiptsModule {}
|
||||
export class SaleReceiptsModule { }
|
||||
|
||||
@@ -7,7 +7,7 @@ import { VendorCreditAutoIncrementService } from './commands/VendorCreditAutoInc
|
||||
import { GetRefundVendorCreditService } from '../VendorCreditsRefund/queries/GetRefundVendorCredit.service';
|
||||
import { GetVendorCreditService } from './queries/GetVendorCredit.service';
|
||||
import { VendorCreditsController } from './VendorCredits.controller';
|
||||
import { ItemsModule } from '../Items/items.module';
|
||||
import { ItemsModule } from '../Items/Items.module';
|
||||
import { TemplateInjectableModule } from '../TemplateInjectable/TemplateInjectable.module';
|
||||
import { AutoIncrementOrdersModule } from '../AutoIncrementOrders/AutoIncrementOrders.module';
|
||||
import { ChromiumlyTenancyModule } from '../ChromiumlyTenancy/ChromiumlyTenancy.module';
|
||||
@@ -75,4 +75,4 @@ import { VendorCreditsImportable } from './commands/VendorCreditsImportable';
|
||||
],
|
||||
controllers: [VendorCreditsController],
|
||||
})
|
||||
export class VendorCreditsModule {}
|
||||
export class VendorCreditsModule { }
|
||||
|
||||
@@ -10,7 +10,7 @@ import { VendorCreditApplyBillsController } from './VendorCreditApplyBills.contr
|
||||
import { BillsModule } from '../Bills/Bills.module';
|
||||
import { BillPaymentsModule } from '../BillPayments/BillPayments.module';
|
||||
import { VendorCreditDTOTransformService } from '../VendorCredit/commands/VendorCreditDTOTransform.service';
|
||||
import { ItemsModule } from '../Items/items.module';
|
||||
import { ItemsModule } from '../Items/Items.module';
|
||||
import { BranchesModule } from '../Branches/Branches.module';
|
||||
import { WarehousesModule } from '../Warehouses/Warehouses.module';
|
||||
import { VendorCreditsModule } from '../VendorCredit/VendorCredits.module';
|
||||
@@ -35,4 +35,4 @@ import { VendorCreditsModule } from '../VendorCredit/VendorCredits.module';
|
||||
],
|
||||
controllers: [VendorCreditApplyBillsController],
|
||||
})
|
||||
export class VendorCreditApplyBillsModule {}
|
||||
export class VendorCreditApplyBillsModule { }
|
||||
|
||||
@@ -13,7 +13,7 @@ import { WarehouseTransferInventoryTransactionsSubscriber } from './susbcribers/
|
||||
import { InitiateWarehouseTransfer } from './commands/InitiateWarehouseTransfer';
|
||||
import { TransferredWarehouseTransfer } from './commands/TransferredWarehouseTransfer';
|
||||
import { CommandWarehouseTransfer } from './commands/CommandWarehouseTransfer';
|
||||
import { ItemsModule } from '../Items/items.module';
|
||||
import { ItemsModule } from '../Items/Items.module';
|
||||
import { InventoryCostModule } from '../InventoryCost/InventoryCost.module';
|
||||
import { RegisterTenancyModel } from '../Tenancy/TenancyModels/Tenancy.module';
|
||||
import { WarehouseTransfer } from './models/WarehouseTransfer';
|
||||
@@ -52,4 +52,4 @@ const models = [
|
||||
exports: [...models],
|
||||
controllers: [WarehouseTransfersController],
|
||||
})
|
||||
export class WarehousesTransfersModule {}
|
||||
export class WarehousesTransfersModule { }
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
"scripts": {
|
||||
"dev": "cross-env PORT=4000 craco start",
|
||||
"build": "craco build",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "node scripts/test.js",
|
||||
"storybook": "start-storybook -p 6006"
|
||||
},
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user