wanted-pre-onboarding-backend7-r / daily-budget Goto Github PK
View Code? Open in Web Editor NEW오늘의 예산 알림 서비스 API
오늘의 예산 알림 서비스 API
기존의 enum 클래스 안에 @JsonCreator
적용한 함수를 만들고 입력된 문자열이 해당 enum 필드에 매칭되는지 확인하고 없으면 null로 반환, 그리고 custom validator에서 단순히 null 체크하는 방식으로 enum 유효성 검증
기능 | Method | URL | 개발 여부 |
---|---|---|---|
유저 회원가입 | POST | /api/members/signup | O |
유저 정보 수정 | PATCH | /api/members | |
로그인 | POST | /api/auth/login | O |
로그아웃 | POST | /api/auth/logout | O |
토큰 재발급 | POST | /api/auth/reissue | O |
카테고리 목록 조회 | GET | /api/categories | O |
예산 설정 | PUT | /api/budgets | O |
예산 설계 | GET | /api/budgets/recommend | |
지출 생성 | POST | /api/expenditures | O |
지출 목록 조회 | GET | /api/expenditures?queryparams... | O |
지출 상세 조회 | GET | /api/expenditures/{expenditureId} | O |
지출 수정 | PATCH | /api/expenditures/{expenditureId} | O |
지출 삭제 | DELETE | /api/expenditures/{expenditureId} | O |
오늘 지출 추천 | GET | /api/expenditures/recommend | |
오늘 예산 안내 | GET | /api/budgets/daily | |
지출 통계 | GET | /api/expenditures/stats |
참고 & 고민
컬럼 | 타입 | 제약 조건 | 설명 |
---|---|---|---|
id | bigint | pk, not null, unsigend, auto increment | 고유 식별자 |
account_id | varchar(20) | unique, not null | 사용자 계정 id |
password | char(60) | not null | 사용자 비밀번호 |
role | varchar(20) | not null | 권한(현재는 ROLE_USER만 존재) |
name | varchar(20) | not null | 사용자 이름 |
allow_daily_budget_noti | tinyint(1) | not null, default(0) | 오늘 가용 예산 알림 허용 여부 |
allow_daily_expenditure_noti | tinyint(1) | not null, default(0) | 오늘 사용한 지출 알림 허용 여부 |
created_at | timestamp | not null | 데이터 생성 일시 |
updated_at | timestamp | - | 데이터 수정 일시 |
기타
알림 종류1, 알림 종류2
이런 방식으로 저장하고 파싱해서 서버에서 사용?컬럼 | 타입 | 제약 조건 | 설명 |
---|---|---|---|
id | bigint | pk, not null, unsigend, auto increment | 고유 식별자 |
member_id | bigint | fk, not null, unsigend | 멤버 fk |
budget_year | int | not null, unsigend | 예산 년 정보 |
budget_month | int | not null, unsigend | 예산 월 정보 |
total_amount | bigint | not null, unsigend | 예산 총액 |
created_at | timestamp | not null | 데이터 생성 일시 |
updated_at | timestamp | - | 데이터 수정 일시 |
기타
필드
컬럼 | 타입 | 제약 조건 | 설명 |
---|---|---|---|
id | bigint | pk, not null, unsigend, auto increment | 고유 식별자 |
name | varchar(40) | not null, unique | 카테고리 이름 |
카테고리별 예산
컬럼 | 타입 | 제약 조건 | 설명 |
---|---|---|---|
id | bigint | pk, not null, unsigend, auto increment | 고유 식별자 |
budget_id | bigint | fk, not null, unsigned | 예산 fk |
category_id | bigint | fk, not null, unsigned | 카테고리 fk |
amount | bigint | not null, unsigned | 해당 카테고리에 대한 예산 금액 |
created_at | timestamp | not null | 데이터 생성 일시 |
updated_at | timestamp | - | 데이터 수정 일시 |
컬럼 | 타입 | 제약 조건 | 설명 |
---|---|---|---|
id | bigint | pk, not null, unsigend, auto increment | 고유 식별자 |
member_id | bigint | fk, not null, unsigend | 멤버 fk |
category_id | bigint | fk, not null, unsigend | 카테고리 외래키 |
amount | bigint | not null, unsigend | 금액 |
memo | CHAR(40) | not null | 메모 |
exclude_from_total | tinyint(1) | not null, default(0) | 합계 제외 여부 |
expenditure_at | timestamp | not null | 지출 일시 |
created_at | timestamp | not null | 데이터 생성 일시 |
updated_at | timestamp | - | 데이터 수정 일시 |
지출 합계
, 카테고리 별 지출 합계
같이 반환카테고리
만 조회합계제외
처리한 지출은 목록에는 포함되어 조회되지만, 모든 지출 합계에서는 제외예산, 지출 관련 개발 먼저할 예정이라 우선순위 낮음
기타 (optional)
/api/auth/login
vs /api/members/login
기타 (optional)
어떻게? -> 유저 데이터의 평균치 사용하는 것이 보통은 적절한 방법인가?
평균을 내는 대상(그룹)
뱅샐
기타 (optional)
#### 합계제외 POST or PATCH /api/expenditures/exclude-total
지출 추천이랑 안내는 API도 열어두고 스케줄링 돌려서 알림도 따로 해야되나?
#### 오늘 지출 추천 GET /api/expenditures/recommend
기타 (optional)
적절한 금액?
알림 우선 순위
지난 달
대비 총액, 카테고리 별 소비율지난 요일
대비 소비율
다른 유저
대비 소비율
희망사항
통계 관련 데이터 배치 처리
시간이 좀 더 필요한 기능
유저 시나리오에서 가장 최소 단위로 필요한게 월별 총 예산을 설정하고 매일 소비 가능한 지출과 매일 발생한 지출을 카테고리별로 안내받는 것인데
이를 위해 필요한 순서
식비
: 40만원, 교통
: 20만원A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.