vinmonopolet-ts
Version:
Extracts information on products, categories and stores from Vinmonopolet
48 lines (47 loc) • 1.23 kB
JavaScript
class BaseStore {
/**
* Unique ID for the store.
*/
storeNumber;
/**
* The name of the store
*/
name;
/**
* The street address of the store.
*/
streetAddress;
/**
* The zip code of the store.
*/
zip;
/**
* The city the store is located in.
*/
city;
/**
* GPS coordinates of the store given as a [lat, lon] array.
*/
gpsCoordinates;
constructor(storeNumber, name, streetAddress, zip, city, latitude, longitude) {
this.storeNumber = storeNumber;
this.name = name;
this.streetAddress = streetAddress;
this.zip = zip;
this.city = city;
this.gpsCoordinates = [latitude, longitude];
}
/**
* Returns a new instance of PopulatedStore, with more fields.
* @returns Promise<PopulatedStore>
*/
populate() {
return new Promise((resolve, reject) => {
import("../../retrievers/getStore").then((getStore) => {
const populatedStore = getStore.default(this.storeNumber);
resolve(populatedStore);
});
});
}
}
export default BaseStore;