Skip to content

Commit b75fae5

Browse files
committed
updated namespace formatting
1 parent 73984df commit b75fae5

8 files changed

Lines changed: 509 additions & 517 deletions

File tree

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
// Configuration.cs - Application configuration settings
2-
namespace EcommerceApp.Configuration
2+
namespace EcommerceApp.Configuration;
3+
4+
public static class AppConfig
35
{
4-
public static class AppConfig
5-
{
6-
// Shipping configuration
7-
public static decimal BaseShippingRate { get; } = 5.99m;
8-
public static decimal WeightBasedRatePerPound { get; } = 1.25m;
9-
public static decimal FreeShippingThreshold { get; } = 50.00m;
10-
public static decimal ReturnProcessingFee { get; } = 2.99m;
11-
12-
// Security configuration
13-
public static int MaxIdLength { get; } = 20;
14-
public static int MinIdLength { get; } = 6;
15-
16-
// Business rules
17-
public static int MaxReturnDays { get; } = 30;
18-
public static decimal MaxRefundAmount { get; } = 1000.00m;
19-
}
6+
// Shipping configuration
7+
public static decimal BaseShippingRate { get; } = 5.99m;
8+
public static decimal WeightBasedRatePerPound { get; } = 1.25m;
9+
public static decimal FreeShippingThreshold { get; } = 50.00m;
10+
public static decimal ReturnProcessingFee { get; } = 2.99m;
11+
12+
// Security configuration
13+
public static int MaxIdLength { get; } = 20;
14+
public static int MinIdLength { get; } = 6;
15+
16+
// Business rules
17+
public static int MaxReturnDays { get; } = 30;
18+
public static decimal MaxRefundAmount { get; } = 1000.00m;
2019
}

DownloadableCodeProjects/standalone-lab-projects/consolidate-duplicate-code/ECommerceOrderAndReturn/Models/Order.cs

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,33 @@
22
using System;
33
using System.Collections.Generic;
44

5-
namespace EcommerceApp.Models
5+
namespace EcommerceApp.Models;
6+
7+
public class Order
68
{
7-
public class Order
8-
{
9-
public string OrderId { get; set; } = string.Empty;
10-
public string CustomerId { get; set; } = string.Empty;
11-
public DateTime OrderDate { get; set; }
12-
public List<OrderItem> Items { get; set; } = new List<OrderItem>();
13-
public decimal TotalAmount { get; set; }
14-
public string ShippingAddress { get; set; } = string.Empty;
15-
public OrderStatus Status { get; set; }
16-
}
9+
public string OrderId { get; set; } = string.Empty;
10+
public string CustomerId { get; set; } = string.Empty;
11+
public DateTime OrderDate { get; set; }
12+
public List<OrderItem> Items { get; set; } = new List<OrderItem>();
13+
public decimal TotalAmount { get; set; }
14+
public string ShippingAddress { get; set; } = string.Empty;
15+
public OrderStatus Status { get; set; }
16+
}
1717

18-
public class OrderItem
19-
{
20-
public string ProductId { get; set; } = string.Empty;
21-
public string ProductName { get; set; } = string.Empty;
22-
public int Quantity { get; set; }
23-
public decimal UnitPrice { get; set; }
24-
public decimal Weight { get; set; } // in pounds, for shipping calculation
25-
}
18+
public class OrderItem
19+
{
20+
public string ProductId { get; set; } = string.Empty;
21+
public string ProductName { get; set; } = string.Empty;
22+
public int Quantity { get; set; }
23+
public decimal UnitPrice { get; set; }
24+
public decimal Weight { get; set; } // in pounds, for shipping calculation
25+
}
2626

27-
public enum OrderStatus
28-
{
29-
Pending,
30-
Processing,
31-
Shipped,
32-
Delivered,
33-
Cancelled
34-
}
27+
public enum OrderStatus
28+
{
29+
Pending,
30+
Processing,
31+
Shipped,
32+
Delivered,
33+
Cancelled
3534
}
Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
// Return.cs - Represents a product return
22
using System;
33

4-
namespace EcommerceApp.Models
4+
namespace EcommerceApp.Models;
5+
6+
public class Return
57
{
6-
public class Return
7-
{
8-
public string ReturnId { get; set; } = string.Empty;
9-
public string OriginalOrderId { get; set; } = string.Empty;
10-
public string CustomerId { get; set; } = string.Empty;
11-
public DateTime ReturnDate { get; set; }
12-
public string ProductId { get; set; } = string.Empty;
13-
public string ProductName { get; set; } = string.Empty;
14-
public int Quantity { get; set; }
15-
public decimal RefundAmount { get; set; }
16-
public string Reason { get; set; } = string.Empty;
17-
public ReturnStatus Status { get; set; }
18-
public decimal Weight { get; set; } // in pounds, for return shipping calculation
19-
}
8+
public string ReturnId { get; set; } = string.Empty;
9+
public string OriginalOrderId { get; set; } = string.Empty;
10+
public string CustomerId { get; set; } = string.Empty;
11+
public DateTime ReturnDate { get; set; }
12+
public string ProductId { get; set; } = string.Empty;
13+
public string ProductName { get; set; } = string.Empty;
14+
public int Quantity { get; set; }
15+
public decimal RefundAmount { get; set; }
16+
public string Reason { get; set; } = string.Empty;
17+
public ReturnStatus Status { get; set; }
18+
public decimal Weight { get; set; } // in pounds, for return shipping calculation
19+
}
2020

21-
public enum ReturnStatus
22-
{
23-
Pending,
24-
Approved,
25-
Rejected,
26-
Processing,
27-
Completed
28-
}
21+
public enum ReturnStatus
22+
{
23+
Pending,
24+
Approved,
25+
Rejected,
26+
Processing,
27+
Completed
2928
}

0 commit comments

Comments
 (0)