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

feat: add notification project/framework for notification work #103

Merged
merged 2 commits into from
Dec 13, 2024
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
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
- Profile/ProfileTests
- WhatsNew/WhatsNewTests
- Theme/ThemeTests
- Notifications/NotificationsTests
- vendor
- Core/Core/SwiftGen
- Authorization/Authorization/SwiftGen
Expand All @@ -35,6 +36,7 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
- Profile/Profile/SwiftGen
- WhatsNew/WhatsNew/SwiftGen
- Theme/Theme/SwiftGen
- Notifications/Notifications/SwiftGen
# - Source/ExcludedFile.swift
# - Source/*/ExcludedFile.swift # Exclude files with a wildcard
#analyzer_rules: # Rules run by `swiftlint analyze` (experimental)
Expand Down
82 changes: 82 additions & 0 deletions Notifications/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/*
/Notifications.xcodeproj/xcuserdata/
/Notifications.xcworkspace/xcuserdata/

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## R.swift
R.generated.swift

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

.DS_Store
.idea
xcode-frameworks
17 changes: 17 additions & 0 deletions Notifications/Mockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sourceryCommand: mint run krzysztofzablocki/[email protected] sourcery
sourceryTemplate: ../MockTemplate.swifttemplate
unit.tests.mock:
sources:
include:
- ./../Core
- ./Notifications
exclude: []
output: ./NotificationsTests/NotificationsMock.generated.swift
targets:
- MyAppUnitTests
import:
- Core
- Notifications
- Foundation
- SwiftUI
- Combine

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,466 changes: 1,466 additions & 0 deletions Notifications/Notifications.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// NotificationsEndpoint.swift
// Notifications
//
// Created by Saeed Bashir on 11.12.2024.
//

import Foundation
import Core
import Alamofire

enum NotificationsEndpoint: EndPointType {
var path: String {
return ""
}

var httpMethod: HTTPMethod {
return .get
}

var headers: HTTPHeaders? {
nil
}

var task: HTTPTask {
let params: [String: Encodable] = [:]
return .requestParameters(parameters: params, encoding: URLEncoding.queryString)
}
}
40 changes: 40 additions & 0 deletions Notifications/Notifications/Data/NotificationsRepository.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// NotificationsRepository.swift
// Notifications
//
// Created by Saeed Bashir on 11.12.2024.
//

import Foundation
import Core
import CoreData
import Alamofire

public protocol NotificationsRepositoryProtocol {

}

public class NotificationsRepository: NotificationsRepositoryProtocol {

private let api: API
private let coreStorage: CoreStorage
private let config: ConfigProtocol
private let persistence: NotificationsPersistenceProtocol

public init(api: API,
appStorage: CoreStorage,
config: ConfigProtocol,
persistence: NotificationsPersistenceProtocol) {
self.api = api
self.coreStorage = appStorage
self.config = config
self.persistence = persistence
}
}

// Mark - For testing and SwiftUI preview
#if DEBUG
class NotificationsRepositoryMock: NotificationsRepositoryProtocol {

}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// NotificationsPersistence.swift
// Notifications
//
// Created by Saeed Bashir on 11.12.2024.
//

import CoreData
import Core

public protocol NotificationsPersistenceProtocol {

}

public final class NotificationsBundle {
private init() {}
}
30 changes: 30 additions & 0 deletions Notifications/Notifications/Domain/NotificationsInteractor.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// NotificationsInteractor.swift
// Notifications
//
// Created by Saeed Bashir on 11.12.2024.
//

import Foundation
import Core

//sourcery: AutoMockable
public protocol NotificationsInteractorProtocol {

}

public class NotificationsInteractor: NotificationsInteractorProtocol {

private let repository: NotificationsRepositoryProtocol

public init(repository: NotificationsRepositoryProtocol) {
self.repository = repository
}
}

// Mark - For testing and SwiftUI preview
//#if DEBUG
//public extension NotificationsInteractor {
// static let mock = NotificationsInteractor(repository: NotificationsRepositoryMock())
//}
//#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// NotificationsAnalytics.swift
// Notifications
//
// Created by Saeed Bashir on 11.12.2024.
//

import Foundation
import Core

//sourcery: AutoMockable
public protocol NotificationsAnalytics {
func NotificationsScreenEvent(event: AnalyticsEvent, biValue: EventBIValue)
}

#if DEBUG
class NotificationsAnalyticsMock: NotificationsAnalytics {
public func NotificationsScreenEvent(event: AnalyticsEvent, biValue: EventBIValue) {}
}
#endif
21 changes: 21 additions & 0 deletions Notifications/Notifications/Presentation/NotificationsRouter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// NotificationsRouter.swift
// Notifications
//
// Created by Saeed Bashir on 11.12.2024.
//

import Foundation
import Core

public protocol NotificationsRouter: BaseRouter {

}

// Mark - For testing and SwiftUI preview
#if DEBUG
public class NotificationsRouterMock: BaseRouterMock, NotificationsRouter {

public override init() {}
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// NotificationsSettingsView.swift
// Notifications
//
// Created by Saeed Bashir on 12/11/24.
//

import SwiftUI
import Theme

public struct NotificationsSettingsView: View {
public var body: some View {
GeometryReader { proxy in
ZStack(alignment: .top) {
VStack(alignment: .center) {
Text("Notificaion settings view")
}
.hideNavigationBar(true)
.navigationBarBackButtonHidden(true)
.navigationTitle(NotificationsLocalization.Notifications.Settings.title)
}

}
.background(
Theme.Colors.background
.ignoresSafeArea()
)
.ignoresSafeArea(.all, edges: .horizontal)
}
}
Loading
Loading