Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 150 additions & 1 deletion db.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down
87 changes: 68 additions & 19 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
],
},
]
],
},
];
13 changes: 13 additions & 0 deletions src/app/models/Customer.model.ts
Original file line number Diff line number Diff line change
@@ -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;
}
10 changes: 10 additions & 0 deletions src/app/models/Orders.model.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand All @@ -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);
}
});
Expand All @@ -61,7 +70,7 @@ export class CategoryListComponent implements OnInit {
},
error: (err) => {
console.log('GET ALL STATUS ERR:', err);
}
},
});
}

Expand All @@ -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 = '';
}

}
Loading