Skip to content
Merged

UIv3 #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="..." />
<!-- Monochrome favicon -->
<link rel="icon" type="image/png" href="/src/public/winegraph.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
Expand Down
7 changes: 6 additions & 1 deletion src/components/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ interface MapViewProps {

export const MapView = ({center, zoom = 13, markers = []}: MapViewProps) => {
return (
<MapContainer center={center} zoom={zoom} className="h-full w-full" style={{height: '100%', width: '100%'}}>
<MapContainer
center={center}
zoom={zoom}
className="h-full w-full z-0"
style={{height: '100%', width: '100%'}}
>
<TileLayer
attribution='&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png"
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const PageHeader: React.FC<PageHeaderProps> = ({ title, desc }) => {
</p>
) : null}
</header>
<div className="w-24 h-1 mt-6" style={{ background: "var(--color-primary)" }} />
<div className="w-24 h-[2px] mt-6 bg-[color:var(--color-border)]" />
</div>
);
};
Expand Down
66 changes: 66 additions & 0 deletions src/graphql/domain/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
type Area {
description: String
id: ID
name: String
"Get producers for the given area"
producers: [Producer]
}

type Country {
description: String
flag: String
id: ID
name: String
"Get regions for the given country"
regions: [Region]
weblink: String
}

type DomainQuery {
"Get an Area by its ID"
area(areaId: ID!): Area
"Countries that have wine producing regions so far..."
countries: [Country]
"Get a country by its ID"
country(id: ID!): Country
grapes: [Grape]
"Get a region by its ID"
region(id: ID!): Region
}

type Grape {
color: String
description: String
id: String
name: String
}

type Producer {
id: String
name: String
slug: String
"Get wines for the given producer"
wines: [Wine]
}

"Query root"
type Query {
Domain: DomainQuery
}

type Region {
"Get areas for the given region"
areas: [Area]
description: String
id: ID
name: String
weblink: String
}

type Wine {
id: String
name: String
slug: String
varietal: String
vintage: String
}
189 changes: 189 additions & 0 deletions src/graphql/producer/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
type Fermentation {
days: Int
temperature: Float
}

type Maceration {
days: Int
temperature: Float
}

"Mutation root"
type Mutation {
Producer: ProducerMutation
Wine: WineMutation
}

type Producer {
description: String
email: String
id: ID
name: String
phone: String
slug: String
website: String
"Get wines for the given producer"
wines: [Wine]
}

type ProducerMutation {
addProducer(producer: ProducerInput!): Producer
}

type ProducerQuery {
"Get all producers"
all: [Producer]
"Get a producer by its ID"
producer(id: ID!): Producer
"Get producers for a given area"
producers(areaId: ID!): [Producer]
}

"Query root"
type Query {
Producer: ProducerQuery
Wine: WineQuery
}

type Wine {
acid: Float
alcohol: Float
bottleAging: Int
closure: String
color: String
description: String
id: ID
name: String
pH: Float
producer: String
shape: String
size: Float
slug: String
subarea: String
type: String
"Can be a single varietal (grape) or blend"
varietal: String
vintage: Int
weblink: String
"Get a wines components"
wineComponents: [WineGrape]
}

type WineGrape {
fermentation: Fermentation
grapeId: ID
grapeName: String
harvestBegin: String
harvestEnd: String
maceration: Maceration
percentage: Float
}

type WineMutation {
"Add a new wine to a producer"
addWine(input: WineInput!): Wine
"Add grape and barrel components to a wine"
addWineComponents(input: WineComponentInput!): [WineGrape]
}

type WineQuery {
"Get a wine by its ID"
wine(id: ID!): Wine
}

enum Closure {
NATURAL_CORK
OTHER
SCREW_CAP
SYNTHETIC_CORK
TECHNICAL_CORK
VALVE
VINO_SEAL
ZORK
}

enum Color {
ORANGE
RED
ROSE
WHITE
}

enum Shape {
ALSACE
BORDEAUX
BOX
BURGUNDY
CALIFORNIA
CHAMPAGNE
OTHER
RHONE
}

enum Type {
FRIZZANTE
SPARKLING
STILL
}

input FermentationInput {
days: Int
temperature: Float
}

input MacerationInput {
days: Int
temperature: Float
}

input ProducerInput {
areaId: ID!
description: String
email: String
fax: String
name: String!
phone: String
website: String
}

input WineComponentInput {
fermentation: FermentationInput
grape: String
harvestBegin: Date
harvestEnd: Date
maceration: MacerationInput
percentage: Float
}

input WineInput {
"Total acidity level (e.g. '5.6')"
acid: Float
"Alcohol content as a percent string (e.g. '13.5')"
alcohol: Float
"Bottle aging duration in months (e.g. '12')"
bottleAging: Int
"Closure type (e.g. CORK, SCREWCAP)"
closure: Closure
"Color of the wine (e.g. RED, WHITE, ROSE)"
color: Color
"Optional general description of the wine"
description: String
"Wine name or label (e.g. 'Château Margaux')"
name: String!
"pH value of the wine (e.g. '3.4')"
pH: Float
"ID of the producer this wine will belong to"
producerId: ID!
"Shape of the bottle (e.g. BORDEAUX, BURGUNDY)"
shape: Shape
"Bottle size in milliliters (e.g. '0.75 or 1.0')"
size: Float
"Optional subarea or vineyard designation (e.g. 'Howell Mountain')"
subarea: String
"Wine type (e.g. STILL, SPARKLING)"
type: Type
"Can be a single varietal (grape) or a blend"
varietal: String!
"Vintage year of the wine (e.g. '2020')"
vintage: Int!
}
88 changes: 88 additions & 0 deletions src/graphql/retailer/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
type Coordinates {
latitude: Float
longitude: Float
}

"Mutation root"
type Mutation {
Retailer: RetailerMutation
}

"Query root"
type Query {
Retailer: RetailerQuery
}

type Retailer {
"Merchant ID from POS"
id: ID
"Get current (persisted) inventory"
inventory: [RetailerInventory]
location: RetailerLocation
logoUrl: String
name: String
"Point-of-sale system"
pos: String
}

type RetailerInventory {
description: String
id: ID
name: String
"For POS linking"
originId: String
price: String
producer: String
"External source system"
source: WineSource
varietal: String
vintage: Int
"Get canonical wine matches for the given retailers inventory"
wineMatches: [RetailerInventoryMatch]
}

type RetailerInventoryMatch {
name: String
producer: String
varietal: String
vintage: Int
wineId: String
}

type RetailerLocation {
address: String
city: String
contactEmail: String
coordinates: Coordinates
id: ID
phone: String
state: String
website: String
zipCode: String
}

type RetailerMutation {
"Onboard a Retailer from their POS"
onboard(
"Merchant ID issued by POS"
merchantId: ID!,
pos: WineSource!
): Retailer
"Sync inventory from Retailer's POS."
syncInventory(
"Merchant ID issued by POS"
merchantId: ID!
): [RetailerInventory]
}

type RetailerQuery {
retailer(retailerId: ID!): Retailer
retailers: [Retailer]
}

enum WineSource {
CANONICAL
CLOVER
SHOPIFY
SQUARE
}
Loading