mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
feat: mail notifications of sales transactions
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
export type IMailAttachment = MailAttachmentPath | MailAttachmentContent;
|
||||
|
||||
export interface MailAttachmentPath {
|
||||
filename: string;
|
||||
path: string;
|
||||
cid: string;
|
||||
}
|
||||
export interface MailAttachmentContent {
|
||||
filename: string;
|
||||
content: Buffer;
|
||||
}
|
||||
|
||||
export interface IMailable {
|
||||
constructor(
|
||||
view: string,
|
||||
data?: { [key: string]: string | number },
|
||||
);
|
||||
constructor(view: string, data?: { [key: string]: string | number });
|
||||
send(): Promise<any>;
|
||||
build(): void;
|
||||
setData(data: { [key: string]: string | number }): IMailable;
|
||||
@@ -13,4 +21,27 @@ export interface IMailable {
|
||||
setView(view: string): IMailable;
|
||||
render(data?: { [key: string]: string | number }): string;
|
||||
getViewContent(): string;
|
||||
}
|
||||
}
|
||||
|
||||
export interface AddressItem {
|
||||
label: string;
|
||||
mail: string;
|
||||
primary?: boolean;
|
||||
}
|
||||
|
||||
export interface CommonMailOptions {
|
||||
toAddresses: AddressItem[];
|
||||
fromAddresses: AddressItem[];
|
||||
from: string;
|
||||
to: string | string[];
|
||||
subject: string;
|
||||
body: string;
|
||||
data?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface CommonMailOptionsDTO {
|
||||
to?: string | string[];
|
||||
from?: string;
|
||||
subject?: string;
|
||||
body?: string;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { Knex } from 'knex';
|
||||
import { ISystemUser } from '@/interfaces';
|
||||
import {
|
||||
CommonMailOptions,
|
||||
CommonMailOptionsDTO,
|
||||
ISystemUser,
|
||||
} from '@/interfaces';
|
||||
import { ILedgerEntry } from './Ledger';
|
||||
import { ISaleInvoice } from './SaleInvoice';
|
||||
|
||||
@@ -19,7 +23,7 @@ export interface IPaymentReceive {
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
localAmount?: number;
|
||||
branchId?: number
|
||||
branchId?: number;
|
||||
}
|
||||
export interface IPaymentReceiveCreateDTO {
|
||||
customerId: number;
|
||||
@@ -166,6 +170,6 @@ export type IPaymentReceiveGLCommonEntry = Pick<
|
||||
| 'branchId'
|
||||
>;
|
||||
|
||||
export interface IPaymentReceiveMailOpts {
|
||||
|
||||
}
|
||||
export interface PaymentReceiveMailOpts extends CommonMailOptions {}
|
||||
|
||||
export interface PaymentReceiveMailOptsDTO extends CommonMailOptionsDTO {}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Knex } from 'knex';
|
||||
import { IItemEntry, IItemEntryDTO } from './ItemEntry';
|
||||
import { IDynamicListFilterDTO } from '@/interfaces/DynamicFilter';
|
||||
import { CommonMailOptions, CommonMailOptionsDTO } from './Mailable';
|
||||
|
||||
export interface ISaleEstimate {
|
||||
id?: number;
|
||||
@@ -125,10 +126,10 @@ export interface ISaleEstimateApprovedEvent {
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface SaleEstimateMailOptions {
|
||||
to: string;
|
||||
from: string;
|
||||
subject: string;
|
||||
body: string;
|
||||
attachInvoice?: boolean;
|
||||
export interface SaleEstimateMailOptions extends CommonMailOptions {
|
||||
attachEstimate?: boolean;
|
||||
}
|
||||
|
||||
export interface SaleEstimateMailOptionsDTO extends CommonMailOptionsDTO {
|
||||
attachEstimate?: boolean;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Knex } from 'knex';
|
||||
import { ISystemUser, IAccount, ITaxTransaction, AddressItem } from '@/interfaces';
|
||||
import { ISystemUser, IAccount, ITaxTransaction } from '@/interfaces';
|
||||
import { CommonMailOptions, CommonMailOptionsDTO } from './Mailable';
|
||||
import { IDynamicListFilter } from '@/interfaces/DynamicFilter';
|
||||
import { IItemEntry, IItemEntryDTO } from './ItemEntry';
|
||||
|
||||
@@ -187,21 +188,11 @@ export enum SaleInvoiceAction {
|
||||
NotifyBySms = 'NotifyBySms',
|
||||
}
|
||||
|
||||
export interface SaleInvoiceMailOptions {
|
||||
toAddresses: AddressItem[];
|
||||
fromAddresses: AddressItem[];
|
||||
from: string;
|
||||
to: string | string[];
|
||||
subject: string;
|
||||
body: string;
|
||||
export interface SaleInvoiceMailOptions extends CommonMailOptions {
|
||||
attachInvoice: boolean;
|
||||
}
|
||||
|
||||
export interface SendInvoiceMailDTO {
|
||||
to: string | string[];
|
||||
from: string;
|
||||
subject: string;
|
||||
body: string;
|
||||
export interface SendInvoiceMailDTO extends CommonMailOptionsDTO {
|
||||
attachInvoice?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Knex } from 'knex';
|
||||
import { IItemEntry } from './ItemEntry';
|
||||
import { CommonMailOptions, CommonMailOptionsDTO } from './Mailable';
|
||||
|
||||
export interface ISaleReceipt {
|
||||
id?: number;
|
||||
@@ -135,6 +136,10 @@ export interface ISaleReceiptDeletingPayload {
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface SaleReceiptMailOpts {
|
||||
|
||||
}
|
||||
export interface SaleReceiptMailOpts extends CommonMailOptions {
|
||||
attachReceipt: boolean;
|
||||
}
|
||||
|
||||
export interface SaleReceiptMailOptsDTO extends CommonMailOptionsDTO {
|
||||
attachReceipt?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user