Wrap long method signatures and remove unused using to comply with 220-char line limit
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
using MicCheck.Api.Audit;
|
using MicCheck.Api.Audit;
|
||||||
using MicCheck.Api.Data;
|
using MicCheck.Api.Data;
|
||||||
using MicCheck.Api.Users;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace MicCheck.Api.Organizations;
|
namespace MicCheck.Api.Organizations;
|
||||||
@@ -151,8 +150,7 @@ public class OrganizationService(MicCheckDbContext db, AuditService auditService
|
|||||||
public async Task<Organization?> FindByInviteTokenAsync(string token, CancellationToken ct = default) =>
|
public async Task<Organization?> FindByInviteTokenAsync(string token, CancellationToken ct = default) =>
|
||||||
await db.Organizations.FirstOrDefaultAsync(o => o.InviteToken == token, ct);
|
await db.Organizations.FirstOrDefaultAsync(o => o.InviteToken == token, ct);
|
||||||
|
|
||||||
public async Task<IReadOnlyList<InviteByEmailResult>> InviteUsersByEmailAsync(
|
public async Task<IReadOnlyList<InviteByEmailResult>> InviteUsersByEmailAsync(int organizationId, IReadOnlyList<InviteByEmailEntry> invites, CancellationToken ct = default)
|
||||||
int organizationId, IReadOnlyList<InviteByEmailEntry> invites, CancellationToken ct = default)
|
|
||||||
{
|
{
|
||||||
var results = new List<InviteByEmailResult>();
|
var results = new List<InviteByEmailResult>();
|
||||||
|
|
||||||
|
|||||||
@@ -5,15 +5,9 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace MicCheck.Api.Segments;
|
namespace MicCheck.Api.Segments;
|
||||||
|
|
||||||
public record SegmentConditionDefinition(
|
public record SegmentConditionDefinition(string Property, SegmentConditionOperator Operator, string Value);
|
||||||
string Property,
|
|
||||||
SegmentConditionOperator Operator,
|
|
||||||
string Value);
|
|
||||||
|
|
||||||
public record SegmentRuleDefinition(
|
public record SegmentRuleDefinition(SegmentRuleType Type, IReadOnlyList<SegmentConditionDefinition> Conditions, IReadOnlyList<SegmentRuleDefinition>? ChildRules = null);
|
||||||
SegmentRuleType Type,
|
|
||||||
IReadOnlyList<SegmentConditionDefinition> Conditions,
|
|
||||||
IReadOnlyList<SegmentRuleDefinition>? ChildRules = null);
|
|
||||||
|
|
||||||
public class SegmentService(MicCheckDbContext db, AuditService auditService)
|
public class SegmentService(MicCheckDbContext db, AuditService auditService)
|
||||||
{
|
{
|
||||||
@@ -37,11 +31,7 @@ public class SegmentService(MicCheckDbContext db, AuditService auditService)
|
|||||||
.FirstOrDefaultAsync(s => s.Id == id, ct);
|
.FirstOrDefaultAsync(s => s.Id == id, ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Segment> CreateAsync(
|
public async Task<Segment> CreateAsync(int projectId, string name, IReadOnlyList<SegmentRuleDefinition> rules, CancellationToken ct = default)
|
||||||
int projectId,
|
|
||||||
string name,
|
|
||||||
IReadOnlyList<SegmentRuleDefinition> rules,
|
|
||||||
CancellationToken ct = default)
|
|
||||||
{
|
{
|
||||||
var count = await db.Segments.CountAsync(s => s.ProjectId == projectId, ct);
|
var count = await db.Segments.CountAsync(s => s.ProjectId == projectId, ct);
|
||||||
if (count >= MaxSegmentsPerProject)
|
if (count >= MaxSegmentsPerProject)
|
||||||
@@ -75,11 +65,7 @@ public class SegmentService(MicCheckDbContext db, AuditService auditService)
|
|||||||
return segment;
|
return segment;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Segment> UpdateAsync(
|
public async Task<Segment> UpdateAsync(int id, string name, IReadOnlyList<SegmentRuleDefinition> rules, CancellationToken ct = default)
|
||||||
int id,
|
|
||||||
string name,
|
|
||||||
IReadOnlyList<SegmentRuleDefinition> rules,
|
|
||||||
CancellationToken ct = default)
|
|
||||||
{
|
{
|
||||||
var segment = await db.Segments
|
var segment = await db.Segments
|
||||||
.Include(s => s.Rules)
|
.Include(s => s.Rules)
|
||||||
|
|||||||
Reference in New Issue
Block a user