From c371b60746651eea3018358658e053a06a31a45e Mon Sep 17 00:00:00 2001 From: Supan Adit Pratama Date: Sat, 26 Oct 2024 17:51:27 +0700 Subject: [PATCH] wip: id might be number or uuid alias string --- .../controller/skeleton-crud.controller.interface.ts | 12 ++++++++++++ .../src/interfaces/skeleton-process.interface.ts | 10 ++++++++++ .../src/interfaces/standard-process.interface.ts | 8 -------- libs/skeleton/src/skeleton-crud.controller.ts | 5 +++-- 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 libs/skeleton/src/interfaces/controller/skeleton-crud.controller.interface.ts create mode 100644 libs/skeleton/src/interfaces/skeleton-process.interface.ts delete mode 100644 libs/skeleton/src/interfaces/standard-process.interface.ts diff --git a/libs/skeleton/src/interfaces/controller/skeleton-crud.controller.interface.ts b/libs/skeleton/src/interfaces/controller/skeleton-crud.controller.interface.ts new file mode 100644 index 0000000..6c3e672 --- /dev/null +++ b/libs/skeleton/src/interfaces/controller/skeleton-crud.controller.interface.ts @@ -0,0 +1,12 @@ +export interface ISkeletonCRUDController { + create(); + readSelected(id); + readPagination(); + readEntire(); + updatePartial(); + updatePartialBatch(); + updateEntire(); + updateEntirePatch(); + deleteSelected(); + deleteBatch(); +} diff --git a/libs/skeleton/src/interfaces/skeleton-process.interface.ts b/libs/skeleton/src/interfaces/skeleton-process.interface.ts new file mode 100644 index 0000000..a9727c9 --- /dev/null +++ b/libs/skeleton/src/interfaces/skeleton-process.interface.ts @@ -0,0 +1,10 @@ +export interface StandardProcess { + initialization(): void; + before(): void; + begin(): void; + process(): void; + end(): void; + after(): void; + + result(); +} diff --git a/libs/skeleton/src/interfaces/standard-process.interface.ts b/libs/skeleton/src/interfaces/standard-process.interface.ts deleted file mode 100644 index 71cfd4a..0000000 --- a/libs/skeleton/src/interfaces/standard-process.interface.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface StandardProcess { - Initialization(): void; - Before(): void; - Begin(): void; - Process(): void; - End(): void; - After(): void; -} diff --git a/libs/skeleton/src/skeleton-crud.controller.ts b/libs/skeleton/src/skeleton-crud.controller.ts index 2ab0cac..af90e2a 100644 --- a/libs/skeleton/src/skeleton-crud.controller.ts +++ b/libs/skeleton/src/skeleton-crud.controller.ts @@ -1,11 +1,12 @@ import { Delete, Get, Param, Patch, Post, Put } from '@nestjs/common'; +import { ISkeletonCRUDController } from './interfaces/controller/skeleton-crud.controller.interface'; -export class SkeletonCRUDController { +export class SkeletonCRUDController implements ISkeletonCRUDController { @Post() create() {} @Get(':id') - readSelected(@Param('id') id: string) {} + readSelected(@Param('id') id) {} @Get() readPagination() {}