---
# System prepended metadata

title: renewal schema

---


# renewal schema 

https://www.thecodebuzz.com/mongo-db-naming-conventions-standards-guidelines/

## User

### common
- data
- identities
- userId
- userType
- isEmailAgreement
- notiCount
- createdAt


### club
- club name : name / string *
- club logo : logo / string 
- introduction : introduction / string *
- club Founding Year : foundingYear / number *
- genders : genders / Array<string> *
- teams : teams / Array<string> *
- academy : hasAcademy / Boolean *
- match Days : matchDays / Array<string> *
- league : league / object * 
    - name : string *
    - isDirectlyInput : boolean *
    - Division : division / object *
        - name / string *
        - isDirectlyInput / boolean *
- EFA : isFACertified / boolean *
- contact Email : contactEmail / string
- tel or mobile : tel / number
- website : website / string
- social : social / object
    - Twitter : twitter / string
    - Instagram : instagram / string
    - LinkedIn : linkedIn / string
    - Facebook : facebook / string
- location : location / object *
    - coodinates *
    - type *
- postcode / string *
- area / string *

### player
- first Name : firstName / string *
- last Name : lastName / string *
- gender : gender / enum *
- date of Birth : birth / DateTime *
- nationality : nationality / string *
- Multiple Nationalities : hasMultipleNationalties / booelan *
- postcode / string *
- area / string *
- main Position  : mainPosition / enum *
- second Position : secondPosition / enum *
- main Foot : mainFoot / enum *
- height : height / object * 
    - value / string *
    - unit / string *
- Are You Currently Registered? :  career / object *
    - isCurrentlyRegistered / boolean *
    - clubName / string *
    - hasAcademyExp / boolean *
    - outOfEngExp / object *
        - hasOutOfEngExp / boolean *
        - country / string * -> hasOutOfEngExp가 false일 경우 입력자체를 받지않아. 스키마에서는 optional.
        - year / number -> hasOutOfEngExp가 false일 경우 입력자체를 받지않아. 스키마에서는 optional.
- location : location / object *
    - coodinates *
    - type *
- preffered match day : prefferedMatchDay / enum *
- Preferred League Level : PreferredLeagueLevel / enum *
- Occupation: occupation / string
- social : social / object
    - Twitter : twitter / string
    - Instagram : instagram / string
    - LinkedIn : linkedIn / string
    - Facebook : facebook / string
- contact Email : contactEmail / string
***(이하 추가)***
- isAllChallengeComplete / object *
  - basic / boolean *
  - advance / boolean *
- isSuperStar / boolean *

    
## Challenge
    
### challenges (0)
<img src="https://i.imgur.com/uI6rj3l.png" width="300px"/>


> 변경되어야 하는 이유: 필드명이 셔틀런일수 없다.. -> 그 스키마를 모두 정의해줄 수 없다. (다 안의 내용은 동일함)

    
### challenges (1)
- playerId : String!
- basic : object 
    - isAllComplete : boolean *
    - contents: Array<Object> *
      - name : enum *
        ["Introduction", "Shuttle Run", "Burpees", "Push-ups", "Sit-ups", "Kick-ups", "Crossbar Challenge", "Shooting", "Zigzag Dribble", "Long Ball Control" ]
      - isComplete : boolean *
      - url : string
      - runningTime : string
      - thumbnail : string
      - like : object *
        - count : number * 
        - users : Array<string>
      - createdAt : date
      - record : string
    
    
> 챌린지 비디오의 어떤 필드를 trigger가 인지하려고 한다면 Array 형태로는 어렵다..? 
> Obect의 field를 trigger가 감지하고 있다면 다른 field 업데이트시 조금 용이하지 않을까...?
    

### challenges (2)

- playerId: String!
- type: enum *
        [basic, advanced]
- name : string
- isComplete : boolean *
- url : string
- runningTime : string
- thumbnail : string
- like : object *
    - count : number * 
    - users : Array<string>
- createdAt : date
- record : string
    

> 쿼리를 친다면? playerId가 현재 탐색중인 playerId와 동일한 챌린지 비디오를 가져오면 됨
> name을 string으로 바꿈 (advanced까지 포함한다면 enum이 너무 많이 포함된다.)
    

### challenges 최종
    
- updatedAt: date *
- like: object *
    - count: number *
    - users: array
        - items: string
- name: string (video name: e.g. Indtroduction) *
- playerId: string *
- record: numer *
- runningTime: number *
- thumbnail: string *
    - thumbnail url
- type: enum(string) *
    - enum: BASIC
- url: string *
    - video url



    
### video_report
- _id : ObjectId *
- videoType : enum *
    - challenge | feed
- isReporterLogin : boolean *
- reporterId : string 
- videoId: string *
- content: array *
    - items: Object
        - reportType: enum(string)  
        - reportMessage: string *
    
#### 삭제된 필드
> content로 통합
- reportType : enum *    
- message : string *

    

### video feed
- createdAt: date *
- like: object *
    - count: number *
    - users: array
        - items: string
- playerId: string *
- runningTime: number *
- thumbnail: string *
    - thumbnail url
    - bucket url
- url: string *
    - video url
    - bucket url
- isPinnedVideo: bool *
- order: number

추가 필드
- isPinnedVideo: bool *
- order: number
    
> players에 `isPinnedVideoOpen` 필드 추가
    트리거 작업