Skip to content

Commit f0db649

Browse files
authored
Merge pull request #5 from enterpriseShop/desenvolvimento
orders list
2 parents 2434cfb + 46c1224 commit f0db649

25 files changed

Lines changed: 932 additions & 267 deletions

db.json

Lines changed: 150 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,156 @@
12971297
"id": "4a17"
12981298
}
12991299
],
1300-
"order": [],
1300+
"order": [
1301+
{
1302+
"id": 1,
1303+
"date_order": "2024-06-11T12:23:59.000Z",
1304+
"value_total": "469,98",
1305+
"status": "Em preparação",
1306+
"receiptNumber": "2024ADG0001",
1307+
"customer": {
1308+
"first_name": "Emily",
1309+
"last_name": "Jones",
1310+
"address": {
1311+
"street": "123 Main St",
1312+
"city": "Springfield",
1313+
"state": "IL",
1314+
"zip": "62701"
1315+
},
1316+
"id": "636a"
1317+
},
1318+
"items": [
1319+
{
1320+
"id": "52",
1321+
"title": "Nike Air Jordan",
1322+
"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.",
1323+
"images": [
1324+
"https://cdnimg.etiquetaunica.com.br/products/3a5604376ac9c36674c1dcbe163c104c35980d9a8e0954ca-f23d-4181-8973-f8e445321e89-clipped-rev-1.jpeg"
1325+
],
1326+
"price": "199.99",
1327+
"stock": "20",
1328+
"category": {
1329+
"id": "4",
1330+
"name": "Shoes",
1331+
"image": "https://i.imgur.com/qNOjJje.jpeg",
1332+
"creationAt": "2024-06-11T12:23:59.000Z",
1333+
"updatedAt": "2024-06-11T12:23:59.000Z",
1334+
"qt_products": 10
1335+
}
1336+
},
1337+
{
1338+
"id": "11",
1339+
"title": "Classic Red Baseball Cap",
1340+
"price": 35,
1341+
"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.",
1342+
"images": [
1343+
"https://i.imgur.com/cBuLvBi.jpeg",
1344+
"https://i.imgur.com/N1GkCIR.jpeg",
1345+
"https://i.imgur.com/kKc9A5p.jpeg"
1346+
],
1347+
"creationAt": "2024-06-11T12:23:59.000Z",
1348+
"updatedAt": "2024-06-11T12:23:59.000Z",
1349+
"category": {
1350+
"id": 1,
1351+
"name": "Clothes",
1352+
"image": "https://i.imgur.com/QkIa5tT.jpeg",
1353+
"creationAt": "2024-06-11T12:23:59.000Z",
1354+
"updatedAt": "2024-06-11T12:23:59.000Z"
1355+
},
1356+
"stock": 17,
1357+
"status": {
1358+
"id": 6,
1359+
"name": "Quase esgotado",
1360+
"slug": "quase_esgotado"
1361+
}
1362+
}
1363+
]
1364+
},
1365+
{
1366+
"id": 2,
1367+
"date_order": "2024-06-11T12:23:59.000Z",
1368+
"value_total": "199.99",
1369+
"status": "Finalizado",
1370+
"receiptNumber": "2024ADG0001",
1371+
"customer": {
1372+
"first_name": "Sophia",
1373+
"last_name": "Johnson",
1374+
"address": {
1375+
"street": "789 Oak St",
1376+
"city": "Maplewood",
1377+
"state": "MN",
1378+
"zip": "55109"
1379+
},
1380+
"id": "1119"
1381+
},
1382+
"items": [
1383+
{
1384+
"id": "52",
1385+
"title": "Nike Air Jordan",
1386+
"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.",
1387+
"images": [
1388+
"https://cdnimg.etiquetaunica.com.br/products/3a5604376ac9c36674c1dcbe163c104c35980d9a8e0954ca-f23d-4181-8973-f8e445321e89-clipped-rev-1.jpeg"
1389+
],
1390+
"price": "199.99",
1391+
"stock": "20",
1392+
"category": {
1393+
"id": "4",
1394+
"name": "Shoes",
1395+
"image": "https://i.imgur.com/qNOjJje.jpeg",
1396+
"creationAt": "2024-06-11T12:23:59.000Z",
1397+
"updatedAt": "2024-06-11T12:23:59.000Z",
1398+
"qt_products": 10
1399+
}
1400+
}
1401+
]
1402+
},
1403+
{
1404+
"id": 3,
1405+
"date_order": "2024-06-11T12:23:59.000Z",
1406+
"value_total": "105.00",
1407+
"status": "Em preparação",
1408+
"receiptNumber": "2024ADG0001",
1409+
"customer": {
1410+
"first_name": "Liam",
1411+
"last_name": "Miller",
1412+
"address": {
1413+
"street": "2222 Walnut St",
1414+
"city": "Asheville",
1415+
"state": "NC",
1416+
"zip": "28801"
1417+
},
1418+
"id": "7b87"
1419+
},
1420+
"items": [
1421+
{
1422+
"id": "11",
1423+
"title": "Classic Red Baseball Cap",
1424+
"price": 35,
1425+
"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.",
1426+
"images": [
1427+
"https://i.imgur.com/cBuLvBi.jpeg",
1428+
"https://i.imgur.com/N1GkCIR.jpeg",
1429+
"https://i.imgur.com/kKc9A5p.jpeg"
1430+
],
1431+
"creationAt": "2024-06-11T12:23:59.000Z",
1432+
"updatedAt": "2024-06-11T12:23:59.000Z",
1433+
"category": {
1434+
"id": 1,
1435+
"name": "Clothes",
1436+
"image": "https://i.imgur.com/QkIa5tT.jpeg",
1437+
"creationAt": "2024-06-11T12:23:59.000Z",
1438+
"updatedAt": "2024-06-11T12:23:59.000Z"
1439+
},
1440+
"stock": 17,
1441+
"status": {
1442+
"id": 6,
1443+
"name": "Quase esgotado",
1444+
"slug": "quase_esgotado"
1445+
}
1446+
}
1447+
]
1448+
}
1449+
],
13011450
"cart": [],
13021451
"status": [
13031452
{

src/app/app.routes.ts

Lines changed: 68 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,107 @@ export const routes: Routes = [
44
{
55
path: '',
66
redirectTo: '/login',
7-
pathMatch: 'full'
7+
pathMatch: 'full',
88
},
99
{
1010
path: 'login',
11-
loadComponent: () => import('./pages/login/login-default/login-default.component').then(c => c.LoginDefaultComponent),
11+
loadComponent: () =>
12+
import('./pages/login/login-default/login-default.component').then(
13+
(c) => c.LoginDefaultComponent
14+
),
1215
children: [
1316
{
1417
path: '',
15-
loadComponent: () => import('./pages/login/login-user/login-user.component').then(c => c.LoginUserComponent),
18+
loadComponent: () =>
19+
import('./pages/login/login-user/login-user.component').then(
20+
(c) => c.LoginUserComponent
21+
),
1622
},
1723
{
1824
path: 'forgot-password',
19-
loadComponent: () => import('./pages/login/login-forgot/login-forgot.component').then(c => c.LoginForgotComponent),
20-
}
21-
]
25+
loadComponent: () =>
26+
import('./pages/login/login-forgot/login-forgot.component').then(
27+
(c) => c.LoginForgotComponent
28+
),
29+
},
30+
],
2231
},
2332
{
2433
path: 'dashboard',
25-
loadComponent: () => import('./pages/dashboard/dash-default/dash-default.component').then(c => c.DashDefaultComponent),
34+
loadComponent: () =>
35+
import('./pages/dashboard/dash-default/dash-default.component').then(
36+
(c) => c.DashDefaultComponent
37+
),
2638
children: [
2739
{
2840
path: '',
29-
loadComponent: () => import('./pages/dashboard/dash-content/dash-content.component').then(c => c.DashContentComponent),
41+
loadComponent: () =>
42+
import('./pages/dashboard/dash-content/dash-content.component').then(
43+
(c) => c.DashContentComponent
44+
),
3045
},
3146
{
3247
path: 'products',
33-
loadComponent: () => import('./pages/products/product-default/product-default.component').then(c => c.ProductDefaultComponent),
48+
loadComponent: () =>
49+
import(
50+
'./pages/products/product-default/product-default.component'
51+
).then((c) => c.ProductDefaultComponent),
3452
children: [
3553
{
3654
path: '',
37-
loadComponent: () => import('./pages/products/components/product-list/product-list.component').then(c => c.ProductListComponent),
55+
loadComponent: () =>
56+
import(
57+
'./pages/products/components/product-list/product-list.component'
58+
).then((c) => c.ProductListComponent),
3859
},
3960
{
4061
path: 'edit',
41-
loadComponent: () => import('./pages/products/components/product-edit/product-edit.component').then(c => c.ProductEditComponent),
42-
}
43-
]
62+
loadComponent: () =>
63+
import(
64+
'./pages/products/components/product-edit/product-edit.component'
65+
).then((c) => c.ProductEditComponent),
66+
},
67+
],
4468
},
4569
{
4670
path: 'categories',
47-
loadComponent: () => import('./pages/categories/category-default/category-default.component').then(c => c.CategoryDefaultComponent),
71+
loadComponent: () =>
72+
import(
73+
'./pages/categories/category-default/category-default.component'
74+
).then((c) => c.CategoryDefaultComponent),
4875
children: [
4976
{
5077
path: '',
51-
loadComponent: () => import('./pages/categories/components/category-list/category-list.component').then(c => c.CategoryListComponent),
78+
loadComponent: () =>
79+
import(
80+
'./pages/categories/components/category-list/category-list.component'
81+
).then((c) => c.CategoryListComponent),
5282
},
5383
{
5484
path: 'edit',
55-
loadComponent: () => import('./pages/categories/components/category-edit/category-edit.component').then(c => c.CategoryEditComponent),
56-
}
57-
]
85+
loadComponent: () =>
86+
import(
87+
'./pages/categories/components/category-edit/category-edit.component'
88+
).then((c) => c.CategoryEditComponent),
89+
},
90+
],
91+
},
92+
{
93+
path: 'orders',
94+
loadComponent: () =>
95+
import('./pages/order/order-default/order-default.component').then(
96+
(c) => c.OrderDefaultComponent
97+
),
98+
children: [
99+
{
100+
path: '',
101+
loadComponent: () =>
102+
import(
103+
'./pages/order/components/order-list/order-list.component'
104+
).then((c) => c.OrderListComponent),
105+
},
106+
],
58107
},
59-
]
108+
],
60109
},
61110
];

src/app/models/Customer.model.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export interface Customer {
2+
first_name: string;
3+
last_name: string;
4+
address: Address;
5+
id: string;
6+
}
7+
8+
export interface Address {
9+
street: string;
10+
city: string;
11+
state: string;
12+
zip: string;
13+
}

src/app/models/Orders.model.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Customer } from './Customer.model';
2+
3+
export interface Order {
4+
id: number;
5+
date_order: string;
6+
value_total: string;
7+
status: string;
8+
receiptNumber: string;
9+
customer: Customer;
10+
}

src/app/pages/categories/components/category-list/category-list.component.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,22 @@ import { Status } from '../../../../models/Status.model';
2020
@Component({
2121
selector: 'app-category-list',
2222
standalone: true,
23-
imports: [AvatarModule, AvatarGroupModule, FormsModule, TableModule, ButtonModule, RouterLink, BreadcrumbComponent, InputTextModule, NgClass, DropdownModule],
23+
imports: [
24+
AvatarModule,
25+
AvatarGroupModule,
26+
FormsModule,
27+
TableModule,
28+
ButtonModule,
29+
RouterLink,
30+
BreadcrumbComponent,
31+
InputTextModule,
32+
NgClass,
33+
DropdownModule,
34+
],
2435
templateUrl: './category-list.component.html',
25-
styleUrl: './category-list.component.scss'
36+
styleUrl: './category-list.component.scss',
2637
})
2738
export class CategoryListComponent implements OnInit {
28-
2939
loading: boolean = false;
3040
searchValue: string | undefined;
3141
selectedStatus: Status | undefined;
@@ -36,10 +46,9 @@ export class CategoryListComponent implements OnInit {
3646

3747
constructor(
3848
private router: Router,
39-
private http: HttpClient,
4049
private statusService: StatusService,
4150
private catService: CategoriesService
42-
) { }
51+
) {}
4352

4453
ngOnInit(): void {
4554
this.allCategories();
@@ -52,7 +61,7 @@ export class CategoryListComponent implements OnInit {
5261
next: (data) => {
5362
let statusFiltered: Status[] = [];
5463
data.forEach((item: Status) => {
55-
if (item.enabled.includes("categories")) {
64+
if (item.enabled.includes('categories')) {
5665
statusFiltered.push(item);
5766
}
5867
});
@@ -61,7 +70,7 @@ export class CategoryListComponent implements OnInit {
6170
},
6271
error: (err) => {
6372
console.log('GET ALL STATUS ERR:', err);
64-
}
73+
},
6574
});
6675
}
6776

@@ -85,13 +94,12 @@ export class CategoryListComponent implements OnInit {
8594
},
8695
error: (err) => {
8796
console.log('GET ALL CATEGORY ERR:', err);
88-
}
97+
},
8998
});
9099
}
91100

92101
clear(table: Table) {
93102
table.clear();
94-
this.searchValue = ''
103+
this.searchValue = '';
95104
}
96-
97105
}

0 commit comments

Comments
 (0)