""" Villa Commerce API GraphQL schema. Public API at api.villamarket.ai. Resolvers talk to Villa Market internally; partners never call Villa website hosts directly. Generated from the Strawberry types in partner_api/graphql; a test fails when the two differ. """ input AddressInput { lat: Float = null lon: Float = null postcode: String = null address: String = null firstName: String = null lastName: String = null phone: String = null email: String = null } type Basket { basketId: ID! ownerId: ID! branchCode: ID! lines: [BasketLine!]! } input BasketAddInput { cprcode: ID! quantity: Int! = 1 branchCode: ID = null } type BasketLine { cprcode: ID! quantity: Int! product: Product } type BasketPayload { basket: Basket userErrors: [UserError!]! } input BasketRemoveInput { cprcode: ID! } input BasketSetQuantityInput { cprcode: ID! quantity: Int! } type Category { l1: String l2: String l3: String } type CategoryCount { name: String! count: Int! } type FulfilmentBranch { branchCode: ID! name: String alcoholLicensed: Boolean deliveryAvailable: Boolean nameTh: String lat: Float lon: Float address: String province: String postcode: String phone: String distanceKm: Float } input FulfilmentResolveInput { lat: Float = null lon: Float = null postcode: String = null } enum FulfilmentType { DELIVERY PICKUP } type InventoryLevel { cprcode: ID! branchCode: ID! listable: Boolean! sellableQty: Int ibCfQty: Int qtySource: InventoryQtySource } enum InventoryQtySource { NEW_IB_VS_STOCK_CV IB_CF_QTY } """ The `JSON` scalar type represents JSON values as specified by [ECMA-404](https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf). """ scalar JSON @specifiedBy(url: "https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf") type Money { amount: Float! currency: String! branchCode: ID source: PriceSource! } type Mutation { basketAdd(input: BasketAddInput!): BasketPayload! basketRemove(input: BasketRemoveInput!): BasketPayload! basketSetQuantity(input: BasketSetQuantityInput!): BasketPayload! basketSetBranch(branchCode: ID!): BasketPayload! basketEmpty: BasketPayload! orderCreate(input: OrderCreateInput = null): OrderPayload! quote(input: QuoteInput!): QuotePayload! quoteApplyCoupon(input: QuoteInput!): QuotePayload! paymentLinkCreate(orderId: ID!): PaymentLinkPayload! paymentStart(input: PaymentStartInput!): PaymentPayload! } type Order { orderId: ID! ownerId: ID branchCode: ID grandTotal: Float isPaid: Boolean specialComment: String lines: [OrderLine!]! payment: OrderPayment shipping: OrderShipping status: String createdAt: String orderSource: String sandbox: Boolean subTotal: Float deliveryFee: Float totalDiscount: Float paymentLink: PaymentLink } type OrderConnection { nodes: [Order!]! pageInfo: PageInfo! } input OrderCreateInput { branchCode: ID = null specialComment: String = null lines: [OrderLineInput!] = null shippingType: String! = "PICKUP" scheduleMode: String! = "REGULAR" address: AddressInput = null couponCodes: [String!] = null } type OrderLine { cprcode: ID! productName: String quantity: Int! price: Float rowTotal: Float } input OrderLineInput { cprcode: ID! quantity: Int! } type OrderPayload { order: Order userErrors: [UserError!]! } type OrderPayment { isPaid: Boolean status: String grandTotal: Float method: String } type OrderSchedule { mode: String dateTime: String pickingStatus: String deliveryFee: Float } type OrderShipping { fulfilmentType: FulfilmentType schedules: [OrderSchedule!] } type PageInfo { hasNextPage: Boolean! endCursor: String } type PaymentLink { url: String! expiresAt: Int! amount: Float! currency: String! provider: String! } type PaymentLinkPayload { paymentLink: PaymentLink userErrors: [UserError!]! } type PaymentPayload { payment: PaymentSession userErrors: [UserError!]! } type PaymentSession { orderId: ID! amountThb: Float! currency: String! publicKey: String merchantId: String sdkUrl: String redirectUrl: String available: Boolean! } input PaymentStartInput { orderId: ID! basketId: ID = null callbackUrl: String = null } enum PriceSource { BRANCH_FEED DETAIL_FALLBACK } type Product { cprcode: ID! nameEn: String nameTh: String brandEn: String sizeDesc: String countryEn: String barcode: String category: Category imageUrl: String availStore: [ID!] price: Money inventory: InventoryLevel } type ProductConnection { nodes: [Product!]! pageInfo: PageInfo! totalCount: Int } input ProductFilter { query: String = null l1: String = null l2: String = null l3: String = null alcoholOnly: Boolean! = false activeOnly: Boolean! = true onlineOnly: Boolean! = true pricedOnly: Boolean! = false } type Query { product(cprcode: ID!, branchCode: ID = null): Product products(filter: ProductFilter = null, branchCode: ID = null, first: Int! = 20, after: String = null): ProductConnection! categories: [CategoryCount!]! branches: [FulfilmentBranch!]! search(query: String!, mode: SearchMode! = SEMANTIC, limit: Int! = 20, branchCode: ID = null): [SearchHit!]! searchSuggest(query: String!, limit: Int! = 30): [String!]! inventory(branchCode: ID!, cprcodes: [ID!] = null): [InventoryLevel!]! basket: Basket order(orderId: ID!): Order orders(first: Int! = 20, after: String = null): OrderConnection! fulfilmentResolve(input: FulfilmentResolveInput!): FulfilmentBranch! } type Quote { quoteId: ID! grandTotal: Float! currency: String! branchCode: ID expiresInSeconds: Int! raw: JSON subTotal: Float deliveryFee: Float discountedDeliveryFee: Float shippingDiscount: Float expressShippingCost: Float totalDiscount: Float lines: [QuoteLine!]! couponCodes: [String!]! failedCoupons: JSON } input QuoteInput { branchCode: ID = null lines: [OrderLineInput!] = null shippingType: String! = "PICKUP" couponCodes: [String!] = null scheduleMode: String! = "REGULAR" address: AddressInput = null } type QuoteLine { cprcode: ID! productName: String quantity: Int! price: Float rowTotal: Float discountedRowTotal: Float } type QuotePayload { quote: Quote userErrors: [UserError!]! } type SearchHit { cprcode: ID! name: String product: Product } enum SearchMode { AUTOCOMPLETE SEMANTIC } type UserError { code: String! message: String! field: String }