diff --git a/src/app/core/models/article.model.ts b/src/app/core/models/article.model.ts index b377ab3..547a11b 100755 --- a/src/app/core/models/article.model.ts +++ b/src/app/core/models/article.model.ts @@ -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; diff --git a/src/app/core/models/brand.model.ts b/src/app/core/models/brand.model.ts new file mode 100644 index 0000000..674c96d --- /dev/null +++ b/src/app/core/models/brand.model.ts @@ -0,0 +1,7 @@ +export interface Brand { + id: number; + name: string; + description: string; + createdAt: string; + updatedAt: string; +} \ No newline at end of file diff --git a/src/app/core/models/category.model.ts b/src/app/core/models/category.model.ts new file mode 100644 index 0000000..ee7bec4 --- /dev/null +++ b/src/app/core/models/category.model.ts @@ -0,0 +1,9 @@ +export interface Category { + id: number; + slug: string; + name: string; + description: string; + parent?: Category; + createdAt: string; + updatedAt: string; +} \ No newline at end of file diff --git a/src/app/core/models/index.ts b/src/app/core/models/index.ts index 700af0b..6e80dfd 100644 --- a/src/app/core/models/index.ts +++ b/src/app/core/models/index.ts @@ -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'; diff --git a/src/app/core/models/packaging.model.ts b/src/app/core/models/packaging.model.ts new file mode 100644 index 0000000..85fa069 --- /dev/null +++ b/src/app/core/models/packaging.model.ts @@ -0,0 +1,7 @@ +export interface Packaging { + id: number; + name: string; + description: string; + createdAt: string; + updatedAt: string; +} \ No newline at end of file diff --git a/src/app/core/models/product.model.ts b/src/app/core/models/product.model.ts index 8329a5f..cbe4548 100644 --- a/src/app/core/models/product.model.ts +++ b/src/app/core/models/product.model.ts @@ -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; + eancode: FormControl; name: FormControl; - numero: FormControl; - barcode: FormControl; - poid: FormControl; - sachets: FormControl>; - molecules: FormControl>; + description: FormControl; + stock: FormControl; + weightGross: FormControl; + weightNet: FormControl; + priceBuy: FormControl; + priceRetail: FormControl; + priceTaxe: FormControl; + tags: FormControl>; + brandId: FormControl; + ownerId: FormControl; + packagingId: FormControl; } export interface ProductPageData { @@ -33,6 +49,8 @@ export interface ProductPageData { export interface ProductsPageData { products: Array; + count: number; + category?: Category; _links: PageLinks; _meta: PageMeta; } @@ -51,36 +69,57 @@ export const productColumns: Array = [ 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' } ]; \ No newline at end of file