Skip to content

Commit

Permalink
chore: add BsonId annotation and LiteDB reference to Entities
Browse files Browse the repository at this point in the history
Signed-off-by: Russell Camo <[email protected]>
  • Loading branch information
russkyc committed Aug 29, 2023
1 parent 4bc3914 commit 99319ae
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 65 deletions.
2 changes: 2 additions & 0 deletions GroomWise.Domain/Entities/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

using GroomWise.Domain.Entities;
using GroomWise.Domain.Interfaces;
using LiteDB;
using Role = GroomWise.Domain.Enums.Role;

public class Account : IEntity
{
[BsonId]
public Guid Id { get; set; }
public string? Username { get; set; }
public string? Password { get; set; }
Expand Down
1 change: 1 addition & 0 deletions GroomWise.Domain/Entities/Appointment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace GroomWise.Domain.Entities;

public class Appointment : IEntity
{
[BsonId]
public Guid Id { get; set; }
public DateTime? Date { get; set; }
public AppointmentStatus? Status { get; set; }
Expand Down
1 change: 1 addition & 0 deletions GroomWise.Domain/Entities/Customer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace GroomWise.Domain.Entities;

public class Customer : IEntity
{
[BsonId]
public Guid Id { get; set; }
public string? FullName { get; set; }
public string? Address { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion GroomWise.Domain/Entities/Employee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace GroomWise.Domain.Entities;

public record Employee : IEntity
{
[BsonId]
public Guid Id { get; set; }

public string? Prefix { get; set; }
public string? FullName { get; set; }
public string? Suffix { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions GroomWise.Domain/Entities/GroomingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
// without written, signed consent from the author is strictly prohibited.

using GroomWise.Domain.Interfaces;
using LiteDB;

namespace GroomWise.Domain.Entities;

public class GroomingService : IEntity
{
[BsonId]
public Guid Id { get; set; }
public string? Type { get; set; }
public TimeSpan? TimeSpan { get; set; }
Expand Down
1 change: 1 addition & 0 deletions GroomWise.Domain/Entities/Pet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace GroomWise.Domain.Entities;

public class Pet : IEntity
{
[BsonId]
public Guid Id { get; set; }
public string? Name { get; set; }
public int? Age { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions GroomWise.Domain/Entities/Product.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
// without written, signed consent from the author is strictly prohibited.

using GroomWise.Domain.Interfaces;
using LiteDB;

namespace GroomWise.Domain.Entities;

public class Product : IEntity
{
[BsonId]
public Guid Id { get; set; }
public string? ProductName { get; set; }
public string? ProductDescription { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions GroomWise.Domain/Entities/Role.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
// without written, signed consent from the author is strictly prohibited.

using GroomWise.Domain.Interfaces;
using LiteDB;

namespace GroomWise.Domain.Entities;

public class Role : IEntity
{
[BsonId]
public Guid Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions GroomWise.Infrastructure/Database/DbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// Unauthorized copying or redistribution of all files, in source and binary forms via any medium
// without written, signed consent from the author is strictly prohibited.

using GroomWise.Domain.Entities;
using GroomWise.Infrastructure.Database.Interfaces;
using LiteDB;

namespace GroomWise.Infrastructure.Database;

Expand Down
2 changes: 0 additions & 2 deletions GroomWise.Infrastructure/Database/GroomWiseDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

using GroomWise.Domain.Entities;
using Injectio.Attributes;
using Russkyc.DependencyInjection.Attributes;
using Russkyc.DependencyInjection.Enums;

namespace GroomWise.Infrastructure.Database;

Expand Down
35 changes: 15 additions & 20 deletions GroomWise.WPF/Views/Pages/CustomersView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,19 @@
Style="{StaticResource FadeInFromBottomAnimation}"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="20,20,0,20">
<Grid VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
Margin="0,0,0,12"
FontSize="16"
Text="Customer Profile" />
<templates:CustomerInfoCardTemplate Grid.Row="1" />
</Grid>
</Grid>
<Grid Grid.Column="1" Margin="16,20,16,16">
<Grid Margin="16,20,16,16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="0,0,0,12"
HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -72,7 +60,14 @@
IconSize="18"
LeftIcon="{icons:MaterialIconExt Kind=AddBold}" />
</Grid>
<ItemsControl Grid.Row="1" ItemsSource="{Binding Customers.EditableCollectionView, UpdateSourceTrigger=PropertyChanged}">
<templates:CustomerInfoCardTemplate
Grid.Row="1"
Grid.Column="0"
Margin="0,0,16,0" />
<ItemsControl
Grid.Row="1"
Grid.Column="1"
ItemsSource="{Binding Customers.EditableCollectionView, UpdateSourceTrigger=PropertyChanged}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<templates:CustomerListCardTemplate />
Expand Down
28 changes: 15 additions & 13 deletions GroomWise.WPF/Views/Pages/InventoryView.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<UserControl x:Class="GroomWise.Views.Pages.InventoryView"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="https://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
HorizontalAlignment="Stretch"
d:DesignHeight="300"
d:DesignWidth="300"
Style="{StaticResource FadeInFromBottomAnimation}"
mc:Ignorable="d">
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="Inventory" />
<UserControl
x:Class="GroomWise.Views.Pages.InventoryView"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="https://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
HorizontalAlignment="Stretch"
d:DesignHeight="720"
d:DesignWidth="1280"
Style="{StaticResource FadeInFromBottomAnimation}"
mc:Ignorable="d">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="Inventory" />
</UserControl>
28 changes: 15 additions & 13 deletions GroomWise.WPF/Views/Pages/PetsView.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<UserControl x:Class="GroomWise.Views.Pages.PetsView"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="https://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
HorizontalAlignment="Stretch"
d:DesignHeight="300"
d:DesignWidth="300"
Style="{StaticResource FadeInFromBottomAnimation}"
mc:Ignorable="d">
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="Pets" />
<UserControl
x:Class="GroomWise.Views.Pages.PetsView"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="https://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
HorizontalAlignment="Stretch"
d:DesignHeight="720"
d:DesignWidth="1280"
Style="{StaticResource FadeInFromBottomAnimation}"
mc:Ignorable="d">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="Pets" />
</UserControl>
28 changes: 15 additions & 13 deletions GroomWise.WPF/Views/Pages/ReportsView.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<UserControl x:Class="GroomWise.Views.Pages.ReportsView"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="https://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
HorizontalAlignment="Stretch"
d:DesignHeight="300"
d:DesignWidth="300"
Style="{StaticResource FadeInFromBottomAnimation}"
mc:Ignorable="d">
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="Reports" />
<UserControl
x:Class="GroomWise.Views.Pages.ReportsView"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="https://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
HorizontalAlignment="Stretch"
d:DesignHeight="720"
d:DesignWidth="1280"
Style="{StaticResource FadeInFromBottomAnimation}"
mc:Ignorable="d">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="Reports" />
</UserControl>
5 changes: 2 additions & 3 deletions GroomWise.WPF/Views/Templates/CustomerInfoCardTemplate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:observables="clr-namespace:GroomWise.Application.Observables;assembly=GroomWise.Application"
xmlns:pages="clr-namespace:GroomWise.Views.Pages"
MinHeight="600"
MinHeight="300"
d:DataContext="{d:DesignInstance observables:ObservableCustomer,
IsDesignTimeCreatable=True}"
d:DesignHeight="600"
d:DesignWidth="300"
DataContext="{Binding DataContext.CustomerInfo, RelativeSource={RelativeSource FindAncestor, AncestorType=pages:CustomersView}}"
mc:Ignorable="d">
<Grid Height="600" VerticalAlignment="Top">
<Grid VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
Expand Down

0 comments on commit 99319ae

Please sign in to comment.