Skip to content
This repository was archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
fix(fix cte generation): fix cte generation
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielDeSouzza committed Jun 23, 2024
1 parent 38d533f commit 082b9c2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions prisma/dbml/schema.dbml
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,13 @@ Table physical_orders {
completedOrdersId String
PhysicalCustomerQuoteTable physical_customer_quote [not null]
quote_table_id String [not null]
PhysicalCustomerCte physical_customer_cte
PhysicalCustomerCte physical_customer_cte [not null]
FreightExpenses freight_expenses [not null]
}

Table physical_customer_cte {
id String [pk]
order_id String [unique, not null]
order_id String [not null]
PhysicalCustomerOrder physical_orders [not null]
access_key String [not null]
type_cte String [not null]
Expand Down Expand Up @@ -880,7 +880,7 @@ Ref: physical_orders.order_processing_id > order_procesing.id

Ref: physical_orders.quote_table_id > physical_customer_quote.id

Ref: physical_customer_cte.order_id - physical_orders.id
Ref: physical_customer_cte.order_id > physical_orders.id

Ref: sender.legal_person_id - legal_people.id

Expand Down
2 changes: 2 additions & 0 deletions prisma/migrations/20240623175605_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- DropIndex
DROP INDEX "physical_customer_cte_order_id_key";
4 changes: 2 additions & 2 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,15 @@ model PhysicalCustomerOrder {
completedOrdersId String?
PhysicalCustomerQuoteTable PhysicalCustomerQuoteTable @relation(fields: [quote_table_id], references: [id])
quote_table_id String
PhysicalCustomerCte PhysicalCustomerCte?
PhysicalCustomerCte PhysicalCustomerCte[]
FreightExpenses FreightExpenses[]
@@map("physical_orders")
}

model PhysicalCustomerCte {
id String @id @default(uuid())
order_id String @unique
order_id String
PhysicalCustomerOrder PhysicalCustomerOrder @relation(fields: [order_id], references: [id])
access_key String
type_cte String
Expand Down
14 changes: 12 additions & 2 deletions src/infra/graphql/generated/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -2609,6 +2609,12 @@ input PhysicalCustomerCteInput {
orderId: String!
}

input PhysicalCustomerCteListRelationFilter {
every: PhysicalCustomerCteWhereInput
none: PhysicalCustomerCteWhereInput
some: PhysicalCustomerCteWhereInput
}

type PhysicalCustomerCteModel {
acessKey: String!
cteNumber: String!
Expand All @@ -2618,6 +2624,10 @@ type PhysicalCustomerCteModel {
orderId: String!
}

input PhysicalCustomerCteOrderByRelationAggregateInput {
_count: SortOrder
}

input PhysicalCustomerCteOrderByWithRelationInput {
PhysicalCustomerOrder: PhysicalCustomerOrderOrderByWithRelationInput
access_key: SortOrder
Expand Down Expand Up @@ -2742,7 +2752,7 @@ input PhysicalCustomerOrderOrderByWithRelationInput {
FreightExpenses: FreightExpensesOrderByRelationAggregateInput
OrderProcessing: OrderProcessingOrderByWithRelationInput
PhysicalCustomer: PhysicalCustomerOrderByWithRelationInput
PhysicalCustomerCte: PhysicalCustomerCteOrderByWithRelationInput
PhysicalCustomerCte: PhysicalCustomerCteOrderByRelationAggregateInput
PhysicalCustomerQuoteTable: PhysicalCustomerQuoteTableOrderByWithRelationInput
UpdatedBy: UserOrderByWithRelationInput
carrier_id: SortOrder
Expand Down Expand Up @@ -2785,7 +2795,7 @@ input PhysicalCustomerOrderWhereInput {
OR: [PhysicalCustomerOrderWhereInput!]
OrderProcessing: OrderProcessingWhereInput
PhysicalCustomer: PhysicalCustomerWhereInput
PhysicalCustomerCte: PhysicalCustomerCteWhereInput
PhysicalCustomerCte: PhysicalCustomerCteListRelationFilter
PhysicalCustomerQuoteTable: PhysicalCustomerQuoteTableWhereInput
UpdatedBy: UserWhereInput
carrier_id: StringFilter
Expand Down

0 comments on commit 082b9c2

Please sign in to comment.