Skip to content

Commit

Permalink
chore: update picture type on user entity
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Oct 21, 2024
1 parent f8e29b5 commit c3f805c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
16 changes: 14 additions & 2 deletions Sources/IdentityUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ public struct VOIdentityUser {
public let username: String
public let email: String
public let fullName: String
public let picture: String?
public let picture: Picture?
public let pendingEmail: String?

public init(
id: String,
username: String,
email: String,
fullName: String,
picture: String? = nil,
picture: Picture? = nil,
pendingEmail: String? = nil
) {
self.id = id
Expand All @@ -286,4 +286,16 @@ public struct VOIdentityUser {
self.pendingEmail = pendingEmail
}
}

public struct Picture: Codable, Equatable, Hashable {
public let fileExtension: String

public init(fileExtension: String) {
self.fileExtension = fileExtension
}

enum CodingKeys: String, CodingKey {
case fileExtension = "extension"
}
}
}
16 changes: 14 additions & 2 deletions Sources/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public struct VOUser {
public let username: String
public let email: String
public let fullName: String
public let picture: String?
public let picture: Picture?
public let createTime: String
public let updateTime: String?

Expand All @@ -176,7 +176,7 @@ public struct VOUser {
username: String,
email: String,
fullName: String,
picture: String? = nil,
picture: Picture? = nil,
createTime: String,
updateTime: String? = nil
) {
Expand All @@ -190,6 +190,18 @@ public struct VOUser {
}
}

public struct Picture: Codable, Equatable, Hashable {
public let fileExtension: String

public init(fileExtension: String) {
self.fileExtension = fileExtension
}

enum CodingKeys: String, CodingKey {
case fileExtension = "extension"
}
}

public struct List: Codable {
public let data: [Entity]
public let totalPages: Int
Expand Down

0 comments on commit c3f805c

Please sign in to comment.