Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

refactor: generate types

Brad Barbince9a240e568d
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index 1c023cd649..81adaabda1 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -41466,6 +41466,168 @@ export default {
tags: ["purchaseOrderSuppliers"],
},
},
+ "/nonConformanceActionProcess": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.actionTaskId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.processId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.updatedBy",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/nonConformanceActionProcess",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["nonConformanceActionProcess"],
+ },
+ post: {
+ parameters: [
+ {
+ $ref: "#/parameters/body.nonConformanceActionProcess",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/preferPost",
+ },
+ ],
+ responses: {
+ "201": {
+ description: "Created",
+ },
+ },
+ tags: ["nonConformanceActionProcess"],
+ },
+ delete: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.actionTaskId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.processId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.updatedBy",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["nonConformanceActionProcess"],
+ },
+ patch: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.actionTaskId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.processId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.nonConformanceActionProcess.updatedBy",
+ },
+ {
+ $ref: "#/parameters/body.nonConformanceActionProcess",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["nonConformanceActionProcess"],
+ },
+ },
"/batchProperty": {
get: {
parameters: [
@@ -58285,6 +58447,85 @@ export default {
tags: ["(rpc) get_part_details"],
},
},
+ "/rpc/get_action_tasks_by_item_and_process": {
+ get: {
+ parameters: [
+ {
+ format: "text",
+ in: "query",
+ name: "p_item_id",
+ required: true,
+ type: "string",
+ },
+ {
+ format: "text",
+ in: "query",
+ name: "p_process_id",
+ required: true,
+ type: "string",
+ },
+ {
+ format: "text",
+ in: "query",
+ name: "p_company_id",
+ required: true,
+ type: "string",
+ },
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_action_tasks_by_item_and_process"],
+ },
+ post: {
+ parameters: [
+ {
+ in: "body",
+ name: "args",
+ required: true,
+ schema: {
+ properties: {
+ p_company_id: {
+ format: "text",
+ type: "string",
+ },
+ p_item_id: {
+ format: "text",
+ type: "string",
+ },
+ p_process_id: {
+ format: "text",
+ type: "string",
+ },
+ },
+ required: ["p_item_id", "p_process_id", "p_company_id"],
+ type: "object",
+ },
+ },
+ {
+ $ref: "#/parameters/preferParams",
+ },
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_action_tasks_by_item_and_process"],
+ },
+ },
"/rpc/xid_pid": {
post: {
parameters: [
@@ -79697,6 +79938,64 @@ export default {
},
type: "object",
},
+ nonConformanceActionProcess: {
+ required: [
+ "id",
+ "actionTaskId",
+ "processId",
+ "companyId",
+ "createdAt",
+ "createdBy",
+ ],
+ properties: {
+ id: {
+ default: "public.xid()",
+ description: "Note:\nThis is a Primary Key.<pk/>",
+ format: "text",
+ type: "string",
+ },
+ actionTaskId: {
+ description:
+ "Note:\nThis is a Foreign Key to `nonConformanceActionTask.id`.<fk table='nonConformanceActionTask' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ processId: {
+ description:
+ "Note:\nThis is a Foreign Key to `process.id`.<fk table='process' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ companyId: {
+ description:
+ "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdAt: {
+ default: "now()",
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ createdBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ updatedAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ updatedBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ },
+ type: "object",
+ },
batchProperty: {
required: [
"id",
@@ -109086,6 +109385,63 @@ export default {
in: "query",
type: "string",
},
+ "body.nonConformanceActionProcess": {
+ name: "nonConformanceActionProcess",
+ description: "nonConformanceActionProcess",
+ required: false,
+ in: "body",
+ schema: {
+ $ref: "#/definitions/nonConformanceActionProcess",
+ },
+ },
+ "rowFilter.nonConformanceActionProcess.id": {
+ name: "id",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.nonConformanceActionProcess.actionTaskId": {
+ name: "actionTaskId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.nonConformanceActionProcess.processId": {
+ name: "processId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.nonConformanceActionProcess.companyId": {
+ name: "companyId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.nonConformanceActionProcess.createdAt": {
+ name: "createdAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.nonConformanceActionProcess.createdBy": {
+ name: "createdBy",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.nonConformanceActionProcess.updatedAt": {
+ name: "updatedAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.nonConformanceActionProcess.updatedBy": {
+ name: "updatedBy",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.batchProperty": {
name: "batchProperty",
description: "batchProperty",
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index 1169c8254e..112988c913 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -7396,6 +7396,7 @@ export type Database = {
gaugeCalibrationRecord: {
Row: {
approvedBy: string | null
+ calibrationAttempts: Json | null
companyId: string | null
createdAt: string
createdBy: string
@@ -7405,6 +7406,7 @@ export type Database = {
humidity: number | null
id: string
inspectionStatus: Database["public"]["Enums"]["inspectionStatus"]
+ measurementStandard: string | null
notes: Json
requiresAction: boolean
requiresAdjustment: boolean
@@ -7416,6 +7418,7 @@ export type Database = {
}
Insert: {
approvedBy?: string | null
+ calibrationAttempts?: Json | null
companyId?: string | null
createdAt?: string
createdBy: string
@@ -7425,6 +7428,7 @@ export type Database = {
humidity?: number | null
id?: string
inspectionStatus: Database["public"]["Enums"]["inspectionStatus"]
+ measurementStandard?: string | null
notes?: Json
requiresAction?: boolean
requiresAdjustment?: boolean
@@ -7436,6 +7440,7 @@ export type Database = {
}
Update: {
approvedBy?: string | null
+ calibrationAttempts?: Json | null
companyId?: string | null
createdAt?: string
createdBy?: string
@@ -7445,6 +7450,7 @@ export type Database = {
humidity?: number | null
id?: string
inspectionStatus?: Database["public"]["Enums"]["inspectionStatus"]
+ measurementStandard?: string | null
notes?: Json
requiresAction?: boolean
requiresAdjustment?: boolean
@@ -16572,7 +16578,6 @@ export type Database = {
createdBy: string
id: string
name: string
- processIds: string[] | null
updatedAt: string | null
updatedBy: string | null
}
@@ -16583,7 +16588,6 @@ export type Database = {
createdBy: string
id?: string
name: string
- processIds?: string[] | null
updatedAt?: string | null
updatedBy?: string | null
}
@@ -16594,7 +16598,6 @@ export type Database = {
createdBy?: string
id?: string
name?: string
- processIds?: string[] | null
updatedAt?: string | null
updatedBy?: string | null
}
@@ -38817,6 +38820,7 @@ export type Database = {
gaugeCalibrationRecords: {
Row: {
approvedBy: string | null
+ calibrationAttempts: Json | null
companyId: string | null
createdAt: string | null
createdBy: string | null
@@ -38831,6 +38835,7 @@ export type Database = {
inspectionStatus:
| Database["public"]["Enums"]["inspectionStatus"]
| null
+ measurementStandard: string | null
notes: Json | null
requiresAction: boolean | null
requiresAdjustment: boolean | null
@@ -43446,14 +43451,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["supplierCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["supplierCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -45965,14 +45970,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -46508,14 +46513,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["paymentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["paymentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 1169c8254e..112988c913 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -7396,6 +7396,7 @@ export type Database = {
gaugeCalibrationRecord: {
Row: {
approvedBy: string | null
+ calibrationAttempts: Json | null
companyId: string | null
createdAt: string
createdBy: string
@@ -7405,6 +7406,7 @@ export type Database = {
humidity: number | null
id: string
inspectionStatus: Database["public"]["Enums"]["inspectionStatus"]
+ measurementStandard: string | null
notes: Json
requiresAction: boolean
requiresAdjustment: boolean
@@ -7416,6 +7418,7 @@ export type Database = {
}
Insert: {
approvedBy?: string | null
+ calibrationAttempts?: Json | null
companyId?: string | null
createdAt?: string
createdBy: string
@@ -7425,6 +7428,7 @@ export type Database = {
humidity?: number | null
id?: string
inspectionStatus: Database["public"]["Enums"]["inspectionStatus"]
+ measurementStandard?: string | null
notes?: Json
requiresAction?: boolean
requiresAdjustment?: boolean
@@ -7436,6 +7440,7 @@ export type Database = {
}
Update: {
approvedBy?: string | null
+ calibrationAttempts?: Json | null
companyId?: string | null
createdAt?: string
createdBy?: string
@@ -7445,6 +7450,7 @@ export type Database = {
humidity?: number | null
id?: string
inspectionStatus?: Database["public"]["Enums"]["inspectionStatus"]
+ measurementStandard?: string | null
notes?: Json
requiresAction?: boolean
requiresAdjustment?: boolean
@@ -16572,7 +16578,6 @@ export type Database = {
createdBy: string
id: string
name: string
- processIds: string[] | null
updatedAt: string | null
updatedBy: string | null
}
@@ -16583,7 +16588,6 @@ export type Database = {
createdBy: string
id?: string
name: string
- processIds?: string[] | null
updatedAt?: string | null
updatedBy?: string | null
}
@@ -16594,7 +16598,6 @@ export type Database = {
createdBy?: string
id?: string
name?: string
- processIds?: string[] | null
updatedAt?: string | null
updatedBy?: string | null
}
@@ -38817,6 +38820,7 @@ export type Database = {
gaugeCalibrationRecords: {
Row: {
approvedBy: string | null
+ calibrationAttempts: Json | null
companyId: string | null
createdAt: string | null
createdBy: string | null
@@ -38831,6 +38835,7 @@ export type Database = {
inspectionStatus:
| Database["public"]["Enums"]["inspectionStatus"]
| null
+ measurementStandard: string | null
notes: Json | null
requiresAction: boolean | null
requiresAdjustment: boolean | null
@@ -43446,14 +43451,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["supplierCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["supplierCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -45965,14 +45970,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -46508,14 +46513,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["paymentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["paymentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]