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

Redesign screens and fixes #72

Merged
merged 56 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6e21b98
Temp commit
cp-nirali-s Oct 8, 2024
18ae64b
Minor changes
cp-nirali-s Oct 10, 2024
a0d459f
Merge branch 'main'
cp-nirali-s Oct 10, 2024
fc4dfae
Added add expense cloud function
cp-nirali-s Oct 10, 2024
f940ef1
Added update expense notification cloud function
cp-nirali-s Oct 10, 2024
e6604c0
Minor changes
cp-nirali-s Oct 10, 2024
054cf9b
Added delete expense notification cloud function
cp-nirali-s Oct 10, 2024
3bce850
Refactored expense cloud functions
cp-nirali-s Oct 11, 2024
0c312f0
Added add/update/delete transaction cloud function
cp-nirali-s Oct 11, 2024
cbe9225
Added delete group/remove member cloud function
cp-nirali-s Oct 11, 2024
87615b5
Added update group cloud function
cp-nirali-s Oct 11, 2024
da52375
Added updatedBy in groups/expenses/transactions &update it
cp-nirali-s Oct 14, 2024
37c6c92
Merge branch 'main'
cp-nirali-s Oct 25, 2024
5217056
Refactored code
cp-nirali-s Oct 25, 2024
5de7d83
Managed notification tap
cp-nirali-s Oct 25, 2024
90c95de
Refactored code
cp-nirali-s Oct 25, 2024
9642e87
Refactored code
cp-nirali-s Oct 25, 2024
ea7aeee
Managed notification with activity collection
cp-nirali-s Oct 28, 2024
235a99b
Managed notification not shown when app killed
cp-nirali-s Oct 28, 2024
8b9f191
Seperated cloud functions file
cp-nirali-s Oct 29, 2024
76bca12
Seperated function
cp-nirali-s Oct 29, 2024
898b690
Fixed scroll
cp-nirali-s Oct 29, 2024
8ab58b9
Refactored code
cp-nirali-s Oct 29, 2024
5b0391d
Refactored code
cp-nirali-s Oct 29, 2024
8f27974
Refactored code
cp-nirali-s Oct 29, 2024
8f5e897
Refactored code
cp-nirali-s Nov 15, 2024
d0b39dc
Merge branch 'main'
cp-nirali-s Nov 15, 2024
f464766
Refactored code
cp-nirali-s Nov 15, 2024
3f6788f
Fixed pipeline
cp-nirali-s Nov 15, 2024
35bf717
Refactored code
cp-nirali-s Nov 18, 2024
259da47
Manage real time log update
cp-nirali-s Nov 18, 2024
6422e31
Temp commit
cp-nirali-s Nov 18, 2024
dfcbcd6
Redesign add expense & fixed date sheet issue
cp-nirali-s Nov 18, 2024
dac6916
Redesign payment detail, add payment screen & refactored code
cp-nirali-s Nov 18, 2024
6fc0b85
localized strings
cp-nirali-s Nov 18, 2024
459adaa
Fix: not update group memberOweAmount & balance after adding expense …
cp-nirali-s Nov 18, 2024
d5436ef
Fix pull to refresh not smooth & added scrollToTop btn
cp-nirali-s Nov 19, 2024
b92513a
Implement push notifications for each activity
cp-amisha-i Nov 19, 2024
2b75828
Fix code signin
cp-amisha-i Nov 19, 2024
7befdbe
Added rupees symbol before amount
cp-nirali-s Nov 19, 2024
520be1d
Merge remote-tracking branch 'refs/remotes/origin/implement-push-noti…
cp-nirali-s Nov 19, 2024
1b9ceed
Merge branch 'implement-push-notifications-for-each-activity'
cp-nirali-s Nov 19, 2024
3f73b0c
Added rupees symbol before amount
cp-nirali-s Nov 19, 2024
be013d1
Merge remote-tracking branch 'refs/remotes/origin/some-fixes-and-rede…
cp-nirali-s Nov 19, 2024
634d56d
Fix: alert btn color & image picker menu text colour
cp-nirali-s Nov 19, 2024
15ab240
Refactored code
cp-nirali-s Nov 19, 2024
8839216
Fix getting toast and alert both in record a payment
cp-nirali-s Nov 19, 2024
464b387
Minor improvement
cp-nirali-s Nov 19, 2024
1bb85c9
Add parallel api call & bottom card amount sign changes in split opti…
cp-nirali-s Nov 20, 2024
c46ffe1
Minor improvement
cp-nirali-s Nov 20, 2024
b723cf6
Minor improvement
cp-nirali-s Nov 20, 2024
5f9b58e
Minor improvement
cp-nirali-s Nov 20, 2024
ecbbb7e
Updated cocoapods version
cp-nirali-s Nov 20, 2024
7bb7ea2
Fix ui
cp-nirali-s Nov 20, 2024
6e9cbe8
Update podfile.lock
cp-nirali-s Nov 20, 2024
96ab002
Changed method name
cp-nirali-s Nov 20, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

This file was deleted.

15 changes: 13 additions & 2 deletions Data/Data/Extension/Double+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@
import Foundation

public extension Double {
var formattedCurrency: String {
func formattedCurrency(removeMinusSign: Bool = true) -> String {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
formatter.locale = Locale.current

if let formattedAmount = formatter.string(from: NSNumber(value: self)) {
return formattedAmount.hasPrefix("-") ? String(formattedAmount.dropFirst()) : formattedAmount
if removeMinusSign && formattedAmount.hasPrefix("-") {
return String(formattedAmount.dropFirst())
}
return formattedAmount
} else {
return String(format: "%.2f", self.rounded()) // Fallback to a basic decimal format
}
}

var formattedCurrency: String {
return formattedCurrency(removeMinusSign: true)
}

var formattedCurrencyWithSign: String {
return formattedCurrency(removeMinusSign: false)
}
}
4 changes: 3 additions & 1 deletion Data/Data/Repository/ExpenseRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ public class ExpenseRepository: ObservableObject {
}

public func deleteExpense(group: Groups, expense: Expense) async throws {
guard let userId = preference.user?.id else { return }

var updatedExpense = expense
updatedExpense.isActive = false // Make expense inactive
updatedExpense.updatedBy = preference.user?.id ?? ""
updatedExpense.updatedBy = userId
try await updateExpense(group: group, expense: updatedExpense, oldExpense: expense, type: .expenseDeleted)
}

Expand Down
34 changes: 28 additions & 6 deletions Data/Data/Repository/GroupRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class GroupRepository: ObservableObject {
@Inject private var activityLogRepository: ActivityLogRepository

private var olderGroupName: String = ""
private var groupMembers: [AppUser] = []

public func createGroup(group: Groups, imageData: Data?) async throws -> Groups {
let groupId = try await store.createGroup(group: group)
Expand Down Expand Up @@ -187,15 +188,32 @@ public class GroupRepository: ObservableObject {
}

public func fetchMemberBy(userId: String) async throws -> AppUser? {
try await userRepository.fetchUserBy(userID: userId)
if let existingMember = groupMembers.first(where: { $0.id == userId }) {
return existingMember // Return the available member from groupMembers
} else {
let member = try await userRepository.fetchUserBy(userID: userId)
if let member {
self.groupMembers.append(member)
}
return member
}
}

public func fetchMembersBy(groupId: String) async throws -> [AppUser] {
guard let group = try await fetchGroupBy(id: groupId) else { return [] }
public func fetchMembersBy(memberIds: [String]) async throws -> [AppUser] {
var members: [AppUser] = []

return try await withThrowingTaskGroup(of: AppUser?.self) { groupTask in
for memberId in group.members {
// Filter out memberIds that already exist in groupMembers to minimize API calls
let missingMemberIds = memberIds.filter { memberId in
let cachedMember = self.groupMembers.first { $0.id == memberId }
return cachedMember == nil
}

if missingMemberIds.isEmpty {
return self.groupMembers.filter { memberIds.contains($0.id) }
}

try await withThrowingTaskGroup(of: AppUser?.self) { groupTask in
for memberId in missingMemberIds {
groupTask.addTask {
try await self.fetchMemberBy(userId: memberId)
}
Expand All @@ -204,9 +222,13 @@ public class GroupRepository: ObservableObject {
for try await member in groupTask {
if let member {
members.append(member)
if !groupMembers.contains(where: { $0.id == member.id }) {
self.groupMembers.append(member)
}
}
}
return members
}

return members
}
}
11 changes: 9 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,10 @@ PODS:
- AppAuth/Core (1.7.5)
- AppAuth/ExternalUserAgent (1.7.5):
- AppAuth/Core
- AppCheckCore (11.0.0):
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- PromisesObjC (~> 2.4)
- BoringSSL-GRPC (0.0.36):
- BoringSSL-GRPC/Implementation (= 0.0.36)
- BoringSSL-GRPC/Interface (= 0.0.36)
Expand Down Expand Up @@ -1229,8 +1233,9 @@ PODS:
- GoogleDataTransport (10.1.0):
- nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.4)
- GoogleSignIn (7.1.0):
- GoogleSignIn (8.0.0):
- AppAuth (< 2.0, >= 1.7.3)
- AppCheckCore (~> 11.0)
- GTMAppAuth (< 5.0, >= 4.1.1)
- GTMSessionFetcher/Core (~> 3.3)
- GoogleUtilities/AppDelegateSwizzler (8.0.2):
Expand Down Expand Up @@ -1380,6 +1385,7 @@ SPEC REPOS:
trunk:
- abseil
- AppAuth
- AppCheckCore
- BoringSSL-GRPC
- CocoaLumberjack
- Firebase
Expand Down Expand Up @@ -1414,6 +1420,7 @@ SPEC REPOS:
SPEC CHECKSUMS:
abseil: d121da9ef7e2ff4cab7666e76c5a3e0915ae08c3
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
AppCheckCore: e25aaaac234b333320b0bebb8fc21ed3576819ba
BoringSSL-GRPC: ca6a8e5d04812fce8ffd6437810c2d46f925eaeb
CocoaLumberjack: 6a459bc897d6d80bd1b8c78482ec7ad05dffc3f0
Firebase: 9f574c08c2396885b5e7e100ed4293d956218af9
Expand All @@ -1430,7 +1437,7 @@ SPEC CHECKSUMS:
FirebaseSharedSwift: 9d0e7130af2f0cf162ecd136971f9661f2a3f769
FirebaseStorage: f9e2bf027d549db18b6195a37b31c85f56e40200
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db
GoogleSignIn: ce8c89bb9b37fb624b92e7514cc67335d1e277e4
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
"gRPC-C++": 049b3605db691c85d65fbde5b0750b5f54ce9b26
gRPC-Core: d1716d28c3f432b4543bce193e3d7178d59341ef
Expand Down
1 change: 0 additions & 1 deletion Splito.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.canopas.splito;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "provision-splito-distribution-2024-03-04";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
4 changes: 1 addition & 3 deletions Splito/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ class AppDelegate: NSObject, UIApplicationDelegate, MessagingDelegate, UNUserNot

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
if FirebaseProvider.auth.canHandleNotification(userInfo) {
completionHandler(.noData)
}
completionHandler(.noData)
}

func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
Expand Down
Loading
Loading