Skip to content

Data Model

Oscar Miras edited this page Mar 2, 2021 · 8 revisions

Users

  • id
  • name
  • desription ( or bio)
  • email
  • phoneNumber
  • location (province at this moment)

Animals

An animal has these fields. The exact name that the field should have in our firebase database must be:

name

Animal's given name type: String

  • validations
    • required
    • 100 characters max

description

A description about the animal, whatever the user wants to input type: String

  • validations
    • 500 characters max

age

What it is? It is a cat? It is a dog? type template: [{ label: 'cria', value: 0 }] // It would nice to have somewhere in our app; a file to map all the values to their labels (globals.js) labelsSpecies = ['cria', 'joven'] values: 'cria','joven', 'adulto', 'senior'

  • required

sex

Animal's sex values: 'macho' , 'hembre'

species

What type of animal it is? [0] => gato [1] => perro ....

Same idea as "species" field

location

Province where is the animal type: String

  • required

photos

A collection of photos (max 5) type: "String" to the URL in images repo?

  • required

userOwnerId

Id of the owner of the animal (the one that firestore provides)

favoritedByUserId

Array of users that set this animal as favorite ['user1ID', 'user2ID', ...]

disableData

Timestamp with the date when the animal was removed

Externalize labels

It would be a good idea to have a file in /src/utils/labels.js

const ANIMAL_SPECIES = ['Gato', 'Perro', 'Aves']

export ANIMAL_SPECIES;

Clone this wiki locally