diff --git a/db.json b/db.json
index 27f6b3d..cc257f4 100644
--- a/db.json
+++ b/db.json
@@ -1297,7 +1297,156 @@
"id": "4a17"
}
],
- "order": [],
+ "order": [
+ {
+ "id": 1,
+ "date_order": "2024-06-11T12:23:59.000Z",
+ "value_total": "469,98",
+ "status": "Em preparação",
+ "receiptNumber": "2024ADG0001",
+ "customer": {
+ "first_name": "Emily",
+ "last_name": "Jones",
+ "address": {
+ "street": "123 Main St",
+ "city": "Springfield",
+ "state": "IL",
+ "zip": "62701"
+ },
+ "id": "636a"
+ },
+ "items": [
+ {
+ "id": "52",
+ "title": "Nike Air Jordan",
+ "description": "O Nike Air Jordan é uma linha de tênis de basquete lendária que foi lançada pela primeira vez em 1985. Criada em colaboração com o jogador de basquete Michael Jordan.",
+ "images": [
+ "https://cdnimg.etiquetaunica.com.br/products/3a5604376ac9c36674c1dcbe163c104c35980d9a8e0954ca-f23d-4181-8973-f8e445321e89-clipped-rev-1.jpeg"
+ ],
+ "price": "199.99",
+ "stock": "20",
+ "category": {
+ "id": "4",
+ "name": "Shoes",
+ "image": "https://i.imgur.com/qNOjJje.jpeg",
+ "creationAt": "2024-06-11T12:23:59.000Z",
+ "updatedAt": "2024-06-11T12:23:59.000Z",
+ "qt_products": 10
+ }
+ },
+ {
+ "id": "11",
+ "title": "Classic Red Baseball Cap",
+ "price": 35,
+ "description": "Elevate your casual wardrobe with this timeless red baseball cap. Crafted from durable fabric, it features a comfortable fit with an adjustable strap at the back, ensuring one size fits all. Perfect for sunny days or adding a sporty touch to your outfit.",
+ "images": [
+ "https://i.imgur.com/cBuLvBi.jpeg",
+ "https://i.imgur.com/N1GkCIR.jpeg",
+ "https://i.imgur.com/kKc9A5p.jpeg"
+ ],
+ "creationAt": "2024-06-11T12:23:59.000Z",
+ "updatedAt": "2024-06-11T12:23:59.000Z",
+ "category": {
+ "id": 1,
+ "name": "Clothes",
+ "image": "https://i.imgur.com/QkIa5tT.jpeg",
+ "creationAt": "2024-06-11T12:23:59.000Z",
+ "updatedAt": "2024-06-11T12:23:59.000Z"
+ },
+ "stock": 17,
+ "status": {
+ "id": 6,
+ "name": "Quase esgotado",
+ "slug": "quase_esgotado"
+ }
+ }
+ ]
+ },
+ {
+ "id": 2,
+ "date_order": "2024-06-11T12:23:59.000Z",
+ "value_total": "199.99",
+ "status": "Finalizado",
+ "receiptNumber": "2024ADG0001",
+ "customer": {
+ "first_name": "Sophia",
+ "last_name": "Johnson",
+ "address": {
+ "street": "789 Oak St",
+ "city": "Maplewood",
+ "state": "MN",
+ "zip": "55109"
+ },
+ "id": "1119"
+ },
+ "items": [
+ {
+ "id": "52",
+ "title": "Nike Air Jordan",
+ "description": "O Nike Air Jordan é uma linha de tênis de basquete lendária que foi lançada pela primeira vez em 1985. Criada em colaboração com o jogador de basquete Michael Jordan.",
+ "images": [
+ "https://cdnimg.etiquetaunica.com.br/products/3a5604376ac9c36674c1dcbe163c104c35980d9a8e0954ca-f23d-4181-8973-f8e445321e89-clipped-rev-1.jpeg"
+ ],
+ "price": "199.99",
+ "stock": "20",
+ "category": {
+ "id": "4",
+ "name": "Shoes",
+ "image": "https://i.imgur.com/qNOjJje.jpeg",
+ "creationAt": "2024-06-11T12:23:59.000Z",
+ "updatedAt": "2024-06-11T12:23:59.000Z",
+ "qt_products": 10
+ }
+ }
+ ]
+ },
+ {
+ "id": 3,
+ "date_order": "2024-06-11T12:23:59.000Z",
+ "value_total": "105.00",
+ "status": "Em preparação",
+ "receiptNumber": "2024ADG0001",
+ "customer": {
+ "first_name": "Liam",
+ "last_name": "Miller",
+ "address": {
+ "street": "2222 Walnut St",
+ "city": "Asheville",
+ "state": "NC",
+ "zip": "28801"
+ },
+ "id": "7b87"
+ },
+ "items": [
+ {
+ "id": "11",
+ "title": "Classic Red Baseball Cap",
+ "price": 35,
+ "description": "Elevate your casual wardrobe with this timeless red baseball cap. Crafted from durable fabric, it features a comfortable fit with an adjustable strap at the back, ensuring one size fits all. Perfect for sunny days or adding a sporty touch to your outfit.",
+ "images": [
+ "https://i.imgur.com/cBuLvBi.jpeg",
+ "https://i.imgur.com/N1GkCIR.jpeg",
+ "https://i.imgur.com/kKc9A5p.jpeg"
+ ],
+ "creationAt": "2024-06-11T12:23:59.000Z",
+ "updatedAt": "2024-06-11T12:23:59.000Z",
+ "category": {
+ "id": 1,
+ "name": "Clothes",
+ "image": "https://i.imgur.com/QkIa5tT.jpeg",
+ "creationAt": "2024-06-11T12:23:59.000Z",
+ "updatedAt": "2024-06-11T12:23:59.000Z"
+ },
+ "stock": 17,
+ "status": {
+ "id": 6,
+ "name": "Quase esgotado",
+ "slug": "quase_esgotado"
+ }
+ }
+ ]
+ }
+ ],
"cart": [],
"status": [
{
diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts
index 676d592..516d9d5 100644
--- a/src/app/app.routes.ts
+++ b/src/app/app.routes.ts
@@ -4,58 +4,107 @@ export const routes: Routes = [
{
path: '',
redirectTo: '/login',
- pathMatch: 'full'
+ pathMatch: 'full',
},
{
path: 'login',
- loadComponent: () => import('./pages/login/login-default/login-default.component').then(c => c.LoginDefaultComponent),
+ loadComponent: () =>
+ import('./pages/login/login-default/login-default.component').then(
+ (c) => c.LoginDefaultComponent
+ ),
children: [
{
path: '',
- loadComponent: () => import('./pages/login/login-user/login-user.component').then(c => c.LoginUserComponent),
+ loadComponent: () =>
+ import('./pages/login/login-user/login-user.component').then(
+ (c) => c.LoginUserComponent
+ ),
},
{
path: 'forgot-password',
- loadComponent: () => import('./pages/login/login-forgot/login-forgot.component').then(c => c.LoginForgotComponent),
- }
- ]
+ loadComponent: () =>
+ import('./pages/login/login-forgot/login-forgot.component').then(
+ (c) => c.LoginForgotComponent
+ ),
+ },
+ ],
},
{
path: 'dashboard',
- loadComponent: () => import('./pages/dashboard/dash-default/dash-default.component').then(c => c.DashDefaultComponent),
+ loadComponent: () =>
+ import('./pages/dashboard/dash-default/dash-default.component').then(
+ (c) => c.DashDefaultComponent
+ ),
children: [
{
path: '',
- loadComponent: () => import('./pages/dashboard/dash-content/dash-content.component').then(c => c.DashContentComponent),
+ loadComponent: () =>
+ import('./pages/dashboard/dash-content/dash-content.component').then(
+ (c) => c.DashContentComponent
+ ),
},
{
path: 'products',
- loadComponent: () => import('./pages/products/product-default/product-default.component').then(c => c.ProductDefaultComponent),
+ loadComponent: () =>
+ import(
+ './pages/products/product-default/product-default.component'
+ ).then((c) => c.ProductDefaultComponent),
children: [
{
path: '',
- loadComponent: () => import('./pages/products/components/product-list/product-list.component').then(c => c.ProductListComponent),
+ loadComponent: () =>
+ import(
+ './pages/products/components/product-list/product-list.component'
+ ).then((c) => c.ProductListComponent),
},
{
path: 'edit',
- loadComponent: () => import('./pages/products/components/product-edit/product-edit.component').then(c => c.ProductEditComponent),
- }
- ]
+ loadComponent: () =>
+ import(
+ './pages/products/components/product-edit/product-edit.component'
+ ).then((c) => c.ProductEditComponent),
+ },
+ ],
},
{
path: 'categories',
- loadComponent: () => import('./pages/categories/category-default/category-default.component').then(c => c.CategoryDefaultComponent),
+ loadComponent: () =>
+ import(
+ './pages/categories/category-default/category-default.component'
+ ).then((c) => c.CategoryDefaultComponent),
children: [
{
path: '',
- loadComponent: () => import('./pages/categories/components/category-list/category-list.component').then(c => c.CategoryListComponent),
+ loadComponent: () =>
+ import(
+ './pages/categories/components/category-list/category-list.component'
+ ).then((c) => c.CategoryListComponent),
},
{
path: 'edit',
- loadComponent: () => import('./pages/categories/components/category-edit/category-edit.component').then(c => c.CategoryEditComponent),
- }
- ]
+ loadComponent: () =>
+ import(
+ './pages/categories/components/category-edit/category-edit.component'
+ ).then((c) => c.CategoryEditComponent),
+ },
+ ],
+ },
+ {
+ path: 'orders',
+ loadComponent: () =>
+ import('./pages/order/order-default/order-default.component').then(
+ (c) => c.OrderDefaultComponent
+ ),
+ children: [
+ {
+ path: '',
+ loadComponent: () =>
+ import(
+ './pages/order/components/order-list/order-list.component'
+ ).then((c) => c.OrderListComponent),
+ },
+ ],
},
- ]
+ ],
},
];
diff --git a/src/app/models/Customer.model.ts b/src/app/models/Customer.model.ts
new file mode 100644
index 0000000..5faebf9
--- /dev/null
+++ b/src/app/models/Customer.model.ts
@@ -0,0 +1,13 @@
+export interface Customer {
+ first_name: string;
+ last_name: string;
+ address: Address;
+ id: string;
+}
+
+export interface Address {
+ street: string;
+ city: string;
+ state: string;
+ zip: string;
+}
diff --git a/src/app/models/Orders.model.ts b/src/app/models/Orders.model.ts
new file mode 100644
index 0000000..c638dc7
--- /dev/null
+++ b/src/app/models/Orders.model.ts
@@ -0,0 +1,10 @@
+import { Customer } from './Customer.model';
+
+export interface Order {
+ id: number;
+ date_order: string;
+ value_total: string;
+ status: string;
+ receiptNumber: string;
+ customer: Customer;
+}
diff --git a/src/app/pages/categories/components/category-list/category-list.component.ts b/src/app/pages/categories/components/category-list/category-list.component.ts
index b8f0275..a72e083 100644
--- a/src/app/pages/categories/components/category-list/category-list.component.ts
+++ b/src/app/pages/categories/components/category-list/category-list.component.ts
@@ -20,12 +20,22 @@ import { Status } from '../../../../models/Status.model';
@Component({
selector: 'app-category-list',
standalone: true,
- imports: [AvatarModule, AvatarGroupModule, FormsModule, TableModule, ButtonModule, RouterLink, BreadcrumbComponent, InputTextModule, NgClass, DropdownModule],
+ imports: [
+ AvatarModule,
+ AvatarGroupModule,
+ FormsModule,
+ TableModule,
+ ButtonModule,
+ RouterLink,
+ BreadcrumbComponent,
+ InputTextModule,
+ NgClass,
+ DropdownModule,
+ ],
templateUrl: './category-list.component.html',
- styleUrl: './category-list.component.scss'
+ styleUrl: './category-list.component.scss',
})
export class CategoryListComponent implements OnInit {
-
loading: boolean = false;
searchValue: string | undefined;
selectedStatus: Status | undefined;
@@ -36,10 +46,9 @@ export class CategoryListComponent implements OnInit {
constructor(
private router: Router,
- private http: HttpClient,
private statusService: StatusService,
private catService: CategoriesService
- ) { }
+ ) {}
ngOnInit(): void {
this.allCategories();
@@ -52,7 +61,7 @@ export class CategoryListComponent implements OnInit {
next: (data) => {
let statusFiltered: Status[] = [];
data.forEach((item: Status) => {
- if (item.enabled.includes("categories")) {
+ if (item.enabled.includes('categories')) {
statusFiltered.push(item);
}
});
@@ -61,7 +70,7 @@ export class CategoryListComponent implements OnInit {
},
error: (err) => {
console.log('GET ALL STATUS ERR:', err);
- }
+ },
});
}
@@ -85,13 +94,12 @@ export class CategoryListComponent implements OnInit {
},
error: (err) => {
console.log('GET ALL CATEGORY ERR:', err);
- }
+ },
});
}
clear(table: Table) {
table.clear();
- this.searchValue = ''
+ this.searchValue = '';
}
-
}
diff --git a/src/app/pages/components/thumbnail/thumbnail-products/thumbnail-products.component.html b/src/app/pages/components/thumbnail/thumbnail-products/thumbnail-products.component.html
index 696e86f..0aedc89 100644
--- a/src/app/pages/components/thumbnail/thumbnail-products/thumbnail-products.component.html
+++ b/src/app/pages/components/thumbnail/thumbnail-products/thumbnail-products.component.html
@@ -1,14 +1,35 @@
-