Add Mobile topic and GraphQL endpoints to API documentation
This commit is contained in:
@@ -664,8 +664,168 @@ export const graphqlMeta = {
|
||||
"billstatus": 1
|
||||
}`,
|
||||
},
|
||||
getcustomerlocations: {
|
||||
query: /* GraphQL */ `
|
||||
query GetCustomerLocations($customerid: bigint!) {
|
||||
customer_locations(where: { customerid: { _eq: $customerid } }) {
|
||||
locationid
|
||||
latitude
|
||||
longitude
|
||||
address
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "customerid": 6060\n}`,
|
||||
},
|
||||
getcustomerordersv3: {
|
||||
query: /* GraphQL */ `
|
||||
query GetCustomerOrders($customerid: bigint!, $tenantid: bigint!, $moduleid: bigint!, $fromdate: timestamptz!, $todate: timestamptz!, $orderstatus: String!, $keyword: String, $limit: Int!, $offset: Int!) {
|
||||
orders(
|
||||
where: {
|
||||
customerid: { _eq: $customerid }
|
||||
tenantid: { _eq: $tenantid }
|
||||
moduleid: { _eq: $moduleid }
|
||||
orderstatus: { _eq: $orderstatus }
|
||||
orderdate: { _gte: $fromdate, _lte: $todate }
|
||||
_or: [{ orderid: { _ilike: $keyword } }]
|
||||
}
|
||||
limit: $limit
|
||||
offset: $offset
|
||||
) {
|
||||
orderid
|
||||
orderstatus
|
||||
orderamount
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "customerid": 6060,\n "tenantid": 1087,\n "moduleid": 2,\n "fromdate": "2026-01-01T00:00:00",\n "todate": "2026-12-31T23:59:59",\n "orderstatus": "delivered",\n "keyword": "%pizza%",\n "limit": 10,\n "offset": 0\n}`,
|
||||
},
|
||||
getcustomer: {
|
||||
query: /* GraphQL */ `
|
||||
query GetCustomer($customerid: bigint!) {
|
||||
customers(where: { customerid: { _eq: $customerid } }) {
|
||||
customerid
|
||||
name
|
||||
contactno
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "customerid": 6060\n}`,
|
||||
},
|
||||
getcustomerrequests: {
|
||||
query: /* GraphQL */ `
|
||||
query GetCustomerRequests($customerid: bigint!, $limit: Int!, $offset: Int!) {
|
||||
customer_requests(where: { customerid: { _eq: $customerid } }, limit: $limit, offset: $offset) {
|
||||
requestid
|
||||
status
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "customerid": 6060,\n "limit": 10,\n "offset": 0\n}`,
|
||||
},
|
||||
getmobileproductsubcategories: {
|
||||
query: /* GraphQL */ `
|
||||
query GetProductSubcategories($categoryid: bigint!) {
|
||||
app_subcategory(where: { categoryid: { _eq: $categoryid } }) {
|
||||
subcategoryid
|
||||
subcategoryname
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "categoryid": 1001\n}`,
|
||||
},
|
||||
getmobileappcategories: {
|
||||
query: /* GraphQL */ `
|
||||
query GetAppCategories {
|
||||
app_category {
|
||||
categoryid
|
||||
categoryname
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{}`,
|
||||
},
|
||||
getmobileproductvariants: {
|
||||
query: /* GraphQL */ `
|
||||
query GetProductVariants($tenantid: bigint!, $subcategoryid: bigint!) {
|
||||
product_variants(where: { tenantid: { _eq: $tenantid }, subcategoryid: { _eq: $subcategoryid } }) {
|
||||
variantid
|
||||
productname
|
||||
price
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "tenantid": 1087,\n "subcategoryid": 14\n}`,
|
||||
},
|
||||
gettenantpromotions: {
|
||||
query: /* GraphQL */ `
|
||||
query GetTenantPromotions($tenantid: bigint!, $locationid: bigint!) {
|
||||
promotions(where: { tenantid: { _eq: $tenantid }, locationid: { _eq: $locationid } }) {
|
||||
promotionid
|
||||
title
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "tenantid": 1087,\n "locationid": 1\n}`,
|
||||
},
|
||||
getappconfig: {
|
||||
query: /* GraphQL */ `
|
||||
query GetAppConfig($configid: bigint!) {
|
||||
app_config(where: { configid: { _eq: $configid } }) {
|
||||
configkey
|
||||
configvalue
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "configid": 15\n}`,
|
||||
},
|
||||
searchcustomers: {
|
||||
query: /* GraphQL */ `
|
||||
query SearchCustomers($tenantid: bigint!, $keyword: String!) {
|
||||
customers(where: { tenantid: { _eq: $tenantid }, name: { _ilike: $keyword } }) {
|
||||
customerid
|
||||
name
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "tenantid": 1087,\n "keyword": "%john%"\n}`,
|
||||
},
|
||||
gettenantorders: {
|
||||
query: /* GraphQL */ `
|
||||
query GetTenantOrders {
|
||||
orders {
|
||||
orderid
|
||||
tenantid
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{}`,
|
||||
},
|
||||
getstaff: {
|
||||
query: /* GraphQL */ `
|
||||
query GetStaff($tenantid: bigint!) {
|
||||
staff(where: { tenantid: { _eq: $tenantid } }) {
|
||||
staffid
|
||||
name
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{\n "tenantid": 1087\n}`,
|
||||
},
|
||||
getmobileapplocations: {
|
||||
query: /* GraphQL */ `
|
||||
query GetAppLocations {
|
||||
app_location {
|
||||
applocationid
|
||||
locationname
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: `{}`,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
export const topics = [
|
||||
{
|
||||
id: "users",
|
||||
@@ -875,4 +1035,124 @@ export const topics = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "mobile",
|
||||
name: "Mobile",
|
||||
description:
|
||||
"Specific endpoints and GraphQL queries optimized for mobile application integration.",
|
||||
endpoints: [
|
||||
{
|
||||
name: "getcustomerlocations",
|
||||
method: "GET",
|
||||
url: "/api/rest/getcustomerlocations?customerid=6060",
|
||||
description:
|
||||
"Retrieve physical locations associated with a specific customer.",
|
||||
},
|
||||
{
|
||||
name: "getcustomerordersv3",
|
||||
method: "GET",
|
||||
url: "/api/rest/getcustomerordersv3?customerid=6060&tenantid=1087&moduleid=2&fromdate=2026-01-01T00:00:00&todate=2026-12-31T23:59:59&orderstatus=delivered&keyword=%25pizza%25&limit=10&offset=0",
|
||||
description:
|
||||
"Fetch comprehensive order history for a customer with advanced filtering.",
|
||||
},
|
||||
{
|
||||
name: "getcustomer",
|
||||
method: "GET",
|
||||
url: "/api/rest/getcustomer?customerid=6060",
|
||||
description: "Get profile details for a specific customer.",
|
||||
},
|
||||
{
|
||||
name: "getcustomerrequests",
|
||||
method: "GET",
|
||||
url: "/api/rest/getcustomerrequests?customerid=6060&limit=10&offset=0",
|
||||
description: "List all service requests made by a customer.",
|
||||
},
|
||||
{
|
||||
name: "getmobileproductsubcategories",
|
||||
method: "GET",
|
||||
url: "/api/rest/getmobileproductsubcategories?categoryid=1001",
|
||||
description:
|
||||
"Retrieve subcategories under a specific product category for mobile display.",
|
||||
},
|
||||
{
|
||||
name: "getmobileappcategories",
|
||||
method: "GET",
|
||||
url: "/api/rest/getmobileappcategories",
|
||||
description: "Fetch all available application categories.",
|
||||
},
|
||||
{
|
||||
name: "getmobileproductvariants",
|
||||
method: "GET",
|
||||
url: "/api/rest/getmobileproductvariants?tenantid=1087&subcategoryid=14",
|
||||
description: "Get product variants filtered by tenant and subcategory.",
|
||||
},
|
||||
{
|
||||
name: "gettenantpromotions",
|
||||
method: "GET",
|
||||
url: "/api/rest/gettenantpromotions?tenantid=1087&locationid=1",
|
||||
description: "Retrieve active promotions for a specific tenant location.",
|
||||
},
|
||||
{
|
||||
name: "getappconfig",
|
||||
method: "GET",
|
||||
url: "/api/rest/getappconfig?configid=15",
|
||||
description: "Retrieve specific application configuration settings.",
|
||||
},
|
||||
{
|
||||
name: "searchcustomers",
|
||||
method: "GET",
|
||||
url: "/api/rest/searchcustomers?tenantid=1087&keyword=%25john%25",
|
||||
description: "Search for customers by name within a tenant's scope.",
|
||||
},
|
||||
{
|
||||
name: "gettenantorders",
|
||||
method: "GET",
|
||||
url: "/api/rest/gettenantorders",
|
||||
description: "List orders across tenants (Admin level).",
|
||||
},
|
||||
{
|
||||
name: "getstaff",
|
||||
method: "GET",
|
||||
url: "/api/rest/getstaff?tenantid=1087",
|
||||
description: "Retrieve staff members associated with a specific tenant.",
|
||||
},
|
||||
{
|
||||
name: "gettenantinfo",
|
||||
method: "GET",
|
||||
url: "/api/rest/gettenantinfo?tenantid=1079",
|
||||
description: "Get basic information about a tenant.",
|
||||
},
|
||||
{
|
||||
name: "gettenantlocations",
|
||||
method: "GET",
|
||||
url: "/api/rest/gettenantlocations?tenantid=1",
|
||||
description: "Fetch all locations for a given tenant.",
|
||||
},
|
||||
{
|
||||
name: "getmobileapplocations",
|
||||
method: "GET",
|
||||
url: "/api/rest/getmobileapplocations",
|
||||
description: "Retrieve all application-wide locations.",
|
||||
},
|
||||
{
|
||||
name: "getsubcategory",
|
||||
method: "GET",
|
||||
url: "/api/rest/getsubcategory?moduleid=6&categoryid=1",
|
||||
description: "Get detailed subcategory info.",
|
||||
},
|
||||
{
|
||||
name: "getpartners",
|
||||
method: "GET",
|
||||
url: "/api/rest/getpartners?applocationid=1&partnerid=44&limit=10&offset=0",
|
||||
description: "Retrieve partner details for mobile integration.",
|
||||
},
|
||||
{
|
||||
name: "getlocationsconfig",
|
||||
method: "GET",
|
||||
url: "/api/rest/getlocationsconfig",
|
||||
description: "Get location configuration settings.",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user