From 00f245ccefe317ca27f72cd0b37450a617b42e1d Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Sun, 13 Jul 2025 20:25:33 -0700 Subject: [PATCH] Update Account DbService --- src/Server/Entities/Account.cs | 1 - .../Services/DatabaseService/Account.cs | 13 +- src/Server/Services/DatabaseService/Cart.cs | 82 --------- .../Services/DatabaseService/Product.cs | 136 -------------- .../Services/DatabaseService/ProductImage.cs | 112 ------------ .../DatabaseService/ProductInventory.cs | 100 ---------- .../Services/DatabaseService/Receipt.cs | 171 ------------------ 7 files changed, 8 insertions(+), 607 deletions(-) delete mode 100755 src/Server/Services/DatabaseService/Cart.cs delete mode 100755 src/Server/Services/DatabaseService/Product.cs delete mode 100644 src/Server/Services/DatabaseService/ProductImage.cs delete mode 100755 src/Server/Services/DatabaseService/ProductInventory.cs delete mode 100755 src/Server/Services/DatabaseService/Receipt.cs diff --git a/src/Server/Entities/Account.cs b/src/Server/Entities/Account.cs index 7aabcf3..a98ddd4 100644 --- a/src/Server/Entities/Account.cs +++ b/src/Server/Entities/Account.cs @@ -11,6 +11,5 @@ namespace BoredCareers.Entities { public string Role { get; set; } = "Generic"; public string EmailToken { get; set; } = ""; public string DataServer { get; set; } = ""; - public string Error { get; set; } = ""; } } \ No newline at end of file diff --git a/src/Server/Services/DatabaseService/Account.cs b/src/Server/Services/DatabaseService/Account.cs index 9e133c2..ca84844 100755 --- a/src/Server/Services/DatabaseService/Account.cs +++ b/src/Server/Services/DatabaseService/Account.cs @@ -35,6 +35,7 @@ namespace BoredCareers.Services.DatabaseService { int _curpasswordattempts = reader.GetInt32( "CurrentPasswordAttempts" ); string _role = reader.GetString( "Role" ); string _emailtoken = reader.GetString( "EmailToken" ); + string _dataserver = reader.GetString( "DataServer" ); account = new Account() { ID = _id, @@ -47,6 +48,7 @@ namespace BoredCareers.Services.DatabaseService { EmailToken = _emailtoken, FailedPasswordLock = _failedpasswordlock, Role = _role, + DataServer = _dataserver }; } } @@ -82,6 +84,7 @@ namespace BoredCareers.Services.DatabaseService { int _curpasswordattempts = reader.GetInt32( "CurrentPasswordAttempts" ); string _role = reader.GetString( "Role" ); string _emailtoken = reader.GetString( "EmailToken" ); + string _dataserver = reader.GetString("DataServer"); account = new Account() { ID = _id, @@ -94,6 +97,7 @@ namespace BoredCareers.Services.DatabaseService { EmailToken = _emailtoken, FailedPasswordLock = _failedpasswordlock, Role = _role, + DataServer = _dataserver }; } } @@ -107,9 +111,9 @@ namespace BoredCareers.Services.DatabaseService { string command = @" INSERT INTO Account - (ID,UserName,Email,EmailVerified,PasswordHash,FailedPasswordLock,PasswordAttempts,CurrentPasswordAttempts,Role,EmailToken) + (ID,UserName,Email,EmailVerified,PasswordHash,FailedPasswordLock,PasswordAttempts,CurrentPasswordAttempts,Role,EmailToken,DataServer) VALUES - (@ID,@UserName,@Email,@EmailVerified,@PasswordHash,@FailedPasswordLock,@PasswordAttempts,@CurrentPasswordAttempts,@Role,@EmailToken); + (@ID,@UserName,@Email,@EmailVerified,@PasswordHash,@FailedPasswordLock,@PasswordAttempts,@CurrentPasswordAttempts,@Role,@EmailToken,@DataServer); ON DUPLICATE KEY UPDATE UserName = @UserName, Email = @Email, @@ -120,6 +124,7 @@ namespace BoredCareers.Services.DatabaseService { CurrentPasswordAttempts = @CurrentPasswordAttempts, Role = @Role, EmailToken = @EmailToken; + DataServer = @DataServer; "; MySqlCommand cmd = new MySqlCommand( command , connection); @@ -133,6 +138,7 @@ namespace BoredCareers.Services.DatabaseService { cmd.Parameters.AddWithValue("@CurrentPasswordAttempts", Profile.CurrentPasswordAttempts); cmd.Parameters.AddWithValue("@Role", Profile.Role); cmd.Parameters.AddWithValue("@EmailToken", Profile.EmailToken); + cmd.Parameters.AddWithValue("@DataServer", Profile.DataServer); await cmd.ExecuteNonQueryAsync(); } @@ -145,9 +151,6 @@ namespace BoredCareers.Services.DatabaseService { string command = @" DELETE FROM Account WHERE ID = @ID; - DELETE FROM AccountInventory WHERE AccountID = @ID; - DELETE FROM ProjectMistData WHERE AccountID = @ID; - DELETE FROM Cart WHERE AccountID = @ID; "; cmd = new MySqlCommand( command, connection ); cmd.Parameters.AddWithValue("@ID", ID); diff --git a/src/Server/Services/DatabaseService/Cart.cs b/src/Server/Services/DatabaseService/Cart.cs deleted file mode 100755 index 77632f6..0000000 --- a/src/Server/Services/DatabaseService/Cart.cs +++ /dev/null @@ -1,82 +0,0 @@ -using BoredCareers.Entities; -using MySql.Data.MySqlClient; -using System.Data; -using System.Data.Common; - -namespace BoredCareers.Services.DatabaseService { - public partial class DatabaseService { - - public async Task GetCart( int accountID ) { - List list = new List(); - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = @" - SELECT * FROM Cart - WHERE AccountID = @AccountID; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@AccountID", accountID); - - using( DbDataReader reader = await cmd.ExecuteReaderAsync() ) { - while( await reader.ReadAsync() ) { - if( reader == null ) { - break; - } - int _id = reader.GetInt32("ID"); - int _accountid = reader.GetInt32("AccountID"); - int _productid = reader.GetInt32("ProductID"); - list.Add( new Cart() { - ID = _id, - AccountID = _accountid, - ProductID = _productid - } ); - } - } - } - return list.ToArray(); - } - - public async Task AddToCart( Cart item ) { - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = @" - INSERT INTO Cart - (AccountID, ProductID) - VALUES - (@AccountID, @ProductID); - "; - - MySqlCommand cmd = new MySqlCommand( command , connection); - cmd.Parameters.AddWithValue("@AccountID", item.AccountID); - cmd.Parameters.AddWithValue("@ProductID", item.ProductID); - - await cmd.ExecuteNonQueryAsync(); - } - } - - public async Task RemoveFromCart( Cart item ) { - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = "DELETE FROM Cart WHERE AccountID=" + item.AccountID + " AND ProductID=" + item.ProductID + ";"; - MySqlCommand cmd = new MySqlCommand( command , connection); - await cmd.ExecuteNonQueryAsync(); - } - } - - public async Task ClearCart( int accountID ) { - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = @" - DELETE FROM Cart - WHERE AccountID = @AccountID; - "; - - MySqlCommand cmd = new MySqlCommand( command , connection); - cmd.Parameters.AddWithValue("@AccountID", accountID); - - await cmd.ExecuteNonQueryAsync(); - } - } - } -} \ No newline at end of file diff --git a/src/Server/Services/DatabaseService/Product.cs b/src/Server/Services/DatabaseService/Product.cs deleted file mode 100755 index 6346188..0000000 --- a/src/Server/Services/DatabaseService/Product.cs +++ /dev/null @@ -1,136 +0,0 @@ -using BoredCareers.Entities; -using MySql.Data.MySqlClient; -using System.Data; -using System.Data.Common; - -namespace BoredCareers.Services.DatabaseService { - public partial class DatabaseService { - - public async Task GetProduct(int ID) { - Product? items = null; - using (MySqlConnection connection = GetConnection()) { - connection.Open(); - string command = @" - SELECT * FROM Product - WHERE ID = @ID; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@ID", ID); - - using (DbDataReader reader = await cmd.ExecuteReaderAsync()) { - while (await reader.ReadAsync()) { - if (reader == null) { - break; - } - int _id = reader.GetInt32("ID"); - string _name = reader.GetString("Name"); - string _description = reader.GetString("Description"); - int _cost = reader.GetInt32("Cost"); - string _url = reader.GetString("URL"); - - ProductImage[] images = await GetAllImages(_id); - - items = new Product() { - ID = _id, - Name = _name, - Images = images, - Description = _description, - Cost = _cost, - URL = _url - }; - } - } - } - return items; - } - - public async Task GetAllProducts() { - List items = new List(); - using (MySqlConnection connection = GetConnection()) { - connection.Open(); - MySqlCommand cmd = new MySqlCommand("SELECT * FROM Product", connection); - using (DbDataReader reader = await cmd.ExecuteReaderAsync()) { - while (await reader.ReadAsync()) { - if (reader == null) { - break; - } - int _id = reader.GetInt32("ID"); - string _name = reader.GetString("Name"); - string _description = reader.GetString("Description"); - int _cost = reader.GetInt32("Cost"); - string _url = reader.GetString("URL"); - - ProductImage[] images = await GetAllImages(_id); - - items.Add(new Product() { - ID = _id, - Name = _name, - Images = images, - Description = _description, - Cost = _cost, - URL = _url - }); - } - } - } - return items.ToArray(); - } - - public async Task SetProduct(Product Item) { - using (MySqlConnection connection = GetConnection()) { - connection.Open(); - string command = @" - INSERT INTO Product - (ID,Name,Description,Cost,URL) - VALUES - (@ID,@Name,@Description,@Cost,@URL) - ON DUPLICATE KEY UPDATE - Name = @Name, - Description = @Description, - Cost = @Cost, - URL = @URL - WHERE ID = @ID; - - SELECT ID FROM Product - WHERE Name = @Name; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@ID", Item.ID); - cmd.Parameters.AddWithValue("@Name", Item.Name); - cmd.Parameters.AddWithValue("@Description", Item.Description); - cmd.Parameters.AddWithValue("@Cost", Item.Cost); - cmd.Parameters.AddWithValue("@URL", Item.URL); - - using (DbDataReader reader = await cmd.ExecuteReaderAsync()) { - while (await reader.ReadAsync()) { - if (reader == null) { - break; - } - Item.ID = reader.GetInt32("ID"); - } - } - - await AddAllImages(Item); - } - } - - public async Task DeleteProduct(int ID) { - using (MySqlConnection connection = GetConnection()) { - - await DeleteAllImages(ID); - - connection.Open(); - string command = @" - DELETE FROM Product - WHERE ID = @ID; - "; - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@ID", ID); - - await cmd.ExecuteNonQueryAsync(); - } - } - } -} diff --git a/src/Server/Services/DatabaseService/ProductImage.cs b/src/Server/Services/DatabaseService/ProductImage.cs deleted file mode 100644 index 04a97b2..0000000 --- a/src/Server/Services/DatabaseService/ProductImage.cs +++ /dev/null @@ -1,112 +0,0 @@ -using BoredCareers.Entities; -using MySql.Data.MySqlClient; -using System.Data; -using System.Data.Common; - -namespace BoredCareers.Services.DatabaseService { - public partial class DatabaseService { - - public async Task GetImage(int ProductID, int ImageID) { - ProductImage? item = null; - using (MySqlConnection connection = GetConnection()) { - connection.Open(); - string command = @" - SELECT * FROM ProductImage - WHERE ProductID = @ProductID AND ImageID = @ImageID; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@ProductID", ProductID); - cmd.Parameters.AddWithValue("@ImageID", ImageID); - - using (DbDataReader reader = await cmd.ExecuteReaderAsync()) { - while (await reader.ReadAsync()) { - if (reader == null) { - break; - } - int _ImageID = reader.GetInt32("ImageID"); - int _ProductID = reader.GetInt32("ProductID"); - byte[] _Image = (byte[])reader["Image"]; - string _Name = reader.GetString("Name"); - - item = new ProductImage() { - ImageID = _ImageID, - ProductID = _ProductID, - Image = _Image, - Name = _Name - }; - break; - } - } - } - return item; - } - - public async Task GetAllImages(int ProductID) { - List items = new List(); - using (MySqlConnection connection = GetConnection()) { - connection.Open(); - string command = @" - SELECT * FROM ProductImage - WHERE ProductID = @ProductID; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@ProductID", ProductID); - - using (DbDataReader reader = await cmd.ExecuteReaderAsync()) { - while (await reader.ReadAsync()) { - if (reader == null) { - break; - } - int _ImageID = reader.GetInt32("ImageID"); - int _ProductID = reader.GetInt32("ProductID"); - string _Name = reader.GetString("Name"); - - items.Add(new ProductImage() { - ImageID = _ImageID, - ProductID = _ProductID, - Name = _Name - }); - } - } - } - return items.ToArray(); - } - - public async Task AddAllImages(Product Item) { - using (MySqlConnection connection = GetConnection()) { - connection.Open(); - foreach (ProductImage cur in Item.Images) { - if (cur.Image != null) { - string command = @" - INSERT INTO ProductImage - (ProductID, Image, Name) - VALUES - (@ProductID, @Image, @Name); - "; - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@ProductID", Item.ID); - cmd.Parameters.AddWithValue("@Image", cur.Image ); - cmd.Parameters.AddWithValue("@Name", cur.Name ); - await cmd.ExecuteNonQueryAsync(); - } - } - } - } - - public async Task DeleteAllImages(int ItemID) { - using (MySqlConnection connection = GetConnection()) { - connection.Open(); - string command = @" - DELETE FROM ProductImage - WHERE ProductID = @ProductID; - "; - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@ProductID", ItemID); - - await cmd.ExecuteNonQueryAsync(); - } - } - } -} diff --git a/src/Server/Services/DatabaseService/ProductInventory.cs b/src/Server/Services/DatabaseService/ProductInventory.cs deleted file mode 100755 index eac699c..0000000 --- a/src/Server/Services/DatabaseService/ProductInventory.cs +++ /dev/null @@ -1,100 +0,0 @@ -using BoredCareers.Entities; -using MySql.Data.MySqlClient; -using System.Data; -using System.Data.Common; - -namespace BoredCareers.Services.DatabaseService { - public partial class DatabaseService { - - public async Task GetAllProductInventory( int accountID, int productID ) { - List list = new List(); - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = @" - SELECT * FROM ProductInventory - WHERE AccountID = @AccountID AND ProductID = @ProductID; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@AccountID", accountID); - cmd.Parameters.AddWithValue("@ProductID", productID); - - using( DbDataReader reader = await cmd.ExecuteReaderAsync() ) { - while( await reader.ReadAsync() ) { - if( reader == null ) { - break; - } - - string _Key = reader.GetString("Key"); - string _Value = reader.GetString("Value"); - - list.Add( new ProductInventory() { - AccountID = accountID, - ProductID = productID, - Key = _Key, - Value = _Value - } ); - } - } - } - return list.ToArray(); - } - - public async Task GetProductInventory( int accountID, int productID, string Key ) { - ProductInventory item = new ProductInventory(); - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = @" - SELECT * FROM ProductInventory - WHERE AccountID = @AccountID AND ProductID = @ProductID AND Key = @Key; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@AccountID", accountID); - cmd.Parameters.AddWithValue("@ProductID", productID); - cmd.Parameters.AddWithValue("@Key", Key); - - using (DbDataReader reader = await cmd.ExecuteReaderAsync()) { - while (await reader.ReadAsync()) { - if (reader == null) { - break; - } - - string _Key = reader.GetString("Key"); - string _Value = reader.GetString("Value"); - - item = new ProductInventory() { - AccountID = accountID, - ProductID = productID, - Key = _Key, - Value = _Value - }; - } - } - } - return item; - } - - async Task SetProductInventory(ProductInventory item) { - using (MySqlConnection connection = GetConnection()) { - string command = @" - INSERT INTO ProductInventory - (AccountID, ProductID, `Key`, `Value`) - Values - (@AccountID, @ProductID, @Key, @Value) - ON DUPLICATE KEY UPDATE - `Value` = @Value; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@AccountID", item.AccountID); - cmd.Parameters.AddWithValue("@ProductID", item.ProductID); - cmd.Parameters.AddWithValue("@Key", item.Key); - cmd.Parameters.AddWithValue("@Value", item.Value ?? (object)DBNull.Value); - - await cmd.ExecuteNonQueryAsync(); - } - } - - } -} \ No newline at end of file diff --git a/src/Server/Services/DatabaseService/Receipt.cs b/src/Server/Services/DatabaseService/Receipt.cs deleted file mode 100755 index ec4b2bf..0000000 --- a/src/Server/Services/DatabaseService/Receipt.cs +++ /dev/null @@ -1,171 +0,0 @@ -using BoredCareers.Entities; -using MySql.Data.MySqlClient; -using System.Data; -using System.Data.Common; - -namespace BoredCareers.Services.DatabaseService { - public partial class DatabaseService { - - public async Task GetAllReceipts( int accountID ) { - List receipts = new List (); - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = @" - SELECT * FROM Receipt - WHERE AccountID = @AccountID; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@AccountID", accountID); - - using( DbDataReader reader = await cmd.ExecuteReaderAsync() ) { - while( await reader.ReadAsync() ) { - if( reader == null ) { - break; - } - int _accountid = reader.GetInt32("AccountID"); - int _gameid = reader.GetInt32("ProductID"); - string _receiptid = reader.GetString("ReceiptID"); - int _lineitem = reader.GetInt32("LineItem"); - DateTime _receiptdate = reader.GetDateTime("Time"); - int _taxamount = reader.GetInt32("TaxAmount"); - int _totalcost = reader.GetInt32("TotalCost"); - - receipts.Add( new Receipt() { - AccountID = _accountid, - ProductID = _gameid, - ReceiptID = _receiptid, - Time = _receiptdate, - TotalCost = _totalcost, - TaxAmount = _taxamount, - LineItem = _lineitem - } ); - } - } - } - return receipts.ToArray(); - } - - public async Task<( Receipt, Product )[]> GetAllReceiptsJoinedToProduct( int accountID ) { - List<( Receipt, Product )> join = new(); - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = @" - SELECT * FROM Receipt - LEFT JOIN Product - ON Receipt.ProductID = Product.ID - WHERE AccountID = @AccountID - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@AccountID", accountID); - - using( DbDataReader reader = await cmd.ExecuteReaderAsync() ) { - while( await reader.ReadAsync() ) { - if( reader == null ) { - break; - } - int _accountid = !reader.IsDBNull( "AccountID" ) ? reader.GetInt32("AccountID") : -1; - int _gameid = !reader.IsDBNull( "ProductID" ) ? reader.GetInt32("ProductID") : 0; - string _receiptid = !reader.IsDBNull( "ReceiptID" ) ? reader.GetString("ReceiptID") : ""; - int _lineitem = !reader.IsDBNull( "LineItem" ) ? reader.GetInt32("LineItem") : 0; - DateTime _receiptdate = !reader.IsDBNull( "Time" ) ? reader.GetDateTime("Time") : DateTime.Now; - int _taxamount = !reader.IsDBNull( "TaxAmount" ) ? reader.GetInt32("TaxAmount") : 0; - int _totalcost = !reader.IsDBNull( "TotalCost" ) ? reader.GetInt32("TotalCost") : 0; - int _id = !reader.IsDBNull( "ID" ) ? reader.GetInt32("ID") : 0; - string _name = !reader.IsDBNull( "Name" ) ? reader.GetString("Name") : ""; - string _desc = !reader.IsDBNull( "Description" ) ? reader.GetString("Description") : ""; - int _cost = !reader.IsDBNull( "Cost" ) ? reader.GetInt32("Cost") : 0; - string _url = !reader.IsDBNull( "URL" ) ? reader.GetString("URL") : "Something Random That Wont Ever Be In A URL"; - - Receipt r = new() { - AccountID = _accountid, - ProductID = _gameid, - ReceiptID = _receiptid, - Time = _receiptdate, - TotalCost = _totalcost, - TaxAmount = _taxamount, - LineItem = _lineitem - }; - - Product p = new() { - ID = _id, - Cost = _cost, - Description = _desc, - Name = _name, - URL = _url - }; - - join.Add( (r, p) ); - } - } - } - return join.ToArray(); - } - - public async Task GetReceipt( int accountID, int gameID ) { - Receipt? receipt = null; - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = @" - SELECT * FROMReceipt - WHERE AccountID = @AccountID AND ProductID = @ProductID; - "; - - MySqlCommand cmd = new MySqlCommand(command, connection); - cmd.Parameters.AddWithValue("@AccountID", accountID); - cmd.Parameters.AddWithValue("@ProductID", gameID); - - using( DbDataReader reader = await cmd.ExecuteReaderAsync() ) { - while( await reader.ReadAsync() ) { - if( reader == null ) { - break; - } - int _accountid = reader.GetInt32("AccountID"); - int _gameid = reader.GetInt32("ProductID"); - string _receiptid = reader.GetString("ReceiptID"); - int _lineitem = reader.GetInt32("LineItem"); - DateTime _receiptdate = reader.GetDateTime("Time"); - int _taxamount = reader.GetInt32("TaxAmount"); - int _totalcost = reader.GetInt32("TotalCost"); - - receipt = new Receipt() { - AccountID = _accountid, - ProductID = _gameid, - ReceiptID = _receiptid, - Time = _receiptdate, - TotalCost = _totalcost, - TaxAmount = _taxamount, - LineItem = _lineitem - }; - } - } - } - return receipt; - } - - public async Task NewReceipt( Receipt receipt ) { - using( MySqlConnection connection = GetConnection() ) { - connection.Open(); - string command = @" - INSERT INTO Receipt - (AccountID, ProductID, ReceiptID, LineItem, TaxAmount, TotalCost, Time) - VALUES - (@AccountID, @ProductID, @ReceiptID, @LineItem, @TaxAmount, @TotalCost, @Time) - "; - - MySqlCommand cmd = new MySqlCommand( command , connection); - cmd.Parameters.AddWithValue("@AccountID", receipt.AccountID); - cmd.Parameters.AddWithValue("@ProductID", receipt.ProductID); - cmd.Parameters.AddWithValue("@ReceiptID", receipt.ReceiptID); - cmd.Parameters.AddWithValue("@LineItem", receipt.LineItem); - cmd.Parameters.AddWithValue("@TaxAmount", receipt.TaxAmount); - cmd.Parameters.AddWithValue("@TotalCost", receipt.TotalCost); - cmd.Parameters.AddWithValue("@Time", receipt.Time); // Just incase i need this in the future | receipt.Time.ToString( "yyyy-MM-dd hh:mm:ss" ) - - await cmd.ExecuteNonQueryAsync(); - } - } - - } -}