Merge branch 'issue-19' into 'develop'

Issue 19

Closes #19

See merge request ldc-web/projets/le-gaulois!56
This commit is contained in:
Vincent BRIDIER 2023-06-26 14:13:19 +00:00
commit c4f3ae1929
77 changed files with 566 additions and 96 deletions

View file

@ -16,7 +16,6 @@ use App\Jobs\DeleteOldNotifications;
use App\Jobs\DeleteOrders;
use App\Jobs\PurgeNotifications as JobsPurgeNotifications;
use App\Jobs\PurgeOldResetPasswords;
use App\Jobs\SendOcbMissingBreederReminder;
use App\Jobs\UpdateReductions as JobsUpdateReductions;
use App\Jobs\XmlEleveursReader as JobsXmlEleveursReader;
use App\Jobs\XmlIncoReader as JobsXmlIncoReader;
@ -52,7 +51,7 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
//$schedule->job(SendOcbMissingBreederReminder::class)->dailyAt('07:30');
// $schedule->job(SendOcbMissingBreederReminder::class)->dailyAt('07:30');
$schedule->job(DeleteOrders::class)->dailyAt('14:00');
$schedule->job(DeleteOldMessages::class)->dailyAt('14:15');
$schedule->job(DeleteOldNotifications::class)->dailyAt('14:30');

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class ArticleCategory extends BaseEnumRoutable
{
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class BreedingBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -17,6 +22,11 @@ final class BreedingBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class ContactFormCivility extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class ContactFormCivility extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -26,6 +36,11 @@ final class ContactFormCivility extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -52,6 +52,7 @@ final class ContactFormType extends BaseEnumRoutable
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string

View file

@ -16,6 +16,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class Days extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -30,6 +35,11 @@ final class Days extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -44,6 +54,11 @@ final class Days extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -6,6 +6,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
abstract class Departaimant extends BaseEnumRoutable
{
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class DepartaimantCollectionType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class DepartaimantCollectionType extends BaseEnumRoutable
];
}
/**
* Enum label
*
* @return array
*/
protected static function labels(): array
{
return [
@ -26,6 +36,11 @@ final class DepartaimantCollectionType extends BaseEnumRoutable
];
}
/**
* Json serialize implementation.
*
* @return array
*/
public function jsonSerialize(): array
{
return [

View file

@ -107,6 +107,11 @@ namespace App\Enums;
*/
final class DepartaimantCurrent extends Departaimant
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -214,6 +219,11 @@ final class DepartaimantCurrent extends Departaimant
];
}
/**
* Enum label
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class DepartaimantStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -22,6 +27,11 @@ final class DepartaimantStatus extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -32,11 +42,21 @@ final class DepartaimantStatus extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;
}
/**
* To Array
*
* @return \Kwaadpepper\Enum\BaseEnum[]
*/
public static function toArray(): array
{
$array = [];
@ -49,6 +69,11 @@ final class DepartaimantStatus extends BaseEnumRoutable
return $array;
}
/**
* Json serialize implementation.
*
* @return array
*/
public function jsonSerialize(): array
{
return [

View file

@ -105,6 +105,11 @@ namespace App\Enums;
*/
final class DepartaimantVintage extends Departaimant
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -210,6 +215,11 @@ final class DepartaimantVintage extends Departaimant
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class EleveurOcbStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -21,6 +26,12 @@ final class EleveurOcbStatus extends BaseEnumRoutable
'yes' => 3
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -31,6 +42,11 @@ final class EleveurOcbStatus extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class EngagementBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -24,6 +29,11 @@ final class EngagementBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class EngagementType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class EngagementType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class GMapDataType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class GeneralConfigType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -22,6 +27,11 @@ final class GeneralConfigType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class GeoType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class GeoType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -21,6 +21,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class InputType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class NotificationType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -24,6 +29,11 @@ final class NotificationType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -18,6 +18,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class NutritionBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -29,6 +34,11 @@ final class NutritionBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class NutritionPageType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class NutritionPageType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -5,25 +5,32 @@ namespace App\Enums;
use Kwaadpepper\Enum\BaseEnumRoutable;
/**
* @method static self egg()
* @method static self rabbit()
* @method static self poultry()
*/
final class OCBType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
'egg' => 0,
'rabbit' => 1,
'poultry' => 2
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
'egg' => __('Oeuf'),
'rabbit' => __('Lapin'),
'poultry' => __('Volaille')
];

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class OrderStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -24,6 +29,11 @@ final class OrderStatus extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class OrderType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class OrderType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class PoultryBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -20,6 +25,11 @@ final class PoultryBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class PoultryPageType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class PoultryPageType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class PresentationType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class PresentationType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -19,6 +19,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RangeColor extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -35,6 +40,12 @@ final class RangeColor extends BaseEnumRoutable
'color11' => 'color-11'
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeDifficulty extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -22,6 +27,11 @@ final class RecipeDifficulty extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -32,6 +42,11 @@ final class RecipeDifficulty extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeFilter extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
$labels = self::labels();
@ -24,6 +29,11 @@ final class RecipeFilter extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeFilterTimes extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
$labels = self::labels();
@ -22,6 +27,11 @@ final class RecipeFilterTimes extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class RecipeType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -7,6 +7,7 @@ use Exception;
/**
* This class Exception is used to skip a row import from
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class AbortContactMailer extends Exception

View file

@ -7,6 +7,7 @@ use Exception;
/**
* This class Exception is used to skip a row import from
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class AbortRowImportException extends Exception

View file

@ -7,6 +7,7 @@ use Exception;
/**
* This class Exception is used in CB payement process
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class CBPayementError extends Exception

View file

@ -7,6 +7,7 @@ use Exception;
/**
* This class Exception is used to skip a row import from
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class RedirectTo extends Exception

View file

@ -39,6 +39,7 @@ class AuthController extends Controller
/**
* Enregistre le customer dans la base de données
*
* @param \App\Http\Requests\CustomerRegisterRequest $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
*/
@ -142,6 +143,7 @@ class AuthController extends Controller
/**
* Retourne la page de connexion
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
@ -251,6 +253,7 @@ class AuthController extends Controller
/**
* Handle Api error exception
*
* @param \LDC\LDCCRM\Exceptions\ApiErrorException $e
* @param \App\Http\Requests\LoginRequest $request
* @return \Illuminate\Http\RedirectResponse
@ -326,6 +329,7 @@ class AuthController extends Controller
/**
* Login a customer
*
* @param \App\Models\Customers $customer
* @param boolean $remember
* @return \Illuminate\Http\RedirectResponse
@ -361,6 +365,7 @@ class AuthController extends Controller
/**
* Fomulaire reset mot de passe sur la page login
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse|void
* @throws \Exception Exception.
@ -455,6 +460,7 @@ class AuthController extends Controller
/**
* Modification du mot de passe par lien via le formulaire reset mot de passe
*
* @param \App\Http\Requests\ResetCustomerPassword $request
* @param string $token
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
@ -504,6 +510,7 @@ class AuthController extends Controller
/**
* Mettre à jour le mot de passe lorsque l'on est connecté
*
* @param \App\Http\Requests\CustomerUpdatePassword $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.

View file

@ -444,6 +444,7 @@ class MomentsController extends Controller
/**
* Passe un moment en moment star. Si il y avait déjà un moment star, il ne l'est plus et le nouveau le remplace
*
* @param id L'id du moment qui doit devenir moment star
*/
public function setStar($id)

View file

@ -406,6 +406,7 @@ class BoutiqueController extends Controller
/**
* Get Mercanet ref and responseCode for request
*
* @return array['ref' => 'value', 'responseCode' => 'value']
*/
private function getMercanetData(Request $request): array

View file

@ -42,8 +42,8 @@ class BreedingPageController extends Controller
*/
public function list(BreedingPageType $pageType)
{
$pages = BreedingPage::where('type', $pageType)->whereStatus(true)->get();
$bannerUrl = $this->getBannerUrlFromGeneralConfig($pageType);
$pages = BreedingPage::where('type', $pageType)->whereStatus(true)->get();
$bannerUrl = $this->getBannerUrlFromGeneralConfig($pageType);
$headerText = $this->getTextHeaderFromGeneralConfig($pageType);
return view('front.breeding-page.list', compact('pages', 'pageType', 'bannerUrl', 'headerText'));

View file

@ -52,6 +52,7 @@ class ClubController extends Controller
/**
* Index
*
* @param \App\Enums\ArticleCategory|null $tag
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
@ -152,6 +153,7 @@ class ClubController extends Controller
/**
* missingCrmInfosSubmit
*
* @param \App\Http\Requests\UpdateInfosRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
@ -174,6 +176,7 @@ class ClubController extends Controller
/**
* Updates user info
*
* @param \App\Http\Requests\UpdateInfosRequest $request
* @return \Illuminate\Http\RedirectResponse|string|boolean return strictly true if success,
* false il failed, could be a string with message error if failed
@ -311,6 +314,7 @@ class ClubController extends Controller
/**
* reductionsGet
*
* @param \App\Http\Requests\DownloadBRFileRequest $request
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
* @throws \Exception Exception.
@ -351,6 +355,7 @@ class ClubController extends Controller
/**
* Call the article page with a slug for the article to print
*
* @param \App\Enums\ArticleCategory $tag
* @param \App\Models\Articles $publishedArticle
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
@ -387,6 +392,7 @@ class ClubController extends Controller
/**
* Handle the request of a customer that answered a survey
*
* @param \App\Http\Requests\SurveyAnswersRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
@ -442,6 +448,7 @@ class ClubController extends Controller
/**
* Send a message to a user
*
* @param \App\Http\Requests\SendMessageRequest $request
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
@ -492,6 +499,7 @@ class ClubController extends Controller
/**
* Destroy a message
*
* @param \App\Http\Requests\DeleteMessagesRequest $request
* @return \Illuminate\Http\JsonResponse
* @throws \LogicException LogicException.
@ -529,6 +537,7 @@ class ClubController extends Controller
/**
* Block a customer to prevent him sending messages
*
* @param \App\Http\Requests\BlockCustomerRequest $request
* @param boolean $status
* @return \Illuminate\Http\JsonResponse

View file

@ -102,6 +102,7 @@ class ContactController extends Controller
/**
* Propose meal recipe
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/

View file

@ -93,6 +93,7 @@ class CustomerController extends Controller
/**
* setFavoriteRecipe
*
* @param \App\Models\Recipes $recipe
* @param boolean $status
* @return \Illuminate\Http\JsonResponse

View file

@ -52,6 +52,7 @@ class HomeController extends Controller
/**
* Call the CRM to add a single optin
*
* @param \App\Http\Requests\SingleOptinRequest $request
* @return string|array|null|\Illuminate\Contracts\Translation\Translator
* @throws \LDC\LDCCRM\Exceptions\ValidationException ValidationException.

View file

@ -77,17 +77,4 @@ class OCBController extends Controller
->inRandomOrder()->first();
return view('front.ocb.poultry', compact('breeder', 'ocbContents'));
}
/**
* Show ocb egg content
*
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
public function egg()
{
$ocbContents = OCBContent::where('type', OCBType::egg())
->orderBy('order')
->where('status', true)->get();
return view('front.ocb.egg', compact('ocbContents'));
}
}

View file

@ -22,6 +22,7 @@ class EnterCodeController extends Controller
/**
* Participate Method
*
* @param \App\Http\Requests\OpBrCharcut\ParticipateRequest $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
@ -33,6 +34,7 @@ class EnterCodeController extends Controller
/**
* Détermine si un BR doit être servi, renvoi la vue de gain BR
*
* @param mixed $code
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
@ -64,6 +66,7 @@ class EnterCodeController extends Controller
/**
* Update a coupon
*
* @param mixed $id_coupon
* @param mixed $qtty
* @return mixed
@ -108,6 +111,7 @@ class EnterCodeController extends Controller
/**
* updateCustomer
*
* @param mixed $hascode
* @param mixed $email
* @param mixed $country

View file

@ -17,6 +17,7 @@ class SendArchadiaMail implements ShouldQueue
/**
* To be serialized by jobs system
*
* @var MailContactData
* */
private $data;

View file

@ -16,6 +16,7 @@ class SendNLMail implements ShouldQueue
/**
* To be serialized by jobs system
*
* @var MailContactData
* */
private $data;

View file

@ -28,6 +28,7 @@ class SendOrderToArchadia implements ShouldQueue
/**
* Create a new job instance.
*
* @param \App\Models\Order $order
* @return void
*/

View file

@ -17,6 +17,7 @@ class SendPasserelleMail implements ShouldQueue
/**
* To be serialized by jobs system
*
* @var MailContactData
* */
private $data;

View file

@ -469,7 +469,6 @@ class XmlIncoReader extends XmlJobs
* <TYP_PORTION><![CDATA[Approximatif]]></TYP_PORTION>
* extracted as "TYP_PORTION" => "Approximatif"
*
*
* @param \SimpleXMLElement|false $sxe
* @return array
*/
@ -484,15 +483,18 @@ class XmlIncoReader extends XmlJobs
if ($value->count()) {
$extraction = $this->extract($value);
if(count($extraction)
&& array_key_exists("code",$extraction)
&& array_key_exists("libelle",$extraction)) {
$val = strval($extraction['libelle']);
if (
count($extraction)
&& array_key_exists("code", $extraction)
&& array_key_exists("libelle", $extraction)
) {
$val = strval($extraction['libelle']);
$extract[$key] = strlen($val) ? $val : null;
continue;
}
$extract[$key][] = $extraction; //$this->extract($value);
$extract[$key][] = $extraction;
// $this->extract($value);
continue;
}
$value = strval($value);
@ -501,7 +503,7 @@ class XmlIncoReader extends XmlJobs
} else {
$extract[$key] = strlen($value) ? $value : null;
}
}
}//end foreach
return $extract;
}
}

View file

@ -558,6 +558,7 @@ class Mercanet
/**
* Filter http request parameters
*
* @param array $requestParameters
*/
private function filterRequestParameters(array $httpRequest)
@ -595,6 +596,7 @@ class Mercanet
/**
* Checks if the response is valid
*
* @return boolean
*/
public function isValid()
@ -658,6 +660,7 @@ class Mercanet
/**
* Retrieves a response parameter
*
* @param string $param
* @throws \InvalidArgumentException
*/

View file

@ -5,6 +5,7 @@ namespace App\Lib;
class MesBR
{
private $endpoint;
private $refCamp;
public function __construct($endpoint, $refCamp)

View file

@ -9,20 +9,23 @@ namespace App\Lib;
class MesBROld
{
private $endpoint;
private $refSite;
private $refCamp;
public function __construct($endpoint, $refSite, $refCamp)
{
$this->endpoint = $endpoint;
$this->refSite = $refSite;
$this->refCamp = $refCamp;
$this->refSite = $refSite;
$this->refCamp = $refCamp;
}
/** Update contact *
* NOT USED - SHOULD BE DELETED
*
* @param $oCrmUser
* @return bool
* @return boolean
*/
public function updateContact($oCrmUser)
{
@ -46,9 +49,10 @@ class MesBROld
}
/** Update panier *
*
* @param $oCrmUser
* @param $couponId
* @param int $quantity
* @param integer $quantity
* @return array
*/
public function updatePanier($oCrmUser, $refid, $couponId, $quantity = 1)
@ -56,7 +60,7 @@ class MesBROld
$datas = [
'refsite' => $this->refSite,
'refcamp' => $this->refCamp,
//TODO : ici il faut une id qui est ajoutée au code barre du coupon donc un hascode c'est trop long
// TODO : ici il faut une id qui est ajoutée au code barre du coupon donc un hascode c'est trop long
'refadherent' => $refid,
'nom' => $oCrmUser->lastname,
'prenom' => $oCrmUser->firstname,
@ -66,7 +70,7 @@ class MesBROld
'pays' => $this->getCountry($oCrmUser->country),
'panier' => "($quantity)$couponId"
];
$res = $this->callAPI("GET", "/updatebasket", $datas);
$res = $this->callAPI("GET", "/updatebasket", $datas);
if (!$res) {
error_log("MESBR - CODE : 999 - MESSAGE : Cannot read API Response (non json)");
return ['status' => 'KO', 'code' => 999, 'message' => 'Cannot read API Response (non json)'];
@ -76,7 +80,7 @@ class MesBROld
return ['status' => 'KO', 'code' => $res->Code, 'message' => $res->Message];
}
$panierVerification = $this->endpoint . '/showbasket?basketid=' . $res->Panier->Panier;
$panier_link = $this->endpoint . '/?basketid=' . $res->Panier->Panier;
$panier_link = $this->endpoint . '/?basketid=' . $res->Panier->Panier;
return ['status' => 'OK', 'link' => $panier_link, 'verif' => $panierVerification, 'basketId' => $res->Panier->Panier];
}
/** Génère le lien vers le mur (ou panier préprogrammé) **/
@ -94,7 +98,8 @@ class MesBROld
return 442;
break;
default:
return 250; //France
return 250;
// France
break;
}
}
@ -104,20 +109,23 @@ class MesBROld
switch ($method) {
case "POST":
curl_setopt($curl, CURLOPT_POST, 1);
if ($data)
if ($data) {
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
break;
case "PUT":
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
if ($data)
if ($data) {
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
break;
default:
if ($data)
if ($data) {
$url = sprintf("%s?%s", $url, http_build_query($data));
}
}
curl_setopt($curl, CURLOPT_URL, $this->endpoint . $url);
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($curl, CURLOPT_COOKIESESSION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
if (!$result) {

View file

@ -25,6 +25,7 @@ class Utils
* Replace stange accents
*
* https://stackoverflow.com/questions/3371697/replacing-accented-characters-php
*
* @author Jérémy Munsch <jeremy.munsch@jeremydev.ovh>
* @param string $subject
* @return string

View file

@ -21,8 +21,8 @@ class ReductionWon extends Mailable implements ShouldQueue
*/
public function __construct($user, $linkpanier)
{
$this->user = $user;
$this->linkpanier = $linkpanier;
$this->user = $user;
$this->linkpanier = $linkpanier;
}
/**

View file

@ -126,6 +126,7 @@ class Contact extends Model
/**
* Get Counter skeleton
*
* @return array
*/
private function counterSkeleton(): array

View file

@ -4,7 +4,6 @@ namespace App\Models;
use App\Enums\DepartaimantCollectionType;
use App\Http\Resources\CustomerCrmResource;
use App\Lib\Utils;
use Illuminate\Support\Str;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

View file

@ -34,22 +34,52 @@ class DepartaimantsCollection extends Model
protected $table = 'departaimants';
private static $columnTableNamePrefix = 'col';
// Le prefix d'un table departaimant
/**
* Le prefix d'un table departaimant
*
* @var integer
*/
private static $tableFields = 4;
// Le nombre de colonnes des departaimants
/**
* Le nombre de colonnes des departaimants
*
* @var integer
*/
private static $departementWidth = 2;
// La largeur en bits d'un départaimant
/**
* La largeur en bits d'un départaimant
* * to be set in construct
*
* @var array
*/
public $attributes = [
'type' => 'current'
// to be set in construct
];
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
public $fillable = [
'collection'
];
/**
* Handle dynamic static method calls into the model.
*
* @param string $name
* @param array $arguments
* @return mixed
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
* @phpcs:disable Squiz.Commenting.FunctionComment.ScalarTypeHintMissing
*/
public static function __callStatic($name, $arguments)
{
// phpcs:enable
if ($name === 'defaultType') {
return DepartaimantCollectionType::current();
}
@ -59,8 +89,8 @@ class DepartaimantsCollection extends Model
/**
* @param array $attributes
* @throws TypeError
* @throws BadMethodCallException
* @throws \TypeError
* @throws \BadMethodCallException
*/
public function __construct(array $attributes = [])
{

View file

@ -11,16 +11,25 @@ use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Kwaadpepper\Enum\Traits\CastsEnums;
// old Breeders
class OCBBreeder extends BreederForGmap
{
use CastsEnums;
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'display' => 'boolean',
'inuavs' => 'array'
];
/**
* The attributes that should be cast to Enums.
*
* @var array
*/
protected $enumCasts = [
'presentation_type' => PresentationType::class,
'ocbStatus' => EleveurOcbStatus::class,
@ -28,8 +37,18 @@ class OCBBreeder extends BreederForGmap
'geo_type' => GeoType::class
];
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'ocb_breeders';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'breeder_code',
'first_name',
@ -51,6 +70,11 @@ class OCBBreeder extends BreederForGmap
'inuavs',
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted()
{
static::creating(function ($breeder) {
@ -96,11 +120,18 @@ class OCBBreeder extends BreederForGmap
});
}
/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName()
{
return "slug";
}
// * METHODS
/**
* Get ocb validated breeders query
*
@ -111,28 +142,55 @@ class OCBBreeder extends BreederForGmap
return static::where('ocbStatus', EleveurOcbStatus::yes());
}
/**
* Getter picture attribute
*
* @return mixed
*/
protected function getPictureAttribute()
{
return $this->pictureAttribute('picture');
}
/**
* Getter picture_1 attribute
*
* @return mixed
*/
protected function getPicture1Attribute()
{
return $this->pictureAttribute('picture1');
}
/**
* Getter picture_2 attribute
*
* @return mixed
*/
protected function getPicture2Attribute()
{
return $this->pictureAttribute('picture2');
}
/**
* Getter picture_3 attribute
*
* @return mixed
*/
protected function getPicture3Attribute()
{
return $this->pictureAttribute('picture3');
}
/**
* Refactored picture attribute
*
* @param string $prop
* @return mixed
*/
private function pictureAttribute(string $prop)
{
$p = $this->attributes[$prop];
// For migrated urls from 2016
// For migrated urls from 2016.
if (
is_null($p) or
!strlen($p) or

View file

@ -10,12 +10,27 @@ class OCBContent extends Model
{
use CastsEnums;
/**
* The attributes that should be cast to Enums.
*
* @var array
*/
protected $enumCasts = [
'type' => OCBType::class
];
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'ocb_content';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'picture',
'content',
@ -24,6 +39,11 @@ class OCBContent extends Model
'status'
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted()
{
static::creating(function ($ocbContent) {

View file

@ -11,6 +11,7 @@ use Kwaadpepper\Serial\Exceptions\SerialCasterException;
class Code extends Model
{
protected $table = 'opbrcharcut_codes';
/**
* The attributes that are mass assignable.
*
@ -29,7 +30,6 @@ class Code extends Model
public $timestamps = false;
// * RELATIONS
public function customer()
{
return $this->belongsTo(Customers::class);
@ -83,7 +83,7 @@ class Code extends Model
);
} catch (SerialCasterException $e) {
Log::error($e->getMessage() . " code utilisé : " . $serial);
//return 0 invalid value for code
// return 0 invalid value for code
return 0;
}
}

View file

@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
class CodeEan extends Model
{
protected $table = 'opbrcharcut_codes_eans';
/**
* The attributes that are mass assignable.
*

View file

@ -70,6 +70,7 @@ class Recipes extends Model
/**
* Get Associated Recipes
*
* @return \Illuminate\Database\Eloquent\Collection<Recipes>
*/
public function associatedRecipes()
@ -137,6 +138,7 @@ class Recipes extends Model
/**
* Check if recipe has been rated by the user (in session also if not Auth)
*
* @return boolean
*/
public function hasBeenRatedByUser()
@ -152,6 +154,7 @@ class Recipes extends Model
/**
* Check if recipe has been rated by the user (in session also if not Auth)
*
* @return boolean
*/
public function getUserRating()
@ -167,6 +170,7 @@ class Recipes extends Model
/**
* Set the recipes rating and memorize in session, or user
*
* @param string $rating
* @return void
*/

View file

@ -27,9 +27,6 @@ trait GoogleMapSerialize
case OCBType::poultry()->value:
$ocbType = trans('Éleveur de volaille');
break;
case OCBType::egg()->value:
$ocbType = trans('Producteur d\'oeufs');
break;
case OCBType::rabbit()->value:
$ocbType = trans('Éleveur de lapins');
break;

View file

@ -269,8 +269,6 @@ class MigrateOldDataBase extends LeGaulois2016Migration
case 'lapin':
$model->ocbType = OCBType::rabbit();
break;
case 'oeuf':
$model->ocbType = OCBType::egg();
}
} catch (Exception $e) {
$model->ocbType = OCBType::poultry();
@ -408,8 +406,6 @@ class MigrateOldDataBase extends LeGaulois2016Migration
return OCBType::poultry();
case 'LAPIN':
return OCBType::rabbit();
case 'OEUF':
return OCBType::egg();
}
},
'name' => 'ocb_type',

View file

@ -84,8 +84,6 @@ class RemigrateOcbBreeders extends LeGaulois2016Migration
case 'lapin':
$model->ocbType = OCBType::rabbit();
break;
case 'oeuf':
$model->ocbType = OCBType::egg();
}
} catch (Exception $e) {
$model->ocbType = OCBType::poultry();

View file

@ -78,8 +78,6 @@ class RemigrateOcbBreeders2 extends LeGaulois2016Migration
case 'lapin':
$model->ocbType = OCBType::rabbit();
break;
case 'oeuf':
$model->ocbType = OCBType::egg();
}
} catch (Exception $e) {
$model->ocbType = OCBType::poultry();

View file

@ -0,0 +1,30 @@
<?php
use App\Models\OCBBreeder;
use App\Models\OCBContent;
use Illuminate\Database\Migrations\Migration;
class RemoveOcbEgg extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// * 0 OCB type EGG.
OCBContent::query()->where('ocbType', 0)->delete();
OCBBreeder::query()->where('ocbType', 0)->delete();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// * Wont undo this.
}
}

View file

@ -30,8 +30,6 @@ use Symfony\Component\Console\Terminal;
* return OCBType::poultry();
* case 'LAPIN':
* return OCBType::rabbit();
* case 'OEUF':
* return OCBType::egg();
* }
* },
* 'name' => 'ocb_type',

View file

@ -9,7 +9,6 @@
<file>database/factories</file>
<file>database/seeders</file>
<file>routes/</file>
<file>tests/</file>
<rule ref="PSR1" />
<rule ref="PSR12" />
@ -22,6 +21,7 @@
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Commenting.DocComment.SpacingBeforeTags"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.Commenting.Fixme"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
@ -35,6 +35,7 @@
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
<rule ref="Generic.Metrics.CyclomaticComplexity"/>
<rule ref="Generic.Metrics.NestingLevel"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 KiB

View file

@ -24,11 +24,6 @@
<p>Poulets<br>& Dindes</p>
<a href="{{ route('ocb.poultry') }}">En savoir +</a>
</div>
<div>
<img src="{{ asset('assets/images/ocb/ocb_oeuf_x2.png') }}" alt="Oeuf - Le Gaulois" class="right">
<p>Oeufs</p>
<a href="{{ route('ocb.egg') }}">En savoir +</a>
</div>
</div>
<div class="description">
<p class="ocb-green inline-with-image">

View file

@ -21,10 +21,6 @@
'ocbContents' => $ocbContents
])
<section class="poultry-infos">
<a href="{{ route('ocb.egg') }}" class="next">
<span></span>
<p class="button-text">{{ __('Découvrez les oeufs Oui C\'est Bon!') }}</p>
</a>
<div class="breeder-info">
@if ($breeder !== null && $breeder->picture !== null)
<figure>

View file

@ -250,7 +250,6 @@
<li class="nav-item dropdown btn btn-sm btn-dark mb-1">
<a class="nav-link dropdown-toggle text-white" data-toggle="dropdown" href="#" role="button">{{ __('Oui c\'est Bon!') }}</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="{{route('bo.ocb.content', OCBType::egg())}}">{{ __('Contenus Oeuf') }}</a>
<a class="dropdown-item" href="{{route('bo.ocb.content', OCBType::rabbit())}}">{{ __('Contenus Lapin') }}</a>
<a class="dropdown-item" href="{{route('bo.ocb.content', OCBType::poultry())}}">{{ __('Contenus Volaille') }}</a>
<a class="dropdown-item" href="{{route('bo.ocb.create')}}">{{ __('Ajouter') }}</a>

View file

@ -15,12 +15,12 @@ use App\Models\Recipes;
use Diglactic\Breadcrumbs\Breadcrumbs;
use Diglactic\Breadcrumbs\Generator;
// Root
// * Root
Breadcrumbs::for('home', function (Generator $trail) {
$trail->push(__('Accueil'), route('home'));
});
// First Level
// * First Level
Breadcrumbs::for('contact-us', function (Generator $trail) {
$trail->parent('home');
$trail->push(__('Contact'), route('contact-us'));
@ -42,8 +42,8 @@ Breadcrumbs::for('legal-notice', function (Generator $trail) {
$trail->push(__('Mentions légales'), route('legal-notice'));
});
// Second level
// Products
// * Second level
// * Products
Breadcrumbs::for('products.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(__('Produits'), route('products.index'));
@ -77,12 +77,12 @@ Breadcrumbs::for('product.show', function (Generator $trail, Products $published
$trail->push($publishedProduct->name, route('product.show', compact('publishedProduct')));
});
// Kitchen side
// * Kitchen side
Breadcrumbs::for('kitchen-side.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(__('Coté Cuisine'), route('kitchen-side.index'));
});
// Recipes
// * Recipes
Breadcrumbs::for('recipes.index', function (Generator $trail) {
$trail->parent('kitchen-side.index');
$trail->push(__('Liste des Recettes'), route('recipes.index'));
@ -95,7 +95,7 @@ Breadcrumbs::for('recipes.show', function (Generator $trail, Recipes $recipe) {
['image' => asset($recipe->picture)]
);
});
// Health and nutrition
// * Health and nutrition
Breadcrumbs::for('kitchen-side.health-nutrition.index', function (Generator $trail) {
$trail->parent('kitchen-side.index');
$trail->push(__('Santé et Nutrition'));
@ -115,7 +115,7 @@ Breadcrumbs::for('kitchen-side.health-nutrition.nutrition-quality', function (Ge
);
});
// Kitchen side
// * Kitchen side
Breadcrumbs::for('brand.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(__('La marque'), route('brand.index'));
@ -142,7 +142,7 @@ Breadcrumbs::for('brand.our-quality-commitments', function (Generator $trail) {
$trail->push(__('Nos Engagements Qualité'), route('brand.our-quality-commitments'));
});
// OCB
// * OCB
Breadcrumbs::for('ocb.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(__('Oui c\'est Bon !'), route('ocb.index'));
@ -151,10 +151,6 @@ Breadcrumbs::for('ocb.poultry', function (Generator $trail) {
$trail->parent('ocb.index');
$trail->push(__('Volaille'), route('ocb.poultry'));
});
Breadcrumbs::for('ocb.egg', function (Generator $trail) {
$trail->parent('ocb.index');
$trail->push(__('Oeuf'), route('ocb.egg'));
});
Breadcrumbs::for('ocb.testimonials', function (Generator $trail) {
$trail->parent('ocb.index');
$trail->push(__('Témoignages des Éleveurs'), route('ocb.testimonials'));
@ -204,14 +200,14 @@ Breadcrumbs::for('onsengage.marqueengage.vivreensemble', function (Generator $tr
);
});
// En ce moment
// * En ce moment
Breadcrumbs::for('moment', function (Generator $trail, Moments $moment) {
$trail->parent('home');
$trail->push(__('En ce moment'));
$trail->push($moment->description, route('moment', compact('moment')));
});
// Élevage
// * Élevage
Breadcrumbs::for('breeding-page.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(__('Élevage et alimentation des volailles'), route('breeding-page.index'));
@ -225,13 +221,13 @@ Breadcrumbs::for('breeding-page.show', function (Generator $trail, BreedingPageT
$trail->push($publishedBreedingPage->title, route('breeding-page.show', [$breedingPageType, $publishedBreedingPage]));
});
// Nous rejoindre
// * Nous rejoindre
Breadcrumbs::for('joinus', function (Generator $trail) {
$trail->parent('home');
$trail->push(__('Nous rejoindre'), route('joinus'));
});
// Club
// * Club
Breadcrumbs::for('club.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(__('Le Club des Gaulois'), route('club.index'));
@ -290,8 +286,8 @@ Breadcrumbs::for('account.favs-recipes', function (Generator $trail) {
$trail->push(__('Mes recettes favorites'), route('account.favs-recipes'));
});
// Dans les prés
// OCB
// * Dans les prés
// * OCB
Breadcrumbs::for('danslespres.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(__('Sortant à l’Extérieur Dans Les Prés'), route('danslespres.index'));

View file

@ -159,7 +159,6 @@ Route::prefix('/oui-cest-bon')
Route::get('/temoignages-eleveurs', [OCBController::class, 'testimonials'])->name('testimonials');
Route::get('/volaille', [OCBController::class, 'poultry'])->name('poultry');
Route::get('/volaille', [OCBController::class, 'poultry'])->name('poultry');
Route::get('/oeuf', [OCBController::class, 'egg'])->name('egg');
Route::view('/', 'front.ocb.index')->name('index');
});