Initial commit

This commit is contained in:
2026-04-28 12:16:47 +05:30
commit 6fb5a6295e
23 changed files with 5599 additions and 0 deletions

878
src/data/apiData.js Normal file
View File

@@ -0,0 +1,878 @@
export const graphqlMeta = {
getsubcategory: {
query: /* GraphQL */ /* GraphQL */ `
query GetSubCategory($moduleid: bigint!, $categoryid: bigint!) {
app_subcategory(
where: {
categoryid: { _eq: $categoryid }
category: { modules: { moduleid: { _eq: $moduleid } } }
}
) {
subcategoryid
categoryid
categorytypeid
subcategoryname
categoryname
sortorder
status
statuscode
}
}
`,
variables: `{\n "moduleid": 6,\n "categoryid": 1\n}`,
},
getorders: {
query: /* GraphQL */ /* GraphQL */ `
query GetOrders(
$start: timestamptz!
$end: timestamptz!
$status: String!
$limit: Int!
$offset: Int!
) {
orders(
where: {
deliverytime: { _gte: $start, _lte: $end }
orderstatus: { _eq: $status }
}
limit: $limit
offset: $offset
) {
orderheaderid
orderid
orderstatus
deliverytime
orderamount
tenant {
tenantname
}
}
}
`,
variables: `{\n "start": "2026-01-01T00:00:00",\n "end": "2026-01-31T23:59:59",\n "status": "delivered",\n "limit": 10,\n "offset": 0\n}`,
},
gettenantlocations: {
query: /* GraphQL */ /* GraphQL */ `
query GetTenantLocations($tenantid: bigint!) {
tenant_locations(where: { tenantid: { _eq: $tenantid } }) {
locationid
locationname
tenantid
}
}
`,
variables: `{\n "tenantid": 1\n}`,
},
getapplocations: {
query: /* GraphQL */ /* GraphQL */ `
query GetAppLocations($userid: bigint!) {
details: app_location(
where: {
app_locationconfigs: {
status: { _eq: "Active" }
userid: { _eq: $userid }
}
}
) {
applocationid
locationname
}
}
`,
variables: `{\n "userid": 1\n}`,
},
getusers: {
query: /* GraphQL */ /* GraphQL */ `
query GetUsers {
app_user {
userid
username
email
contactno
status
}
}
`,
variables: `{}`,
},
gettenantinfo: {
query: /* GraphQL */ /* GraphQL */ `
query GetTenantInfo($tenantid: bigint!) {
tenants(where: { tenantid: { _eq: $tenantid } }) {
tenantid
tenantname
email
contactno
status
}
}
`,
variables: `{\n "tenantid": 1079,\n "configid": 1,\n "fromdate": "2025-07-24T00:00:00",\n "todate": "2025-07-24T23:59:59"\n}`,
},
getordersummary: {
query: /* GraphQL */ /* GraphQL */ `
query GetOrderSummary(
$tenantid: bigint!
$configid: bigint!
$fromdate: timestamp!
$todate: timestamp!
) {
orders_aggregate(
where: {
tenantid: { _eq: $tenantid }
deliverytime: { _gte: $fromdate, _lte: $todate }
}
) {
aggregate {
count
}
}
orders(
where: {
tenantid: { _eq: $tenantid }
deliverytime: { _gte: $fromdate, _lte: $todate }
}
limit: 10
order_by: { deliverytime: desc }
) {
orderid
orderstatus
orderamount
deliverytime
}
}
`,
variables: `{\n "tenantid": 1079,\n "fromdate": "2025-07-24T00:00:00",\n "todate": "2025-07-24T23:59:59"\n}`,
},
getcustomersbytenant: {
query: /* GraphQL */ /* GraphQL */ `
query GetCustomersByTenant(
$tenantid: bigint!
$limit: Int!
$offset: Int!
) {
tenantcustomers(
where: { tenantid: { _eq: $tenantid } }
limit: $limit
offset: $offset
order_by: { customer: { customerid: desc } }
) {
tenantlocationid: locationid
customer {
customerid
firstname
lastname
contactno
email
address
suburb
city
state
landmark
doorno
postcode
latitude
longitude
applocationid
status
}
}
}
`,
variables: `{\n "tenantid": 1079,\n "limit": 10,\n "offset": 0\n}`,
},
getapproles: {
query: /* GraphQL */ /* GraphQL */ `
query GetAppRoles($configid: bigint!) {
app_roles(where: { configid: { _eq: $configid } }) {
roleid
rolename
configid
}
}
`,
variables: `{\n "configid": 1\n}`,
},
getactivelocationbyid: {
query: /* GraphQL */ /* GraphQL */ `
query GetActiveLocationById {
app_locations(where: { status: { _eq: "Active" } }) {
locationid
locationname
}
}
`,
variables: `{}`,
},
getlocationsconfig: {
query: /* GraphQL */ /* GraphQL */ `
query GetLocationsConfig {
app_location_config {
configid
configvalue
locationid
}
}
`,
variables: `{}`,
},
getpartners: {
query: /* GraphQL */ /* GraphQL */ `
query GetPartners(
$applocationid: bigint!
$partnerid: bigint!
$limit: Int!
$offset: Int!
) {
details: partnerinfo(
where: {
status: { _eq: "Active" }
_and: [
{
_or: [
{ applocationid: { _eq: $applocationid } }
{ applocationid: { _eq: 0 } }
]
}
{
_or: [
{ partnerid: { _eq: $partnerid } }
{ partnerid: { _eq: 0 } }
]
}
]
}
limit: $limit
offset: $offset
) {
partnerid
applocationid
partnertypeid
partnername
primarycontact
primaryemail
contactno
address
suburb
state
city
partnerimage
}
}
`,
variables: `{\n "applocationid": 1,\n "partnerid": 0,\n "limit": 10,\n "offset": 0\n}`,
},
getridershifts: {
query: /* GraphQL */ /* GraphQL */ `
query GetRiderShifts($applocationid: bigint!) {
details: ridershifts(
where: { applocationid: { _eq: $applocationid } }
order_by: { shiftid: desc }
) {
shiftid
shiftdate
starttime
endtime
shifthours
basefare
additionalkm
additionalcharges
orders
fuelcharge
shiftname
}
}
`,
variables: `{\n "applocationid": 1\n}`,
},
getapptypes: {
query: /* GraphQL */ /* GraphQL */ `
query GetTypes($tag: String!) {
app_types(where: { status: { _eq: "Active" }, tag: { _eq: $tag } }) {
apptypeid
typename
tag
status
description
mapid
created
updated
}
}
`,
variables: `{\n "tag": "partner"\n}`,
},
gettenantcustomers: {
query: /* GraphQL */ /* GraphQL */ `
query GetTenantCustomers(
$tenantid: bigint!
$locationid: bigint!
$limit: Int!
$offset: Int!
) {
details: tenantcustomers(
where: {
tenantid: { _eq: $tenantid }
locationid: { _eq: $locationid }
customer: { customerid: { _is_null: false } }
}
limit: $limit
offset: $offset
order_by: { customer: { customerid: desc } }
) {
tenantlocationid: locationid
customer {
customerid
firstname
lastname
contactno
email
address
suburb
city
state
landmark
doorno
postcode
latitude
longitude
applocationid
status
}
}
}
`,
variables: `{\n "tenantid": 1079,\n "locationid": 1,\n "limit": 10,\n "offset": 0\n}`,
},
getproductcategories: {
query: /* GraphQL */ /* GraphQL */ `
query GetProductCategories($moduleid: bigint!) {
productcategories(
where: { moduleid: { _eq: $moduleid }, status: { _eq: "Active" } }
order_by: { sortorder: asc }
) {
categoryid
moduleid
categorytypeid
categoryname
status
created
updated
}
}
`,
variables: `{\n "moduleid": 6\n}`,
},
getproductsubcategories: {
query: /* GraphQL */ /* GraphQL */ `
query GetProductSubCategories($categoryid: bigint!) {
product_subcategories(where: { categoryid: { _eq: $categoryid } }) {
subcategoryid
categoryid
subcategoryname
status
}
}
`,
variables: `{\n "categoryid": 1\n}`,
},
getproductvariants: {
query: /* GraphQL */ /* GraphQL */ `
query GetProductVariants($tenantid: bigint!, $subcategoryid: bigint!) {
productvariants(
where: {
tenantid: { _eq: $tenantid }
subcategoryid: { _eq: $subcategoryid }
}
) {
variantid
productid
tenantid
categoryid
subcategoryid
variantname
price
status
created
updated
category {
categoryname
}
}
}
`,
variables: `{\n "tenantid": 1079,\n "subcategoryid": 1\n}`,
},
getstockstatement: {
query: /* GraphQL */ /* GraphQL */ `
query GetStockStatement(
$tenantid: bigint!
$locationid: bigint!
$subcategoryid: bigint
$keyword: String
$limit: Int
$offset: Int
) {
product_stock_statement(
where: {
tenantid: { _eq: $tenantid }
locationid: { _eq: $locationid }
subcategoryid: { _eq: $subcategoryid }
productname: { _ilike: $keyword }
}
limit: $limit
offset: $offset
order_by: { productid: desc }
) {
productid
productname
productimage
categoryid
subcategoryid
productunit
unitvalue
productcost
taxpercent
taxamount
retailprice
tenantid
locationid
opening
credit
debit
closing
}
}
`,
variables: `{\n "tenantid": 1079,\n "locationid": 1,\n "subcategoryid": null,\n "keyword": "%",\n "limit": 10,\n "offset": 0\n}`,
},
gettenantdeliveries: {
query: /* GraphQL */ /* GraphQL */ `
query GetTenantDeliveriesFull(
$tenantid: bigint!
$status: String
$fromdate: timestamp
$todate: timestamp
$keyword: String
$limit: Int
$offset: Int
) {
deliveries(
where: {
tenantid: { _eq: $tenantid }
_and: [
{ orderstatus: { _eq: $status } }
{ deliverydate: { _gte: $fromdate } }
{ deliverydate: { _lte: $todate } }
{
_or: [
{ pickupcustomer: { _ilike: $keyword } }
{ deliverycustomer: { _ilike: $keyword } }
{ pickupcontactno: { _ilike: $keyword } }
{ deliverycontactno: { _ilike: $keyword } }
{ orderid: { _ilike: $keyword } }
]
}
]
}
limit: $limit
offset: $offset
order_by: { deliveryid: desc }
) {
deliveryid
orderid
deliverydate
orderstatus
pickupcustomer
pickupcontactno
pickupaddress
deliverycustomer
deliverycontactno
deliveryaddress
kms
customers {
customertoken
}
app_users {
firstname
contactno
}
tenants {
tenantname
primarycontact
}
}
}
`,
variables: `{\n "tenantid": 1079,\n "status": "delivered",\n "fromdate": "2026-01-01T00:00:00",\n "todate": "2026-01-31T23:59:59",\n "keyword": "%",\n "limit": 10,\n "offset": 0\n}`,
},
getinvoiceinsight: {
query: /* GraphQL */ /* GraphQL */ `
query GetInvoiceInsight($tenantid: bigint!) {
invoice_insight(where: { tenantid: { _eq: $tenantid } }) {
totalcount
total
pendingcount
pending
pendingpercent
confirmedcount
confirmed
confirmedpercent
paidcount
paid
paidpercent
overduecount
overdue
overduepercent
}
}
`,
variables: `{\n "tenantid": 1079\n}`,
},
getproductscount: {
query: /* GraphQL */ /* GraphQL */ `
query GetProductsCount(
$tenantid: bigint!
$categoryid: bigint!
$subcategoryid: bigint!
) {
total: products_aggregate(
where: {
tenantid: { _eq: $tenantid }
categoryid: { _eq: $categoryid }
subcategoryid: { _eq: $subcategoryid }
}
) {
aggregate {
count
}
}
available: products_aggregate(
where: {
tenantid: { _eq: $tenantid }
categoryid: { _eq: $categoryid }
subcategoryid: { _eq: $subcategoryid }
productstatus: { _eq: "available" }
}
) {
aggregate {
count
}
}
outofstock: products_aggregate(
where: {
tenantid: { _eq: $tenantid }
categoryid: { _eq: $categoryid }
subcategoryid: { _eq: $subcategoryid }
productstatus: { _eq: "outofstock" }
}
) {
aggregate {
count
}
}
}
`,
variables: `{\n "tenantid": 1079,\n "categoryid": 1,\n "subcategoryid": 1\n}`,
},
createproduct: {
query: /* GraphQL */ /* GraphQL */ `
mutation CreateProduct($object: products_insert_input!) {
insert_products_one(object: $object) {
productid
applocationid
tenantid
categoryid
subcategoryid
productname
productimage
productdesc
productsku
productbrand
productunit
unitvalue
toppicks
productcost
taxamount
taxpercent
producttax
productstock
productcombo
variants
quantity
retailprice
diffprice
diffpercent
othercost
approve
productstatus
}
}
`,
variables: `{
"object": {
"applocationid": 1,
"tenantid": 1079,
"categoryid": 1,
"subcategoryid": 1,
"productname": "Sample Product",
"productimage": "",
"productdesc": "Sample description",
"productsku": "SKU123",
"productbrand": "BrandX",
"productunit": "kg",
"unitvalue": 1,
"toppicks": false,
"productcost": 50,
"taxamount": 5,
"taxpercent": 10,
"producttax": true,
"productstock": 100,
"productcombo": false,
"variants": false,
"quantity": 100,
"retailprice": 60,
"diffprice": 10,
"diffpercent": 20,
"othercost": 0,
"approve": true,
"productstatus": "available"
}
}`,
},
getinvoices: {
query: /* GraphQL */ /* GraphQL */ `
query GetInvoices($tenantid: bigint!, $billstatus: bigint!) {
tenantsales(
where: {
tenantid: { _eq: $tenantid }
billstatus: { _eq: $billstatus }
}
order_by: { salesid: desc }
) {
salesid
tenantid
totalamount
billstatus
duedate
status
}
}
`,
variables: `{
"tenantid": 1079,
"billstatus": 1
}`,
},
};
export const topics = [
{
id: "users",
name: "Users",
description: "Manage users and roles within the NearleDaily ecosystem.",
endpoints: [
{
name: "getusers",
method: "GET",
url: "/api/rest/getusers?roleid=1&tenantid=1079&limit=10&offset=0",
description: "Retrieve a list of all users in the system.",
},
{
name: "getapproles",
method: "GET",
url: "/api/rest/getapproles?configid=1",
description:
"Get all application roles based on a specific configuration.",
},
],
},
{
id: "orders",
name: "Orders",
description:
"Endpoints related to creating, updating, and querying customer orders.",
endpoints: [
{
name: "getorders",
method: "GET",
url: "/api/rest/getorders?start=2026-01-01T00:00:00&end=2026-01-31T23:59:59&status=delivered&limit=10&offset=0",
description: "Get detailed order information within a time frame.",
},
{
name: "getordersummary",
method: "GET",
url: "/api/rest/getordersummary?tenantid=1079&configid=1&fromdate=2025-07-24T00:00:00&todate=2025-07-24T23:59:59",
description:
"Retrieve high-level summary and aggregated counts for orders.",
},
],
},
{
id: "tenants",
name: "Tenants",
description:
"Manage tenant details, their customers, and their specific delivery statistics.",
endpoints: [
{
name: "gettenantinfo",
method: "GET",
url: "/api/rest/gettenantinfo?tenantid=1079",
description: "Get specific information about a tenant by their ID.",
},
{
name: "gettenantlocations",
method: "GET",
url: "/api/rest/gettenantlocations?tenantid=1",
description: "Get all physical locations linked to a tenant.",
},
{
name: "getcustomersbytenant",
method: "GET",
url: "/api/rest/getcustomersbytenant?tenantid=1079&limit=10&offset=0",
description: "Retrieve customers associated with a specific tenant.",
},
{
name: "gettenantcustomers",
method: "GET",
url: "/api/rest/gettenantcustomers?tenantid=1079&locationid=1&limit=10&offset=0",
description:
"Get customers under a specific tenant and location combination.",
},
{
name: "gettenantdeliveries",
method: "GET",
url: "/api/rest/gettenantdeliveries?tenantid=1079&status=delivered&fromdate=2026-01-01T00:00:00&todate=2026-01-31T23:59:59&keyword=%25&limit=10&offset=0",
description:
"Query extensive delivery data for a tenant including pickup/delivery info.",
},
{
name: "getinvoiceinsight",
method: "GET",
url: "/api/rest/getinvoiceinsight?tenantid=1079",
useGraphql: true,
description:
"Retrieve detailed insights and statistics regarding tenant invoices.",
},
{
name: "getinvoices",
method: "GET",
url: "/api/rest/getinvoices?tenantid=1079&billstatus=1",
useGraphql: true,
description:
"Retrieve all invoices for a tenant based on their billing status.",
},
],
},
{
id: "products",
name: "Products",
description:
"Operations for managing product catalogs, categories, variants, and stock tracking.",
endpoints: [
{
name: "getproductcategories",
method: "GET",
url: "/api/rest/getproductcategories?moduleid=6",
description: "Get all root product categories for a specific module.",
},
{
name: "getsubcategory",
method: "GET",
url: "/api/rest/getsubcategory?moduleid=6&categoryid=1",
description: "Get a specific subcategory belonging to a root category.",
},
{
name: "getproductsubcategories",
method: "GET",
url: "/api/rest/getproductsubcategories?categoryid=1",
description: "List all subcategories under a specific root category.",
},
{
name: "getproductvariants",
method: "GET",
url: "/api/rest/getproductvariants?tenantid=1079&subcategoryid=1",
description:
"Get different variants of products (e.g. sizes, colors) for a tenant.",
},
{
name: "getstockstatement",
method: "GET",
url: "/api/rest/getstockstatement?tenantid=1079&locationid=1&subcategoryid=&keyword=%25&limit=10&offset=0",
description:
"Generate a comprehensive statement of stock including opening, credit, debit, closing balances.",
},
{
name: "getproductscount",
method: "GET",
url: "/api/rest/getproductscount?tenantid=1079&categoryid=1&subcategoryid=1",
description:
"Get aggregated counts of products available and out of stock.",
},
{
name: "createproduct",
method: "POST",
url: "/api/rest/createproduct",
useGraphql: true,
description: "Create a new product within the catalog.",
},
],
},
{
id: "locations",
name: "Apps & Locations",
description:
"Query configuration endpoints for application locations and active statuses.",
endpoints: [
{
name: "getapplocations",
method: "GET",
url: "/api/rest/getapplocations?userid=1",
useGraphql: true,
description:
"Retrieve application location settings for a specific user.",
},
{
name: "getactivelocationbyid",
method: "GET",
url: "/api/rest/getapplocations",
description: "List all currently active locations globally.",
},
{
name: "getlocationsconfig",
method: "GET",
url: "/api/rest/getapplocationconfig",
description:
"Retrieve the global configuration properties for application locations.",
},
{
name: "getapptypes",
method: "GET",
url: "/api/rest/getapptypes?tag=partner",
description: "Get specific application types grouped by a tag name.",
},
],
},
{
id: "partners",
name: "Partners",
description:
"Manage partners, drivers/riders, and their shifts and earnings.",
endpoints: [
{
name: "getpartners",
method: "GET",
url: "/api/rest/getpartners?applocationid=1&partnerid=0&limit=10&offset=0",
description:
"Retrieve a list of active partners associated with locations.",
},
{
name: "getridershifts",
method: "GET",
url: "/api/rest/getridershifts?applocationid=1",
description:
"Get historic and active shift records for riders in a specific location.",
},
],
},
];