Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TicketDiscussion #4

Merged
merged 10 commits into from
Nov 28, 2023
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.3</Version>
<Version>0.0.0.5</Version>
<Description>client generated code.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>microservice,Support,Supports,client</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
public class SupportContext : RelationalCoreContext
{
IEntityFrameworkCoreDatabaseBuilder _builder;

Check warning on line 10 in src/CSharp/EasyMicroservices.SupportsMicroservice.Database/Database/Contexts/SupportContext.cs

View workflow job for this annotation

GitHub Actions / os-tests

Field 'SupportContext._builder' is never assigned to, and will always have its default value null

Check warning on line 10 in src/CSharp/EasyMicroservices.SupportsMicroservice.Database/Database/Contexts/SupportContext.cs

View workflow job for this annotation

GitHub Actions / os-tests

Field 'SupportContext._builder' is never assigned to, and will always have its default value null

Check warning on line 10 in src/CSharp/EasyMicroservices.SupportsMicroservice.Database/Database/Contexts/SupportContext.cs

View workflow job for this annotation

GitHub Actions / os-tests

Field 'SupportContext._builder' is never assigned to, and will always have its default value null

Check warning on line 10 in src/CSharp/EasyMicroservices.SupportsMicroservice.Database/Database/Contexts/SupportContext.cs

View workflow job for this annotation

GitHub Actions / os-tests

Field 'SupportContext._builder' is never assigned to, and will always have its default value null

Check warning on line 10 in src/CSharp/EasyMicroservices.SupportsMicroservice.Database/Database/Contexts/SupportContext.cs

View workflow job for this annotation

GitHub Actions / os-tests

Field 'SupportContext._builder' is never assigned to, and will always have its default value null

Check warning on line 10 in src/CSharp/EasyMicroservices.SupportsMicroservice.Database/Database/Contexts/SupportContext.cs

View workflow job for this annotation

GitHub Actions / os-tests

Field 'SupportContext._builder' is never assigned to, and will always have its default value null
public SupportContext(IEntityFrameworkCoreDatabaseBuilder builder) : base(builder)
{
}
Expand All @@ -18,6 +18,8 @@
public DbSet<TicketEntity> Tickets { get; set; }
public DbSet<TicketHistoryEntity> TicketHistories { get; set; }
public DbSet<TicketSupportTimeHistoryEntity> TicketSupportTimeHistories { get; set; }
public DbSet<TicketDiscussionEntity> TicketDiscussions { get; set; }


protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
Expand All @@ -38,7 +40,7 @@
{
model.HasKey(x => x.Id);

model.HasOne(x => x.TicketEntity)
model.HasOne(x => x.Ticket)
.WithMany(x => x.TicketHistories)
.HasForeignKey(x => x.TicketId);
});
Expand All @@ -50,23 +52,40 @@
{
model.HasKey(x => x.Id);

modelBuilder.Entity<TicketDepartmentEntity>()
.HasOne(bc => bc.Ticket)
model.HasOne(bc => bc.Ticket)
.WithMany(b => b.TicketDepartments)
.HasForeignKey(bc => bc.TicketId);

modelBuilder.Entity<TicketDepartmentEntity>()
.HasOne(bc => bc.Department)
model.HasOne(bc => bc.Department)
.WithMany(b => b.TicketDepartments)
.HasForeignKey(bc => bc.DepartmentId);


});
modelBuilder.Entity<TicketSupportTimeHistoryEntity>(model =>
{
model.HasKey(x => x.Id);

model.HasOne(bc => bc.Ticket)
.WithMany(b => b.TicketSupportTimeHistories)
.HasForeignKey(bc => bc.TicketId);
});
modelBuilder.Entity<TicketAssignEntity>(model =>
{
model.HasKey(x => x.Id);

model.HasOne(bc => bc.Ticket)
.WithMany(b => b.TicketAssigns)
.HasForeignKey(bc => bc.TicketId);

});
modelBuilder.Entity<TicketDiscussionEntity>(model =>
{
model.HasKey(x => x.Id);

model.HasOne(bc => bc.Ticket)
.WithMany(b => b.TicketDiscussions)
.HasForeignKey(bc => bc.TicketId);
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ public class TicketAssignEntity : TicketAssignSchema, IIdSchema<long>
{
public long Id { get; set; }
public long TicketId { get; set; }
public TicketEntity Ticket { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using EasyMicroservices.Cores.Interfaces;
using EasyMicroservices.SupportsMicroservice.Database.Schemas;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyMicroservices.SupportsMicroservice.Database.Entities
{
public class TicketDiscussionEntity : TicketDiscussionSchema , IIdSchema<long>
{
public long Id { get; set; }
public long TicketId { get; set; }
public TicketEntity Ticket { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@ public class TicketEntity : TicketSchema, IIdSchema<long>
public long Id { get; set; }
public ICollection<TicketHistoryEntity> TicketHistories { get; set; }
public ICollection<TicketDepartmentEntity> TicketDepartments { get; set; }
public ICollection<TicketDiscussionEntity> TicketDiscussions { get; set; }
public ICollection<TicketAssignEntity> TicketAssigns { get; set; }
public ICollection<TicketSupportTimeHistoryEntity> TicketSupportTimeHistories { get; set; }



}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class TicketHistoryEntity : TicketHistorySchema , IIdSchema<long>
{
public long Id { get; set; }
public long TicketId { get; set; }
public TicketEntity TicketEntity { get; set; }
public TicketEntity Ticket { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace EasyMicroservices.SupportsMicroservice.Database.Entities
{
public class TicketSupportTimeHistoryEntity : TicketSupportTimeHistorySchema , IIdSchema<long>
{
public long TicketId { get; set; }
public long Id { get; set; }
public long TicketId { get; set; }
public TicketEntity Ticket { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using EasyMicroservices.Cores.Database.Schemas;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyMicroservices.SupportsMicroservice.Database.Schemas
{
public class TicketDiscussionSchema : FullAbilitySchema
{
public string Content { get; set; }

}
}
Loading
Loading