-
Notifications
You must be signed in to change notification settings - Fork 1
BreakPoint -> Starter Dev #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GoranStefanovski
wants to merge
72
commits into
NikolovskiRatko:dev
Choose a base branch
from
GoranStefanovski:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
bc6f35e
initial breakpoint commit
GoranStefanovski 1a6d4dc
initial layouting changes commit
GoranStefanovski 1e8749e
adding permissions and roles
GoranStefanovski 1efaafe
add new tables for leave types and user days count, add to seeder
GoranStefanovski 2d6517e
add leave_requests migration, add leave type php
GoranStefanovski 137ff9c
mave view for leave types available
GoranStefanovski 191a348
add PHP for leave requests
GoranStefanovski 49368fa
enable listing of leave types
GoranStefanovski 4b22c6c
fix create and update for leaveTypes
GoranStefanovski 9ee9dde
update leave types search, create leave request page core, starting d…
GoranStefanovski 8f36eb6
fix save on request, update migration and types
GoranStefanovski 9cf1b27
minor update to view and change in draw search
GoranStefanovski 8545c91
frontend work with dropdowns and design
GoranStefanovski ac70986
fix migration, fix typo and fix request edit
GoranStefanovski 3dc375f
fix branding, fix my profile page
GoranStefanovski c5e38dc
fix issues with minimize
GoranStefanovski 7c4c6d6
add confirmation page, add permissions, add proper save to all values…
GoranStefanovski 58b4824
add email sending to admins and assigned manager, remove faker accounts
GoranStefanovski 9673084
email hadndling on create/update, approve and decline request day api…
GoranStefanovski 70d8858
show status on requests
GoranStefanovski ec6c97b
add status badge to requests
GoranStefanovski f67a8df
add colors on btns
GoranStefanovski b9d0b95
create Calendar user tab, tab active classes fix
GoranStefanovski be924e0
get approved days by user in edit, show request depending on role
GoranStefanovski 82086a5
draw leave types for colors in the calendar
GoranStefanovski e843ba0
add max leave and leave felt in user
GoranStefanovski c792412
add if leave type paid vacation, to substract days left, add better d…
GoranStefanovski 424f24d
disable paid if no paid days left
GoranStefanovski 0fa2849
add singe calendar view for user
GoranStefanovski 037ef82
add calendar view for all people
GoranStefanovski 540b342
add national holiday db, add country dropdown for user, add command f…
GoranStefanovski 8b20ab3
remove sensitive from .env
GoranStefanovski 0fbd2da
add deduct vacation paid days function, removing holidays and weekend…
GoranStefanovski f716ccf
add national holidays in main calendar
GoranStefanovski 4dcb644
add national holiday on user calendar
GoranStefanovski 93a3194
change command to not save holiday if weekend
GoranStefanovski b4d5cc2
disable national holiday
GoranStefanovski 8b5dd9f
show days left on user row
GoranStefanovski d87a3c9
add main dashboard views and tables
GoranStefanovski ac246cb
change command
GoranStefanovski bb229f1
Refactor leave days and add relation to leavedays to user and leave t…
StefanUgrenovikj fc4fd18
fix deleting and editing requests, fix email sendings
GoranStefanovski d6ef2ce
fix email templates
GoranStefanovski 6ef7a01
add work from home
GoranStefanovski a4eb6b4
fix apis, improve work from home functionality
GoranStefanovski 1648650
add is_office_based in DB and in User view
GoranStefanovski 4d993a1
make sortabkle
GoranStefanovski b2298e0
fix setback routes, add filtering to headers
GoranStefanovski 01d3530
add loading to save button
GoranStefanovski 3351eb2
approve loading
GoranStefanovski f49e319
fix my profile page
GoranStefanovski f129dcf
fix back button on my profile
GoranStefanovski 5678ba6
add reason to email template, fix approve/decline buttons to show to …
GoranStefanovski be4d84d
changes in hompeage public, request validation for leave requets, cha…
GoranStefanovski f197bbb
Add delete crud for users and leave request and add modal for confirm
StefanUgrenovikj 8e8cbc6
add document table, send pdf to email, download pdf in users, fix my …
GoranStefanovski 04be158
fix approve decline stylie
GoranStefanovski c84e1fd
fix pdf file with layouting data, need to update cyrilic data in DB
GoranStefanovski 7ae04d8
fix layouting with leave types row in leave calendar tab and page
GoranStefanovski 4e7075b
small layouting changes
GoranStefanovski d023067
Merge pull request #1 from GoranStefanovski/breakpoint-to-dev
GoranStefanovski 2070a1e
add pdf mail to administration, add cancelation email
GoranStefanovski dec80d4
ad MK templates
GoranStefanovski 038832b
Merge branch 'breakpoint-master' into dev
GoranStefanovski c14d51a
change email subjects, change approve bg color btn
GoranStefanovski 9d5b51b
add validation for leave types and leave requests
GoranStefanovski d7bae06
delete leave type, refactor not needed code
GoranStefanovski d2be3f9
rename in leavetypes
GoranStefanovski c9048a5
update user id confirmed by
GoranStefanovski a373bd0
add error messages
GoranStefanovski b92e1ae
Merge branch 'breakpoint-master' into dev
GoranStefanovski 9c1fda3
test deploy
GoranStefanovski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "workbench.colorCustomizations": { | ||
| "activityBar.activeBackground": "#7c83e9", | ||
| "activityBar.background": "#7c83e9", | ||
| "activityBar.foreground": "#15202b", | ||
| "activityBar.inactiveForeground": "#15202b99", | ||
| "activityBarBadge.background": "#f6c8cb", | ||
| "activityBarBadge.foreground": "#15202b", | ||
| "commandCenter.border": "#e7e7e799", | ||
| "sash.hoverBorder": "#7c83e9", | ||
| "statusBar.background": "#505ae2", | ||
| "statusBar.foreground": "#e7e7e7", | ||
| "statusBarItem.hoverBackground": "#7c83e9", | ||
| "statusBarItem.remoteBackground": "#505ae2", | ||
| "statusBarItem.remoteForeground": "#e7e7e7", | ||
| "titleBar.activeBackground": "#505ae2", | ||
| "titleBar.activeForeground": "#e7e7e7", | ||
| "titleBar.inactiveBackground": "#505ae299", | ||
| "titleBar.inactiveForeground": "#e7e7e799" | ||
| }, | ||
| "peacock.color": "#505ae2" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ DB_USERNAME=root | |
| DB_PASSWORD=password | ||
|
|
||
| BROADCAST_DRIVER=log | ||
| CACHE_DRIVER=memcached | ||
| CACHE_DRIVER=file | ||
| SESSION_DRIVER=file | ||
| SESSION_LIFETIME=120 | ||
| QUEUE_CONNECTION=sync | ||
|
|
@@ -27,13 +27,14 @@ REDIS_HOST=redis | |
| REDIS_PASSWORD=null | ||
| REDIS_PORT=6379 | ||
|
|
||
| MAIL_DRIVER=smtp | ||
| MAIL_HOST=smtp.mailtrap.io | ||
| MAIL_PORT=587 | ||
| MAIL_USERNAME=14b3bc30ce304d | ||
| MAIL_PASSWORD=22b08660b859f6 | ||
| MAIL_FROM_ADDRESS="[email protected]" | ||
| MAIL_FROM_NAME="${APP_NAME}" | ||
| MAIL_MAILER=smtp | ||
| MAIL_HOST=sandbox.smtp.mailtrap.io | ||
| MAIL_PORT=2525 | ||
| MAIL_USERNAME=USERNAME | ||
| MAIL_PASSWORD=PASSWORD | ||
| MAIL_ENCRYPTION=tls | ||
| [email protected] | ||
| MAIL_FROM_NAME="Leave Management System" | ||
|
|
||
| AWS_ACCESS_KEY_ID= | ||
| AWS_SECRET_ACCESS_KEY= | ||
|
|
@@ -55,3 +56,5 @@ VITE_PUSHER_HOST="${PUSHER_HOST}" | |
| VITE_PUSHER_PORT="${PUSHER_PORT}" | ||
| VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" | ||
| VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" | ||
|
|
||
| HOLIDAYS_YEAR="2025" | ||
82 changes: 82 additions & 0 deletions
82
app/api/app/Applications/Document/Controllers/DocumentController.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| <?php | ||
|
|
||
| namespace App\Applications\Document\Controllers; | ||
|
|
||
| use App\Applications\Document\DTO\DocumentDTO; | ||
| use Illuminate\Http\Request; | ||
| use App\Http\Controllers\Controller; | ||
| use App\Applications\Document\Services\DocumentServiceInterface; | ||
| use Illuminate\Support\Facades\Route; | ||
| use Illuminate\Validation\ValidationException; | ||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||
|
|
||
| /** | ||
| * @property DocumentServiceInterface $documentService | ||
| */ | ||
| class DocumentController extends Controller | ||
| { | ||
| public function __construct( | ||
| DocumentServiceInterface $documentService | ||
| ) { | ||
| $this->documentService = $documentService; | ||
| } | ||
|
|
||
| /** | ||
| * Get a JSON with all the users | ||
| * | ||
| * @return JsonResponse | ||
| */ | ||
| public function getAll(): JsonResponse | ||
| { | ||
| $leaveTypeDTOs = $this->documentService->getAll(); | ||
| return response()->json($leaveTypeDTOs); | ||
| } | ||
|
|
||
| /** | ||
| * Get a JSON with a user by ID | ||
| * | ||
| * @param integer $id | ||
| * @return JsonResponse | ||
| */ | ||
| public function get(int $id): JsonResponse | ||
| { | ||
| $leaveTypeDTO = $this->documentService->get($id); | ||
| return response()->json($leaveTypeDTO); | ||
| } | ||
|
|
||
| /** | ||
| * Get a paginated, filtered and sorted array of Users. | ||
| * This endpoint requires some data in the request. | ||
| * | ||
| * @param Request $request | ||
| * @return JsonResponse | ||
| */ | ||
| public function draw(Request $request): JsonResponse | ||
| { | ||
| try { | ||
| $data = $request->all(); | ||
| $leaveTypesDTO = $this->documentService->draw($data); | ||
|
|
||
| return response()->json($leaveTypesDTO); | ||
| } catch (\InvalidArgumentException $e) { | ||
| // Handle specific exceptions like InvalidArgumentException | ||
| return response()->json([ | ||
| 'error' => 'Invalid Argument', | ||
| 'message' => $e->getMessage(), | ||
| ], 400); // Bad Request status code | ||
| } catch (\ValidationException $e) { | ||
| // Handle validation exceptions | ||
| return response()->json([ | ||
| 'error' => 'Validation Error', | ||
| 'message' => $e->getMessage(), | ||
| 'errors' => $e->errors(), | ||
| ], 422); // Unprocessable Entity status code | ||
| } catch (\Exception $e) { | ||
| // Handle any other general exceptions | ||
| return response()->json([ | ||
| 'error' => 'Server Error', | ||
| 'message' => $e->getMessage(), | ||
| ], 500); // Internal Server Error status code | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| <?php | ||
|
|
||
| namespace App\Applications\Document\DTO; | ||
|
|
||
| use App\Applications\Document\Model\Document; | ||
| use Illuminate\Http\Request; | ||
|
|
||
| class DocumentDTO | ||
| { | ||
| public string $file_name; | ||
| public string $file_path; | ||
| public int $id; | ||
| public int $leave_request_id; | ||
| public int $user_id; | ||
|
|
||
| public function __construct( | ||
| string $file_name, | ||
| string $file_path, | ||
| int $id = 0, | ||
| int $leave_request_id = 0, | ||
| int $user_id = 0, | ||
| ) { | ||
| $this->file_name = $file_name; | ||
| $this->file_path = $file_path; | ||
| $this->id = $id; | ||
| $this->leave_request_id = $leave_request_id; | ||
| $this->user_id = $user_id; | ||
| } | ||
|
|
||
| public static function fromRequest(Request $request): self | ||
| { | ||
| return new self( | ||
| $request->input('file_name'), | ||
| $request->input('file_path'), | ||
| $request->input('id', 0), | ||
| $request->input('leave_request_id', 0), | ||
| $request->input('user_id', 0), | ||
| ); | ||
| } | ||
|
|
||
| public static function fromRequestForCreate(Request $request): self | ||
| { | ||
| return new self( | ||
| $request->input('file_name'), | ||
| $request->input('file_path'), | ||
| id: 0, | ||
| leave_request_id: 0, | ||
| user_id: 0, | ||
| ); | ||
| } | ||
|
|
||
| public static function fromModel(Document $document): self | ||
| { | ||
| return new self( | ||
| $document->file_name, | ||
| $document->file_path, | ||
| $document->id, | ||
| $document->leave_request_id, | ||
| $document->user_id, | ||
|
|
||
| ); | ||
| } | ||
|
|
||
| public function jsonSerialize(): array | ||
| { | ||
| return $this->toArray(); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'name' => $this->file_name, | ||
| 'slug' => $this->file_path, | ||
| 'id' => $this->id, | ||
| 'leave_request_id' => $this->leave_request_id, | ||
| 'user_id' => $this->user_id, | ||
| ]; | ||
| } | ||
|
|
||
| public static function fromCollection(iterable $leaveTypes): array | ||
| { | ||
| return array_map(function (Document $leaveType) { | ||
| return self::fromModel($leaveType); | ||
| }, $leaveTypes->all()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <?php | ||
|
|
||
| namespace App\Applications\Document\Model; | ||
|
|
||
| use Illuminate\Database\Eloquent\Model; | ||
|
|
||
| class Document extends Model | ||
| { | ||
| protected $fillable = ['user_id', 'leave_request_id', 'file_name', 'file_path']; | ||
| public $timestamps = true; | ||
| } |
58 changes: 58 additions & 0 deletions
58
app/api/app/Applications/Document/Providers/DocumentServiceProvider.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| <?php | ||
|
|
||
| namespace App\Applications\Document\Providers; | ||
|
|
||
| use App\Applications\Document\Repositories\DocumentRepository; | ||
| use App\Applications\Document\Repositories\DocumentRepositoryInterface; | ||
| use App\Applications\Document\Services\DocumentService; | ||
| use App\Applications\Document\Services\DocumentServiceInterface; | ||
| use Illuminate\Support\Facades\Route; | ||
| use Illuminate\Support\ServiceProvider; | ||
|
|
||
| class DocumentServiceProvider extends ServiceProvider | ||
| { | ||
| /** | ||
| * Set the service provider namespace | ||
| * | ||
| */ | ||
| protected $namespace = 'App\Applications\Document'; | ||
| /** | ||
| * Bootstrap the application services. | ||
| * | ||
| * @return void | ||
| */ | ||
| public function boot() | ||
| { | ||
| if ($this->app->routesAreCached()) { | ||
| // This is already done in the main RouteServiceProvider so not needed here | ||
| } else { | ||
|
|
||
| $this->app->call([$this, 'map']); | ||
|
|
||
| $this->app->booted(function () { | ||
| $this->app['router']->getRoutes()->refreshNameLookups(); | ||
| $this->app['router']->getRoutes()->refreshActionLookups(); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Register the application services. | ||
| * | ||
| * @return void | ||
| */ | ||
| public function register() | ||
| { | ||
| $this->app->bind(DocumentRepositoryInterface::class, DocumentRepository::class); | ||
| $this->app->bind(DocumentServiceInterface::class, DocumentService::class); | ||
| } | ||
|
|
||
| public function map() | ||
| { | ||
| Route::prefix('api') | ||
| ->middleware('api') | ||
| ->namespace($this->namespace) | ||
| ->group(base_path('routes/Document/api.php')); | ||
| } | ||
|
|
||
| } |
55 changes: 55 additions & 0 deletions
55
app/api/app/Applications/Document/Repositories/DocumentRepository.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| <?php | ||
|
|
||
| namespace App\Applications\Document\Repositories; | ||
|
|
||
| use App\Applications\Document\DTO\DocumentDTO; | ||
| use App\Applications\Pagination\StarterPaginator; | ||
| use App\Applications\Document\Model\Document; | ||
|
|
||
|
|
||
| /** | ||
| * @property Document $document | ||
| */ | ||
| class DocumentRepository implements DocumentRepositoryInterface | ||
| { | ||
| public function __construct( | ||
| Document $document, | ||
| ) { | ||
| $this->document = $document; | ||
| } | ||
|
|
||
| private const COLUMNS_MAP = [ | ||
| 'file_name' => 'documents.file_name', | ||
| 'file_path' => 'documents.file_path', | ||
| ]; | ||
|
|
||
| public function getAll(): array | ||
| { | ||
| $documents = $this->document::all(); | ||
| return DocumentDTO::fromCollection($documents); | ||
| } | ||
|
|
||
| public function get($id): Document | ||
| { | ||
| return $this->document::findOrFail($id); | ||
| } | ||
|
|
||
| public function draw($data): StarterPaginator | ||
| { | ||
| // $paginatedUsers = $this->prepareDatatableQuery($data, [User::ADMIN, User::EDITOR, User::COLLABORATOR]); | ||
| $query = $this->document->query(); | ||
|
|
||
| // $query->whereIn('roles.name', $roles); | ||
|
|
||
| if (array_key_exists($data['column'], self::COLUMNS_MAP)) { | ||
| $query->orderBy(self::COLUMNS_MAP[$data['column']], $data['dir']); | ||
| } | ||
|
|
||
| $userId = $data['userId']; | ||
| if ($userId ) { | ||
| $query->where('documents.user_id', '=', $userId); | ||
| } | ||
|
|
||
| return $query->paginate($data['length']); | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
app/api/app/Applications/Document/Repositories/DocumentRepositoryInterface.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <?php | ||
|
|
||
| namespace App\Applications\Document\Repositories; | ||
|
|
||
| use App\Applications\Pagination\StarterPaginator; | ||
| use App\Applications\Document\DTO\DocumentDTO; | ||
| use App\Applications\Document\Model\Document; | ||
|
|
||
| /** | ||
| * Interface DocumentRepositoryInterface | ||
| * @package App\Applications\Document | ||
| */ | ||
|
|
||
| interface DocumentRepositoryInterface | ||
| { | ||
| /** | ||
| * @return array | ||
| */ | ||
| public function getAll(): array; | ||
|
|
||
| /** | ||
| * @param integer $id | ||
| * @return Document | ||
| */ | ||
| public function get($id); | ||
|
|
||
| /** | ||
| * @param array $data | ||
| * @return StarterPaginator | ||
| */ | ||
| public function draw(array $data): StarterPaginator; | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${APP_NAME} is more appropriate for this and not sure for the rest of the values