mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: licenses administration basic authentication.
feat: accounts slug. feat: duplicate accounts_balance table and merge balance with accounts table. feat: refactoring customers and vendors. feat: system user soft deleting. feat: preventing build tenant database without any subscription. feat: remove 'password' property from 'req.user' object. feat: refactoring JournalPoster class. feat: delete duplicated directories and files.
This commit is contained in:
170
server/src/interfaces/Contact.ts
Normal file
170
server/src/interfaces/Contact.ts
Normal file
@@ -0,0 +1,170 @@
|
||||
|
||||
// Contact Interfaces.
|
||||
// ----------------------------------
|
||||
export interface IContactAddress {
|
||||
billingAddress1: string,
|
||||
billingAddress2: string,
|
||||
billingAddressCity: string,
|
||||
billingAddressCountry: string,
|
||||
billingAddressEmail: string,
|
||||
billingAddressZipcode: string,
|
||||
billingAddressPhone: string,
|
||||
billingAddressState: string,
|
||||
|
||||
shippingAddress1: string,
|
||||
shippingAddress2: string,
|
||||
shippingAddressCity: string,
|
||||
shippingAddressCountry: string,
|
||||
shippingAddressEmail: string,
|
||||
shippingAddressZipcode: string,
|
||||
shippingAddressPhone: string,
|
||||
shippingAddressState: string,
|
||||
}
|
||||
export interface IContactAddressDTO {
|
||||
billingAddress1?: string,
|
||||
billingAddress2?: string,
|
||||
billingAddressCity?: string,
|
||||
billingAddressCountry?: string,
|
||||
billingAddressEmail?: string,
|
||||
billingAddressZipcode?: string,
|
||||
billingAddressPhone?: string,
|
||||
billingAddressState?: string,
|
||||
|
||||
shippingAddress1?: string,
|
||||
shippingAddress2?: string,
|
||||
shippingAddressCity?: string,
|
||||
shippingAddressCountry?: string,
|
||||
shippingAddressEmail?: string,
|
||||
shippingAddressZipcode?: string,
|
||||
shippingAddressPhone?: string,
|
||||
shippingAddressState?: string,
|
||||
};
|
||||
export interface IContact extends IContactAddress{
|
||||
contactService: 'customer' | 'vendor',
|
||||
contactType: string,
|
||||
|
||||
balance: number,
|
||||
openingBalance: number,
|
||||
|
||||
firstName: string,
|
||||
lastName: string,
|
||||
companyName: string,
|
||||
displayName: string,
|
||||
|
||||
email: string,
|
||||
workPhone: string,
|
||||
personalPhone: string,
|
||||
|
||||
note: string,
|
||||
active: boolean,
|
||||
}
|
||||
export interface IContactNewDTO {
|
||||
contactType?: string,
|
||||
|
||||
openingBalance?: number,
|
||||
|
||||
firstName?: string,
|
||||
lastName?: string,
|
||||
companyName?: string,
|
||||
displayName: string,
|
||||
|
||||
email?: string,
|
||||
workPhone?: string,
|
||||
personalPhone?: string,
|
||||
|
||||
note?: string,
|
||||
active: boolean,
|
||||
}
|
||||
export interface IContactEditDTO {
|
||||
contactType?: string,
|
||||
|
||||
openingBalance?: number,
|
||||
|
||||
firstName?: string,
|
||||
lastName?: string,
|
||||
companyName?: string,
|
||||
displayName: string,
|
||||
|
||||
email?: string,
|
||||
workPhone?: string,
|
||||
personalPhone?: string,
|
||||
|
||||
note?: string,
|
||||
active: boolean,
|
||||
}
|
||||
|
||||
// Customer Interfaces.
|
||||
// ----------------------------------
|
||||
export interface ICustomer extends IContact {
|
||||
contactService: 'customer',
|
||||
}
|
||||
export interface ICustomerNewDTO extends IContactAddressDTO {
|
||||
customerType: string,
|
||||
|
||||
openingBalance?: number,
|
||||
|
||||
firstName?: string,
|
||||
lastName?: string,
|
||||
companyName?: string,
|
||||
displayName: string,
|
||||
|
||||
email?: string,
|
||||
workPhone?: string,
|
||||
personalPhone?: string,
|
||||
|
||||
note?: string,
|
||||
active?: boolean,
|
||||
};
|
||||
export interface ICustomerEditDTO extends IContactAddressDTO {
|
||||
customerType: string,
|
||||
|
||||
openingBalance?: number,
|
||||
|
||||
firstName?: string,
|
||||
lastName?: string,
|
||||
companyName?: string,
|
||||
displayName: string,
|
||||
|
||||
email?: string,
|
||||
workPhone?: string,
|
||||
personalPhone?: string,
|
||||
|
||||
note?: string,
|
||||
active?: boolean,
|
||||
};
|
||||
|
||||
// Vendor Interfaces.
|
||||
// ----------------------------------
|
||||
export interface IVendor extends IContact {
|
||||
contactService: 'vendor',
|
||||
}
|
||||
export interface IVendorNewDTO extends IContactAddressDTO {
|
||||
openingBalance?: number,
|
||||
|
||||
firstName?: string,
|
||||
lastName?: string,
|
||||
companyName?: string,
|
||||
displayName: string,
|
||||
|
||||
email?: string,
|
||||
workPhone?: string,
|
||||
personalPhone?: string,
|
||||
|
||||
note?: string,
|
||||
active?: boolean,
|
||||
};
|
||||
export interface IVendorEditDTO extends IContactAddressDTO {
|
||||
openingBalance?: number,
|
||||
|
||||
firstName?: string,
|
||||
lastName?: string,
|
||||
companyName?: string,
|
||||
displayName?: string,
|
||||
|
||||
email?: string,
|
||||
workPhone?: string,
|
||||
personalPhone?: string,
|
||||
|
||||
note?: string,
|
||||
active?: boolean,
|
||||
};
|
||||
40
server/src/interfaces/Journal.ts
Normal file
40
server/src/interfaces/Journal.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
|
||||
export interface IJournalEntry {
|
||||
index?: number,
|
||||
|
||||
date: Date,
|
||||
credit: number,
|
||||
debit: number,
|
||||
account: number,
|
||||
referenceType: string,
|
||||
referenceId: number,
|
||||
|
||||
transactionType?: string,
|
||||
note?: string,
|
||||
userId?: number,
|
||||
contactType?: string,
|
||||
contactId?: number,
|
||||
};
|
||||
|
||||
export interface IJournalPoster {
|
||||
credit(entry: IJournalEntry): void;
|
||||
debit(entry: IJournalEntry): void;
|
||||
|
||||
removeEntries(ids: number[]): void;
|
||||
|
||||
saveEntries(): void;
|
||||
saveBalance(): void;
|
||||
deleteEntries(): void;
|
||||
}
|
||||
|
||||
export type TEntryType = 'credit' | 'debit';
|
||||
|
||||
export interface IAccountChange {
|
||||
credit: number,
|
||||
debit: number,
|
||||
};
|
||||
|
||||
export interface IAccountsChange {
|
||||
[key: string]: IAccountChange,
|
||||
};
|
||||
@@ -50,6 +50,22 @@ import {
|
||||
IAccount,
|
||||
IAccountDTO,
|
||||
} from './Account';
|
||||
import {
|
||||
IJournalEntry,
|
||||
IJournalPoster,
|
||||
TEntryType,
|
||||
IAccountChange,
|
||||
IAccountsChange,
|
||||
} from './Journal';
|
||||
import {
|
||||
IContactAddress,
|
||||
IContact,
|
||||
IContactNewDTO,
|
||||
IContactEditDTO,
|
||||
ICustomer,
|
||||
ICustomerNewDTO,
|
||||
ICustomerEditDTO,
|
||||
} from './Contact';
|
||||
|
||||
export {
|
||||
IAccount,
|
||||
@@ -96,4 +112,18 @@ export {
|
||||
|
||||
IOptionDTO,
|
||||
IOptionsDTO,
|
||||
|
||||
IJournalEntry,
|
||||
IJournalPoster,
|
||||
TEntryType,
|
||||
IAccountChange,
|
||||
IAccountsChange,
|
||||
|
||||
IContactAddress,
|
||||
IContact,
|
||||
IContactNewDTO,
|
||||
IContactEditDTO,
|
||||
ICustomer,
|
||||
ICustomerNewDTO,
|
||||
ICustomerEditDTO,
|
||||
};
|
||||
Reference in New Issue
Block a user