mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: Payment system with voucher cards.
feat: Design with inversion dependency injection architecture. feat: Prettier http middleware. feat: Re-write items categories with preferred accounts.
This commit is contained in:
30
server/src/interfaces/ItemCategory.ts
Normal file
30
server/src/interfaces/ItemCategory.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
|
||||
export interface IItemCategory {
|
||||
name: string,
|
||||
|
||||
parentCategoryId?: number,
|
||||
description?: string,
|
||||
userId: number,
|
||||
|
||||
costAccountId?: number,
|
||||
sellAccountId?: number,
|
||||
inventoryAccountId?: number,
|
||||
|
||||
costMethod?: string,
|
||||
};
|
||||
|
||||
export interface IItemCategoryOTD {
|
||||
name: string,
|
||||
|
||||
parentCategoryId?: number,
|
||||
description?: string,
|
||||
userId: number,
|
||||
|
||||
costAccountId?: number,
|
||||
sellAccountId?: number,
|
||||
inventoryAccountId?: number,
|
||||
|
||||
costMethod?: string,
|
||||
};
|
||||
20
server/src/interfaces/Payment.ts
Normal file
20
server/src/interfaces/Payment.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
export interface IPaymentModel {}
|
||||
|
||||
export interface IVoucherPaymentModel extends IPaymentModel {
|
||||
voucherCode: string;
|
||||
}
|
||||
|
||||
export interface IPaymentMethod {
|
||||
makePayment(paymentModel: IPaymentModel): Promise<boolean>;
|
||||
}
|
||||
|
||||
export interface IVoucherPaymentMethod {
|
||||
makePayment(paymentModel: IVoucherPaymentModel): Promise<boolean>;
|
||||
}
|
||||
|
||||
export interface IPaymentContext<PaymentModel> {
|
||||
paymentMethod: IPaymentMethod;
|
||||
makePayment(paymentModel: PaymentModel): Promise<boolean>;
|
||||
}
|
||||
17
server/src/interfaces/Voucher.ts
Normal file
17
server/src/interfaces/Voucher.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
export interface IVoucher {
|
||||
id?: number,
|
||||
voucherCode: string,
|
||||
voucherPeriod: number,
|
||||
sent: boolean,
|
||||
disabled: boolean,
|
||||
used: boolean,
|
||||
};
|
||||
|
||||
export interface IVouchersFilter {
|
||||
active: boolean,
|
||||
disabld: boolean,
|
||||
used: boolean,
|
||||
sent: boolean,
|
||||
};
|
||||
@@ -1,8 +1,17 @@
|
||||
import { IInventoryTransaction, IInventoryLotCost } from './InventoryTransaction';
|
||||
import { IBillPaymentEntry, IBillPayment } from './BillPayment';
|
||||
import { IInventoryCostMethod } from './IInventoryCostMethod';
|
||||
import { IInventoryCostMethod } from './InventoryCostMethod';
|
||||
import { IItemEntry } from './ItemEntry';
|
||||
import { IItem } from './Item';
|
||||
import { IVoucher, IVouchersFilter } from './Voucher';
|
||||
import { IItemCategory, IItemCategoryOTD } from './ItemCategory';
|
||||
import {
|
||||
IPaymentModel,
|
||||
IVoucherPaymentModel,
|
||||
IPaymentMethod,
|
||||
IVoucherPaymentMethod,
|
||||
IPaymentContext,
|
||||
} from './Payment';
|
||||
|
||||
export {
|
||||
IBillPaymentEntry,
|
||||
@@ -10,6 +19,16 @@ export {
|
||||
IInventoryTransaction,
|
||||
IInventoryLotCost,
|
||||
IInventoryCostMethod,
|
||||
IItemEntry
|
||||
IItemEntry,
|
||||
IItem,
|
||||
IVoucher,
|
||||
IVouchersFilter,
|
||||
IItemCategory,
|
||||
IItemCategoryOTD,
|
||||
|
||||
IPaymentModel,
|
||||
IPaymentMethod,
|
||||
IPaymentContext,
|
||||
IVoucherPaymentModel,
|
||||
IVoucherPaymentMethod,
|
||||
};
|
||||
Reference in New Issue
Block a user