Frozenfire92 / Sobeys-IBM-Hackathon

1 stars 0 forks source link

Add APIs for static fixture data - Store's airmiles and Products #12

Open Frozenfire92 opened 8 years ago

Frozenfire92 commented 8 years ago
{
    id: 123,
    name: "Queen Street Sobeys",
    lat: 44.444,
    lng: 65.555,
    polls: [
        {
            id: 1,
            date: date,
            question: "What is your favorite brand of lays chips",
            answers: [
                { name: "BBQ", responses: 12 },
                { name: "Sour Cream and Onion", responses: 12 },
                { name: "Plain", responses: 12 }
            ]
        },
        {
            id: 1,
            date: date,
            question: "What is your favorite brand of lays chips",
            answers: [
                { name: "BBQ", responses: 12 },
                { name: "Sour Cream and Onion", responses: 12 },
                { name: "Plain", responses: 12 }
            ]
        },
    ],
    airmiles: {
        newCustomers: {
            today: 0,
            yesterday: 0,
            month: 0,
        },
        existingCustomers: {
            today: 0,
            yesterday: 0,
            month: 0,
        }
    }
}
{
    top: [
        { day: date, product: "apples", amountSold: 12354.55, weightSold: 123, storeId: 123},
        { day: date, product: "oranges", amountSold: 12354.55, weightSold: 123, storeId: 123},
        { day: date, product: "bananas", amountSold: 12354.55, weightSold: 123, storeId: 123},
        { day: date, product: "bbq lays chips", amountSold: 12354.55, weightSold: 123, storeId: 123},    
    ],
    bottom: [
        { day: date, product: "apples", amountSold: 12354.55, weightSold: 123, storeId: 123},
        { day: date, product: "oranges", amountSold: 12354.55, weightSold: 123, storeId: 123},
        { day: date, product: "bananas", amountSold: 12354.55, weightSold: 123, storeId: 123},
        { day: date, product: "bbq lays chips", amountSold: 12354.55, weightSold: 123, storeId: 123},            
    ]
}
Frozenfire92 commented 8 years ago

The products, will contain 100 top and bottom for each of the 3 stores

Glavin001 commented 8 years ago

I am going to break up the Polls into a separate API, with two models: Poll and Response.

Frozenfire92 commented 8 years ago

Mocked up store locations (proper lat/lng works with map)

{
        lat: 44.637397,
        lng: -63.574255,
        name: "Queen St",
        storeId: 123
      },
      {
        lat: 44.653536,
        lng: -63.599003,
        name: "Windsor St",
        storeId: 321
      },
      {
        lat: 44.663005,
        lng: -63.657324,
        name: "Lacewood Dr",
        storeId: 654
      }
Glavin001 commented 8 years ago

See https://docs.strongloop.com/display/public/LB/Extend+your+API for extending loopback's API.

Glavin001 commented 8 years ago

@rainbee2214 this is where you change the static fixture data files: https://github.com/Frozenfire92/Sobeys-IBM-Hackathon/tree/back-end/common/fixtures