Skip to content

[IDLE-000] 센터관리자 구인 공고 작성 연동 #50

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

Merged
merged 6 commits into from
Aug 29, 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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import RootFeature
import PresentationCore
import UseCaseInterface

class CenterSettingCoordinator: CenterSettingScreenCoordinatable {
class CenterSettingCoordinator: CenterSettingCoordinatable {

struct Dependency {
let parent: CenterMainCoordinatable
Expand All @@ -34,20 +34,19 @@ class CenterSettingCoordinator: CenterSettingScreenCoordinatable {
self.parent = dependency.parent
}

public func start() {
func start() {
let coordinator = CenterSettingScreenCoordinator(
dependency: .init(
navigationController: navigationController,
settingUseCase: injector.resolve(SettingScreenUseCase.self),
centerProfileUseCase: injector.resolve(CenterProfileUseCase.self)
settingUseCase: injector.resolve(SettingScreenUseCase.self)
)
)
addChildCoordinator(coordinator)
coordinator.parent = self
coordinator.start()
}

public func startRemoveCenterAccountFlow() {
func startRemoveCenterAccountFlow() {
let coordinator = DeRegisterCoordinator(
dependency: .init(
userType: .center,
Expand All @@ -60,4 +59,17 @@ class CenterSettingCoordinator: CenterSettingScreenCoordinatable {
coordinator.parent = self
coordinator.start()
}

func showMyCenterProfile() {
let coordinator = CenterProfileCoordinator(
dependency: .init(
mode: .myProfile,
profileUseCase: injector.resolve(CenterProfileUseCase.self),
navigationController: navigationController
)
)
addChildCoordinator(coordinator)
coordinator.parent = self
coordinator.start()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,17 @@ public extension RecruitmentManagementCoordinator {
coordinator.parent = self
coordinator.start()
}

func showRegisterPostScrean() {

let coordinator = RegisterRecruitmentPostCoordinator(
dependency: .init(
navigationController: navigationController,
recruitmentPostUseCase: injector.resolve(RecruitmentPostUseCase.self)
)
)
addChildCoordinator(coordinator)
coordinator.parent = self
coordinator.start()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,25 @@ public class DefaultSettingUseCase: SettingScreenUseCase {
}

public func getPersonalDataUsageDescriptionUrl() -> URL {
// MARK: TODO
URL(string: "")!
}

public func getApplicationPolicyUrl() -> URL {
// MARK: TODO
URL(string: "")!
}

public func getWorkerProfile() -> Entity.WorkerProfileVO {
// 세팅화면이라면 반드시 존재해야한다.
userInfoLocalRepository.getCurrentWorkerData()!
}

public func getCenterProfile() -> Entity.CenterProfileVO {
// 세팅화면이라면 반드시 존재해야한다.
userInfoLocalRepository.getCurrentCenterData()!
}

// MARK: 회원탈퇴 & 로그아웃
// 센터 회원탈퇴
public func deregisterCenterAccount(reasons: [Entity.DeregisterReasonVO], password: String) -> RxSwift.Single<Result<Void, Entity.DomainError>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public protocol SettingScreenUseCase: UseCaseBase {
/// 어플리케이션 이용약관을 가져옵니다.
func getApplicationPolicyUrl() -> URL

// MARK: Worker
/// 센터 프로필정보 가져오기
func getWorkerProfile() -> WorkerProfileVO

/// 요양보호사 회원 탈퇴
func deregisterWorkerAccount(
reasons: [DeregisterReasonVO]
Expand All @@ -37,6 +41,11 @@ public protocol SettingScreenUseCase: UseCaseBase {
/// 요양보호사 로그아웃
func signoutWorkerAccount() -> Single<Result<Void, DomainError>>

// MARK: Center

/// 센터 프로필정보 가져오기
func getCenterProfile() -> CenterProfileVO

/// 센터 회원 탈퇴
func deregisterCenterAccount(
reasons: [DeregisterReasonVO],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "plus.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
//
// IdleFloatingButton.swift
// DSKit
//
// Created by choijunios on 8/29/24.
//

import UIKit
import RxSwift
import RxCocoa

public class IdleFloatingButton: TappableUIView {

// Init

// View
public let imageView: UIImageView = {
let view = UIImageView()
view.image = DSIcon.plus.image
return view
}()
public let label: IdleLabel = {
let label = IdleLabel(typography: .Subtitle3)
label.attrTextColor = DSColor.gray0.color
return label
}()

private let disposeBag = DisposeBag()

public init(labelText: String) {
self.label.textString = labelText
super.init()

setApearance()
setAutoLayout()
setObservable()
}

required init?(coder: NSCoder) { fatalError() }

public override func layoutSubviews() {
super.layoutSubviews()
let hegiht = self.bounds.height
self.layer.cornerRadius = hegiht/2
}

private func setApearance() {
// InitialSetting
self.backgroundColor = DSColor.gray700.color
}

private func setAutoLayout() {
self.layoutMargins = .init(top: 8, left: 16, bottom: 8, right: 16)
let contentStack = HStack([
imageView, label
], spacing: 6, alignment: .center)
[
contentStack
].forEach {
$0.translatesAutoresizingMaskIntoConstraints = false
self.addSubview($0)
}

NSLayoutConstraint.activate([
contentStack.topAnchor.constraint(equalTo: self.layoutMarginsGuide.topAnchor),
contentStack.leftAnchor.constraint(equalTo: self.layoutMarginsGuide.leftAnchor),
contentStack.rightAnchor.constraint(equalTo: self.layoutMarginsGuide.rightAnchor),
contentStack.bottomAnchor.constraint(equalTo: self.layoutMarginsGuide.bottomAnchor),
])
}

private func setObservable() {

self.rx.tap
.subscribe { [weak self] _ in
guard let self else { return }
self.alpha = 0.7
UIView.animate(withDuration: 0.3) {
self.alpha = 1
}
}
.disposed(by: disposeBag)
}
}

@available(iOS 17.0, *)
#Preview("Preview", traits: .defaultLayout) {

IdleFloatingButton(labelText: "공고 등록")
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ public class WorkerEmployCard: UIView {
let tagStarStack = HStack(
[
tagStack,
Spacer(),
starButton
],
alignment: .center,
distribution: .equalSpacing
distribution: .fill
)
tagStack.setContentHuggingPriority(.defaultLow, for: .horizontal)
starButton.setContentHuggingPriority(.defaultHigh, for: .horizontal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class ApplicationDetailViewContentView: UIView {

// 지원 방법
let applyTypeButtons: [StateButtonTyp1] = {
ApplyType.allCases.map { type in
[ApplyType.phoneCall, ApplyType.app].map { type in
StateButtonTyp1(
text: type.korTextForBtn,
initial: .normal
Expand Down Expand Up @@ -234,8 +234,8 @@ public class ApplicationDetailViewContentView: UIView {
// 마감기간
if let state = stateFromVM.deadlineDate {

calendarOpenButton
.textLabel.textString = state.convertDateToString()
calendarOpenButton.textLabel.textString = state.convertDateToString()
calendarOpenButton.textLabel.attrTextColor = DSColor.gray900.color
}

})
Expand Down Expand Up @@ -326,6 +326,7 @@ public class ApplicationDetailViewContentView: UIView {

extension ApplicationDetailViewContentView: OneDayPickerDelegate {
public func oneDayPicker(selectedDate: Date) {

// 위임자 패턴으로 데이터를 수신
deadlineDate.accept(selectedDate)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,9 @@ public class CenterRecruitmentPostBoardScreenCoordinator: ChildCoordinator {
public func showEditScreen(postId: String) {
parent?.showEditScreen(postId: postId)
}

public func showRegisterPostScreen() {
parent?.showRegisterPostScrean()
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class RegisterCompleteCoordinator: ChildCoordinator {
}

public func start() {
let vc = RegisterCompleteVC()
let vc = PostRegisterCompleteVC()
vc.coordinator = self
viewControllerRef = vc
navigationController.pushViewController(vc, animated: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ public class RegisterRecruitmentPostCoordinator: RegisterRecruitmentPostCoordina

public func start() {
let vc = RegisterRecruitmentPostVC()

vc.bind(viewModel: registerRecruitmentPostVM)
viewControllerRef = vc
navigationController.pushViewController(vc, animated: true)

let coordinator = CoordinatorWrapper(
parent: self,
nav: navigationController,
vc: vc
)
coordinator.start()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,24 @@ public class CenterSettingScreenCoordinator: ChildCoordinator {
public struct Dependency {
let navigationController: UINavigationController
let settingUseCase: SettingScreenUseCase
let centerProfileUseCase: CenterProfileUseCase

public init(navigationController: UINavigationController, settingUseCase: SettingScreenUseCase, centerProfileUseCase: CenterProfileUseCase) {
public init(navigationController: UINavigationController, settingUseCase: SettingScreenUseCase) {
self.navigationController = navigationController
self.settingUseCase = settingUseCase
self.centerProfileUseCase = centerProfileUseCase
}
}

public weak var viewControllerRef: UIViewController?
public weak var parent: CenterSettingScreenCoordinatable?
public weak var parent: CenterSettingCoordinatable?

public let navigationController: UINavigationController
let settingUseCase: SettingScreenUseCase
let centerProfileUseCase: CenterProfileUseCase

public init(
dependency: Dependency
) {
self.navigationController = dependency.navigationController
self.settingUseCase = dependency.settingUseCase
self.centerProfileUseCase = dependency.centerProfileUseCase
}

deinit {
Expand All @@ -47,8 +43,7 @@ public class CenterSettingScreenCoordinator: ChildCoordinator {
let vc = CenterSettingVC()
let vm = CenterSettingVM(
coordinator: self,
settingUseCase: settingUseCase,
centerProfileUseCase: centerProfileUseCase
settingUseCase: settingUseCase
)
vc.bind(viewModel: vm)
viewControllerRef = vc
Expand All @@ -69,5 +64,9 @@ public class CenterSettingScreenCoordinator: ChildCoordinator {
public func startRemoveCenterAccountFlow() {
parent?.startRemoveCenterAccountFlow()
}

public func showMyCenterProfile() {
parent?.showMyCenterProfile()
}
}

Loading