mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
Merge branch 'develop' into draft-import-resources
This commit is contained in:
@@ -84,6 +84,12 @@ import { WriteInvoiceTaxTransactionsSubscriber } from '@/services/TaxRates/subsc
|
||||
import { BillTaxRateValidateSubscriber } from '@/services/TaxRates/subscribers/BillTaxRateValidateSubscriber';
|
||||
import { WriteBillTaxTransactionsSubscriber } from '@/services/TaxRates/subscribers/WriteBillTaxTransactionsSubscriber';
|
||||
import { SyncItemTaxRateOnEditTaxSubscriber } from '@/services/TaxRates/SyncItemTaxRateOnEditTaxSubscriber';
|
||||
import { PlaidUpdateTransactionsOnItemCreatedSubscriber } from '@/services/Banking/Plaid/subscribers/PlaidUpdateTransactionsOnItemCreatedSubscriber';
|
||||
import { InvoiceChangeStatusOnMailSentSubscriber } from '@/services/Sales/Invoices/subscribers/InvoiceChangeStatusOnMailSentSubscriber';
|
||||
import { SaleReceiptMarkClosedOnMailSentSubcriber } from '@/services/Sales/Receipts/subscribers/SaleReceiptMarkClosedOnMailSentSubcriber';
|
||||
import { SaleEstimateMarkApprovedOnMailSent } from '@/services/Sales/Estimates/subscribers/SaleEstimateMarkApprovedOnMailSent';
|
||||
import { DeleteCashflowTransactionOnUncategorize } from '@/services/Cashflow/subscribers/DeleteCashflowTransactionOnUncategorize';
|
||||
import { PreventDeleteTransactionOnDelete } from '@/services/Cashflow/subscribers/PreventDeleteTransactionsOnDelete'; }
|
||||
|
||||
export default () => {
|
||||
return new EventPublisher();
|
||||
@@ -104,8 +110,12 @@ export const susbcribers = () => {
|
||||
InventorySubscriber,
|
||||
CustomerWriteGLOpeningBalanceSubscriber,
|
||||
VendorsWriteGLOpeningSubscriber,
|
||||
|
||||
// # Estimate
|
||||
SaleEstimateAutoSerialSubscriber,
|
||||
SaleEstimateSmsNotificationSubscriber,
|
||||
SaleEstimateMarkApprovedOnMailSent,
|
||||
|
||||
ExpensesWriteGLSubscriber,
|
||||
SaleReceiptAutoSerialSubscriber,
|
||||
SaleInvoiceAutoIncrementSubscriber,
|
||||
@@ -152,11 +162,13 @@ export const susbcribers = () => {
|
||||
// #Invoices
|
||||
InvoicePaymentGLRewriteSubscriber,
|
||||
InvoiceCostGLEntriesSubscriber,
|
||||
InvoiceChangeStatusOnMailSentSubscriber,
|
||||
|
||||
BillPaymentsGLEntriesRewriteSubscriber,
|
||||
|
||||
// # Receipts
|
||||
SaleReceiptCostGLEntriesSubscriber,
|
||||
SaleReceiptMarkClosedOnMailSentSubcriber,
|
||||
|
||||
// Transaction locking.
|
||||
SalesTransactionLockingGuardSubscriber,
|
||||
@@ -199,6 +211,13 @@ export const susbcribers = () => {
|
||||
BillTaxRateValidateSubscriber,
|
||||
WriteBillTaxTransactionsSubscriber,
|
||||
|
||||
SyncItemTaxRateOnEditTaxSubscriber
|
||||
SyncItemTaxRateOnEditTaxSubscriber,
|
||||
|
||||
// Plaid
|
||||
PlaidUpdateTransactionsOnItemCreatedSubscriber,
|
||||
|
||||
// Cashflow
|
||||
DeleteCashflowTransactionOnUncategorize,
|
||||
PreventDeleteTransactionOnDelete
|
||||
];
|
||||
};
|
||||
|
||||
@@ -5,6 +5,8 @@ import boom from 'express-boom';
|
||||
import errorHandler from 'errorhandler';
|
||||
import bodyParser from 'body-parser';
|
||||
import fileUpload from 'express-fileupload';
|
||||
import { Server } from 'socket.io';
|
||||
import Container from 'typedi';
|
||||
import routes from 'api';
|
||||
import LoggerMiddleware from '@/api/middleware/LoggerMiddleware';
|
||||
import AgendashController from '@/api/controllers/Agendash';
|
||||
@@ -72,4 +74,32 @@ export default ({ app }) => {
|
||||
app.use((req: Request, res: Response, next: NextFunction) => {
|
||||
return res.boom.notFound();
|
||||
});
|
||||
const server = app.listen(app.get('port'), (err) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
process.exit(1);
|
||||
return;
|
||||
}
|
||||
console.log(`
|
||||
################################################
|
||||
Server listening on port: ${app.get('port')}
|
||||
################################################
|
||||
`);
|
||||
});
|
||||
const io = new Server(server, { path: '/socket' });
|
||||
|
||||
// Set socket.io listeners.
|
||||
io.on('connection', (socket) => {
|
||||
console.log('SOCKET CONNECTED');
|
||||
|
||||
socket.on('disconnect', () => {
|
||||
console.log('SOCKET DISCONNECTED');
|
||||
});
|
||||
});
|
||||
// Middleware to pass socket to each request object.
|
||||
app.use((req: Request, res: Response, next: NextFunction) => {
|
||||
req.io = io;
|
||||
next();
|
||||
});
|
||||
Container.set('socket', io);
|
||||
};
|
||||
|
||||
@@ -5,6 +5,12 @@ import RewriteInvoicesJournalEntries from 'jobs/WriteInvoicesJEntries';
|
||||
import UserInviteMailJob from 'jobs/UserInviteMail';
|
||||
import OrganizationSetupJob from 'jobs/OrganizationSetup';
|
||||
import OrganizationUpgrade from 'jobs/OrganizationUpgrade';
|
||||
import { SendSaleInvoiceMailJob } from '@/services/Sales/Invoices/SendSaleInvoiceMailJob';
|
||||
import { SendSaleInvoiceReminderMailJob } from '@/services/Sales/Invoices/SendSaleInvoiceMailReminderJob';
|
||||
import { SendSaleEstimateMailJob } from '@/services/Sales/Estimates/SendSaleEstimateMailJob';
|
||||
import { SaleReceiptMailNotificationJob } from '@/services/Sales/Receipts/SaleReceiptMailNotificationJob';
|
||||
import { PaymentReceiveMailNotificationJob } from '@/services/Sales/PaymentReceives/PaymentReceiveMailNotificationJob';
|
||||
import { PlaidFetchTransactionsJob } from '@/services/Banking/Plaid/PlaidFetchTransactionsJob';
|
||||
|
||||
export default ({ agenda }: { agenda: Agenda }) => {
|
||||
new ResetPasswordMailJob(agenda);
|
||||
@@ -13,6 +19,12 @@ export default ({ agenda }: { agenda: Agenda }) => {
|
||||
new RewriteInvoicesJournalEntries(agenda);
|
||||
new OrganizationSetupJob(agenda);
|
||||
new OrganizationUpgrade(agenda);
|
||||
new SendSaleInvoiceMailJob(agenda);
|
||||
new SendSaleInvoiceReminderMailJob(agenda);
|
||||
new SendSaleEstimateMailJob(agenda);
|
||||
new SaleReceiptMailNotificationJob(agenda);
|
||||
new PaymentReceiveMailNotificationJob(agenda);
|
||||
new PlaidFetchTransactionsJob(agenda);
|
||||
|
||||
agenda.start();
|
||||
};
|
||||
|
||||
@@ -62,6 +62,8 @@ import TaxRate from 'models/TaxRate';
|
||||
import TaxRateTransaction from 'models/TaxRateTransaction';
|
||||
import Attachment from 'models/Attachment';
|
||||
import Import from 'models/Import';
|
||||
import PlaidItem from 'models/PlaidItem';
|
||||
import UncategorizedCashflowTransaction from 'models/UncategorizedCashflowTransaction';
|
||||
|
||||
export default (knex) => {
|
||||
const models = {
|
||||
@@ -126,7 +128,9 @@ export default (knex) => {
|
||||
TaxRate,
|
||||
TaxRateTransaction,
|
||||
Attachment,
|
||||
Import
|
||||
Import,
|
||||
PlaidItem,
|
||||
UncategorizedCashflowTransaction
|
||||
};
|
||||
return mapValues(models, (model) => model.bindKnex(knex));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user