Giter Site home page Giter Site logo

adopteitor / adopteitor-api Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 421 KB

Backend for adopteitor

License: MIT License

JavaScript 63.02% Shell 0.27% Makefile 1.24% HTML 34.89% Dockerfile 0.59%
adopteitor-api animals backend feathersjs pets shelters swagger

adopteitor-api's People

Contributors

anabellaspinelli avatar josx avatar smarbos avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cambalab

adopteitor-api's Issues

Mongo connection failure on test run

Do you think we should maybe tell the app to not try to connect to the DB when only it's running tests via some config option?

Also for error logging like in 404 tests like this:

    404
error: Page not found {"type":"FeathersError","name":"NotFound","code":404,"className":"not-found","data":{"url":"/path/to/nowhere"},"errors":{}}

      โœ“ shows a 404 HTML page

Or do we plan to test DB connection? In that case we could dockerize it too ๐Ÿณ

WDYT @smarbos @josx ?

Breed and Species

Im adding these two services. Both with the same schema:

    displayName: {
      type: String,
      required: true
    },
    default: {
      type: Boolean,
      default: false,
      required: true
    }
``

displayName is the name we will show, for referencing we will use the _id field.
Default will specify wich option will be preselected when creating a new animal.

Contracts endpoint

Description:
Create a Contracts Linking an Animal and a Human.

Parameters:

  • humanId (string)
  • animalId (string)

Todo:

  • I think we can use a BEFORE hook to check if both human and animal exists (and do any more check if we need) and then creating the contract. @anabellaspinelli what do you think?
  • Define contract, maybe this should be a variable set by the shelter.

Create Users

Create Users

  • Model
  • Collection
  • Service
  • something more?

About Animal Schema

const AnimalSchema = new Schema({
  stage: { / SHouldn't this be autocalculated based on the dateOfBirth?
    type: String,
    required: true
  },
  name: { // Should be displayName?
    type: String,
    required: true
  },
  dateOfBirth: {
    type: Date,
    required: true
  },
  description: { // A description of the animal.
    type: String,
    required: true
  },
  sex: {
    type: String,
    required: true
  },
  location: { // A string describing where in the world the animal is located
    type: String,
    required: false
  },
  entryDate: {
    type: Date,
    required: true
  }
  state: { // Adopted, in adoption, other?
    type: String,
    required: true
  }
});
  • I added a state field to indicate if the animal is in adoption, adopted or any other condition.
  • I wondered if the stage field should automatic generated based on the dateOfBirth and a "threshold setting" for the "stages"?
  • Also, how can we handle different species? Maybe a shelter could have dogs and cats, and show them separately? I think this could be a common scenario.
  • I added location field because right now in Adopta un Galgo en Argentina, we have Galguitos in Buenos Aires and Rosario City.

Breed and Species behaviour

We must implement a before hook to check if there's another "default" selected, and deselect it before selecting the new one.

  • Add a restriction so that only one can be default.
  • On Updates too, if another breed/specie is selected as default, the previous default should be changed to false.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.