• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

karanshukla / openresto / 28881805559

07 Jul 2026 04:23PM UTC coverage: 94.253% (+0.07%) from 94.185%
28881805559

Pull #209

github

web-flow
Merge 55996179b into 108a871bd
Pull Request #209: Massive Refactor

4316 of 4939 branches covered (87.39%)

Branch coverage included in aggregate %.

1466 of 1601 new or added lines in 120 files covered. (91.57%)

65 existing lines in 27 files now uncovered.

13954 of 14445 relevant lines covered (96.6%)

83.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.95
/OpenRestoApi/Infrastructure/Persistence/Repositories/AdminPushSubscriptionRepository.cs
1
using CustomAccessibility.Attributes;
2
using Microsoft.EntityFrameworkCore;
3
using OpenRestoApi.Core.Application.Interfaces;
4
using OpenRestoApi.Core.Domain;
5

6
namespace OpenRestoApi.Infrastructure.Persistence.Repositories;
7

8
[OnlyAccessibleBy("OpenRestoApi.Extensions.ServiceCollectionExtensions")]
9
[OnlyAccessibleBy("OpenRestoApi.Tests.Services.NotificationServiceTests")]
10
[OnlyAccessibleBy("OpenRestoApi.Tests.Services.BookingNotificationServiceTests")]
11
[ExternalAccessAllowed]
12
internal class AdminPushSubscriptionRepository(AppDbContext db) : IAdminPushSubscriptionRepository
66✔
13
{
14
    private readonly AppDbContext _db = db;
66✔
15

16
    public async Task<AdminPushSubscription?> GetByEndpointAndRestaurantAsync(string endpoint, int restaurantId)
17
    {
18
        return await _db.AdminPushSubscriptions
4✔
19
            .FirstOrDefaultAsync(s => s.Endpoint == endpoint && s.RestaurantId == restaurantId);
4✔
20
    }
4✔
21

22
    public async Task<List<AdminPushSubscription>> GetByRestaurantAsync(int restaurantId)
23
    {
NEW
24
        return await _db.AdminPushSubscriptions
×
NEW
25
            .Where(s => s.RestaurantId == restaurantId)
×
NEW
26
            .ToListAsync();
×
NEW
27
    }
×
28

29
    public async Task<List<AdminPushSubscription>> GetByEndpointAsync(string endpoint)
30
    {
31
        return await _db.AdminPushSubscriptions
4✔
32
            .Where(s => s.Endpoint == endpoint)
4✔
33
            .ToListAsync();
4✔
34
    }
4✔
35

36
    public async Task<AdminPushSubscription> AddAsync(AdminPushSubscription subscription)
37
    {
38
        _db.AdminPushSubscriptions.Add(subscription);
2✔
39
        await _db.SaveChangesAsync();
2✔
40
        return subscription;
2✔
41
    }
2✔
42

43
    public void RemoveRange(IEnumerable<AdminPushSubscription> subscriptions)
44
    {
45
        _db.AdminPushSubscriptions.RemoveRange(subscriptions);
2✔
46
    }
2✔
47

48
    public async Task SaveChangesAsync()
49
    {
50
        await _db.SaveChangesAsync();
4✔
51
    }
4✔
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc