mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
add server to monorepo.
This commit is contained in:
126
packages/server/src/interfaces/SaleEstimate.ts
Normal file
126
packages/server/src/interfaces/SaleEstimate.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import { Knex } from 'knex';
|
||||
import { IItemEntry } from './ItemEntry';
|
||||
import { IDynamicListFilterDTO } from '@/interfaces/DynamicFilter';
|
||||
|
||||
export interface ISaleEstimate {
|
||||
id?: number;
|
||||
amount: number;
|
||||
currencyCode: string;
|
||||
customerId: number;
|
||||
estimateDate: Date;
|
||||
estimateNumber: string;
|
||||
reference: string;
|
||||
note: string;
|
||||
termsConditions: string;
|
||||
userId: number;
|
||||
entries: IItemEntry[];
|
||||
sendToEmail: string;
|
||||
createdAt?: Date;
|
||||
deliveredAt: string | Date;
|
||||
isConvertedToInvoice: boolean;
|
||||
isDelivered: boolean;
|
||||
|
||||
branchId?: number;
|
||||
warehouseId?: number;
|
||||
}
|
||||
export interface ISaleEstimateDTO {
|
||||
customerId: number;
|
||||
exchangeRate?: number;
|
||||
estimateDate?: Date;
|
||||
reference?: string;
|
||||
estimateNumber?: string;
|
||||
entries: IItemEntry[];
|
||||
note: string;
|
||||
termsConditions: string;
|
||||
sendToEmail: string;
|
||||
delivered: boolean;
|
||||
|
||||
branchId?: number;
|
||||
warehouseId?: number;
|
||||
}
|
||||
|
||||
export interface ISalesEstimatesFilter extends IDynamicListFilterDTO {
|
||||
stringifiedFilterRoles?: string;
|
||||
}
|
||||
|
||||
export interface ISalesEstimatesService {
|
||||
validateCustomerHasNoEstimates(
|
||||
tenantId: number,
|
||||
customerId: number
|
||||
): Promise<void>;
|
||||
}
|
||||
|
||||
export interface ISaleEstimateCreatedPayload {
|
||||
tenantId: number;
|
||||
saleEstimate: ISaleEstimate;
|
||||
saleEstimateId: number;
|
||||
saleEstimateDTO: ISaleEstimateDTO;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ISaleEstimateCreatingPayload {
|
||||
estimateDTO: ISaleEstimateDTO;
|
||||
tenantId: number;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ISaleEstimateEditedPayload {
|
||||
tenantId: number;
|
||||
estimateId: number;
|
||||
saleEstimate: ISaleEstimate;
|
||||
oldSaleEstimate: ISaleEstimate;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ISaleEstimateEditingPayload {
|
||||
tenantId: number;
|
||||
oldSaleEstimate: ISaleEstimate;
|
||||
estimateDTO: ISaleEstimateDTO;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ISaleEstimateDeletedPayload {
|
||||
tenantId: number;
|
||||
saleEstimateId: number;
|
||||
oldSaleEstimate: ISaleEstimate;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ISaleEstimateDeletingPayload {
|
||||
tenantId: number;
|
||||
oldSaleEstimate: ISaleEstimate;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ISaleEstimateEventDeliveredPayload {
|
||||
tenantId: number;
|
||||
saleEstimate: ISaleEstimate;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ISaleEstimateEventDeliveringPayload {
|
||||
tenantId: number;
|
||||
oldSaleEstimate: ISaleEstimate;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export enum SaleEstimateAction {
|
||||
Create = 'Create',
|
||||
Edit = 'Edit',
|
||||
Delete = 'Delete',
|
||||
View = 'View',
|
||||
NotifyBySms = 'NotifyBySms',
|
||||
}
|
||||
|
||||
export interface ISaleEstimateApprovingEvent {
|
||||
tenantId: number;
|
||||
oldSaleEstimate: ISaleEstimate;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ISaleEstimateApprovedEvent {
|
||||
tenantId: number;
|
||||
oldSaleEstimate: ISaleEstimate;
|
||||
saleEstimate: ISaleEstimate;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
Reference in New Issue
Block a user