Skip to content

Commit

Permalink
fix: πŸ› update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mfw78 authored and kostysh committed Jun 1, 2022
1 parent 93e1729 commit dc5c0d6
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions packages/lpms-server/src/services/ExampleFindSpaceService.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Ask } from '@windingtree/stays-models/src/proto/ask';
import { ServiceProviderData } from '@windingtree/stays-models/dist/esm/proto/storage';
import { utils } from 'ethers';
import { Exception, Facility, Item, ItemType, SpaceTier } from '@windingtree/stays-models/dist/esm/proto/facility';
import { Space } from '@windingtree/stays-models/src/proto/facility';
import { keccak256 } from 'ethers/lib/utils';
import { DateTime } from 'luxon';
import { Ask } from 'src/proto/ask';
import { Exception, Facility, Item, ItemType, Space, SpaceTier } from 'src/proto/facility';
import { ContactType } from 'src/proto/contact';
// TODO: move this to local proto once new `stays-models` is published
import { ServiceProviderData } from '@windingtree/stays-models/dist/cjs/proto/storage';

//for test ↓
//import findSpaceService from './services/ExampleFindSpaceService';
Expand All @@ -27,6 +28,7 @@ export class ExampleFindSpaceService {
}

public checker(ask: Ask) {

const serviceProviderData: ServiceProviderData = {
serviceProvider: utils.arrayify(utils.formatBytes32String('provider')),
payload: Facility.toBinary(
Expand All @@ -37,15 +39,18 @@ export class ExampleFindSpaceService {
latitude: 43.0335,
longitude: 42.6895
},
emails: [],
phones: [],
uris: [],
policies: {
currencyCode: "xDAI",
checkInTimeOneof: { oneofKind: "checkInTime", checkInTime: "1500" },
checkOutTimeOneof: { oneofKind: "checkOutTime", checkOutTime: "1000" }
},
photos: [
{ uri: '/image1.jpg', description: 'Chic guesthouse' },
{ uri: '/image2.jpg', description: 'Winter Wonderland' }
],
website: 'https://wonderland.somewhere/',
connectivity: {
wifiAvailableOneof: { oneofKind: "wifiAvailable", wifiAvailable: true },
wifiForFreeOneof: { oneofKind: "wifiForFree", wifiForFree: true }
Expand All @@ -66,7 +71,15 @@ export class ExampleFindSpaceService {
type: ItemType.SPACE,
payload: Space.toBinary(
{
website: 'https://wonderland.somewhere/fancy',
uris: [
{
uri: 'https://someplace/space',
typeOneof: {
oneofKind: 'type',
type: ContactType.WORK
}
}
],
maxNumberOfAdultOccupantsOneof: {
oneofKind: "maxNumberOfAdultOccupants",
maxNumberOfAdultOccupants: 2
Expand Down Expand Up @@ -155,7 +168,15 @@ export class ExampleFindSpaceService {
type: ItemType.SPACE,
payload: Space.toBinary(
{
website: 'https://wonderland.somewhere/fancy',
uris: [
{
uri: 'https://someplace/space',
typeOneof: {
oneofKind: 'type',
type: ContactType.WORK
}
}
],
maxNumberOfAdultOccupantsOneof: {
oneofKind: "maxNumberOfAdultOccupants",
maxNumberOfAdultOccupants: 2
Expand Down

0 comments on commit dc5c0d6

Please sign in to comment.