-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from APPSCHOOL1-REPO/server/230103-CustomerSer…
…vice-Dahae Server/230103 customer service dahae #4
- Loading branch information
Showing
10 changed files
with
240 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
big-project-a-customer-ios/big-project-a-customer-ios/Extension/Timestamp+Extension.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Timestamp+Extension.swift | ||
// big-project-a-customer-ios | ||
// | ||
// Created by Da Hae Lee on 2023/01/03. | ||
// | ||
|
||
import Foundation | ||
import Firebase | ||
|
||
extension Timestamp { | ||
/// Timestamp로 날짜를 받아올 때, 날짜를 한국식 날짜로 받아오는 함수 입니다. | ||
/// 타임스탬프의 인스턴스(fetch된 데이터)에서 호출합니다. | ||
/// 리턴할 때는 String 타입으로 리턴합니다. | ||
public func formattedKoreanTime() -> String { | ||
let date = self.dateValue() | ||
let dateFormatter = DateFormatter() | ||
dateFormatter.locale = Locale(identifier: "ko-KR") | ||
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm" | ||
return dateFormatter.string(from: date) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
big-project-a-customer-ios/big-project-a-customer-ios/Model/CustomerServiceInfo.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// CustomerServiceInfo.swift | ||
// big-project-a-customer-ios | ||
// | ||
// Created by Da Hae Lee on 2023/01/03. | ||
// | ||
|
||
import Foundation | ||
import Firebase | ||
|
||
typealias ItemAllOption = [String:[String]]? | ||
|
||
// MARK: - 고객 서비스를 위한 모델 | ||
/// 제품 문의 기능에서 사용하는 데이터 모델입니다. | ||
struct CustomerServiceInfo: Identifiable { | ||
var id: String | ||
var title: String // 문의 제목 | ||
var description: String // 문의 내역 | ||
var itemId: String // 문의를 하려는 제품 id | ||
var itemName: String // 문의를 하려는 제품명 | ||
var itemImage: [String] // 문의를 하려는 제품의 이미지(배열) | ||
var serviceDate: Timestamp // 문의 날짜 | ||
var customerId: String // 작성자 | ||
var orderId: String // 주문번호 | ||
var itemAllOption: ItemAllOption? // 선택한 제품 옵션 | ||
var isAnswered: Bool = false // 판매자 답글 여부 | ||
|
||
var formattedServiceDate: String { | ||
get { | ||
serviceDate.formattedKoreanTime() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
big-project-a-customer-ios/big-project-a-customer-ios/Model/OrderInfo.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// OrderInfo.swift | ||
// big-project-a-customer-ios | ||
// | ||
// Created by Da Hae Lee on 2023/01/03. | ||
// | ||
|
||
import Foundation | ||
|
||
struct ItemOptions: Codable { | ||
var itemOptions: [String: [String]] | ||
} | ||
|
||
struct OrderInfo: Codable { | ||
var orderId: String = UUID().uuidString | ||
var orderedUserInfo: String | ||
var orderTime: Double | ||
var orderedItems: [OrderedItemInfo] | ||
var orderAddress: String | ||
var orderMessage: String? | ||
var payment: PaymentEnum = .byCreditCard | ||
} | ||
|
||
struct OrderedItemInfo: Codable { | ||
var itemUid: String | ||
var itemName: String | ||
var itemImage: [String] | ||
var price: Double | ||
var option: ItemOptions | ||
var deliveryStatus: DeliveryStatusEnum = .pending | ||
} | ||
|
||
enum DeliveryStatusEnum: String, Codable { | ||
case beforePurchase = "구매전" | ||
case pending = "배송준비중" | ||
case onDeliverying = "배송중" | ||
case didDelivered = "배송완료" | ||
case reviewable = "리뷰작성 가능" | ||
case reviewed = "리뷰작성 완료" | ||
} | ||
|
||
enum PaymentEnum: String, Codable { | ||
case byCreditCard = "카드결제", byAccount = "무통장입금", byMobile = "핸드폰결제" | ||
} |
Oops, something went wrong.