From a735885bbb2d5ff7c532c5b7edaf7e8bc811c70a Mon Sep 17 00:00:00 2001 From: edmondlang Date: Wed, 23 Feb 2022 19:07:45 +0800 Subject: [PATCH] cretae update comapny name function --- .../Companies/Services/UpdatesCompany.php | 26 ++++++++++ .../Standards/Rules/CanUpdateCompany.php | 51 +++++++++++++++++++ .../IdentificationVerificationComponent.vue | 16 +++++- .../forms/UpdateCompanyNameFormComponent.vue | 38 ++++++++++++++ 4 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 app/Classes/Modules/Companies/Services/UpdatesCompany.php create mode 100644 app/Classes/Modules/Companies/Standards/Rules/CanUpdateCompany.php create mode 100644 resources/assets/vue/components/companies/forms/UpdateCompanyNameFormComponent.vue diff --git a/app/Classes/Modules/Companies/Services/UpdatesCompany.php b/app/Classes/Modules/Companies/Services/UpdatesCompany.php new file mode 100644 index 00000000..f89bbca8 --- /dev/null +++ b/app/Classes/Modules/Companies/Services/UpdatesCompany.php @@ -0,0 +1,26 @@ +name = $object->getName(); + $model->reference = $object->getReference(); + $model->type = $object->getType(); + + return $this->handler($model); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Standards/Rules/CanUpdateCompany.php b/app/Classes/Modules/Companies/Standards/Rules/CanUpdateCompany.php new file mode 100644 index 00000000..c7bd1f70 --- /dev/null +++ b/app/Classes/Modules/Companies/Standards/Rules/CanUpdateCompany.php @@ -0,0 +1,51 @@ +companyValidation = $companyValidation; + } + + /** + * @return bool + */ + protected function authorized(): bool + { + // TODO Set Authorization rules + return true; + } + + /** + * @param CompanyObject $object + * @return bool + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function validators($object): bool + { + return $this->companyValidation->validate($object, 'PUT'); + } + + /** + * @param CompanyObject $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } +} \ No newline at end of file diff --git a/resources/assets/vue/components/companies/elements/IdentificationVerificationComponent.vue b/resources/assets/vue/components/companies/elements/IdentificationVerificationComponent.vue index 1c14a0fe..29edf834 100644 --- a/resources/assets/vue/components/companies/elements/IdentificationVerificationComponent.vue +++ b/resources/assets/vue/components/companies/elements/IdentificationVerificationComponent.vue @@ -63,9 +63,21 @@
Company Name
-
+
-
{{item.owner.name}}
+
{{item.owner.name}}
+
+
+
+
+ +
+
+
+
+ +
+
diff --git a/resources/assets/vue/components/companies/forms/UpdateCompanyNameFormComponent.vue b/resources/assets/vue/components/companies/forms/UpdateCompanyNameFormComponent.vue new file mode 100644 index 00000000..0cafa5db --- /dev/null +++ b/resources/assets/vue/components/companies/forms/UpdateCompanyNameFormComponent.vue @@ -0,0 +1,38 @@ + +