+
+ {employee && (
+
+ Employee Information
+
+ UUID: {employee.uuid}
+
+ Provider Email: {(employee.provider || {}).email || "No Email!"}
+
+
+ Provider Name:{" "}
+ {`${(employee.provider || {}).first_name} ${
+ (employee.provider || {}).last_name
+ }`.trim() || "No Name!"}
+
+
+ Provider Phone Number:{" "}
+ {`${((employee.provider || {}).userinfo || {}).phone_number ||
+ "No Number!"}`}
+
+ Approved: {"" + employee.approved}
+ Deleted: {"" + employee.deleted}
+
+
+ )}
+ {!employee && (
+
+ Invalid Employee
+ No accessable employee exists for given UUID.
+
+ )}
+ {!workTypeOptions.length && (
+
+ No Work Types
+
+ No worktypes exists. Please{" "}
+
+ create some work types
+ .
+
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create Price successful!
+ Price successfully created.
+ {!!priceRequestSuccess && (
+
+ )}
+
+ Submit Price
+
+
+);
+
+function mapStateToProps(state) {
+ return { ...state.price, selfUser: state.user.selfUser };
+}
+
+export default connect(mapStateToProps)(CreatePriceForm);
diff --git a/src/components/User/Client/UpdatePriceForm.jsx b/src/components/User/Client/UpdatePriceForm.jsx
new file mode 100644
index 0000000..e0c0aac
--- /dev/null
+++ b/src/components/User/Client/UpdatePriceForm.jsx
@@ -0,0 +1,184 @@
+import React, { Component } from "react";
+import { connect } from "react-redux";
+import { Redirect } from "react-router-dom";
+import {
+ Container,
+ Form,
+ Header,
+ Input,
+ Label,
+ Message
+} from "semantic-ui-react";
+import {
+ clearPriceRequestError,
+ clearPriceRequestSuccess,
+ setFormPriceAmount
+} from "../../../actions/price/reducer.actions";
+import { updatePriceRequest } from "../../../actions/price/saga.actions";
+import Error from "../../Shared/Error";
+
+class UpdatePriceForm extends Component {
+ constructor(props) {
+ super(props);
+
+ // Get referenced employee
+ const { selfUser } = props;
+ const employeeUUID = this.props.match.params.providerUUID;
+ const employees = ((selfUser || {}).client || {}).employees || [];
+ const employee =
+ employees.filter(employee => employee.uuid === employeeUUID)[0] || null;
+
+ // Get referenced price
+ const priceUUID = this.props.match.params.priceUUID;
+ const price =
+ (employee.prices || []).filter(
+ price => price.uuid === priceUUID && !price.deleted
+ )[0] || null;
+ this.props.dispatch(setFormPriceAmount((price || {}).amount || ""));
+ this.state = {
+ price,
+ employee
+ };
+ }
+
+ componentWillMount = () => {
+ this.props.dispatch(clearPriceRequestError());
+ this.props.dispatch(clearPriceRequestSuccess());
+ };
+
+ changeAmount = event => {
+ this.props.dispatch(setFormPriceAmount(event.target.value));
+ };
+
+ onSubmitPrice = event => {
+ event.preventDefault();
+ const { amount } = this.props;
+ const { price } = this.state;
+ this.props.dispatch(
+ updatePriceRequest({ uuid: (price || {}).uuid, amount })
+ );
+ };
+
+ render() {
+ const {
+ isSendingPriceRequest,
+ priceRequestError,
+ priceRequestSuccess,
+ amount,
+ selfUser
+ } = this.props;
+ const { employee, price } = this.state;
+
+ if (!selfUser.client) {
+ return