Initial commit: NestJS NextJS pnpm monorepo
This commit is contained in:
commit
610dcf202b
175 files changed
+25172
No files matched your search
@@ -0,0 +1,9 @@
|
||||
|
||||
type ValidationError = {
|
||||
|
||||
errors: string[];
|
||||
};
|
||||
|
||||
type ActionResult =
|
||||
| { success: true,data?:any }
|
||||
| { success: false; errors: string[] };
|
||||
@@ -0,0 +1,93 @@
|
||||
import { Category } from "./category.types";
|
||||
import {Manufacturer,emptyManufacturer} from "./manufacturer.types"
|
||||
|
||||
export interface Article {
|
||||
_id: string,
|
||||
name: string,
|
||||
category: Category;
|
||||
attributes?: Record<string, any>;
|
||||
variants: Variant[],
|
||||
}
|
||||
|
||||
export interface ArticleCreate {
|
||||
name: string;
|
||||
categoryId: string;
|
||||
attributes?: Record<string, any>;
|
||||
variants: Variant[],
|
||||
}
|
||||
|
||||
|
||||
//--- Artikel Variante
|
||||
export interface ArticleVariant {
|
||||
_id: string;
|
||||
article: Article;
|
||||
manufacturer: Manufacturer;
|
||||
supplierArticleNumber?: string;
|
||||
packagingUnit?: string;
|
||||
extra?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface ArticleVariantCreate {
|
||||
articleId: string;
|
||||
manufacturerId: string;
|
||||
supplierArticleNumber?: string;
|
||||
packagingUnit?: string;
|
||||
extra?: Record<string, any>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface Variant {
|
||||
_id?: string;
|
||||
manufacturerId: string;
|
||||
supplierArticleNumber?: string;
|
||||
packagingUnit?: string;
|
||||
extra?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface VariantCreate {
|
||||
manufacturerId: string;
|
||||
supplierArticleNumber?: string;
|
||||
packagingUnit?: string;
|
||||
extra?: Record<string, any>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const emptyArticle = {
|
||||
name: '',
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const emptyArticleVariant = {
|
||||
article: emptyArticle,
|
||||
manufacturer: emptyManufacturer
|
||||
}
|
||||
|
||||
|
||||
export const emptyArticleDto:ArticleCreate = {
|
||||
name:'',
|
||||
categoryId:'',
|
||||
variants:[]
|
||||
}
|
||||
|
||||
|
||||
//Upsert
|
||||
export interface ArticleUpsert {
|
||||
_id:string,
|
||||
name: string;
|
||||
categoryId?: string;
|
||||
attributes?: Record<string, any>;
|
||||
variants: VariantUpsert[],
|
||||
}
|
||||
|
||||
export interface VariantUpsert {
|
||||
_id?:string
|
||||
manufacturerId: string;
|
||||
supplierArticleNumber?: string;
|
||||
packagingUnit?: string;
|
||||
extra?: Record<string, any>;
|
||||
deleted?:boolean;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
export interface CategoryCreate {
|
||||
name: string;
|
||||
isConsumable: boolean;
|
||||
description?: string;
|
||||
parentCategoryId?: string;
|
||||
requiredAttributes?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface Category {
|
||||
_id:string
|
||||
name: string
|
||||
isConsumable: boolean
|
||||
description?: string
|
||||
parentCategoryId?: string
|
||||
parentName?:string
|
||||
requiredAttributes?: Record<string, any>
|
||||
}
|
||||
|
||||
export const emptyCategory = {
|
||||
|
||||
name: '',
|
||||
isConsumable: false,
|
||||
// description: ''
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './category.types';
|
||||
export * from './article.types';
|
||||
export * from './manufacturer.types';
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
export interface ManufacturerCreate {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface ManufacturerUpdate {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface Manufacturer {
|
||||
_id:string
|
||||
name: string
|
||||
}
|
||||
|
||||
export const emptyManufacturer = {
|
||||
|
||||
name: '',
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './location.types'
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
export interface LocationMutaion {
|
||||
name: string;
|
||||
description?: string;
|
||||
parentLocationId?: string;
|
||||
}
|
||||
|
||||
export interface LocationCreate {
|
||||
name: string;
|
||||
description?: string;
|
||||
parentLocationId?: string;
|
||||
}
|
||||
|
||||
export interface LocationUpdate {
|
||||
name?: string;
|
||||
description?: string;
|
||||
parentLocationId?: string;
|
||||
}
|
||||
|
||||
export interface Location {
|
||||
_id:string;
|
||||
name: string;
|
||||
description?: string;
|
||||
parentLocationId?: string;
|
||||
}
|
||||
|
||||
export const emptyLocation = {
|
||||
name: ''
|
||||
}
|
||||
|
||||
export interface LocationTreeNode {
|
||||
_id: string;
|
||||
name: string;
|
||||
parentLocationId?: string;
|
||||
children: LocationTreeNode[];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Location } from "./location.types";
|
||||
|
||||
export interface StockCreate {
|
||||
name: string;
|
||||
locationId: string;
|
||||
areas?:string[]
|
||||
}
|
||||
|
||||
export interface StockUpdate {
|
||||
name?: string;
|
||||
locationId?: string;
|
||||
areas?:string[]
|
||||
}
|
||||
|
||||
export interface Stock {
|
||||
id: string
|
||||
name: string;
|
||||
location: Location;
|
||||
areas?:string[]
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
export interface Stock {
|
||||
id: string
|
||||
articleVariantId: string
|
||||
locationId: string
|
||||
quantity: number
|
||||
expiryDate?: Date
|
||||
batchNumber: string
|
||||
}
|
||||
|
||||
|
||||
export interface StockCreate {
|
||||
articleVariantId: string
|
||||
locationId: string
|
||||
quantity: number
|
||||
expiryDate?: Date
|
||||
batchNumber: string
|
||||
}
|
||||
|
||||
export interface StockUpdate {
|
||||
articleVariantId?: string
|
||||
locationId?: string
|
||||
quantity?: number
|
||||
expiryDate?: Date
|
||||
batchNumber?: string
|
||||
}
|
||||
|
||||
|
||||
export const emptyStock:StockCreate = {
|
||||
articleVariantId: '',
|
||||
locationId: '',
|
||||
quantity: 0,
|
||||
expiryDate: new Date(),
|
||||
batchNumber: '1'
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
|
||||
export interface StockMovementIn {
|
||||
stockId: string;
|
||||
articleVariantId: string;
|
||||
quantity: number;
|
||||
batchNumber?: string;
|
||||
expiryDate?: Date;
|
||||
area?: string;
|
||||
}
|
||||
|
||||
export interface StockMovementOut {
|
||||
stockContentId: string;
|
||||
quantity: number;
|
||||
}
|
||||
|
||||
export interface StockMovementTransfer {
|
||||
articleVariantId: string;
|
||||
fromStockId: string;
|
||||
toStockId: string;
|
||||
toArea?: string;
|
||||
quantity: number;
|
||||
batchNumber?: string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user