git.iko.soy/dashared/hookah-tau
on develop help sign in
исправила карту гороховского, добавила адрес в просмотр брони, цифры количества броней в списке клиентов настоящие
74b3876Darya Rednikina
Hookah Tau/API/ClientsService/ClientsService.swift+1−1
@@ -15,7 +15,7 @@ class ClientsService {
15 self.apiClient = apiClient
15 self.apiClient = apiClient
16 }
16 }
17
17
18− func loadClientsList(completion: @escaping ((Result<[FullUser], GeneralError>) -> Void)) {
18+ func loadClientsList(completion: @escaping ((Result<[Client], GeneralError>) -> Void)) {
19 let resolver = ClientsListResolver<ClientsResponce>()
19 let resolver = ClientsListResolver<ClientsResponce>()
20 let request = ApiRequest(resolver: resolver, httpMethod: .get)
20 let request = ApiRequest(resolver: resolver, httpMethod: .get)
21
21
Hookah Tau/API/ClientsService/Resolvers/ClientsListResolver.swift+1−1
@@ -9,7 +9,7 @@
9import Foundation
9import Foundation
10
10
11struct ClientsResponce: MyCodable {
11struct ClientsResponce: MyCodable {
12− var clients: [FullUser]
12+ var clients: [Client]
13}
13}
14
14
15class ClientsListResolver<Responce: MyCodable>: ApiResolver {
15class ClientsListResolver<Responce: MyCodable>: ApiResolver {
Hookah Tau/Controllers/Admin/Clients/Cells/ClientTableViewCell.swift+2−1
@@ -35,10 +35,11 @@ class ClientTableViewCell: UITableViewCell {
35
35
36 // MARK: - Bind
36 // MARK: - Bind
37
37
38− func bind(withModel model: FullUser) {
38+ func bind(withModel model: Client) {
39 let name = model.name ?? "❔"
39 let name = model.name ?? "❔"
40 nameLabel.text = model.isAdmin ? "👑 " + name : name
40 nameLabel.text = model.isAdmin ? "👑 " + name : name
41 phoneNumberLabel.text = model.phoneNumber.formattedNumber()
41 phoneNumberLabel.text = model.phoneNumber.formattedNumber()
42+ numberOfReservationsLabel.text = "\(model.reservationCount)"
42 }
43 }
43
44
44}
45}
Hookah Tau/Controllers/Admin/Clients/ClientsCoordinator.swift+5−2
@@ -21,9 +21,12 @@ class ClientsCoordinator: BaseCoordinator {
21 }
21 }
22
22
23 /// TODO
23 /// TODO
24− func openUserProfile(_ profile: FullUser) {
24+ func openUserProfile(_ profile: Client) {
25 let profileCoordinator = ClientProfileCoordinator(navigationController: navigationController)
25 let profileCoordinator = ClientProfileCoordinator(navigationController: navigationController)
26− profileCoordinator.user = profile
26+ profileCoordinator.user = FullUser(uuid: profile.uuid,
27+ name: profile.name,
28+ phoneNumber: profile.phoneNumber,
29+ isAdmin: profile.isAdmin)
27
30
28 self.addDependency(profileCoordinator)
31 self.addDependency(profileCoordinator)
29 profileCoordinator.didEndFlow = {
32 profileCoordinator.didEndFlow = {
Hookah Tau/Controllers/Admin/Clients/ClientsViewController.swift+1−2
@@ -12,9 +12,8 @@ class ClientsViewController: UITableViewController {
12
12
13 // MARK: - Properties
13 // MARK: - Properties
14
14
15− var dataSource: [FullUser] = [] {
15+ var dataSource: [Client] = [] {
16 didSet {
16 didSet {
17− print(dataSource)
18 tableView.reloadData()
17 tableView.reloadData()
19 }
18 }
20 }
19 }
Hookah Tau/Controllers/Admin/Reservations/AdminReservationEditingViewController.swift+2
@@ -82,6 +82,8 @@ class AdminReservationEditingViewController: BaseViewController {
82 mapView = MapView2.loadFromNib()
82 mapView = MapView2.loadFromNib()
83 }
83 }
84
84
85+ navigationItem.title = TotalStorage.standard.getEstablishment(model.establishment)?.address
86+
85 mapView?.isUserInteractionEnabled = false
87 mapView?.isUserInteractionEnabled = false
86
88
87 tableContentView.addSubviewThatFills(mapView)
89 tableContentView.addSubviewThatFills(mapView)
Hookah Tau/Controllers/Admin/Reservations/List of reservations/AdminReservationsController.swift+1
@@ -70,6 +70,7 @@ class AdminReservationsController: BaseViewController {
70
70
71 func setupNavBar() {
71 func setupNavBar() {
72 self.navigationItem.title = "Брони"
72 self.navigationItem.title = "Брони"
73+ navigationController?.navigationBar.prefersLargeTitles = true
73 navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(book))
74 navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(book))
74 }
75 }
75
76
Hookah Tau/Controllers/Client/Reservations/Maps/1/MapView1.xib+14−14
@@ -1,9 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?>
1<?xml version="1.0" encoding="UTF-8"?>
2−<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3 <device id="retina4_7" orientation="portrait" appearance="light"/>
3 <device id="retina4_7" orientation="portrait" appearance="light"/>
4 <dependencies>
4 <dependencies>
5 <deployment identifier="iOS"/>
5 <deployment identifier="iOS"/>
6− <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
6+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
7 <capability name="Safe area layout guides" minToolsVersion="9.0"/>
7 <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9 </dependencies>
9 </dependencies>
@@ -21,22 +21,22 @@
21 <rect key="frame" x="0.0" y="0.0" width="536" height="636"/>
21 <rect key="frame" x="0.0" y="0.0" width="536" height="636"/>
22 </imageView>
22 </imageView>
23 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Y23-Wu-4BW" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
23 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Y23-Wu-4BW" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
24− <rect key="frame" x="44" y="37" width="102" height="117"/>
24+ <rect key="frame" x="44" y="37" width="102" height="119"/>
25 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
25 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
26 <constraints>
26 <constraints>
27 <constraint firstAttribute="width" constant="102" id="EKZ-Ny-4RQ"/>
27 <constraint firstAttribute="width" constant="102" id="EKZ-Ny-4RQ"/>
28− <constraint firstAttribute="height" constant="117" id="u1N-5d-cFR"/>
28+ <constraint firstAttribute="height" constant="119" id="u1N-5d-cFR"/>
29 </constraints>
29 </constraints>
30 <connections>
30 <connections>
31 <action selector="chooseFirstTable:" destination="iN0-l3-epB" eventType="touchUpInside" id="1O9-7Q-a8g"/>
31 <action selector="chooseFirstTable:" destination="iN0-l3-epB" eventType="touchUpInside" id="1O9-7Q-a8g"/>
32 </connections>
32 </connections>
33 </button>
33 </button>
34 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xsw-fJ-8cN" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
34 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xsw-fJ-8cN" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
35− <rect key="frame" x="209" y="113" width="131" height="119"/>
35+ <rect key="frame" x="209" y="116" width="131" height="117"/>
36 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
36 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
37 <constraints>
37 <constraints>
38 <constraint firstAttribute="width" constant="131" id="2xi-Oz-ceC"/>
38 <constraint firstAttribute="width" constant="131" id="2xi-Oz-ceC"/>
39− <constraint firstAttribute="height" constant="119" id="xPD-fh-9Zg"/>
39+ <constraint firstAttribute="height" constant="117" id="xPD-fh-9Zg"/>
40 </constraints>
40 </constraints>
41 <connections>
41 <connections>
42 <action selector="chooseSecondTable:" destination="iN0-l3-epB" eventType="touchUpInside" id="5XE-gZ-DyJ"/>
42 <action selector="chooseSecondTable:" destination="iN0-l3-epB" eventType="touchUpInside" id="5XE-gZ-DyJ"/>
@@ -54,10 +54,10 @@
54 </connections>
54 </connections>
55 </button>
55 </button>
56 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Fw9-l6-N8a" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
56 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Fw9-l6-N8a" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
57− <rect key="frame" x="60" y="350" width="102" height="118"/>
57+ <rect key="frame" x="60" y="350" width="102" height="120"/>
58 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
58 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
59 <constraints>
59 <constraints>
60− <constraint firstAttribute="height" constant="118" id="2Vp-Ip-7cO"/>
60+ <constraint firstAttribute="height" constant="120" id="2Vp-Ip-7cO"/>
61 <constraint firstAttribute="width" constant="102" id="2hI-75-UCM"/>
61 <constraint firstAttribute="width" constant="102" id="2hI-75-UCM"/>
62 </constraints>
62 </constraints>
63 <connections>
63 <connections>
@@ -65,10 +65,10 @@
65 </connections>
65 </connections>
66 </button>
66 </button>
67 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KJZ-Nl-7hH" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
67 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KJZ-Nl-7hH" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
68− <rect key="frame" x="222" y="272" width="104" height="119"/>
68+ <rect key="frame" x="222" y="273" width="104" height="120"/>
69 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
69 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
70 <constraints>
70 <constraints>
71− <constraint firstAttribute="height" constant="119" id="Ifu-kd-YHH"/>
71+ <constraint firstAttribute="height" constant="120" id="Ifu-kd-YHH"/>
72 <constraint firstAttribute="width" constant="104" id="phm-aP-6dx"/>
72 <constraint firstAttribute="width" constant="104" id="phm-aP-6dx"/>
73 </constraints>
73 </constraints>
74 <connections>
74 <connections>
@@ -76,7 +76,7 @@
76 </connections>
76 </connections>
77 </button>
77 </button>
78 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mUw-im-1BC" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
78 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mUw-im-1BC" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
79− <rect key="frame" x="222" y="431" width="92" height="67"/>
79+ <rect key="frame" x="222" y="433" width="92" height="67"/>
80 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
80 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
81 <constraints>
81 <constraints>
82 <constraint firstAttribute="width" constant="92" id="AJ6-ku-4R3"/>
82 <constraint firstAttribute="width" constant="92" id="AJ6-ku-4R3"/>
@@ -87,10 +87,10 @@
87 </connections>
87 </connections>
88 </button>
88 </button>
89 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aIM-Qn-Uhl" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
89 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aIM-Qn-Uhl" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
90− <rect key="frame" x="386" y="116" width="130" height="119"/>
90+ <rect key="frame" x="386" y="116" width="131" height="119"/>
91 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
91 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
92 <constraints>
92 <constraints>
93− <constraint firstAttribute="width" constant="130" id="Lhq-jM-PQ0"/>
93+ <constraint firstAttribute="width" constant="131" id="Lhq-jM-PQ0"/>
94 <constraint firstAttribute="height" constant="119" id="vsx-u8-L6o"/>
94 <constraint firstAttribute="height" constant="119" id="vsx-u8-L6o"/>
95 </constraints>
95 </constraints>
96 <connections>
96 <connections>
@@ -123,7 +123,7 @@
123 <constraint firstItem="mUw-im-1BC" firstAttribute="top" secondItem="KJZ-Nl-7hH" secondAttribute="bottom" constant="40" id="GaI-BE-NZy"/>
123 <constraint firstItem="mUw-im-1BC" firstAttribute="top" secondItem="KJZ-Nl-7hH" secondAttribute="bottom" constant="40" id="GaI-BE-NZy"/>
124 <constraint firstItem="btD-Wl-3P6" firstAttribute="width" secondItem="FuE-LV-NBR" secondAttribute="width" priority="250" id="MDs-kk-aza"/>
124 <constraint firstItem="btD-Wl-3P6" firstAttribute="width" secondItem="FuE-LV-NBR" secondAttribute="width" priority="250" id="MDs-kk-aza"/>
125 <constraint firstItem="btD-Wl-3P6" firstAttribute="top" secondItem="aIM-Qn-Uhl" secondAttribute="bottom" constant="-235" id="NwR-U0-V6F"/>
125 <constraint firstItem="btD-Wl-3P6" firstAttribute="top" secondItem="aIM-Qn-Uhl" secondAttribute="bottom" constant="-235" id="NwR-U0-V6F"/>
126− <constraint firstItem="mUw-im-1BC" firstAttribute="top" secondItem="btD-Wl-3P6" secondAttribute="bottom" constant="-205" id="UXz-DD-dPH"/>
126+ <constraint firstItem="mUw-im-1BC" firstAttribute="top" secondItem="btD-Wl-3P6" secondAttribute="bottom" constant="-203" id="UXz-DD-dPH"/>
127 <constraint firstItem="mUw-im-1BC" firstAttribute="leading" secondItem="Fw9-l6-N8a" secondAttribute="trailing" constant="60" id="V4u-ko-iFV"/>
127 <constraint firstItem="mUw-im-1BC" firstAttribute="leading" secondItem="Fw9-l6-N8a" secondAttribute="trailing" constant="60" id="V4u-ko-iFV"/>
128 <constraint firstItem="KJZ-Nl-7hH" firstAttribute="top" secondItem="xsw-fJ-8cN" secondAttribute="bottom" constant="40" id="XFV-l2-chC"/>
128 <constraint firstItem="KJZ-Nl-7hH" firstAttribute="top" secondItem="xsw-fJ-8cN" secondAttribute="bottom" constant="40" id="XFV-l2-chC"/>
129 <constraint firstItem="btD-Wl-3P6" firstAttribute="top" secondItem="onR-hl-Q2x" secondAttribute="bottom" constant="-332" id="XNT-i4-1l8"/>
129 <constraint firstItem="btD-Wl-3P6" firstAttribute="top" secondItem="onR-hl-Q2x" secondAttribute="bottom" constant="-332" id="XNT-i4-1l8"/>
Hookah Tau/Models/User.swift+10−1
@@ -15,10 +15,19 @@ struct User: MyCodable {
15 var isAdmin: Bool
15 var isAdmin: Bool
16}
16}
17
17
18−/// При запросах на список пользователей в аккаунте администратора
18+/// При запросах на список пользователей в аккаунте администратора.
19struct FullUser: MyCodable {
19struct FullUser: MyCodable {
20 var uuid: String
20 var uuid: String
21 var name: String?
21 var name: String?
22 var phoneNumber: String
22 var phoneNumber: String
23 var isAdmin: Bool
23 var isAdmin: Bool
24}
24}
25+
26+/// `GET /admin/clients`
27+struct Client: MyCodable {
28+ var uuid: String
29+ var name: String?
30+ var phoneNumber: String
31+ var isAdmin: Bool
32+ var reservationCount: Int
33+}