Skip to content

Commit

Permalink
Merge pull request #11 from Haven-Code/main
Browse files Browse the repository at this point in the history
refactor api endpoint
  • Loading branch information
phuchptty authored Feb 24, 2024
2 parents 2827db3 + fd37a66 commit db69970
Show file tree
Hide file tree
Showing 30 changed files with 5,919 additions and 2,347 deletions.
2 changes: 1 addition & 1 deletion .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
module.exports = { extends: ['@commitlint/config-conventional'] };
68 changes: 34 additions & 34 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['prettier', '@typescript-eslint'],
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'all',
tabWidth: 2,
insertPragma: false,
endOfLine: 'lf',
emptyLines: true,
useTabs: false,
},
],
},
ignorePatterns: [
'*.js',
'*.cjs',
'package.json',
'package-lock.json',
'pnpm-lock.yaml',
'pnpm-workspace.yaml',
'dist',
'.sst',
'/**/node_modules/*',
'*.d.ts',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['prettier', '@typescript-eslint'],
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'all',
tabWidth: 2,
insertPragma: false,
endOfLine: 'lf',
emptyLines: true,
useTabs: false,
},
],
},
ignorePatterns: [
'*.js',
'*.cjs',
'package.json',
'package-lock.json',
'pnpm-lock.yaml',
'pnpm-workspace.yaml',
'dist',
'.sst',
'/**/node_modules/*',
'*.d.ts',
],
};
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"tabWidth": 2,
"semi": true,
"useTabs": false,
"bracketSpacing": true
"bracketSpacing": true,
"insertPragma": false,
"endOfLine": "lf",
"emptyLines": true
}
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
module.exports = { extends: ['@commitlint/config-conventional'] };
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"typecheck": "tsc --noEmit",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
"prepare": "husky install",
"db:push": "pnpm recursive run db:push",
"db:migrate-gen": "pnpm recursive run db:migrate-gen",
Expand Down
7 changes: 2 additions & 5 deletions packages/core/migrations/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@
"compositePrimaryKeys": {
"scores_studentId_subjectId_pk": {
"name": "scores_studentId_subjectId_pk",
"columns": [
"studentId",
"subjectId"
]
"columns": ["studentId", "subjectId"]
}
},
"uniqueConstraints": {}
Expand Down Expand Up @@ -167,4 +164,4 @@
"schemas": {},
"tables": {}
}
}
}
2 changes: 1 addition & 1 deletion packages/core/migrations/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"breakpoints": true
}
]
}
}
8 changes: 0 additions & 8 deletions packages/core/src/application/ports/schedule/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import {
StudentInfo,
StudentSchedule,
} from '@domain/schedule/proto/quantum/schedule';
import {
GetStudentTuitionFeeReq,
GetStudentTuitionFeeRsp_Data,
} from '@domain/schedule/proto/quantum/student';

export type StudentScheduleData = {
studentInfo: StudentInfo | undefined;
Expand All @@ -20,8 +16,4 @@ export interface IScheduleService {
getStudentSchedule(
param: GetScheduleByStudentCodeReq,
): Promise<StudentScheduleData>;

getStudentTuitionFee(
param: GetStudentTuitionFeeReq,
): Promise<GetStudentTuitionFeeRsp_Data>;
}
1 change: 0 additions & 1 deletion packages/core/src/application/useCases/students/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './studentDetails';
export * from './errors';
export * from './studentTuitionFee';

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions packages/core/src/container/cradle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
SemestersUseCase,
StudentDetailsUseCase,
StudentScheduleUseCase,
StudentTuitionFeeUseCase,
} from '@application/useCases';
import { IAuthService } from '@application/ports/auth';
import { IScheduleService } from '@application/ports/schedule/interfaces';
Expand All @@ -19,5 +18,4 @@ export interface Cradle {
studentDetailsUseCase: StudentDetailsUseCase;
semestersUseCase: SemestersUseCase;
studentScheduleUseCase: StudentScheduleUseCase;
studentTuitionFeeUseCase: StudentTuitionFeeUseCase;
}
2 changes: 0 additions & 2 deletions packages/core/src/container/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
SemestersUseCase,
StudentDetailsUseCase,
StudentScheduleUseCase,
StudentTuitionFeeUseCase,
} from '@application/useCases';
import { AuthService } from '@infra/auth';
import { StudentScheduleService } from '@infra/schedule';
Expand All @@ -32,5 +31,4 @@ container.register({
studentDetailsUseCase: asClass(StudentDetailsUseCase),
semestersUseCase: asClass(SemestersUseCase),
studentScheduleUseCase: asClass(StudentScheduleUseCase),
studentTuitionFeeUseCase: asClass(StudentTuitionFeeUseCase),
});
Loading

0 comments on commit db69970

Please sign in to comment.