Skip to content

Commit

Permalink
Add Model and Adjustment Prefs
Browse files Browse the repository at this point in the history
  • Loading branch information
iqbalnurhaq committed Jun 3, 2023
1 parent 1783f38 commit ca57a69
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Sources/Core/Data/Remote/Response/BaseResponseAPI.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// File.swift
//
//
// Created by Iqbal Nur Haq on 03/06/23.
//

import Foundation

public struct BaseResponseAPI<T: Decodable> : Decodable {
private enum CodingKeys: String, CodingKey {
case code
case success
case message
case data
}

let code: String
let success: Bool
let message: String
let data: T?
}
10 changes: 10 additions & 0 deletions Sources/Core/Utils/Prefs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class Prefs
private let keyAccessTokenPrefs = "tokenPrefs"
private let keyDoctorIdPrefs = "doctorIdPrefs"
private let keyUserCodePrefs = "userCodePrefs"
private let keyNoType = "noTypePrefs"
private let keyDoctorHospitalIdPrefs = "doctorHospitalIdPrefs"
private let keyOnboardingPatient = "onBoardingPatientPrefs"
private let keyNotifToken = "notifTokenPrefs"
Expand Down Expand Up @@ -72,6 +73,15 @@ public class Prefs
return defaults.string(forKey: keyNotifToken) ?? ""
}
}

public var noTypePrefs: String {
set {
defaults.setValue(newValue, forKey: keyNoType)
}
get {
return defaults.string(forKey: keyNoType) ?? ""
}
}

public class var shared: Prefs {
struct Static {
Expand Down
23 changes: 23 additions & 0 deletions Sources/Core/Utils/SelectedItemButtomSheet.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// File.swift
//
//
// Created by Iqbal Nur Haq on 12/05/23.
//

import Foundation

public struct slcItemModel: Identifiable {
public var id: Int
public var code: String?
public var name: String
public var postal_code: String?


public init(id: Int, code: String? = nil, name: String, postal_code: String? = nil) {
self.id = id
self.code = code
self.name = name
self.postal_code = postal_code
}
}

0 comments on commit ca57a69

Please sign in to comment.