Просмотр исходного кода

modelado de datos para almacenes y stock

robert2206 8 лет назад
Родитель
Сommit
6fe48bbce1
2 измененных файлов с 60 добавлено и 2 удалено
  1. 41 1
      src/models/stock.ts
  2. 19 1
      src/models/warehouse.ts

+ 41 - 1
src/models/stock.ts

@@ -1,4 +1,44 @@
+import { Product } from './product';
+import { Warehouse } from './warehouse';
+
 export class Stock {
 
-    constructor() {}
+    constructor(
+        private _id: number,
+        private _stock: Stock,
+        private _warehouse: Warehouse,
+        private _existence: number
+    ) {}
+
+    get id(): number {
+        return this._id;
+    }
+
+    get stock(): Stock {
+        return this._stock;
+    }
+
+    get warehouse(): Warehouse {
+        return this._warehouse;
+    }
+
+    get existence(): number {
+        return this._existence;
+    }
+
+    set id(_id: number) {
+        this._id = _id;
+    }
+
+    set stock(_stock: Stock) {
+        this._stock = _stock;
+    }
+
+    set warehouse(_warehouse: Warehouse) {
+        this._warehouse = _warehouse;
+    }
+
+    set existence(_existence: number) {
+        this._existence = _existence;
+    }
 }

+ 19 - 1
src/models/warehouse.ts

@@ -1,5 +1,23 @@
 export class Warehouse {
 
-    constructor() {}
+    constructor(
+        private _id: number,
+        private _name: string
+    ) {}
 
+    get id(): number {
+        return this._id;
+    }
+
+    get name(): string {
+        return this._name;
+    }
+
+    set id(_id: number) {
+        this._id = _id;
+    }
+    
+    set name(_name: string) {
+        this._name = _name;
+    }
 }