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 Barbinaf394f6b318d
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index d1f421a94f..bc51eb6600 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -9162,6 +9162,9 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceFailureMode.updatedAt",
},
+ {
+ $ref: "#/parameters/rowFilter.maintenanceFailureMode.type",
+ },
{
$ref: "#/parameters/select",
},
@@ -9242,6 +9245,9 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceFailureMode.updatedAt",
},
+ {
+ $ref: "#/parameters/rowFilter.maintenanceFailureMode.type",
+ },
{
$ref: "#/parameters/preferReturn",
},
@@ -9276,6 +9282,9 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceFailureMode.updatedAt",
},
+ {
+ $ref: "#/parameters/rowFilter.maintenanceFailureMode.type",
+ },
{
$ref: "#/parameters/body.maintenanceFailureMode",
},
@@ -23439,9 +23448,6 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.source",
},
- {
- $ref: "#/parameters/rowFilter.maintenanceDispatch.severity",
- },
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.workCenterId",
},
@@ -23496,6 +23502,9 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.oeeImpact",
},
+ {
+ $ref: "#/parameters/rowFilter.maintenanceDispatch.severity",
+ },
{
$ref: "#/parameters/select",
},
@@ -23573,9 +23582,6 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.source",
},
- {
- $ref: "#/parameters/rowFilter.maintenanceDispatch.severity",
- },
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.workCenterId",
},
@@ -23630,6 +23636,9 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.oeeImpact",
},
+ {
+ $ref: "#/parameters/rowFilter.maintenanceDispatch.severity",
+ },
{
$ref: "#/parameters/preferReturn",
},
@@ -23661,9 +23670,6 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.source",
},
- {
- $ref: "#/parameters/rowFilter.maintenanceDispatch.severity",
- },
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.workCenterId",
},
@@ -23718,6 +23724,9 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.oeeImpact",
},
+ {
+ $ref: "#/parameters/rowFilter.maintenanceDispatch.severity",
+ },
{
$ref: "#/parameters/body.maintenanceDispatch",
},
@@ -59322,6 +59331,18 @@ export default {
{
$ref: "#/parameters/rowFilter.companySettings.maintenanceAdvanceDays",
},
+ {
+ $ref: "#/parameters/rowFilter.companySettings.maintenanceDispatchNotificationGroup",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.qualityDispatchNotificationGroup",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.operationsDispatchNotificationGroup",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.otherDispatchNotificationGroup",
+ },
{
$ref: "#/parameters/select",
},
@@ -59432,6 +59453,18 @@ export default {
{
$ref: "#/parameters/rowFilter.companySettings.maintenanceAdvanceDays",
},
+ {
+ $ref: "#/parameters/rowFilter.companySettings.maintenanceDispatchNotificationGroup",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.qualityDispatchNotificationGroup",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.operationsDispatchNotificationGroup",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.otherDispatchNotificationGroup",
+ },
{
$ref: "#/parameters/preferReturn",
},
@@ -59496,6 +59529,18 @@ export default {
{
$ref: "#/parameters/rowFilter.companySettings.maintenanceAdvanceDays",
},
+ {
+ $ref: "#/parameters/rowFilter.companySettings.maintenanceDispatchNotificationGroup",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.qualityDispatchNotificationGroup",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.operationsDispatchNotificationGroup",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.otherDispatchNotificationGroup",
+ },
{
$ref: "#/parameters/body.companySettings",
},
@@ -63802,6 +63847,45 @@ export default {
tags: ["(rpc) get_next_prefixed_sequence"],
},
},
+ "/rpc/get_maintenance_schedules_by_location": {
+ post: {
+ parameters: [
+ {
+ in: "body",
+ name: "args",
+ required: true,
+ schema: {
+ properties: {
+ p_company_id: {
+ format: "text",
+ type: "string",
+ },
+ p_location_id: {
+ format: "text",
+ type: "string",
+ },
+ },
+ required: ["p_company_id", "p_location_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_maintenance_schedules_by_location"],
+ },
+ },
"/rpc/get_active_job_operations_by_employee": {
post: {
parameters: [
@@ -64084,6 +64168,45 @@ export default {
tags: ["(rpc) get_purchasing_planning"],
},
},
+ "/rpc/get_maintenance_dispatches_by_location": {
+ post: {
+ parameters: [
+ {
+ in: "body",
+ name: "args",
+ required: true,
+ schema: {
+ properties: {
+ p_company_id: {
+ format: "text",
+ type: "string",
+ },
+ p_location_id: {
+ format: "text",
+ type: "string",
+ },
+ },
+ required: ["p_company_id", "p_location_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_maintenance_dispatches_by_location"],
+ },
+ },
"/rpc/id": {
post: {
parameters: [
@@ -68456,7 +68579,7 @@ export default {
type: "object",
},
maintenanceFailureMode: {
- required: ["id", "name", "companyId", "createdBy", "createdAt"],
+ required: ["id", "name", "companyId", "createdBy", "createdAt", "type"],
properties: {
id: {
default: "public.id()",
@@ -68495,6 +68618,12 @@ export default {
format: "timestamp with time zone",
type: "string",
},
+ type: {
+ default: "Maintenance",
+ enum: ["Maintenance", "Quality", "Operations", "Other"],
+ format: 'public."maintenanceFailureModeType"',
+ type: "string",
+ },
},
type: "object",
},
@@ -75134,6 +75263,7 @@ export default {
"createdBy",
"createdAt",
"oeeImpact",
+ "severity",
],
properties: {
id: {
@@ -75167,16 +75297,6 @@ export default {
format: 'public."maintenanceSource"',
type: "string",
},
- severity: {
- enum: [
- "Preventive",
- "Operator Performed",
- "Support Required",
- "OEM Required",
- ],
- format: 'public."maintenanceSeverity"',
- type: "string",
- },
workCenterId: {
description:
"Note:\nThis is a Foreign Key to `workCenter.id`.<fk table='workCenter' column='id'/>",
@@ -75270,6 +75390,16 @@ export default {
format: 'public."oeeImpact"',
type: "string",
},
+ severity: {
+ enum: [
+ "Preventive",
+ "Operator Performed",
+ "Support Required",
+ "OEM Required",
+ ],
+ format: 'public."maintenanceSeverity"',
+ type: "string",
+ },
},
type: "object",
},
@@ -92669,6 +92799,34 @@ export default {
format: "integer",
type: "integer",
},
+ maintenanceDispatchNotificationGroup: {
+ format: "text[]",
+ items: {
+ type: "string",
+ },
+ type: "array",
+ },
+ qualityDispatchNotificationGroup: {
+ format: "text[]",
+ items: {
+ type: "string",
+ },
+ type: "array",
+ },
+ operationsDispatchNotificationGroup: {
+ format: "text[]",
+ items: {
+ type: "string",
+ },
+ type: "array",
+ },
+ otherDispatchNotificationGroup: {
+ format: "text[]",
+ items: {
+ type: "string",
+ },
+ type: "array",
+ },
},
type: "object",
},
@@ -97754,6 +97912,12 @@ export default {
in: "query",
type: "string",
},
+ "rowFilter.maintenanceFailureMode.type": {
+ name: "type",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.gaugeCalibrationRecords": {
name: "gaugeCalibrationRecords",
description: "gaugeCalibrationRecords",
@@ -105263,12 +105427,6 @@ export default {
in: "query",
type: "string",
},
- "rowFilter.maintenanceDispatch.severity": {
- name: "severity",
- required: false,
- in: "query",
- type: "string",
- },
"rowFilter.maintenanceDispatch.workCenterId": {
name: "workCenterId",
required: false,
@@ -105377,6 +105535,12 @@ export default {
in: "query",
type: "string",
},
+ "rowFilter.maintenanceDispatch.severity": {
+ name: "severity",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.openProductionOrders": {
name: "openProductionOrders",
description: "openProductionOrders",
@@ -124920,6 +125084,30 @@ export default {
in: "query",
type: "string",
},
+ "rowFilter.companySettings.maintenanceDispatchNotificationGroup": {
+ name: "maintenanceDispatchNotificationGroup",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.companySettings.qualityDispatchNotificationGroup": {
+ name: "qualityDispatchNotificationGroup",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.companySettings.operationsDispatchNotificationGroup": {
+ name: "operationsDispatchNotificationGroup",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.companySettings.otherDispatchNotificationGroup": {
+ name: "otherDispatchNotificationGroup",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.part": {
name: "part",
description: "part",
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index 16cdf50a90..3e0b095348 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -49566,14 +49566,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"]
@@ -54048,7 +54048,6 @@ export type Database = {
maintenanceFailureModeType:
| "Maintenance"
| "Quality"
- | "Safety"
| "Operations"
| "Other"
maintenanceFrequency:
@@ -55196,7 +55195,6 @@ export const Constants = {
maintenanceFailureModeType: [
"Maintenance",
"Quality",
- "Safety",
"Operations",
"Other",
],
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 16cdf50a90..3e0b095348 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -49566,14 +49566,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"]
@@ -54048,7 +54048,6 @@ export type Database = {
maintenanceFailureModeType:
| "Maintenance"
| "Quality"
- | "Safety"
| "Operations"
| "Other"
maintenanceFrequency:
@@ -55196,7 +55195,6 @@ export const Constants = {
maintenanceFailureModeType: [
"Maintenance",
"Quality",
- "Safety",
"Operations",
"Other",
],