diff --git a/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyProfileLogic.php b/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyProfileLogic.php
index f9a1c91e..e25fdbf6 100644
--- a/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyProfileLogic.php
+++ b/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyProfileLogic.php
@@ -52,7 +52,7 @@ class UpdateCompanyProfileLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
- $object = new CompanyProfileObject($request->input('email'), $request->input('phone'), $request->input('business_type'));
+ $object = new CompanyProfileObject($request->input('email'), $request->input('phone'), $request->input('type'));
$company = $this->fetchesCompany->execute(['id' => $request->route('id')]);
diff --git a/app/Classes/Modules/Companies/DataTransferObjects/CompanyProfileObject.php b/app/Classes/Modules/Companies/DataTransferObjects/CompanyProfileObject.php
index b82e33a0..0f3e8a54 100644
--- a/app/Classes/Modules/Companies/DataTransferObjects/CompanyProfileObject.php
+++ b/app/Classes/Modules/Companies/DataTransferObjects/CompanyProfileObject.php
@@ -14,7 +14,7 @@ class CompanyProfileObject implements DataTransferObject
private $phone;
/** @var int|null */
- private $businessType;
+ private $companyType;
/**
* CompanyObject constructor.
@@ -22,11 +22,11 @@ class CompanyProfileObject implements DataTransferObject
* @param string $phone
* @param int|null $businessType
*/
- public function __construct(?string $email, string $phone, ?int $businessType = BusinessType::IMPORTER)
+ public function __construct(?string $email, string $phone, int $companyType)
{
$this->email = $email;
$this->phone = $phone;
- $this->businessType = $businessType;
+ $this->companyType = $companyType;
}
/**
@@ -48,8 +48,8 @@ class CompanyProfileObject implements DataTransferObject
/**
* @return int
*/
- public function getBusinessType(): int
+ public function getCompanyType(): int
{
- return $this->businessType;
+ return $this->companyType;
}
}
diff --git a/app/Classes/Modules/Companies/Services/UpdatesCompanyProfile.php b/app/Classes/Modules/Companies/Services/UpdatesCompanyProfile.php
index fd5e9f5a..85da8836 100644
--- a/app/Classes/Modules/Companies/Services/UpdatesCompanyProfile.php
+++ b/app/Classes/Modules/Companies/Services/UpdatesCompanyProfile.php
@@ -17,7 +17,7 @@ class UpdatesCompanyProfile extends AbstractUpdateRecord
*/
public function execute(Company $model, CompanyProfileObject $object)
{
- $model->business_type = $object->getBusinessType();
+ $model->type = $object->getCompanyType();
$contact = $model->contacts()->first();
if ($contact) {
diff --git a/resources/assets/vue/components/companies/elements/CompanyDetailsComponent.vue b/resources/assets/vue/components/companies/elements/CompanyDetailsComponent.vue
index ebb188e2..8bc0b7a8 100644
--- a/resources/assets/vue/components/companies/elements/CompanyDetailsComponent.vue
+++ b/resources/assets/vue/components/companies/elements/CompanyDetailsComponent.vue
@@ -10,8 +10,13 @@
{{this.company_details.business_type ? getBusinessTypeDesc(this.company_details.business_type) : ""}}
-
Company Type
-
{{this.company_details.type ? getCompanyTypeDesc(this.company_details.type) : ""}}
+
Company Type
+
+ {{getCompanyTypeDesc(this.company_details.type)}}
+
+
+
+
Email
@@ -23,7 +28,12 @@
-
{{this.company_details.contact ? this.company_details.contact.phone : ""}}
+
+ {{this.company_details.contact ? this.company_details.contact.phone : ""}}
+
+
+
+
Identification
@@ -42,7 +52,7 @@
-
+
Edit Profile Info
@@ -73,7 +83,12 @@
-
+
+
+
+
+
+
@@ -204,14 +219,7 @@
}
},
getCompanyTypeDesc(company_type_id) {
- switch (company_type_id) {
- case 0:
- return 'Personal Business';
- case 1:
- return 'Company Business';
- default:
- return null;
- }
+ return (company_type_id == 1) ? 'Company Business' : 'Personal Business';
},
},
mixins: [componentHandler]
diff --git a/resources/assets/vue/components/companies/forms/EditCustomerCompanyTypeFormComponent.vue b/resources/assets/vue/components/companies/forms/EditCustomerCompanyTypeFormComponent.vue
new file mode 100644
index 00000000..c15091b5
--- /dev/null
+++ b/resources/assets/vue/components/companies/forms/EditCustomerCompanyTypeFormComponent.vue
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
Edit Company Type
+
Please double confirm before ediiting the Company Type
+
+
+
+
+
+ Company Type
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/assets/vue/components/companies/forms/EditCustomerContactNumberFormComponent.vue b/resources/assets/vue/components/companies/forms/EditCustomerContactNumberFormComponent.vue
new file mode 100644
index 00000000..0145e057
--- /dev/null
+++ b/resources/assets/vue/components/companies/forms/EditCustomerContactNumberFormComponent.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
Edit Contact Number
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/assets/vue/components/companies/forms/EditCustomerProfileInfoFormComponent.vue b/resources/assets/vue/components/companies/forms/EditCustomerProfileInfoFormComponent.vue
index 09cdaa9a..949ab2a4 100644
--- a/resources/assets/vue/components/companies/forms/EditCustomerProfileInfoFormComponent.vue
+++ b/resources/assets/vue/components/companies/forms/EditCustomerProfileInfoFormComponent.vue
@@ -1,5 +1,5 @@
-
+
@@ -10,9 +10,9 @@
@@ -56,24 +56,19 @@
},
},
created() {
- if(this.data){
- this.parameters.business_type = this.data.business_type;
- this.parameters.email = this.data.contact ? this.data.contact.email : "";
- this.parameters.phone = this.data.contact ? this.data.contact.phone : "";
- }
+ this.parameters = {};
+ this.parameters.type = [0,1].includes(this.data.type) ? this.data.type: 0;
+ this.parameters.email = this.data.contact ? this.data.contact.email : "";
+ this.parameters.phone = this.data.contact ? this.data.contact.phone : "";
},
data(){
return {
- parameters: {
- business_type: "",
- email: "",
- phone: "",
- }
+ parameters: {},
}
},
validations: {
parameters: {
- business_type: {
+ type: {
required,
},
email: {
@@ -84,13 +79,6 @@
},
}
},
- watch: {
- 'data': function() {
- this.parameters.business_type = this.data.business_type;
- this.parameters.email = this.data.contact ? this.data.contact.email : "";
- this.parameters.phone = this.data.contact ? this.data.contact.phone : "";
- }
- },
methods: {
submitForm(){
this.submit(route('api.company.profile.update', this.data.id), 'put', this.section, true, true);