blob: 0c043a96d7c802d1a9a5ade03062c792c14a155e [file] [log] [blame]
/*
Example Entity feed for Google Order Redirect.
*/
import {
EntityFeed, Entity
} from './generated/entity';
function createFeed() : string {
// Create Entity
const entity: Entity = {
entity_id: 'merchant-1',
name: "Mo's Dinner",
telephone: '+14567891234',
url: 'http://moesdinner.com',
location: {
latitude: 41.525588,
longitude: -90.507067,
address: {
country: 'US',
locality: 'Mountain View',
region: 'CA',
postal_code: '94043',
street_address: '1600 Amphitheatre Pkwy'
}
}
};
// Add Entity to feed data array
const feed: EntityFeed = {
data: [entity]
};
// Serialize feed to JSON
return JSON.stringify(feed);
}
const feedJSON = createFeed();
console.log(feedJSON);