Index: kreiranje_app.sql
===================================================================
--- kreiranje_app.sql	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
+++ kreiranje_app.sql	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -0,0 +1,287 @@
+set search_path = "IND0_185022";
+
+drop table if exists token_;
+drop table if exists customer_weekday;
+drop table if exists unit_price;
+drop table if exists article_unit;
+drop table if exists orders;
+drop table if exists delivery;
+drop table if exists pro_forma;
+drop table if exists price;
+drop table if exists article;
+drop table if exists manufacturer;
+drop table if exists driver;
+drop table if exists manager;
+drop table if exists customer;
+drop table if exists users;
+drop table if exists vehicle;
+drop table if exists warehouse;
+drop table if exists city;
+drop table if exists region;
+drop table if exists category;
+drop table if exists weekday;
+drop table if exists pro_forma_status;
+drop table if exists delivery_status;
+drop table if exists order_status;
+
+drop schema if exists "IND0_185022";
+
+create schema "IND0_185022";
+
+set search_path = "IND0_185022";
+
+-- ENTITIES:
+
+create table order_status
+(
+    o_status_id   smallint generated by default as identity primary key,
+    o_status_name varchar(255) not null unique,
+    o_status_desc text         not null
+);
+
+create table delivery_status
+(
+    d_status_id   smallint generated by default as identity primary key,
+    d_status_name varchar(255) not null unique,
+    d_status_desc text         not null
+);
+
+create table pro_forma_status
+(
+    pf_status_id   smallint generated by default as identity primary key,
+    pf_status_name varchar(255) not null unique,
+    pf_status_desc text         not null
+);
+
+create table weekday
+(
+    day_id   smallint generated by default as identity primary key,
+    day_name varchar(20) not null
+);
+
+create table category
+(
+    ctg_id   int generated by default as identity primary key,
+    ctg_name varchar(255) not null
+);
+
+create table region
+(
+    region_id   int generated by default as identity primary key,
+    region_name varchar(255) not null
+);
+
+create table city
+(
+    city_id   int generated by default as identity primary key,
+    city_name varchar(255) not null,
+    region_id int          not null,
+    foreign key (region_id) references region (region_id)
+);
+
+create table warehouse
+(
+    wh_id   int generated by default as identity primary key,
+    wh_adr  varchar(255) not null,
+    city_id int          not null,
+    foreign key (city_id) references city (city_id)
+);
+
+create table vehicle
+(
+    veh_id               int generated by default as identity primary key,
+    veh_carry_weight     int         not null,
+    veh_service_interval smallint    not null,
+    veh_last_service_km  int         not null,
+    veh_last_service     date        not null,
+    veh_kilometers       int         not null,
+    veh_plate            varchar(8)  not null,
+    veh_vin              varchar(17) not null unique,
+    veh_reg_date         date        not null,
+    wh_id                int         not null,
+    foreign key (wh_id) references warehouse (wh_id)
+);
+
+create table users
+(
+    user_id      bigint generated by default as identity primary key,
+    user_name    varchar(255) not null,
+    user_surname varchar(255) not null,
+    user_pass    varchar(255) not null,
+    user_salt    varchar(255) not null,
+    user_email   varchar(255) not null,
+    user_mobile  varchar(255) not null,
+    user_active  boolean      not null,
+    user_image   varchar(255),
+    clazz_       varchar(255) not null,
+    user_role 	 varchar(255) not null,
+    city_id      int          not null,
+    foreign key (city_id) references city (city_id),
+    unique(user_email)
+);
+
+create table customer
+(
+    user_id                 bigint primary key,
+    cust_EDB                varchar(13)  not null,
+    cust_company_name       varchar(255) not null,
+    cust_adr                varchar(255) not null,
+    cust_representative_img varchar(255),
+    foreign key (user_id) references users (user_id),
+    unique(cust_EDB)
+);
+
+create table manager
+(
+    user_id bigint primary key,
+    wh_id   int not null,
+    foreign key (wh_id) references warehouse (wh_id),
+    foreign key (user_id) references users (user_id)
+);
+
+create table driver
+(
+    user_id bigint primary key,
+    veh_id  int not null,
+    foreign key (veh_id) references vehicle (veh_id),
+    foreign key (user_id) references users (user_id)
+);
+
+create table manufacturer
+(
+    man_id     bigint generated by default as identity primary key,
+    man_name   varchar(255) not null,
+    man_adr    varchar(255) not null,
+    man_mobile varchar(255) not null,
+    man_email  varchar(255) not null
+);
+
+create table article
+(
+    art_id     bigint generated by default as identity primary key,
+    art_name   varchar(255) not null,
+    art_image  varchar(255) not null,
+    art_weight int          not null,
+    ctg_id     int          not null,
+    man_id     bigint       not null,
+    foreign key (ctg_id) references category (ctg_id),
+    foreign key (man_id) references manufacturer (man_id)
+);
+
+create table price
+(
+    price_id       int generated by default as identity primary key,
+    price          decimal   not null,
+    price_eff_date timestamp not null default current_timestamp,
+    art_id         bigint    not null,
+    foreign key (art_id) references article (art_id)
+);
+
+create table pro_forma
+(
+    pf_id           bigint generated by default as identity primary key,
+    pf_deadline     date     not null,
+    pf_date_created date     not null,
+    pf_status_id    smallint not null,
+    foreign key (pf_status_id) references pro_forma_status (pf_status_id)
+);
+
+create table delivery
+(
+    del_id           bigint generated by default as identity primary key,
+    del_date_created date     not null,
+    del_date         date     not null,
+    del_start_km     int,
+    del_end_km       int,
+    del_start_time   time,
+    del_end_time     time,
+    d_status_id      smallint not null,
+    veh_id           int      not null,
+    foreign key (d_status_id) references delivery_status (d_status_id),
+    foreign key (veh_id) references vehicle (veh_id)
+);
+
+create table orders
+(
+    ord_id               bigint generated by default as identity primary key,
+    ord_date             date     not null,
+    ord_sum              decimal (10,2)      not null,
+    ord_fulfillment_date timestamp,
+    ord_comment          text,
+    o_status_id          smallint not null,
+    cust_id              bigint   not null,
+    del_id               bigint,
+    pf_id                bigint,
+    foreign key (o_status_id) references order_status (o_status_id),
+    foreign key (cust_id) references customer (user_id),
+    foreign key (del_id) references delivery (del_id),
+    foreign key (pf_id) references pro_forma (pf_id)
+);
+
+create table article_unit
+(
+    unit_id               bigint generated by default as identity primary key,
+    unit_expiration_date  date         not null,
+    unit_serial_number    varchar(255) not null,
+    unit_batch_number     varchar(255) not null,
+    unit_manufacture_date date         not null,
+    wh_id                 int          not null,
+    ord_id                bigint,
+    foreign key (wh_id) references warehouse (wh_id),
+    foreign key (ord_id) references orders (ord_id)
+);
+
+create table unit_price
+(
+    unit_id  bigint not null,
+    price_id bigint not null,
+    primary key (unit_id, price_id),
+    foreign key (unit_id) references article_unit (unit_id),
+    foreign key (price_id) references price (price_id)
+);
+
+create table order_item (
+	item_id bigint generated by default as identity primary key,
+	ord_id bigint not null,
+	art_id bigint not null,
+	quantity int not null,
+	unit_price decimal(10,2) not null,
+	total_price decimal(10,2) generated always as (quantity*unit_price) stored,
+	foreign key (ord_id) references orders(ord_id),
+	foreign key (art_id) references article (art_id),
+	unique (ord_id, art_id)
+);
+
+create table customer_weekday
+(
+    cust_day_id bigint generated by default as identity primary key,
+    cust_id     bigint   not null,
+    day_id      smallint not null,
+    start_time  time     not null,
+    end_time    time     not null,
+    foreign key (cust_id) references customer (user_id),
+    foreign key (day_id) references weekday (day_id)
+);
+
+create table token_
+(
+    t_id     bigint generated by default as identity primary key,
+    t_value  text         not null,
+    t_date   timestamp         not null default current_timestamp,
+    t_type   varchar(255) not null,
+    t_expiry timestamp,
+    t_validated_at timestamp,
+    t_user   bigint       not null,
+    foreign key (t_user) references users (user_id)
+);
+
+create table image_store(
+	img_id bigint generated by default as identity primary key,
+	img_path text not null,
+	img_ent_type text not null,
+	img_ent_id int not null,
+	img_title varchar(255),
+	img_upload_date timestamp default current_timestamp,
+	img_uploaded_by bigint,
+	foreign key (img_uploaded_by) references users(user_id)
+);
Index: src/app/customer/create-order/create-order.component.html
===================================================================
--- src/app/customer/create-order/create-order.component.html	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/customer/create-order/create-order.component.html	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -104,9 +104,11 @@
     <tbody>
       <tr *ngFor="let it of orderItems; let i = index">
-        <td>{{ it.article.name }}</td>
-        <td>${{ it.article.price.toFixed(2) }}</td>
-        <td>{{ it.article.manufacturer }}</td>
+        <td>{{ it.article?.art_name }}</td>
+        <td>${{ it.article?.currentPrice }}</td>
+        <td>{{ it.article?.manufacturer }}</td>
         <td>{{ it.quantity }}</td>
-        <td>${{ (it.article.price * it.quantity).toFixed(2) }}</td>
+        <td>
+          <!-- ${{ ((it.article?.currentPrice ?? 0) * (it.quantity ? Number(it.quantity) : 0)).toFixed(2) }} -->
+        </td>
         <td>
           <button class="btn btn-danger btn-sm" (click)="removeItem(i)">
Index: src/app/customer/create-order/create-order.component.ts
===================================================================
--- src/app/customer/create-order/create-order.component.ts	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/customer/create-order/create-order.component.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -5,5 +5,5 @@
 import { Router } from '@angular/router';
 import { NavbarComponent } from '../../navbar/navbar.component';
-import { Category, Manufacturer, Article, OrderItem } from '../../models';
+import { Category, Manufacturer, Article, OrderItem, adaptArticle } from '../../models';
 import { OrderService } from '../../services/order.service';
 import { PagedModel } from '../../models/paged-model';
@@ -57,5 +57,6 @@
       .subscribe((resp: PagedModel<Article>) => {
         const listKey = Object.keys(resp._embedded)[0];
-        this.displayed = resp._embedded[listKey];
+        // Apply adapter to each article
+        this.displayed = resp._embedded[listKey].map(adaptArticle);
         this.currentPage = resp.page.number;
         this.totalPages = resp.page.totalPages;
@@ -72,15 +73,18 @@
   }
   trackByArticle(_: number, a: Article) {
-    return a.id;
+    return a.art_id || a.id;
   }
 
   addArticle(a: Article) {
-    const qty = Number(prompt(`Quantity for ${a.name}:`, '1'));
+    const qty = Number(prompt(`Quantity for ${a.art_name}:`, '1'));
 
-    if (!qty || qty < 1 || qty > a.quantity) {
+    if (!qty || qty < 1 || qty > (a.quantity ?? 0)) {
       alert('invalid quantity');
       return;
     }
     this.orderItems.push({
+      ord_id: 0,
+      art_id: a.art_id ?? a.id ?? 0,
+      unit_price: typeof a.price === 'number' ? a.price : (typeof a.currentPrice === 'number' ? a.currentPrice : (a.currentPrice?.price ?? 0)),
       article: a,
       quantity: qty,
@@ -97,5 +101,17 @@
   updateTotal() {
     this.totalSum = this.orderItems.reduce(
-      (sum, it) => sum + it.article.price * it.quantity,
+      (sum, it) => {
+        let price = 0;
+        if (it.article) {
+          if (typeof it.article.price === 'number') {
+            price = it.article.price;
+          } else if (typeof it.article.currentPrice === 'number') {
+            price = it.article.currentPrice;
+          } else if (it.article.currentPrice && typeof it.article.currentPrice.price === 'number') {
+            price = it.article.currentPrice.price;
+          }
+        }
+        return sum + (price * it.quantity);
+      },
       0
     );
Index: src/app/customer/customer-dashboard/customer-dashboard.component.html
===================================================================
--- src/app/customer/customer-dashboard/customer-dashboard.component.html	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/customer/customer-dashboard/customer-dashboard.component.html	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -17,7 +17,7 @@
         <tbody>
           <tr *ngFor="let order of orders; trackBy: trackByOrder">
-            <td>{{ order.ordDate | date: "shortDate" }}</td>
-            <td>{{ order.ordSum | currency }}</td>
-            <td>{{ order.ordComment }}</td>
+            <td>{{ order.ord_date | date: "shortDate" }}</td>
+            <td>{{ order.ord_sum | currency }}</td>
+            <td>{{ order.ord_comment }}</td>
           </tr>
         </tbody>
@@ -37,7 +37,7 @@
         <tbody>
           <tr *ngFor="let del of deliveries; trackBy: trackByDelivery">
-            <td>{{ del.delDate | date: "shortDate" }}</td>
+            <td>{{ del.del_date | date: "shortDate" }}</td>
             <td>{{ del.driverName }}</td>
-            <td>{{ del.delStatus }}</td>
+            <td>{{ del.d_status_id }}</td>
           </tr>
         </tbody>
Index: src/app/customer/customer-dashboard/customer-dashboard.component.ts
===================================================================
--- src/app/customer/customer-dashboard/customer-dashboard.component.ts	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/customer/customer-dashboard/customer-dashboard.component.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -35,5 +35,5 @@
 
   trackByDelivery(_: number, d: Delivery) {
-    return d.delDate + d.driverName;
+    return d.del_date + (d.driverName ?? 'Driver name unavailable');
   }
 }
Index: src/app/manager/manager-dashboard/manager-dashboard.component.html
===================================================================
--- src/app/manager/manager-dashboard/manager-dashboard.component.html	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/manager/manager-dashboard/manager-dashboard.component.html	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -18,5 +18,5 @@
         <tbody>
           <tr *ngFor="let order of unassignedOrders">
-            <td>{{ order.id }}</td>
+            <td>{{ order.ord_id }}</td>
             <!-- <td>{{ order.customerName }}</td>
             <td>{{ order.date | date: "shortDate" }}</td>
@@ -40,8 +40,8 @@
         <tbody>
           <tr *ngFor="let delivery of activeDeliveries">
-            <!-- <td>{{ delivery.id }}</td> -->
+            <td>{{ delivery.del_id }}</td> 
             <td>{{ delivery.driverName }}</td>
-            <!-- <td>{{ delivery.status }}</td>
-            <td>{{ delivery.orderCount }}</td> -->
+            <td>{{ delivery.deliveryStatus }}</td>
+            <td>{{ delivery.orderCount }}</td>
           </tr>
         </tbody>
Index: src/app/manager/manager-warehouse/manager-warehouse.component.html
===================================================================
--- src/app/manager/manager-warehouse/manager-warehouse.component.html	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/manager/manager-warehouse/manager-warehouse.component.html	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -3,5 +3,5 @@
 <div class="container-fluid mt-4">
   <h1>Warehouse Management</h1>
-  
+
   <!-- Summary Cards -->
   <div class="row mb-4">
@@ -61,17 +61,38 @@
               </thead>
               <tbody>
-                <tr *ngFor="let article of availableArticles" 
-                    [class]="'stock-' + getStockLevel(article.quantity, article.minQuantity)">
-                  <td>{{ article.name }}</td>
-                  <td>{{ article.quantity }}</td>
-                  <td>{{ article.unitPrice | currency }}</td>
-                  <td>{{ (article.quantity * article.unitPrice) | currency }}</td>
-                  <td>
-                    <span class="badge" 
-                          [class]="'badge-' + getStockLevel(article.quantity, article.minQuantity)">
-                      {{ getStockLevel(article.quantity, article.minQuantity) | titlecase }}
+                <tr
+                  *ngFor="let stock of availableArticles"
+                  [class]="
+                    'stock-' +
+                    getStockLevel(
+                      stock.quantity,
+                      getMinQuantity(stock)
+                    )
+                  "
+                >
+                  <td>{{ stock.article.art_name }}</td>
+                  <td>{{ stock.quantity }}</td>
+                  <td>{{ stock.article.price | currency }}</td>
+                  <td>{{ stock.quantity * (stock.sellingPrice) | currency }}</td>
+                  <td>
+                    <span
+                      class="badge"
+                      [class]="
+                        'badge-' +
+                        getStockLevel(
+                          stock.quantity,
+                          getMinQuantity(stock)
+                        )
+                      "
+                    >
+                      {{
+                        getStockLevel(
+                          stock.quantity,
+                          getMinQuantity(stock)
+                        ) | titlecase
+                      }}
                     </span>
                   </td>
-                  <td>{{ article.expirationDate | date }}</td>
+                  <td>{{ stock.nearestExpirationDate | date }}</td>
                 </tr>
               </tbody>
@@ -104,9 +125,9 @@
               <tbody>
                 <tr *ngFor="let article of pendingDeliveryArticles">
-                  <td>{{ article.name }}</td>
+                  <td>{{ article.article.art_name }}</td>
                   <td>{{ article.quantity }}</td>
-                  <td>{{ article.deliveryId }}</td>
-                  <td>{{ article.customerName }}</td>
-                  <td>{{ article.scheduledDate | date }}</td>
+                  <!-- <td>{{ article.deliveryId }}</td>
+                  <td>{{ article. }}</td>
+                  <td>{{ article.scheduledDate | date }}</td> -->
                 </tr>
               </tbody>
@@ -138,14 +159,17 @@
               </thead>
               <tbody>
-                <tr *ngFor="let article of nearExpirationArticles" class="table-warning">
-                  <td>{{ article.name }}</td>
+                <tr
+                  *ngFor="let article of nearExpirationArticles"
+                  class="table-warning"
+                >
+                  <td>{{ article.article.art_name }}</td>
                   <td>{{ article.quantity }}</td>
                   <td>
                     <span class="badge bg-warning text-dark">
-                      {{ getDaysUntilExpiration(article.expirationDate) }} days
+                      {{ getDaysUntilExpiration(article.nearestExpirationDate) }} days
                     </span>
                   </td>
-                  <td>{{ article.expirationDate | date }}</td>
-                  <td>{{ (article.quantity * article.unitPrice) | currency }}</td>
+                  <td>{{ article.nearestExpirationDate | date }}</td>
+                  <td>{{ article.quantity * (article.sellingPrice) | currency }}</td>
                 </tr>
               </tbody>
@@ -178,16 +202,24 @@
               </thead>
               <tbody>
-                <tr *ngFor="let article of expiredArticles" class="table-danger">
-                  <td>{{ article.name }}</td>
+                <tr
+                  *ngFor="let article of expiredArticles"
+                  class="table-danger"
+                >
+                  <td>{{ article.article.art_name }}</td>
                   <td>{{ article.quantity }}</td>
-                  <td>{{ article.expirationDate | date }}</td>
+                  <td>{{ article.nearestExpirationDate | date }}</td>
                   <td>
                     <span class="badge bg-danger">
-                      {{ Math.abs(getDaysUntilExpiration(article.expirationDate)) }} days ago
+                      {{
+                        Math.abs(getDaysUntilExpiration(article.nearestExpirationDate))
+                      }}
+                      days ago
                     </span>
                   </td>
-                  <td>{{ (article.quantity * article.unitPrice) | currency }}</td>
-                  <td>
-                    <button class="btn btn-sm btn-outline-danger">Mark for Disposal</button>
+                  <td>{{ article.quantity * (article.sellingPrice) | currency }}</td>
+                  <td>
+                    <button class="btn btn-sm btn-outline-danger">
+                      Mark for Disposal
+                    </button>
                   </td>
                 </tr>
@@ -221,14 +253,28 @@
               </thead>
               <tbody>
-                <tr *ngFor="let forecast of stockForecast" 
-                    [class]="forecast.daysRemaining <= 7 ? 'table-danger' : 
-                             forecast.daysRemaining <= 14 ? 'table-warning' : 'table-success'">
+                <tr
+                  *ngFor="let forecast of stockForecast"
+                  [class]="
+                    forecast.daysRemaining <= 7
+                      ? 'table-danger'
+                      : forecast.daysRemaining <= 14
+                        ? 'table-warning'
+                        : 'table-success'
+                  "
+                >
                   <td>{{ forecast.articleName }}</td>
                   <td>{{ forecast.currentStock }}</td>
                   <td>{{ forecast.dailyUsage }}</td>
                   <td>
-                    <span class="badge" 
-                          [class]="forecast.daysRemaining <= 7 ? 'bg-danger' : 
-                                   forecast.daysRemaining <= 14 ? 'bg-warning' : 'bg-success'">
+                    <span
+                      class="badge"
+                      [class]="
+                        forecast.daysRemaining <= 7
+                          ? 'bg-danger'
+                          : forecast.daysRemaining <= 14
+                            ? 'bg-warning'
+                            : 'bg-success'
+                      "
+                    >
                       {{ forecast.daysRemaining }} days
                     </span>
@@ -236,7 +282,22 @@
                   <td>{{ forecast.estimatedRefillDate | date }}</td>
                   <td>
-                    <span *ngIf="forecast.daysRemaining <= 7" class="badge bg-danger">Urgent</span>
-                    <span *ngIf="forecast.daysRemaining > 7 && forecast.daysRemaining <= 14" class="badge bg-warning">Soon</span>
-                    <span *ngIf="forecast.daysRemaining > 14" class="badge bg-success">OK</span>
+                    <span
+                      *ngIf="forecast.daysRemaining <= 7"
+                      class="badge bg-danger"
+                      >Urgent</span
+                    >
+                    <span
+                      *ngIf="
+                        forecast.daysRemaining > 7 &&
+                        forecast.daysRemaining <= 14
+                      "
+                      class="badge bg-warning"
+                      >Soon</span
+                    >
+                    <span
+                      *ngIf="forecast.daysRemaining > 14"
+                      class="badge bg-success"
+                      >OK</span
+                    >
                   </td>
                 </tr>
Index: src/app/manager/manager-warehouse/manager-warehouse.component.ts
===================================================================
--- src/app/manager/manager-warehouse/manager-warehouse.component.ts	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/manager/manager-warehouse/manager-warehouse.component.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -2,7 +2,7 @@
 import { NavbarComponent } from '../../navbar/navbar.component';
 import { CommonModule } from '@angular/common';
-import { Article } from '../../models';
 import { StockForecast } from '../../models/stock-forecast.model';
 import { WarehouseService } from '../../services/warehouse.service';
+import { WarehouseStock } from '../../models/warehouse-stock.model';
 
 @Component({
@@ -13,11 +13,10 @@
 })
 export class ManagerWarehouseComponent {
-  availableArticles: Article[] = [];
-  pendingDeliveryArticles: Article[] = [];
-  nearExpirationArticles: Article[] = [];
-  expiredArticles: Article[] = [];
+  availableArticles: WarehouseStock[] = [];
+  pendingDeliveryArticles: WarehouseStock[] = [];
+  nearExpirationArticles: WarehouseStock[] = [];
+  expiredArticles: WarehouseStock[] = [];
   stockForecast: StockForecast[] = [];
   totalLoss: number = 0;
-  warehouseId: number = 1;
 
   public Math = Math;
@@ -31,17 +30,17 @@
   loadWarehouseData() {
     this.warehouseService
-      .getAvailableArticles(this.warehouseId)
+      .getAvailableArticles()
       .subscribe((articles) => (this.availableArticles = articles));
     this.warehouseService
-      .getPendingDeliveryArticles(this.warehouseId)
+      .getPendingDeliveryArticles()
       .subscribe((articles) => (this.pendingDeliveryArticles = articles));
     this.warehouseService
-      .getNearExpirationArticles(this.warehouseId)
+      .getNearExpirationArticles()
       .subscribe((articles) => (this.nearExpirationArticles = articles));
     this.warehouseService
-      .getExpiredArticles(this.warehouseId)
+      .getExpiredArticles()
       .subscribe((articles) => (this.expiredArticles = articles));
     this.warehouseService
-      .getStockForecast(this.warehouseId)
+      .getStockForecast()
       .subscribe((forecast) => (this.stockForecast = forecast));
   }
@@ -49,6 +48,5 @@
   calculateTotalLoss() {
     this.totalLoss = this.expiredArticles.reduce(
-      (sum, article) => sum + article.quantity * article.unitPrice,
-      0,
+      (sum, stock) => sum + stock.quantity * (stock.article.price || 0), 0
     );
   }
@@ -62,8 +60,14 @@
 
   getStockLevel(quantity: number, minQuantity: number): string {
+      const minQty = minQuantity ?? 10;
+
     if (quantity <= 0) return 'out-of-stock';
-    if (quantity <= minQuantity) return 'low-stock';
-    if (quantity <= minQuantity * 2) return 'medium-stock';
+    if (quantity <= minQty) return 'low-stock';
+    if (quantity <= minQty * 2) return 'medium-stock';
     return 'high-stock';
   }
+
+  getMinQuantity(stock: WarehouseStock): number {
+  return stock.article?.minQuantity ?? 10;
 }
+}
Index: src/app/models/article-unit.model.ts
===================================================================
--- src/app/models/article-unit.model.ts	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/models/article-unit.model.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -4,17 +4,28 @@
 import { Warehouse } from "./warehouse.model";
 
-export interface ArticleUnit{
-    unit_id?: number;
-    unit_expiration_date: Date;
-    unit_serial_number: string;
-    unit_batch_number: string;
-    unit_manufacture_date: Date;
-    unit_cost_price?: number;
-    wh_id: number;
-    ord_id?: number;
-
-    article?: Article;
-    price?: Price;
-    order?: Order;
-    warehouse?: Warehouse;
+export interface ArticleUnit {
+  unit_id?: number;
+  id?: number;
+  unit_expiration_date: string;
+  expiryDate?: string;
+  unit_serial_number: string;  
+  serialNo?: string;
+  unit_batch_number: string;
+  batchNo?: string;
+  unit_manufacture_date: string;
+  manufactureDate?: string;
+  unit_cost_price?: number;
+  costPrice?: number;
+  wh_id: number;
+  whId?: number;
+  art_id: number;
+  artId?: number;
+  ord_id?: number;
+  ordId?: number;
+  
+  // Joined properties from DTOs
+  artName?: string;
+  whRegion?: string;
+  whCity?: string;
+  customerEmail?: string;
 }
Index: src/app/models/article.model.ts
===================================================================
--- src/app/models/article.model.ts	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/models/article.model.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -1,16 +1,51 @@
-import { Category } from "./category.model";
-import { Manufacturer } from "./manufacturer.model";
-import { Price } from "./price.model";
+import { Category } from './category.model';
+import { Manufacturer } from './manufacturer.model';
+import { Price } from './price.model';
 
 export interface Article {
   art_id?: number;
+  id?: number;
   art_name: string;
+  name?: string;
   art_image: string;
+  image?: string;
   art_weight: number;
+  weight?: number;
   ctg_id: number;
+  categoryId?: number;
   man_id: number;
+  manufacturerId?: number;
   
-  category?: Category;
-  manufacturer?: Manufacturer;
-  currentPrice?: Price;
+  category?: Category | string;
+  manufacturer?: Manufacturer | string;
+  currentPrice?: Price | number;
+  quantity?: number;
+  price?: number;
+  minQuantity?: number;
 }
+
+export function adaptArticle(backendArticle: any): Article {
+  return {
+    art_id: backendArticle.id || backendArticle.art_id,
+    id: backendArticle.id || backendArticle.art_id,
+    art_name: backendArticle.name || backendArticle.art_name,
+    name: backendArticle.name || backendArticle.art_name,
+    art_image: backendArticle.image || backendArticle.art_image,
+    image: backendArticle.image || backendArticle.art_image,
+    art_weight: backendArticle.weight || backendArticle.art_weight,
+    weight: backendArticle.weight || backendArticle.art_weight,
+    ctg_id: backendArticle.categoryId || backendArticle.ctg_id,
+    categoryId: backendArticle.categoryId || backendArticle.ctg_id,
+    man_id: backendArticle.manufacturerId || backendArticle.man_id,
+    manufacturerId: backendArticle.manufacturerId || backendArticle.man_id,
+    
+    category: backendArticle.category,
+    manufacturer: backendArticle.manufacturer,
+    currentPrice: backendArticle.price || backendArticle.currentPrice,
+    price: backendArticle.price || 
+           (typeof backendArticle.currentPrice === 'object' ? 
+             backendArticle.currentPrice.price : 
+             backendArticle.currentPrice),
+    quantity: backendArticle.quantity
+  };
+}
Index: src/app/models/delivery.model.ts
===================================================================
--- src/app/models/delivery.model.ts	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/models/delivery.model.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -12,3 +12,9 @@
   veh_id: number;
   orders?: Order[];
+
+  driverId?: number;
+  driverName?: string;
+  driverImage?: string;
+  deliveryStatus?: string;
+  orderCount?: number;
 }
Index: src/app/models/warehouse-stock.model.ts
===================================================================
--- src/app/models/warehouse-stock.model.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
+++ src/app/models/warehouse-stock.model.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -0,0 +1,53 @@
+import { Article } from "./article.model";
+
+export interface WarehouseStock {
+  article: Article;
+  quantity: number;
+  nearestExpirationDate: string;
+  sellingPrice: number;
+  costPrice: number;
+  manufacturerName: string;
+  categoryName: string;
+
+  profit?: number;
+  profitMargin?: number;
+  daysToExpiration?: number;
+  expirationStatus?: 'ok' | 'near' | 'expired';
+}
+
+export function getMinQuantity(stock: WarehouseStock): number {
+  return stock.article?.minQuantity ?? 10;
+}
+
+export function calculateProfitMargin(stock: WarehouseStock): number {
+  if (!stock.sellingPrice || !stock.costPrice || stock.costPrice === 0)
+    return 0;
+
+  return ((stock.sellingPrice - stock.costPrice) / stock.costPrice) * 100;
+}
+
+export function calculateDaysToExpiration(
+  stock: WarehouseStock,
+): number | null {
+  if (!stock.nearestExpirationDate) return null;
+
+  const expDate = new Date(stock.nearestExpirationDate);
+  const today = new Date();
+
+  expDate.setHours(0, 0, 0, 0);
+  today.setHours(0, 0, 0, 0);
+
+  const diffTime = expDate.getTime() - today.getTime();
+  return Math.ceil(diffTime / (1000 * 60 * 60 * 24));
+}
+
+export function getExpirationStatus(
+  stock: WarehouseStock,
+): 'ok' | 'near' | 'expired' {
+  const daysToExpiration = calculateDaysToExpiration(stock);
+
+  if (daysToExpiration === null) return 'ok';
+  if (daysToExpiration < 0) return 'expired';
+  if (daysToExpiration <= 7) return 'near';
+  return 'ok';
+}
Index: src/app/services/manager.service.ts
===================================================================
--- src/app/services/manager.service.ts	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/services/manager.service.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -1,9 +1,9 @@
 import { HttpClient, HttpParams } from '@angular/common/http';
 import { Injectable } from '@angular/core';
-import { Observable } from 'rxjs';
+import { map, Observable } from 'rxjs';
 import { environment } from '../../environment';
 import { Manager } from '../models/manager.model';
 import { FinancialSummary } from '../models/financial-summary.model';
-import {  ProFormaResponseDto } from '../models/pro-forma-dtos.model';
+import { ProFormaResponseDto } from '../models/pro-forma-dtos.model';
 import { Driver } from '../models/driver.model';
 import { Vehicle } from '../models/vehicle.model';
@@ -11,4 +11,10 @@
 import { Order } from '../models';
 import { Delivery } from '../models/delivery.model';
+import {
+  calculateDaysToExpiration,
+  calculateProfitMargin,
+  getExpirationStatus,
+  WarehouseStock,
+} from '../models/warehouse-stock.model';
 
 @Injectable({
@@ -16,5 +22,5 @@
 })
 export class ManagerService {
-  constructor(private http: HttpClient) { }
+  constructor(private http: HttpClient) {}
 
   getProfile(): Observable<Manager> {
@@ -39,48 +45,80 @@
 
   getAllProFormas(): Observable<ProFormaResponseDto[]> {
-    return this.http.get<ProFormaResponseDto[]>(`${environment.apiUrl}/pro-forma/manager/all`);
+    return this.http.get<ProFormaResponseDto[]>(
+      `${environment.apiUrl}/pro-forma/manager/all`,
+    );
   }
 
   getMonthlyFinancialSummary(): Observable<FinancialSummary> {
-    return this.http.get<FinancialSummary>(`${environment.apiUrl}/manager/finances/monthly-report`);
+    return this.http.get<FinancialSummary>(
+      `${environment.apiUrl}/manager/finances/monthly-report`,
+    );
   }
 
   getQuarterlyFinancialSummary(): Observable<FinancialSummary> {
-    return this.http.get<FinancialSummary>(`${environment.apiUrl}/manager/finances/quarterly-report`);
+    return this.http.get<FinancialSummary>(
+      `${environment.apiUrl}/manager/finances/quarterly-report`,
+    );
   }
 
   createProForma(proForma: number): Observable<ProFormaResponseDto> {
-    return this.http.post<ProFormaResponseDto>(`${environment.apiUrl}/manager/pro-formas`, proForma);
+    return this.http.post<ProFormaResponseDto>(
+      `${environment.apiUrl}/manager/pro-formas`,
+      proForma,
+    );
   }
 
   getDrivers(): Observable<Driver[]> {
-    return this.http.get<Driver[]>(`${environment.apiUrl}/driver/manager/list-all`);
+    return this.http.get<Driver[]>(
+      `${environment.apiUrl}/driver/manager/list-all`,
+    );
   }
 
   getAvailableCities(): Observable<City[]> {
-  return this.http.get<City[]>(`${environment.apiUrl}/cities/manager/available-cities`);
-}
+    return this.http.get<City[]>(
+      `${environment.apiUrl}/cities/manager/available-cities`,
+    );
+  }
 
   getAvailableVehicles(deliveryDate?: string): Observable<Vehicle[]> {
-  let params = new HttpParams();
-  if (deliveryDate) {
-    params = params.set('deliveryDate', deliveryDate);
+    let params = new HttpParams();
+    if (deliveryDate) {
+      params = params.set('deliveryDate', deliveryDate);
+    }
+    return this.http.get<Vehicle[]>(
+      `${environment.apiUrl}/manager/vehicles/available`,
+      { params },
+    );
   }
-  return this.http.get<Vehicle[]>(`${environment.apiUrl}/manager/vehicles/available`, { params });
-}
 
-  // TODO: Implement in backend
   getUnassignedOrdersByCities(cityIds: number[]): Observable<Order[]> {
     const params = new HttpParams().set('cityIds', cityIds.join(','));
-    return this.http.get<Order[]>(`${environment.apiUrl}/orders/manager/unassigned-by-city`, { params });
+    return this.http.get<Order[]>(
+      `${environment.apiUrl}/orders/manager/unassigned-by-city`,
+      { params },
+    );
   }
 
-  // TODO: Implement in backend
-  getWarehouseStock(): Observable<any[]> {
-    return this.http.get<any[]>(`${environment.apiUrl}/warehouse/manager/stock`);
+  getWarehouseStock(): Observable<WarehouseStock[]> {
+    return this.http
+      .get<WarehouseStock[]>(`${environment.apiUrl}/warehouse/manager/stock`)
+      .pipe(
+        map((stocks) =>
+          stocks.map((stock) => ({
+            ...stock,
+            profi: stock.sellingPrice - stock.costPrice,
+            profitMargin: calculateProfitMargin(stock),
+            daysToExpiration: calculateDaysToExpiration(stock) ?? undefined,
+            expirationStatus: getExpirationStatus(stock),
+          })),
+        ),
+      );
   }
 
   createDelivery(deliveryData: any): Observable<Delivery> {
-    return this.http.post<Delivery>(`${environment.apiUrl}/delivery/manager/create`, deliveryData);
+    return this.http.post<Delivery>(
+      `${environment.apiUrl}/delivery/manager/create`,
+      deliveryData,
+    );
   }
 }
Index: src/app/services/order.service.ts
===================================================================
--- src/app/services/order.service.ts	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/services/order.service.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -50,14 +50,14 @@
       orderItems: orderItems.map((it) => ({
         article: {
-          id: it.article.id,
-          name: it.article.name,
-          manufacturer: it.article.manufacturer,
-          quantity: it.article.quantity,
-          manufacturerId: it.article.manufacturerId,
-          price: it.article.price,
-          category: it.article.category,
-          categoryId: it.article.categoryId,
-          weight: it.article.weight,
-          image: it.article.image || null,
+          id: it.article?.id ?? null,
+          name: it.article?.name ?? '',
+          manufacturer: it.article?.manufacturer ?? null,
+          quantity: it.article?.quantity ?? 0,
+          manufacturerId: it.article?.manufacturerId ?? null,
+          price: it.article?.price ?? 0,
+          category: it.article?.category ?? null,
+          categoryId: it.article?.categoryId ?? null,
+          weight: it.article?.weight ?? 0,
+          image: it.article?.image ?? null,
         },
         quantity: it.quantity,
Index: src/app/services/warehouse.service.ts
===================================================================
--- src/app/services/warehouse.service.ts	(revision d6c4e910841c0e3995cd767fed054449dd21acee)
+++ src/app/services/warehouse.service.ts	(revision ffc28e7f610127c90f531caae74fe9fed2ac87c4)
@@ -3,4 +3,7 @@
 import { StockForecast } from '../models/stock-forecast.model';
 import { Article } from '../models';
+import { WarehouseStock } from '../models/warehouse-stock.model';
+import { environment } from '../../environment';
+import { Observable } from 'rxjs';
 
 @Injectable({
@@ -10,31 +13,37 @@
   constructor(private http: HttpClient) {}
 
-  getAvailableArticles(warehouseId: number) {
-    return this.http.get<Article[]>(
-      `/api/warehouses/${warehouseId}/articles/available`,
+  getWarehouseStock(): Observable<WarehouseStock[]> {
+    return this.http.get<WarehouseStock[]>(
+      `${environment.apiUrl}/warehouse/stock`,
     );
   }
 
-  getPendingDeliveryArticles(warehouseId: number) {
-    return this.http.get<Article[]>(
-      `/api/warehouses/${warehouseId}/articles/pending-delivery`,
+  getAvailableArticles(): Observable<WarehouseStock[]> {
+    return this.http.get<WarehouseStock[]>(
+      `${environment.apiUrl}/warehouse/articles/available`,
     );
   }
 
-  getNearExpirationArticles(warehouseId: number) {
-    return this.http.get<Article[]>(
-      `/api/warehouses/${warehouseId}/articles/near-expiration`,
+  getPendingDeliveryArticles(): Observable<WarehouseStock[]> {
+    return this.http.get<WarehouseStock[]>(
+      `${environment.apiUrl}/warehouse/articles/pending-delivery`,
     );
   }
 
-  getExpiredArticles(warehouseId: number) {
-    return this.http.get<Article[]>(
-      `/api/warehouses/${warehouseId}/articles/expired`,
+  getNearExpirationArticles(): Observable<WarehouseStock[]> {
+    return this.http.get<WarehouseStock[]>(
+      `${environment.apiUrl}/warehouse/articles/near-expiration`,
     );
   }
 
-  getStockForecast(warehouseId: number) {
+  getExpiredArticles(): Observable<WarehouseStock[]> {
+    return this.http.get<WarehouseStock[]>(
+      `${environment.apiUrl}/warehouse/articles/expired`,
+    );
+  }
+
+  getStockForecast(): Observable<StockForecast[]> {
     return this.http.get<StockForecast[]>(
-      `/api/warehouses/${warehouseId}/stock-forecast`,
+      `${environment.apiUrl}/warehouse/stock-forecast`,
     );
   }
