first commit

This commit is contained in:
Sampanna Rimal
2024-08-27 17:48:06 +05:45
commit 53c0140f58
10839 changed files with 1125847 additions and 0 deletions

View File

View File

@ -0,0 +1,13 @@
<?php
namespace Modules\Office\Repositories;
interface ContractInterface
{
public function pluck();
public function findAll();
public function getContractById($contractId);
public function delete($contractId);
public function create(array $contractDetails);
public function update($contractId, array $newDetails);
}

View File

@ -0,0 +1,38 @@
<?php
namespace Modules\Office\Repositories;
use Modules\Office\Models\Contract;
class ContractRepository implements ContractInterface
{
public function pluck(){
return Contract::pluck('name','id');
}
public function findAll()
{
return Contract::get();
}
public function getContractById($contractId)
{
return Contract::findOrFail($contractId);
}
public function delete($contractId)
{
Contract::destroy($contractId);
}
public function create(array $contractDetails)
{
return Contract::create($contractDetails);
}
public function update($contractId, array $newDetails)
{
return Contract::where('id', $contractId)->update($newDetails);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Office\Repositories;
interface DepositInterface
{
public function findAll();
public function getDepositById($depositId);
public function delete($depositId);
public function create(array $depositDetails);
public function update($depositId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Office\Repositories;
use Modules\Office\Models\Deposit;
class DepositRepository implements DepositInterface
{
public function findAll()
{
return Deposit::get();
}
public function getDepositById($depositId)
{
return Deposit::findOrFail($depositId);
}
public function delete($depositId)
{
Deposit::destroy($depositId);
}
public function create(array $depositDetails)
{
return Deposit::create($depositDetails);
}
public function update($depositId, array $newDetails)
{
return Deposit::where('id', $depositId)->update($newDetails);
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Modules\Office\Repositories;
interface GeneratorInterface
{
public function pluck();
public function findAll();
public function getGeneratorById($generatorId);
public function delete($generatorId);
public function create(array $generatorDetails);
public function update($generatorId, array $newDetails);
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Office\Repositories;
interface GeneratorLogBookInterface
{
public function findAll();
public function getGeneratorLogBookById($generatorLogBookId);
public function delete($generatorLogBookId);
public function create(array $generatorLogBookDetails);
public function update($generatorLogBookId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Office\Repositories;
use Modules\Office\Models\GeneratorLogBook;
class GeneratorLogBookRepository implements GeneratorLogBookInterface
{
public function findAll()
{
return GeneratorLogBook::get();
}
public function getGeneratorLogBookById($generatorLogBookId)
{
return GeneratorLogBook::findOrFail($generatorLogBookId);
}
public function delete($generatorLogBookId)
{
GeneratorLogBook::destroy($generatorLogBookId);
}
public function create(array $generatorLogBookDetails)
{
return GeneratorLogBook::create($generatorLogBookDetails);
}
public function update($generatorLogBookId, array $newDetails)
{
return GeneratorLogBook::where('id', $generatorLogBookId)->update($newDetails);
}
}

View File

@ -0,0 +1,38 @@
<?php
namespace Modules\Office\Repositories;
use Modules\Office\Models\Generator;
class GeneratorRepository implements GeneratorInterface
{
public function pluck(){
return Generator::pluck('name','id');
}
public function findAll()
{
return Generator::get();
}
public function getGeneratorById($generatorId)
{
return Generator::findOrFail($generatorId);
}
public function delete($generatorId)
{
Generator::destroy($generatorId);
}
public function create(array $generatorDetails)
{
return Generator::create($generatorDetails);
}
public function update($generatorId, array $newDetails)
{
return Generator::where('id', $generatorId)->update($newDetails);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Office\Repositories;
interface PurchaseServiceInterface
{
public function findAll();
public function getPurchaseServiceById($purchaseServiceId);
public function delete($purchaseServiceId);
public function create(array $purchaseServiceDetails);
public function update($purchaseServiceId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Office\Repositories;
use Modules\Office\Models\PurchaseService;
class PurchaseServiceRepository implements PurchaseServiceInterface
{
public function findAll()
{
return PurchaseService::get();
}
public function getPurchaseServiceById($purchaseServiceId)
{
return PurchaseService::findOrFail($purchaseServiceId);
}
public function delete($purchaseServiceId)
{
PurchaseService::destroy($purchaseServiceId);
}
public function create(array $purchaseServiceDetails)
{
return PurchaseService::create($purchaseServiceDetails);
}
public function update($purchaseServiceId, array $newDetails)
{
return PurchaseService::where('id', $purchaseServiceId)->update($newDetails);
}
}