diff options
Diffstat (limited to 'src/services/types.ts')
-rw-r--r-- | src/services/types.ts | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/services/types.ts b/src/services/types.ts new file mode 100644 index 0000000..e6e01db --- /dev/null +++ b/src/services/types.ts @@ -0,0 +1,40 @@ +interface BaseModel { + _id: string; + createdAt: string; + updatedAt: string; +} + +export interface Contractor extends BaseModel { + name: string; + vatId: string; + debt: number; +} + +export interface Product extends BaseModel { + name: string; + description: string; + price: number; + quantity: number; +} + +export interface Transfer extends BaseModel { + date: string; + operation: 'in' | 'out'; + contractorId: string; + amount: number; + contractor?: Contractor; +} + +export interface Waybill extends BaseModel { + date: string; + operation: 'in' | 'out'; + status: 'waiting' | 'executed' | 'cancelled'; + contractorId: string; + contractor?: Contractor; + records: { + productId: string; + price: number; + quantity: number; + }[]; + total: number; +} |