Ajouts et modifications de models
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { Profile } from './profile.model';
|
||||
import { PageLinks, PageMeta } from './shared.model';
|
||||
import { Tag } from './tag.model';
|
||||
import { Profile, Tag } from '.';
|
||||
|
||||
export interface Article {
|
||||
slug: string;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
export interface Brand {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export interface Category {
|
||||
id: number;
|
||||
slug: string;
|
||||
name: string;
|
||||
description: string;
|
||||
parent?: Category;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -6,8 +6,10 @@ export * from './article-list-config.model';
|
||||
export * from './application.model';
|
||||
export * from './application-list.model';
|
||||
export * from './application-list-config.model';
|
||||
export * from './brand.model';
|
||||
export * from './calculator.model';
|
||||
export * from './canopy.model';
|
||||
export * from './category.model';
|
||||
export * from './chart.model';
|
||||
export * from './dropzone.model';
|
||||
export * from './errors.model';
|
||||
@@ -15,6 +17,7 @@ export * from './jump.model';
|
||||
export * from './jump-list.model';
|
||||
export * from './jump-list-config.model';
|
||||
export * from './menu.model';
|
||||
export * from './packaging.model';
|
||||
export * from './product.model';
|
||||
export * from './product-list.model';
|
||||
export * from './product-list-config.model';
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
export interface Packaging {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -1,28 +1,44 @@
|
||||
import { FormControl } from '@angular/forms';
|
||||
|
||||
import { ColumnDefinition, PageLinks, PageMeta } from './shared.model';
|
||||
import { Brand, Category, Packaging, Profile, Tag } from '.';
|
||||
|
||||
export interface Product {
|
||||
id: number;
|
||||
slug: string;
|
||||
eancode: string;
|
||||
name: string;
|
||||
numero: number;
|
||||
barcode: number;
|
||||
poid?: number;
|
||||
sachets?: string;
|
||||
molecules?: string;
|
||||
isSelected?: boolean;
|
||||
description: string;
|
||||
stock: number;
|
||||
weightGross?: number;
|
||||
weightNet?: number;
|
||||
priceBuy?: number;
|
||||
priceRetail?: number;
|
||||
priceTaxe?: number;
|
||||
tags?: Tag[];
|
||||
brand: Brand;
|
||||
packaging: Packaging;
|
||||
owner: Profile;
|
||||
productCategories: Category[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isSelected?: boolean;
|
||||
}
|
||||
|
||||
export interface ProductForm {
|
||||
slug: FormControl<string>;
|
||||
eancode: FormControl<string>;
|
||||
name: FormControl<string>;
|
||||
numero: FormControl<number>;
|
||||
barcode: FormControl<number>;
|
||||
poid: FormControl<number>;
|
||||
sachets: FormControl<Array<number>>;
|
||||
molecules: FormControl<Array<string>>;
|
||||
description: FormControl<string>;
|
||||
stock: FormControl<number>;
|
||||
weightGross: FormControl<number>;
|
||||
weightNet: FormControl<number>;
|
||||
priceBuy: FormControl<number>;
|
||||
priceRetail: FormControl<number>;
|
||||
priceTaxe: FormControl<number>;
|
||||
tags: FormControl<Array<string>>;
|
||||
brandId: FormControl<number>;
|
||||
ownerId: FormControl<string>;
|
||||
packagingId: FormControl<number>;
|
||||
}
|
||||
|
||||
export interface ProductPageData {
|
||||
@@ -33,6 +49,8 @@ export interface ProductPageData {
|
||||
|
||||
export interface ProductsPageData {
|
||||
products: Array<Product>;
|
||||
count: number;
|
||||
category?: Category;
|
||||
_links: PageLinks;
|
||||
_meta: PageMeta;
|
||||
}
|
||||
@@ -51,36 +69,57 @@ export const productColumns: Array<ColumnDefinition> = [
|
||||
required: true
|
||||
},
|
||||
{
|
||||
key: 'numero',
|
||||
type: 'numeric',
|
||||
label: 'Numéro',
|
||||
required: true,
|
||||
min: 0,
|
||||
step: 1
|
||||
},
|
||||
{
|
||||
key: 'barcode',
|
||||
type: 'numeric',
|
||||
key: 'eancode',
|
||||
type: 'text',
|
||||
label: 'Code EAN13',
|
||||
required: true
|
||||
},
|
||||
{
|
||||
key: 'stock',
|
||||
type: 'numeric',
|
||||
label: 'Stock',
|
||||
required: true,
|
||||
min: 0,
|
||||
step: 1
|
||||
},
|
||||
{
|
||||
key: 'poid',
|
||||
key: 'weightGross',
|
||||
type: 'numeric',
|
||||
label: 'Poid',
|
||||
label: 'Poid brut',
|
||||
min: 0,
|
||||
step: 1
|
||||
},
|
||||
{
|
||||
key: 'sachets',
|
||||
type: 'text',
|
||||
label: 'Sachets'
|
||||
key: 'weightNet',
|
||||
type: 'numeric',
|
||||
label: 'Poid net',
|
||||
min: 0,
|
||||
step: 1
|
||||
},
|
||||
{
|
||||
key: 'molecules',
|
||||
key: 'priceBuy',
|
||||
type: 'numeric',
|
||||
label: 'Prix achat',
|
||||
min: 0,
|
||||
step: 1
|
||||
},
|
||||
{
|
||||
key: 'priceRetail',
|
||||
type: 'numeric',
|
||||
label: 'Prix vente',
|
||||
min: 0,
|
||||
step: 1
|
||||
},
|
||||
{
|
||||
key: 'priceTaxe',
|
||||
type: 'numeric',
|
||||
label: 'TVA',
|
||||
min: 0,
|
||||
step: 1
|
||||
},
|
||||
{
|
||||
key: 'tags',
|
||||
type: 'text',
|
||||
label: 'Molécules'
|
||||
label: 'Tags'
|
||||
}
|
||||
];
|
||||
Reference in New Issue
Block a user