Skip to content

[falcor] idempotent book operations #9

Description

@joshdmiller

Summary

Create falcor routes to retrieve books and set their properties. This does not address non-idempotent book operations (e.g. calls).

See also #8.

Authentication & Authorization

The current user must have read permissions of the world for any get operations and write or owner permissions for any set operations.

Books of a World

worldsById[id: string].books.length

Immutable.

Gets the total number of books of this world.

worldsById[id: string].books[index: number]

Immutable.

Gets a reference to booksById[bookId: string], where the book is determined by its index position in the results of a Neo4j query to fetch non-archived* (:World)<-[:IN]-(:Book) paths ordered by the creation time of the book.

Books by ID

booksById[id: string][ key: AllowableProp ]

Sets or gets the property provided in MongoDB, with the slug being computed from the title.

type AllowableProp = '_id' | 'title' | 'slug' | 'created_at';

The created_at property is stored in both MongoDB and Neo4j.

booksById[id: string].world

Returns a reference to worldById[worldId: string], as determined by the non-archived* relationship (:World)<-[:IN]-(:Book).

booksById[id: string].status

Immutable.

Returns "O" to indicate the outline status. In subsequent iterations, it will be mutable and dynamic.

Footnotes

Non-archived relationships are those that have not been archived her #11.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions