Skip to content

Commit

Permalink
Merge pull request #402 from AllieJonsson/timeline-model
Browse files Browse the repository at this point in the history
Add mapping to timeline model
  • Loading branch information
ornicar authored Dec 1, 2024
2 parents 9e3e111 + f848c65 commit 54e72bb
Show file tree
Hide file tree
Showing 15 changed files with 371 additions and 338 deletions.
371 changes: 33 additions & 338 deletions doc/specs/schemas/Timeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,346 +4,38 @@ properties:
type: array
items:
anyOf:
- type: object
properties:
type:
type: string
enum:
- follow
date:
type: number
data:
type: object
properties:
u1:
type: string
u2:
type: string
required:
- u1
- u2
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- team-join
date:
type: number
data:
type: object
properties:
userId:
type: string
teamId:
type: string
required:
- userId
- teamId
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- team-create
date:
type: number
data:
type: object
properties:
userId:
type: string
teamId:
type: string
required:
- userId
- teamId
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- forum-post
date:
type: number
data:
type: object
properties:
userId:
type: string
topicId:
type: string
topicName:
type: string
postId:
type: string
required:
- userId
- topicId
- topicName
- postId
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- blog-post
date:
type: number
data:
type: object
properties:
id:
type: string
slug:
type: string
title:
type: string
required:
- id
- slug
- title
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- ublog-post
date:
type: number
data:
type: object
properties:
userId:
type: string
id:
type: string
slug:
type: string
title:
type: string
required:
- userId
- id
- slug
- title
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- tour-join
date:
type: number
data:
type: object
properties:
userId:
type: string
tourId:
type: string
tourName:
type: string
required:
- userId
- tourId
- tourName
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- game-end
date:
type: number
data:
type: object
properties:
fullId:
type: string
opponent:
type: string
win:
type: boolean
perf:
$ref: './PerfType.yaml'
required:
- fullId
- opponent
- win
- perf
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- simul-create
- simul-join
date:
type: number
data:
type: object
properties:
userId:
type: string
simulId:
type: string
simulName:
type: string
required:
- userId
- simulId
- simulName
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- study-like
date:
type: number
data:
type: object
properties:
userId:
type: string
studyId:
type: string
studyName:
type: string
required:
- userId
- studyId
- studyName
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- plan-start
date:
type: number
data:
type: object
properties:
userId:
type: string
required:
- userId
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- plan-renew
date:
type: number
data:
type: object
properties:
userId:
type: string
months:
type: number
required:
- userId
- months
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- ublog-post-like
date:
type: number
data:
type: object
properties:
userId:
type: string
id:
type: string
title:
type: string
required:
- userId
- id
- title
required:
- type
- date
- data
- type: object
properties:
type:
type: string
enum:
- stream-start
date:
type: number
data:
type: object
properties:
id:
type: string
name:
type: string
required:
- id
required:
- type
- date
- data
- $ref: './TimelineEntryFollow.yaml'
- $ref: './TimelineEntryTeamJoin.yaml'
- $ref: './TimelineEntryTeamCreate.yaml'
- $ref: './TimelineEntryForumPost.yaml'
- $ref: './TimelineEntryBlogPost.yaml'
- $ref: './TimelineEntryUblogPost.yaml'
- $ref: './TimelineEntryTourJoin.yaml'
- $ref: './TimelineEntryGameEnd.yaml'
- $ref: './TimelineEntrySimul.yaml'
- $ref: './TimelineEntryStudyLike.yaml'
- $ref: './TimelineEntryPlanStart.yaml'
- $ref: './TimelineEntryPlanRenew.yaml'
- $ref: './TimelineEntryUblogPostLike.yaml'
- $ref: './TimelineEntryStreamStart.yaml'
discriminator:
propertyName: type
mapping:
follow: './TimelineEntryFollow.yaml'
team-join: './TimelineEntryTeamJoin.yaml'
team-create: './TimelineEntryTeamCreate.yaml'
forum-post: './TimelineEntryForumPost.yaml'
blog-post: './TimelineEntryBlogPost.yaml'
ublog-post: './TimelineEntryUblogPost.yaml'
tour-join: './TimelineEntryTourJoin.yaml'
game-end: './TimelineEntryGameEnd.yaml'
simul-create: './TimelineEntrySimul.yaml'
simul-join: './TimelineEntrySimul.yaml'
study-like: './TimelineEntryStudyLike.yaml'
plan-start: './TimelineEntryPlanStart.yaml'
plan-renew: './TimelineEntryPlanRenew.yaml'
ublog-post-like: './TimelineEntryUblogPostLike.yaml'
stream-start: './TimelineEntryStreamStart.yaml'
users:
type: object
additionalProperties:
Expand All @@ -360,6 +52,9 @@ properties:
required:
- id
- name
required:
- entries
- users
example:
{
'entries':
Expand Down
Loading

0 comments on commit 54e72bb

Please sign in to comment.