Skip to content

Commit b43b774

Browse files
author
Luiz Neto
committed
fix namespace
1 parent 011392b commit b43b774

19 files changed

+125
-41
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ PUSHER_APP_CLUSTER=mt1
3737

3838
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
3939
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
40+
GOOGLE_CALENDAR_AUTH_PROFILE=oauth
4041
GOOGLE_API_KEY=
4142
GOOGLE_CLIENT_ID=
4243
GOOGLE_CLIENT_SECRET=

app/Conversations/Boasvindas.php

+15-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use BotMan\BotMan\Messages\Incoming\Answer;
1010
use BotMan\BotMan\Messages\Outgoing\Actions\Button;
1111
use BotMan\BotMan\Messages\Outgoing\Question;
12+
use Illuminate\Support\Facades\DB;
1213
use Illuminate\Support\Facades\Validator;
1314
use Illuminate\Support\Str;
1415

@@ -43,17 +44,23 @@ public function pegaResposta($valido = null){
4344

4445
$this->ask('Qual motivo para o seu contato conosco?',function(Answer $resposta) use($email){
4546
$user = $this->getBot()->getUser();
46-
$cliente = Cliente::create([
47-
'nome' => $this->respostas[0]['resposta'],
48-
'email' => $email,
49-
'telefone' => $user->getId(),
50-
'whatsapp' => true,
51-
'motivo' => $resposta->getText(),
52-
'password' => $user->getId().'#'.$email
53-
]);
47+
DB::beginTransaction();
48+
$cliente = Cliente::create([
49+
'nome' => $this->respostas[0]['resposta'],
50+
'email' => $email,
51+
'telefone' => $user->getId(),
52+
'whatsapp' => true,
53+
'motivo' => $resposta->getText(),
54+
'password' => $user->getId().'#'.$email
55+
]);
56+
57+
DB::commit();
58+
5459
GeraAtendimento::dispatch($this->respostas,$cliente->id);
5560
$this->say('Suas informações foram cadastradas com sucesso!');
5661
$this->bot->startConversation(new AtendimentoConversation($cliente));
62+
63+
5764
});
5865

5966
});

app/Conversations/ExampleConversation.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public function askFirstname()
3131
$opcao = $resposta;
3232
if($opcao == 'sim'){
3333
$this->say('Seja bem vindo! Vamos fazer um cadastro para melhor atendê-lo. 😊');
34-
$formulario = Formulario::first();
34+
35+
$formulario = Formulario::find(2);
3536
$this->bot->startConversation(new Boasvindas($formulario));
3637
}elseif($opcao == 'não'){
3738
$this->askEmail();

app/Jobs/GeraAtendimento.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function handle()
3030
{
3131

3232
Db::beginTransaction();
33-
33+
dd($this->respostas);
3434
foreach ($this->respostas as $resposta) {
3535
RespostaFormulario::insert([
3636
'formulario_id' => $resposta['formulario_id'],

app/Models/Psicologo/UsesGoogleCalendar.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ trait UsesGoogleCalendar
88
{
99
public function googleAuth()
1010
{
11-
return $this->hasOne(GoogleAuth::class);
11+
return $this-> hasOne(GoogleAuth::class);
1212
}
1313
}

app/Services/BaseService.php

100644100755
File mode changed.

app/Services/Cliente/TokenLinkService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Illuminate\Support\Facades\URL;
99
use Illuminate\Support\Str;
1010

11-
class TokenLinkService extends BaseService{
11+
class TokenLinkService extends BaseService {
1212

1313
public function __construct(TokenLinkRepository $repo)
1414
{

app/Services/Psicologo/GoogleCalendarService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getEvents(Psicologo $user, Carbon $from, Carbon $to)
8989
'info' => $this->getEntryPoints($event->getConferenceData()),
9090
'recurrence' => isset($event->recurrence[0]) ? $this->parseRecurrenceRule($event->recurrence[0]) : '',
9191
'status' => $event->status,
92-
'descricao' => $event->description,
92+
'description' => $event->description,
9393
]);
9494

9595
}

app/Services/ServiceInterface.php

100644100755
File mode changed.

app/helpers.php

100644100755
File mode changed.

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"laravel/ui": "^2.0",
2828
"livewire/livewire": "^1.1",
2929
"rlanvin/php-rrule": "^2.2",
30-
"silviolleite/laravelpwa": "^2.0"
30+
"silviolleite/laravelpwa": "^2.0",
31+
"spatie/laravel-google-calendar": "^3.2"
3132
},
3233
"require-dev": {
3334
"barryvdh/laravel-debugbar": "^3.3",

composer.lock

100644100755
+72-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/botman/telegram.php

100644100755
File mode changed.

database/seeds/DatabaseSeeder.php

+25-24
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,31 @@ class DatabaseSeeder extends Seeder
1515
*/
1616
public function run()
1717
{
18-
$this->call(UsersTableSeeder::class);
19-
$this->call(FormularioCadastroSeeder::class);
20-
$psi = 1;
21-
for($i = 1 ; $i < 6; $i++){
22-
for($j= 8 ; $j < 17 ; $j +=2 ){
23-
if($j < 12 or $j > 13){
24-
$horario = Horario::create([
25-
'psicologo_id' => $psi,
26-
'dia_semana' => $i,
27-
'hora_inicio' => Carbon::create(null,null,null,$j,0,0),
28-
'hora_final' => Carbon::create(null,null,null,$j+1,0,0)
29-
]);
30-
Agendamento::create([
31-
'cliente_id' => factory(Cliente::class)->create()->id,
32-
'horario_id' => $horario->id,
33-
'status' => Agendamento::PENDENTE,
34-
'data_agendada' => Carbon::create(2020,9,$i,0)->startOfWeek()
35-
->addDays($horario->dia_semana > 1 ? $horario->dia_semana-1 : 0)
36-
->hour($horario->hora_inicio->hour)
37-
->minute($horario->hora_inicio->minute)
38-
]);
39-
}
40-
}
41-
}
18+
// $this->call(UsersTableSeeder::class);
19+
// $this->call(FormularioCadastroSeeder::class);
20+
$this->call(FormularioAtendimentoInfAcadSeeder::class);
21+
// $psi = 1;
22+
// for($i = 1 ; $i < 6; $i++){
23+
// for($j= 8 ; $j < 17 ; $j +=2 ){
24+
// if($j < 12 or $j > 13){
25+
// $horario = Horario::create([
26+
// 'psicologo_id' => $psi,
27+
// 'dia_semana' => $i,
28+
// 'hora_inicio' => Carbon::create(null,null,null,$j,0,0),
29+
// 'hora_final' => Carbon::create(null,null,null,$j+1,0,0)
30+
// ]);
31+
// Agendamento::create([
32+
// 'cliente_id' => factory(Cliente::class)->create()->id,
33+
// 'horario_id' => $horario->id,
34+
// 'status' => Agendamento::PENDENTE,
35+
// 'data_agendada' => Carbon::create(2020,9,$i,0)->startOfWeek()
36+
// ->addDays($horario->dia_semana > 1 ? $horario->dia_semana-1 : 0)
37+
// ->hour($horario->hora_inicio->hour)
38+
// ->minute($horario->hora_inicio->minute)
39+
// ]);
40+
// }
41+
// }
42+
// }
4243
//$this->call(AtendimentoTableSeeder::class);
4344
}
4445
}

database/seeds/FormularioAtendimentoInfAcadSeeder.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

3-
use App\Models\CampoFormulario;
3+
use App\Models\Formulario\CampoFormulario;
4+
use App\Models\Formulario\Formulario;
45
use Illuminate\Database\Seeder;
56

67
class FormularioAtendimentoInfAcadSeeder extends Seeder

resources/views/chat.blade.php

100644100755
File mode changed.

resources/views/livewire/psicologo/agenda/agenda.blade.php

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<div class="container mx-auto px-4">
2020
@component('partials.card')
2121
@slot('class','bg-primary')
22+
2223
@if(auth()->user()->googleAuth == null)
2324
<a href="{{$this->googleUrl}}" class="m-4 px-4 py-2 border border-gray-300 bg-button text-button rounded-md hover:bg-secondary hover:text-secondary ">Integrar ao Google Calendário</a>
2425
@endif

resources/views/livewire/psicologo/atendimento/index.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div>
1+
<div>
22
@component('partials.card')
33
@slot('class','bg-primary container py-2 py-4 mx-auto')
44
<div class="flex flex-col">

resources/views/partials/botman.blade.php

100644100755
File mode changed.

0 commit comments

Comments
 (0)