diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala index 490715b2c9..9065a2d132 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `compositepk.person` */ -case class PersonId(one: Long, two: Option[String]) +case class PersonId( + one: Long, + two: Option[String] +) object PersonId { implicit def ordering(implicit O0: Ordering[Option[String]]): Ordering[PersonId] = Ordering.by(x => (x.one, x.two)) implicit lazy val reads: Reads[PersonId] = Reads[PersonId](json => JsResult.fromTry( diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index f2cc9a2423..50b85e1d89 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -31,6 +31,7 @@ case class PersonRow( name: Option[String] ){ val compositeId: PersonId = PersonId(one, two) + val id = compositeId def toUnsavedRow(one: Defaulted[Long], two: Defaulted[Option[String]]): PersonRowUnsaved = PersonRowUnsaved(name, one, two) } diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/testInsert.scala b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/testInsert.scala index 963c576965..a0ef543a0b 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/testInsert.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/testInsert.scala @@ -27,8 +27,8 @@ class TestInsert(random: Random) { one: Defaulted[Long] = Defaulted.UseDefault, two: Defaulted[Option[String]] = Defaulted.UseDefault )(implicit c: Connection): PersonRow = (new PersonRepoImpl).insert(new PersonRowUnsaved(name = name, one = one, two = two)) - def myschemaFootballClub(id: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString)(implicit c: Connection): FootballClubRow = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) - def myschemaMaritalStatus(id: MaritalStatusId)(implicit c: Connection): MaritalStatusRow = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) + def myschemaFootballClub(id: FootballClubId = FootballClubId(random.nextLong()), name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString)(implicit c: Connection): FootballClubRow = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) + def myschemaMaritalStatus(id: MaritalStatusId = MaritalStatusId(random.nextLong()))(implicit c: Connection): MaritalStatusRow = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) def myschemaPerson(favouriteFootballClubId: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString, nickName: Option[/* max 30 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala index 963c576965..a0ef543a0b 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala @@ -27,8 +27,8 @@ class TestInsert(random: Random) { one: Defaulted[Long] = Defaulted.UseDefault, two: Defaulted[Option[String]] = Defaulted.UseDefault )(implicit c: Connection): PersonRow = (new PersonRepoImpl).insert(new PersonRowUnsaved(name = name, one = one, two = two)) - def myschemaFootballClub(id: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString)(implicit c: Connection): FootballClubRow = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) - def myschemaMaritalStatus(id: MaritalStatusId)(implicit c: Connection): MaritalStatusRow = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) + def myschemaFootballClub(id: FootballClubId = FootballClubId(random.nextLong()), name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString)(implicit c: Connection): FootballClubRow = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) + def myschemaMaritalStatus(id: MaritalStatusId = MaritalStatusId(random.nextLong()))(implicit c: Connection): MaritalStatusRow = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) def myschemaPerson(favouriteFootballClubId: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString, nickName: Option[/* max 30 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala index 490715b2c9..9065a2d132 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `compositepk.person` */ -case class PersonId(one: Long, two: Option[String]) +case class PersonId( + one: Long, + two: Option[String] +) object PersonId { implicit def ordering(implicit O0: Ordering[Option[String]]): Ordering[PersonId] = Ordering.by(x => (x.one, x.two)) implicit lazy val reads: Reads[PersonId] = Reads[PersonId](json => JsResult.fromTry( diff --git a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index f2cc9a2423..50b85e1d89 100644 --- a/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-anorm@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -31,6 +31,7 @@ case class PersonRow( name: Option[String] ){ val compositeId: PersonId = PersonId(one, two) + val id = compositeId def toUnsavedRow(one: Defaulted[Long], two: Defaulted[Option[String]]): PersonRowUnsaved = PersonRowUnsaved(name, one, two) } diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala index 200ee34aa6..be0341a6e4 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala @@ -27,8 +27,8 @@ class TestInsert(random: Random) { one: Defaulted[Long] = Defaulted.UseDefault, two: Defaulted[Option[String]] = Defaulted.UseDefault ): ConnectionIO[PersonRow] = (new PersonRepoImpl).insert(new PersonRowUnsaved(name = name, one = one, two = two)) - def myschemaFootballClub(id: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString): ConnectionIO[FootballClubRow] = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) - def myschemaMaritalStatus(id: MaritalStatusId): ConnectionIO[MaritalStatusRow] = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) + def myschemaFootballClub(id: FootballClubId = FootballClubId(random.nextLong()), name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString): ConnectionIO[FootballClubRow] = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) + def myschemaMaritalStatus(id: MaritalStatusId = MaritalStatusId(random.nextLong())): ConnectionIO[MaritalStatusRow] = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) def myschemaPerson(favouriteFootballClubId: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString, nickName: Option[/* max 30 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala index d3bd892c1e..4724144cd8 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala @@ -12,7 +12,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `compositepk.person` */ -case class PersonId(one: Long, two: Option[String]) +case class PersonId( + one: Long, + two: Option[String] +) object PersonId { implicit lazy val decoder: Decoder[PersonId] = Decoder.forProduct2[PersonId, Long, Option[String]]("one", "two")(PersonId.apply)(Decoder.decodeLong, Decoder.decodeOption(Decoder.decodeString)) implicit lazy val encoder: Encoder[PersonId] = Encoder.forProduct2[PersonId, Long, Option[String]]("one", "two")(x => (x.one, x.two))(Encoder.encodeLong, Encoder.encodeOption(Encoder.encodeString)) diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index 909c7c50f4..cdfb0c8c22 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -27,6 +27,7 @@ case class PersonRow( name: Option[String] ){ val compositeId: PersonId = PersonId(one, two) + val id = compositeId def toUnsavedRow(one: Defaulted[Long], two: Defaulted[Option[String]]): PersonRowUnsaved = PersonRowUnsaved(name, one, two) } diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala index 200ee34aa6..be0341a6e4 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala @@ -27,8 +27,8 @@ class TestInsert(random: Random) { one: Defaulted[Long] = Defaulted.UseDefault, two: Defaulted[Option[String]] = Defaulted.UseDefault ): ConnectionIO[PersonRow] = (new PersonRepoImpl).insert(new PersonRowUnsaved(name = name, one = one, two = two)) - def myschemaFootballClub(id: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString): ConnectionIO[FootballClubRow] = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) - def myschemaMaritalStatus(id: MaritalStatusId): ConnectionIO[MaritalStatusRow] = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) + def myschemaFootballClub(id: FootballClubId = FootballClubId(random.nextLong()), name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString): ConnectionIO[FootballClubRow] = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) + def myschemaMaritalStatus(id: MaritalStatusId = MaritalStatusId(random.nextLong())): ConnectionIO[MaritalStatusRow] = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) def myschemaPerson(favouriteFootballClubId: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString, nickName: Option[/* max 30 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala index d3bd892c1e..4724144cd8 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala @@ -12,7 +12,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `compositepk.person` */ -case class PersonId(one: Long, two: Option[String]) +case class PersonId( + one: Long, + two: Option[String] +) object PersonId { implicit lazy val decoder: Decoder[PersonId] = Decoder.forProduct2[PersonId, Long, Option[String]]("one", "two")(PersonId.apply)(Decoder.decodeLong, Decoder.decodeOption(Decoder.decodeString)) implicit lazy val encoder: Encoder[PersonId] = Encoder.forProduct2[PersonId, Long, Option[String]]("one", "two")(x => (x.one, x.two))(Encoder.encodeLong, Encoder.encodeOption(Encoder.encodeString)) diff --git a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index 909c7c50f4..cdfb0c8c22 100644 --- a/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-doobie@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -27,6 +27,7 @@ case class PersonRow( name: Option[String] ){ val compositeId: PersonId = PersonId(one, two) + val id = compositeId def toUnsavedRow(one: Defaulted[Long], two: Defaulted[Option[String]]): PersonRowUnsaved = PersonRowUnsaved(name, one, two) } diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala index 429cb3c034..c6632d1580 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala @@ -28,8 +28,8 @@ class TestInsert(random: Random) { one: Defaulted[Long] = Defaulted.UseDefault, two: Defaulted[Option[String]] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, PersonRow] = (new PersonRepoImpl).insert(new PersonRowUnsaved(name = name, one = one, two = two)) - def myschemaFootballClub(id: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString): ZIO[ZConnection, Throwable, FootballClubRow] = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) - def myschemaMaritalStatus(id: MaritalStatusId): ZIO[ZConnection, Throwable, MaritalStatusRow] = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) + def myschemaFootballClub(id: FootballClubId = FootballClubId(random.nextLong()), name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString): ZIO[ZConnection, Throwable, FootballClubRow] = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) + def myschemaMaritalStatus(id: MaritalStatusId = MaritalStatusId(random.nextLong())): ZIO[ZConnection, Throwable, MaritalStatusRow] = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) def myschemaPerson(favouriteFootballClubId: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString, nickName: Option[/* max 30 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala index f66c5f0d7c..57d3a9284a 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala @@ -14,7 +14,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `compositepk.person` */ -case class PersonId(one: Long, two: Option[String]) +case class PersonId( + one: Long, + two: Option[String] +) object PersonId { implicit lazy val jsonDecoder: JsonDecoder[PersonId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val one = jsonObj.get("one").toRight("Missing field 'one'").flatMap(_.as(JsonDecoder.long)) diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index c60d5e04fa..83670c05b2 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm213/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -26,6 +26,7 @@ case class PersonRow( name: Option[String] ){ val compositeId: PersonId = PersonId(one, two) + val id = compositeId def toUnsavedRow(one: Defaulted[Long], two: Defaulted[Option[String]]): PersonRowUnsaved = PersonRowUnsaved(name, one, two) } diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala index 429cb3c034..c6632d1580 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/TestInsert.scala @@ -28,8 +28,8 @@ class TestInsert(random: Random) { one: Defaulted[Long] = Defaulted.UseDefault, two: Defaulted[Option[String]] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, PersonRow] = (new PersonRepoImpl).insert(new PersonRowUnsaved(name = name, one = one, two = two)) - def myschemaFootballClub(id: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString): ZIO[ZConnection, Throwable, FootballClubRow] = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) - def myschemaMaritalStatus(id: MaritalStatusId): ZIO[ZConnection, Throwable, MaritalStatusRow] = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) + def myschemaFootballClub(id: FootballClubId = FootballClubId(random.nextLong()), name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString): ZIO[ZConnection, Throwable, FootballClubRow] = (new FootballClubRepoImpl).insert(new FootballClubRow(id = id, name = name)) + def myschemaMaritalStatus(id: MaritalStatusId = MaritalStatusId(random.nextLong())): ZIO[ZConnection, Throwable, MaritalStatusRow] = (new MaritalStatusRepoImpl).insert(new MaritalStatusRow(id = id)) def myschemaPerson(favouriteFootballClubId: FootballClubId, name: /* max 100 chars */ String = random.alphanumeric.take(20).mkString, nickName: Option[/* max 30 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala index f66c5f0d7c..57d3a9284a 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonId.scala @@ -14,7 +14,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `compositepk.person` */ -case class PersonId(one: Long, two: Option[String]) +case class PersonId( + one: Long, + two: Option[String] +) object PersonId { implicit lazy val jsonDecoder: JsonDecoder[PersonId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val one = jsonObj.get("one").toRight("Missing field 'one'").flatMap(_.as(JsonDecoder.long)) diff --git a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala index c60d5e04fa..83670c05b2 100644 --- a/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala +++ b/.bleep/generated-sources/typo-tester-zio-jdbc@jvm3/scripts.GenHardcodedFiles/testdb/hardcoded/compositepk/person/PersonRow.scala @@ -26,6 +26,7 @@ case class PersonRow( name: Option[String] ){ val compositeId: PersonId = PersonId(one, two) + val id = compositeId def toUnsavedRow(one: Defaulted[Long], two: Defaulted[Option[String]]): PersonRowUnsaved = PersonRowUnsaved(name, one, two) } diff --git a/site-in/other-features/testing-with-random-values.md b/site-in/other-features/testing-with-random-values.md index 0d714d4ffc..c42ce2f1d4 100644 --- a/site-in/other-features/testing-with-random-values.md +++ b/site-in/other-features/testing-with-random-values.md @@ -28,7 +28,7 @@ c.setAutoCommit(false) ``` ```scala mdoc -import adventureworks.customtypes.{Defaulted, TypoXml} +import adventureworks.customtypes.{Defaulted, TypoShort, TypoLocalDateTime, TypoXml} import adventureworks.production.unitmeasure.UnitmeasureId import adventureworks.TestInsert @@ -41,6 +41,12 @@ val productCategory = testInsert.productionProductcategory() val productSubcategory = testInsert.productionProductsubcategory(productCategory.productcategoryid) val productModel = testInsert.productionProductmodel(catalogdescription = Some(new TypoXml("")), instructions = Some(new TypoXml(""))) testInsert.productionProduct( + safetystocklevel = TypoShort(1), + reorderpoint = TypoShort(1), + standardcost = BigDecimal(1), + listprice = BigDecimal(1), + daystomanufacture = 10, + sellstartdate = TypoLocalDateTime.now, sizeunitmeasurecode = Some(unitmeasure.unitmeasurecode), weightunitmeasurecode = Some(unitmeasure.unitmeasurecode), `class` = Some("H "), diff --git a/site-in/patterns/multi-repo.md b/site-in/patterns/multi-repo.md index 181afdac66..e96782c98f 100644 --- a/site-in/patterns/multi-repo.md +++ b/site-in/patterns/multi-repo.md @@ -131,7 +131,7 @@ import scala.util.Random val testInsert = new TestInsert(new Random(1)) val businessentityRow = testInsert.personBusinessentity() -val personRow = testInsert.personPerson(businessentityRow.businessentityid, FirstName("name"), persontype = "SC") +val personRow = testInsert.personPerson(businessentityRow.businessentityid, persontype = "SC", FirstName("name")) val countryregionRow = testInsert.personCountryregion(CountryregionId("NOR")) val salesterritoryRow = testInsert.salesSalesterritory(countryregionRow.countryregioncode) val stateprovinceRow = testInsert.personStateprovince(countryregionRow.countryregioncode, salesterritoryRow.territoryid) diff --git a/typo-dsl-anorm/src/scala/typo/dsl/SqlExpr.scala b/typo-dsl-anorm/src/scala/typo/dsl/SqlExpr.scala index 5b9c823249..f37dd4406a 100644 --- a/typo-dsl-anorm/src/scala/typo/dsl/SqlExpr.scala +++ b/typo-dsl-anorm/src/scala/typo/dsl/SqlExpr.scala @@ -215,7 +215,7 @@ object SqlExpr { } object CompositeIn { - case class TuplePart[Tuple, T, Row](field: IdField[T, Row])(val extract: Tuple => T)(implicit val asConst: Const.As[Array[T], Required], val CT: ClassTag[T]) + case class TuplePart[Tuple, T, Row](field: FieldLike[T, Required, Row])(val extract: Tuple => T)(implicit val asConst: Const.As[Array[T], Required], val CT: ClassTag[T]) } case class RowExpr(exprs: List[SqlExpr.SqlExprNoHkt[?]]) extends SqlExpr[List[?], Required] { diff --git a/typo-dsl-doobie/src/scala/typo/dsl/SqlExpr.scala b/typo-dsl-doobie/src/scala/typo/dsl/SqlExpr.scala index 89e4a679ba..2345bf5daf 100644 --- a/typo-dsl-doobie/src/scala/typo/dsl/SqlExpr.scala +++ b/typo-dsl-doobie/src/scala/typo/dsl/SqlExpr.scala @@ -216,7 +216,7 @@ object SqlExpr { } object CompositeIn { - case class TuplePart[Tuple, T, Row](field: IdField[T, Row])(val extract: Tuple => T)(implicit val asConst: Const.As[Array[T], Required], val CT: ClassTag[T]) + case class TuplePart[Tuple, T, Row](field: FieldLike[T, Required, Row])(val extract: Tuple => T)(implicit val asConst: Const.As[Array[T], Required], val CT: ClassTag[T]) } case class RowExpr(exprs: List[SqlExpr.SqlExprNoHkt[?]]) extends SqlExpr[List[?], Required] { diff --git a/typo-dsl-zio-jdbc/src/scala/typo/dsl/SqlExpr.scala b/typo-dsl-zio-jdbc/src/scala/typo/dsl/SqlExpr.scala index 164c206ee4..4893faf4c5 100644 --- a/typo-dsl-zio-jdbc/src/scala/typo/dsl/SqlExpr.scala +++ b/typo-dsl-zio-jdbc/src/scala/typo/dsl/SqlExpr.scala @@ -228,7 +228,7 @@ object SqlExpr { } object CompositeIn { - case class TuplePart[Tuple, T, Row](field: IdField[T, Row])(val extract: Tuple => T)(implicit val asConst: Const.As[Array[T], Required], val CT: ClassTag[T]) + case class TuplePart[Tuple, T, Row](field: FieldLike[T, Required, Row])(val extract: Tuple => T)(implicit val asConst: Const.As[Array[T], Required], val CT: ClassTag[T]) } case class RowExpr(exprs: List[SqlExpr.SqlExprNoHkt[?]]) extends SqlExpr[List[?], Required] { diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala index 2b7edfc2d4..f7d7e01f46 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala @@ -34,6 +34,7 @@ case class DepartmentRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = departmentid def toUnsavedRow(departmentid: Defaulted[DepartmentId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): DepartmentRowUnsaved = DepartmentRowUnsaved(name, groupname, departmentid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala index fbff475987..309512d5a8 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala @@ -73,6 +73,7 @@ case class EmployeeRow( Default: '/'::character varying */ organizationnode: Option[String] ){ + val id = businessentityid def toUnsavedRow(salariedflag: Defaulted[Flag] = Defaulted.Provided(this.salariedflag), vacationhours: Defaulted[TypoShort] = Defaulted.Provided(this.vacationhours), sickleavehours: Defaulted[TypoShort] = Defaulted.Provided(this.sickleavehours), currentflag: Defaulted[Flag] = Defaulted.Provided(this.currentflag), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate), organizationnode: Defaulted[Option[String]] = Defaulted.Provided(this.organizationnode)): EmployeeRowUnsaved = EmployeeRowUnsaved(businessentityid, nationalidnumber, loginid, jobtitle, birthdate, maritalstatus, gender, hiredate, salariedflag, vacationhours, sickleavehours, currentflag, rowguid, modifieddate, organizationnode) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala index 3793c162ec..1b182061ef 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala @@ -20,7 +20,12 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `humanresources.employeedepartmenthistory` */ -case class EmployeedepartmenthistoryId(businessentityid: BusinessentityId, startdate: TypoLocalDate, departmentid: DepartmentId, shiftid: ShiftId) +case class EmployeedepartmenthistoryId( + businessentityid: BusinessentityId, + startdate: TypoLocalDate, + departmentid: DepartmentId, + shiftid: ShiftId +) object EmployeedepartmenthistoryId { implicit def ordering(implicit O0: Ordering[TypoLocalDate]): Ordering[EmployeedepartmenthistoryId] = Ordering.by(x => (x.businessentityid, x.startdate, x.departmentid, x.shiftid)) implicit lazy val reads: Reads[EmployeedepartmenthistoryId] = Reads[EmployeedepartmenthistoryId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala index 9b69c4e870..3d67431425 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala @@ -48,6 +48,7 @@ case class EmployeedepartmenthistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: EmployeedepartmenthistoryId = EmployeedepartmenthistoryId(businessentityid, startdate, departmentid, shiftid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): EmployeedepartmenthistoryRowUnsaved = EmployeedepartmenthistoryRowUnsaved(businessentityid, departmentid, shiftid, startdate, enddate, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala index cad6c6a40e..4c44cfef05 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `humanresources.employeepayhistory` */ -case class EmployeepayhistoryId(businessentityid: BusinessentityId, ratechangedate: TypoLocalDateTime) +case class EmployeepayhistoryId( + businessentityid: BusinessentityId, + ratechangedate: TypoLocalDateTime +) object EmployeepayhistoryId { implicit def ordering(implicit O0: Ordering[TypoLocalDateTime]): Ordering[EmployeepayhistoryId] = Ordering.by(x => (x.businessentityid, x.ratechangedate)) implicit lazy val reads: Reads[EmployeepayhistoryId] = Reads[EmployeepayhistoryId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala index c833614a03..2ba398b956 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala @@ -42,6 +42,7 @@ case class EmployeepayhistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: EmployeepayhistoryId = EmployeepayhistoryId(businessentityid, ratechangedate) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): EmployeepayhistoryRowUnsaved = EmployeepayhistoryRowUnsaved(businessentityid, ratechangedate, rate, payfrequency, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala index 561a62dea0..9e5c0ff73a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala @@ -38,6 +38,7 @@ case class JobcandidateRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = jobcandidateid def toUnsavedRow(jobcandidateid: Defaulted[JobcandidateId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): JobcandidateRowUnsaved = JobcandidateRowUnsaved(businessentityid, resume, jobcandidateid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala index 6808d330b7..1c2e19275c 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala @@ -37,6 +37,7 @@ case class ShiftRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = shiftid def toUnsavedRow(shiftid: Defaulted[ShiftId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ShiftRowUnsaved = ShiftRowUnsaved(name, starttime, endtime, shiftid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/address/AddressRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/address/AddressRow.scala index aefd700341..d7043e44df 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/address/AddressRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/address/AddressRow.scala @@ -49,6 +49,7 @@ case class AddressRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = addressid def toUnsavedRow(addressid: Defaulted[AddressId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): AddressRowUnsaved = AddressRowUnsaved(addressline1, addressline2, city, stateprovinceid, postalcode, spatiallocation, addressid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala index bb96b2c24e..d6817f042d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala @@ -35,6 +35,7 @@ case class AddresstypeRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = addresstypeid def toUnsavedRow(addresstypeid: Defaulted[AddresstypeId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): AddresstypeRowUnsaved = AddresstypeRowUnsaved(name, addresstypeid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala index 0706496926..4d3771bc4f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala @@ -32,6 +32,7 @@ case class BusinessentityRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(businessentityid: Defaulted[BusinessentityId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BusinessentityRowUnsaved = BusinessentityRowUnsaved(businessentityid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala index d276c4193b..4adbc4ca65 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala @@ -19,7 +19,11 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `person.businessentityaddress` */ -case class BusinessentityaddressId(businessentityid: BusinessentityId, addressid: AddressId, addresstypeid: AddresstypeId) +case class BusinessentityaddressId( + businessentityid: BusinessentityId, + addressid: AddressId, + addresstypeid: AddresstypeId +) object BusinessentityaddressId { implicit lazy val ordering: Ordering[BusinessentityaddressId] = Ordering.by(x => (x.businessentityid, x.addressid, x.addresstypeid)) implicit lazy val reads: Reads[BusinessentityaddressId] = Reads[BusinessentityaddressId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala index 747b2e9006..4adcd4c8ad 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala @@ -42,6 +42,7 @@ case class BusinessentityaddressRow( modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentityaddressId = BusinessentityaddressId(businessentityid, addressid, addresstypeid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BusinessentityaddressRowUnsaved = BusinessentityaddressRowUnsaved(businessentityid, addressid, addresstypeid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala index ed20235e51..e305479050 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala @@ -18,7 +18,11 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `person.businessentitycontact` */ -case class BusinessentitycontactId(businessentityid: BusinessentityId, personid: BusinessentityId, contacttypeid: ContacttypeId) +case class BusinessentitycontactId( + businessentityid: BusinessentityId, + personid: BusinessentityId, + contacttypeid: ContacttypeId +) object BusinessentitycontactId { implicit lazy val ordering: Ordering[BusinessentitycontactId] = Ordering.by(x => (x.businessentityid, x.personid, x.contacttypeid)) implicit lazy val reads: Reads[BusinessentitycontactId] = Reads[BusinessentitycontactId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala index 8b4b89000f..6223143ec6 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala @@ -41,6 +41,7 @@ case class BusinessentitycontactRow( modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentitycontactId = BusinessentitycontactId(businessentityid, personid, contacttypeid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BusinessentitycontactRowUnsaved = BusinessentitycontactRowUnsaved(businessentityid, personid, contacttypeid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala index 120a884bb3..18d26d4b4e 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala @@ -32,6 +32,7 @@ case class ContacttypeRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = contacttypeid def toUnsavedRow(contacttypeid: Defaulted[ContacttypeId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ContacttypeRowUnsaved = ContacttypeRowUnsaved(name, contacttypeid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala index e017b7f4c5..b3c7ded03d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala @@ -31,6 +31,7 @@ case class CountryregionRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = countryregioncode def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CountryregionRowUnsaved = CountryregionRowUnsaved(countryregioncode, name, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala index 5b1b58a472..f63b0bc4ee 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `person.emailaddress` */ -case class EmailaddressId(businessentityid: BusinessentityId, emailaddressid: Int) +case class EmailaddressId( + businessentityid: BusinessentityId, + emailaddressid: Int +) object EmailaddressId { implicit lazy val ordering: Ordering[EmailaddressId] = Ordering.by(x => (x.businessentityid, x.emailaddressid)) implicit lazy val reads: Reads[EmailaddressId] = Reads[EmailaddressId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala index f7530986ee..2a8c84167d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala @@ -41,6 +41,7 @@ case class EmailaddressRow( modifieddate: TypoLocalDateTime ){ val compositeId: EmailaddressId = EmailaddressId(businessentityid, emailaddressid) + val id = compositeId def toUnsavedRow(emailaddressid: Defaulted[Int], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): EmailaddressRowUnsaved = EmailaddressRowUnsaved(businessentityid, emailaddress, emailaddressid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala index 7925997b8e..8f33ad811f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala @@ -38,6 +38,7 @@ case class PasswordRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PasswordRowUnsaved = PasswordRowUnsaved(businessentityid, passwordhash, passwordsalt, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRow.scala index c092427427..d6c94945aa 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRow.scala @@ -63,6 +63,7 @@ case class PersonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(namestyle: Defaulted[NameStyle] = Defaulted.Provided(this.namestyle), emailpromotion: Defaulted[Int] = Defaulted.Provided(this.emailpromotion), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PersonRowUnsaved = PersonRowUnsaved(businessentityid, persontype, title, firstname, middlename, lastname, suffix, additionalcontactinfo, demographics, namestyle, emailpromotion, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala index 0d39055916..18d085b7a7 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala @@ -19,7 +19,11 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `person.personphone` */ -case class PersonphoneId(businessentityid: BusinessentityId, phonenumber: Phone, phonenumbertypeid: PhonenumbertypeId) +case class PersonphoneId( + businessentityid: BusinessentityId, + phonenumber: Phone, + phonenumbertypeid: PhonenumbertypeId +) object PersonphoneId { implicit lazy val ordering: Ordering[PersonphoneId] = Ordering.by(x => (x.businessentityid, x.phonenumber, x.phonenumbertypeid)) implicit lazy val reads: Reads[PersonphoneId] = Reads[PersonphoneId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala index c049f8fc64..aadbdebf8d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala @@ -38,6 +38,7 @@ case class PersonphoneRow( modifieddate: TypoLocalDateTime ){ val compositeId: PersonphoneId = PersonphoneId(businessentityid, phonenumber, phonenumbertypeid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PersonphoneRowUnsaved = PersonphoneRowUnsaved(businessentityid, phonenumber, phonenumbertypeid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala index 725aaa3919..807ebbc1d3 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala @@ -32,6 +32,7 @@ case class PhonenumbertypeRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = phonenumbertypeid def toUnsavedRow(phonenumbertypeid: Defaulted[PhonenumbertypeId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PhonenumbertypeRowUnsaved = PhonenumbertypeRowUnsaved(name, phonenumbertypeid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala index 6994fbf201..20fd31910d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala @@ -51,6 +51,7 @@ case class StateprovinceRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = stateprovinceid def toUnsavedRow(stateprovinceid: Defaulted[StateprovinceId], isonlystateprovinceflag: Defaulted[Flag] = Defaulted.Provided(this.isonlystateprovinceflag), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): StateprovinceRowUnsaved = StateprovinceRowUnsaved(stateprovincecode, countryregioncode, name, territoryid, stateprovinceid, isonlystateprovinceflag, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala index 71965b67e3..b52266c956 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala @@ -61,6 +61,7 @@ case class BillofmaterialsRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = billofmaterialsid def toUnsavedRow(billofmaterialsid: Defaulted[Int], startdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.startdate), perassemblyqty: Defaulted[BigDecimal] = Defaulted.Provided(this.perassemblyqty), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BillofmaterialsRowUnsaved = BillofmaterialsRowUnsaved(productassemblyid, componentid, enddate, unitmeasurecode, bomlevel, billofmaterialsid, startdate, perassemblyqty, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala index 6baca1f203..4e8c06a8d5 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala @@ -31,6 +31,7 @@ case class CultureRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = cultureid def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CultureRowUnsaved = CultureRowUnsaved(cultureid, name, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala index cb5b63be52..d93495d636 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala @@ -63,6 +63,7 @@ case class DocumentRow( Default: '/'::character varying */ documentnode: DocumentId ){ + val id = documentnode def toUnsavedRow(documentnode: Defaulted[DocumentId], folderflag: Defaulted[Flag] = Defaulted.Provided(this.folderflag), changenumber: Defaulted[Int] = Defaulted.Provided(this.changenumber), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): DocumentRowUnsaved = DocumentRowUnsaved(title, owner, filename, fileextension, revision, status, documentsummary, document, folderflag, changenumber, rowguid, modifieddate, documentnode) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala index 52bff7c9a8..c17a01a6e3 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala @@ -34,6 +34,7 @@ case class IllustrationRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = illustrationid def toUnsavedRow(illustrationid: Defaulted[IllustrationId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): IllustrationRowUnsaved = IllustrationRowUnsaved(diagram, illustrationid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRow.scala index e65f938ec8..9bf0d57a71 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRow.scala @@ -42,6 +42,7 @@ case class LocationRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = locationid def toUnsavedRow(locationid: Defaulted[LocationId], costrate: Defaulted[BigDecimal] = Defaulted.Provided(this.costrate), availability: Defaulted[BigDecimal] = Defaulted.Provided(this.availability), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): LocationRowUnsaved = LocationRowUnsaved(name, locationid, costrate, availability, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRow.scala index f01a6ed6eb..a11a25c7c3 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRow.scala @@ -101,6 +101,7 @@ case class ProductRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productid def toUnsavedRow(productid: Defaulted[ProductId], makeflag: Defaulted[Flag] = Defaulted.Provided(this.makeflag), finishedgoodsflag: Defaulted[Flag] = Defaulted.Provided(this.finishedgoodsflag), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductRowUnsaved = ProductRowUnsaved(name, productnumber, color, safetystocklevel, reorderpoint, standardcost, listprice, size, sizeunitmeasurecode, weightunitmeasurecode, weight, daystomanufacture, productline, `class`, style, productsubcategoryid, productmodelid, sellstartdate, sellenddate, discontinueddate, productid, makeflag, finishedgoodsflag, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala index 0e7c21f190..4a6cad8b5f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala @@ -35,6 +35,7 @@ case class ProductcategoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productcategoryid def toUnsavedRow(productcategoryid: Defaulted[ProductcategoryId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductcategoryRowUnsaved = ProductcategoryRowUnsaved(name, productcategoryid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala index 50c2cd457a..2725c8fa45 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `production.productcosthistory` */ -case class ProductcosthistoryId(productid: ProductId, startdate: TypoLocalDateTime) +case class ProductcosthistoryId( + productid: ProductId, + startdate: TypoLocalDateTime +) object ProductcosthistoryId { implicit def ordering(implicit O0: Ordering[TypoLocalDateTime]): Ordering[ProductcosthistoryId] = Ordering.by(x => (x.productid, x.startdate)) implicit lazy val reads: Reads[ProductcosthistoryId] = Reads[ProductcosthistoryId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala index 4068e07e3e..5579ed5b0c 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala @@ -42,6 +42,7 @@ case class ProductcosthistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductcosthistoryId = ProductcosthistoryId(productid, startdate) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductcosthistoryRowUnsaved = ProductcosthistoryRowUnsaved(productid, startdate, enddate, standardcost, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala index a222a89a3b..c025b2fc8f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala @@ -36,6 +36,7 @@ case class ProductdescriptionRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productdescriptionid def toUnsavedRow(productdescriptionid: Defaulted[ProductdescriptionId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductdescriptionRowUnsaved = ProductdescriptionRowUnsaved(description, productdescriptionid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala index 91197d3935..30c7e6408e 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `production.productdocument` */ -case class ProductdocumentId(productid: ProductId, documentnode: DocumentId) +case class ProductdocumentId( + productid: ProductId, + documentnode: DocumentId +) object ProductdocumentId { implicit lazy val ordering: Ordering[ProductdocumentId] = Ordering.by(x => (x.productid, x.documentnode)) implicit lazy val reads: Reads[ProductdocumentId] = Reads[ProductdocumentId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala index fb0197a72d..82a45b54a6 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala @@ -36,6 +36,7 @@ case class ProductdocumentRow( documentnode: DocumentId ){ val compositeId: ProductdocumentId = ProductdocumentId(productid, documentnode) + val id = compositeId def toUnsavedRow(documentnode: Defaulted[DocumentId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductdocumentRowUnsaved = ProductdocumentRowUnsaved(productid, modifieddate, documentnode) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala index 0e9b142e2f..a8cd92f7ae 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `production.productinventory` */ -case class ProductinventoryId(productid: ProductId, locationid: LocationId) +case class ProductinventoryId( + productid: ProductId, + locationid: LocationId +) object ProductinventoryId { implicit lazy val ordering: Ordering[ProductinventoryId] = Ordering.by(x => (x.productid, x.locationid)) implicit lazy val reads: Reads[ProductinventoryId] = Reads[ProductinventoryId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala index 0569fd966b..dc10e2b4fb 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala @@ -49,6 +49,7 @@ case class ProductinventoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductinventoryId = ProductinventoryId(productid, locationid) + val id = compositeId def toUnsavedRow(quantity: Defaulted[TypoShort] = Defaulted.Provided(this.quantity), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductinventoryRowUnsaved = ProductinventoryRowUnsaved(productid, locationid, shelf, bin, quantity, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala index 561351ed29..07a04c8d1b 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `production.productlistpricehistory` */ -case class ProductlistpricehistoryId(productid: ProductId, startdate: TypoLocalDateTime) +case class ProductlistpricehistoryId( + productid: ProductId, + startdate: TypoLocalDateTime +) object ProductlistpricehistoryId { implicit def ordering(implicit O0: Ordering[TypoLocalDateTime]): Ordering[ProductlistpricehistoryId] = Ordering.by(x => (x.productid, x.startdate)) implicit lazy val reads: Reads[ProductlistpricehistoryId] = Reads[ProductlistpricehistoryId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala index 43135bc362..5dfa5edd94 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala @@ -42,6 +42,7 @@ case class ProductlistpricehistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductlistpricehistoryId = ProductlistpricehistoryId(productid, startdate) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductlistpricehistoryRowUnsaved = ProductlistpricehistoryRowUnsaved(productid, startdate, enddate, listprice, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala index d55a95af28..1a2f558038 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala @@ -42,6 +42,7 @@ case class ProductmodelRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productmodelid def toUnsavedRow(productmodelid: Defaulted[ProductmodelId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductmodelRowUnsaved = ProductmodelRowUnsaved(name, catalogdescription, instructions, productmodelid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala index 72b024bcc1..1975f3fc28 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `production.productmodelillustration` */ -case class ProductmodelillustrationId(productmodelid: ProductmodelId, illustrationid: IllustrationId) +case class ProductmodelillustrationId( + productmodelid: ProductmodelId, + illustrationid: IllustrationId +) object ProductmodelillustrationId { implicit lazy val ordering: Ordering[ProductmodelillustrationId] = Ordering.by(x => (x.productmodelid, x.illustrationid)) implicit lazy val reads: Reads[ProductmodelillustrationId] = Reads[ProductmodelillustrationId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala index 9d9294fff1..ef43192791 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala @@ -35,6 +35,7 @@ case class ProductmodelillustrationRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelillustrationId = ProductmodelillustrationId(productmodelid, illustrationid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductmodelillustrationRowUnsaved = ProductmodelillustrationRowUnsaved(productmodelid, illustrationid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala index 39df978a87..4a055f1528 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala @@ -19,7 +19,11 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `production.productmodelproductdescriptionculture` */ -case class ProductmodelproductdescriptioncultureId(productmodelid: ProductmodelId, productdescriptionid: ProductdescriptionId, cultureid: CultureId) +case class ProductmodelproductdescriptioncultureId( + productmodelid: ProductmodelId, + productdescriptionid: ProductdescriptionId, + cultureid: CultureId +) object ProductmodelproductdescriptioncultureId { implicit lazy val ordering: Ordering[ProductmodelproductdescriptioncultureId] = Ordering.by(x => (x.productmodelid, x.productdescriptionid, x.cultureid)) implicit lazy val reads: Reads[ProductmodelproductdescriptioncultureId] = Reads[ProductmodelproductdescriptioncultureId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala index 2587957253..c864d8e685 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala @@ -39,6 +39,7 @@ case class ProductmodelproductdescriptioncultureRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelproductdescriptioncultureId = ProductmodelproductdescriptioncultureId(productmodelid, productdescriptionid, cultureid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductmodelproductdescriptioncultureRowUnsaved = ProductmodelproductdescriptioncultureRowUnsaved(productmodelid, productdescriptionid, cultureid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala index 86faf340ec..84b4ffc1f7 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala @@ -40,6 +40,7 @@ case class ProductphotoRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productphotoid def toUnsavedRow(productphotoid: Defaulted[ProductphotoId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductphotoRowUnsaved = ProductphotoRowUnsaved(thumbnailphoto, thumbnailphotofilename, largephoto, largephotofilename, productphotoid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala index 9a24965b08..195605dd54 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `production.productproductphoto` */ -case class ProductproductphotoId(productid: ProductId, productphotoid: ProductphotoId) +case class ProductproductphotoId( + productid: ProductId, + productphotoid: ProductphotoId +) object ProductproductphotoId { implicit lazy val ordering: Ordering[ProductproductphotoId] = Ordering.by(x => (x.productid, x.productphotoid)) implicit lazy val reads: Reads[ProductproductphotoId] = Reads[ProductproductphotoId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala index c9e831c2e6..b3e6425705 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala @@ -39,6 +39,7 @@ case class ProductproductphotoRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductproductphotoId = ProductproductphotoId(productid, productphotoid) + val id = compositeId def toUnsavedRow(primary: Defaulted[Flag] = Defaulted.Provided(this.primary), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductproductphotoRowUnsaved = ProductproductphotoRowUnsaved(productid, productphotoid, primary, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala index 771e439601..8d40395011 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala @@ -48,6 +48,7 @@ case class ProductreviewRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productreviewid def toUnsavedRow(productreviewid: Defaulted[ProductreviewId], reviewdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.reviewdate), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductreviewRowUnsaved = ProductreviewRowUnsaved(productid, reviewername, emailaddress, rating, comments, productreviewid, reviewdate, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala index 02588b3a9e..a6a4a80f4a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala @@ -39,6 +39,7 @@ case class ProductsubcategoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productsubcategoryid def toUnsavedRow(productsubcategoryid: Defaulted[ProductsubcategoryId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductsubcategoryRowUnsaved = ProductsubcategoryRowUnsaved(productcategoryid, name, productsubcategoryid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala index fe7e8e71b0..df12fea0cc 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala @@ -32,6 +32,7 @@ case class ScrapreasonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = scrapreasonid def toUnsavedRow(scrapreasonid: Defaulted[ScrapreasonId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ScrapreasonRowUnsaved = ScrapreasonRowUnsaved(name, scrapreasonid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala index dd50052d13..dd398cc953 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala @@ -50,6 +50,7 @@ case class TransactionhistoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = transactionid def toUnsavedRow(transactionid: Defaulted[TransactionhistoryId], referenceorderlineid: Defaulted[Int] = Defaulted.Provided(this.referenceorderlineid), transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.transactiondate), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): TransactionhistoryRowUnsaved = TransactionhistoryRowUnsaved(productid, referenceorderid, transactiontype, quantity, actualcost, transactionid, referenceorderlineid, transactiondate, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala index 2d0d7ccc6b..9e82847e52 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala @@ -47,6 +47,7 @@ case class TransactionhistoryarchiveRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = transactionid def toUnsavedRow(referenceorderlineid: Defaulted[Int] = Defaulted.Provided(this.referenceorderlineid), transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.transactiondate), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): TransactionhistoryarchiveRowUnsaved = TransactionhistoryarchiveRowUnsaved(transactionid, productid, referenceorderid, transactiontype, quantity, actualcost, referenceorderlineid, transactiondate, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala index 4baa1c03e0..574f82c393 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala @@ -31,6 +31,7 @@ case class UnitmeasureRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = unitmeasurecode def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): UnitmeasureRowUnsaved = UnitmeasureRowUnsaved(unitmeasurecode, name, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala index ae116d5fd2..703b2dbbc8 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala @@ -54,6 +54,7 @@ case class WorkorderRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = workorderid def toUnsavedRow(workorderid: Defaulted[WorkorderId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): WorkorderRowUnsaved = WorkorderRowUnsaved(productid, orderqty, scrappedqty, startdate, enddate, duedate, scrapreasonid, workorderid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala index b849ea81b7..f5ba79a483 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala @@ -19,7 +19,11 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `production.workorderrouting` */ -case class WorkorderroutingId(workorderid: WorkorderId, productid: Int, operationsequence: TypoShort) +case class WorkorderroutingId( + workorderid: WorkorderId, + productid: Int, + operationsequence: TypoShort +) object WorkorderroutingId { implicit def ordering(implicit O0: Ordering[TypoShort]): Ordering[WorkorderroutingId] = Ordering.by(x => (x.workorderid, x.productid, x.operationsequence)) implicit lazy val reads: Reads[WorkorderroutingId] = Reads[WorkorderroutingId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala index 60c36334e2..3a493585af 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala @@ -63,6 +63,7 @@ case class WorkorderroutingRow( modifieddate: TypoLocalDateTime ){ val compositeId: WorkorderroutingId = WorkorderroutingId(workorderid, productid, operationsequence) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): WorkorderroutingRowUnsaved = WorkorderroutingRowUnsaved(workorderid, productid, operationsequence, locationid, scheduledstartdate, scheduledenddate, actualstartdate, actualenddate, actualresourcehrs, plannedcost, actualcost, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala index 5fca706098..848420c635 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala @@ -17,7 +17,12 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `public.flaff` */ -case class FlaffId(code: ShortText, anotherCode: /* max 20 chars */ String, someNumber: Int, specifier: ShortText) +case class FlaffId( + code: ShortText, + anotherCode: /* max 20 chars */ String, + someNumber: Int, + specifier: ShortText +) object FlaffId { implicit lazy val ordering: Ordering[FlaffId] = Ordering.by(x => (x.code, x.anotherCode, x.someNumber, x.specifier)) implicit lazy val reads: Reads[FlaffId] = Reads[FlaffId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala index 173a93a20c..8788a3b17d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala @@ -33,6 +33,7 @@ case class FlaffRow( parentspecifier: Option[ShortText] ){ val compositeId: FlaffId = FlaffId(code, anotherCode, someNumber, specifier) + val id = compositeId } object FlaffRow { diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala index d53ee64993..dc230430ef 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala @@ -29,6 +29,7 @@ case class IdentityTestRow( defaultGenerated: Int, name: IdentityTestId ){ + val id = name def toUnsavedRow(defaultGenerated: Defaulted[Int] = Defaulted.Provided(this.defaultGenerated)): IdentityTestRowUnsaved = IdentityTestRowUnsaved(name, defaultGenerated) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/users/UsersRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/users/UsersRow.scala index b0d2a47c5e..b4ab394dd1 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/public/users/UsersRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/public/users/UsersRow.scala @@ -34,6 +34,7 @@ case class UsersRow( createdAt: TypoInstant, verifiedOn: Option[TypoInstant] ){ + val id = userId def toUnsavedRow(createdAt: Defaulted[TypoInstant] = Defaulted.Provided(this.createdAt)): UsersRowUnsaved = UsersRowUnsaved(userId, name, lastName, email, password, verifiedOn, createdAt) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala index 513bd096e5..2659207acc 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `purchasing.productvendor` */ -case class ProductvendorId(productid: ProductId, businessentityid: BusinessentityId) +case class ProductvendorId( + productid: ProductId, + businessentityid: BusinessentityId +) object ProductvendorId { implicit lazy val ordering: Ordering[ProductvendorId] = Ordering.by(x => (x.productid, x.businessentityid)) implicit lazy val reads: Reads[ProductvendorId] = Reads[ProductvendorId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala index f2b4385be9..080c8b71b5 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala @@ -61,6 +61,7 @@ case class ProductvendorRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductvendorId = ProductvendorId(productid, businessentityid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductvendorRowUnsaved = ProductvendorRowUnsaved(productid, businessentityid, averageleadtime, standardprice, lastreceiptcost, lastreceiptdate, minorderqty, maxorderqty, onorderqty, unitmeasurecode, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala index d44f5dcdf5..2f9c29b40c 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `purchasing.purchaseorderdetail` */ -case class PurchaseorderdetailId(purchaseorderid: PurchaseorderheaderId, purchaseorderdetailid: Int) +case class PurchaseorderdetailId( + purchaseorderid: PurchaseorderheaderId, + purchaseorderdetailid: Int +) object PurchaseorderdetailId { implicit lazy val ordering: Ordering[PurchaseorderdetailId] = Ordering.by(x => (x.purchaseorderid, x.purchaseorderdetailid)) implicit lazy val reads: Reads[PurchaseorderdetailId] = Reads[PurchaseorderdetailId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala index b5fa2ca3be..e2f30c86ba 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala @@ -55,6 +55,7 @@ case class PurchaseorderdetailRow( modifieddate: TypoLocalDateTime ){ val compositeId: PurchaseorderdetailId = PurchaseorderdetailId(purchaseorderid, purchaseorderdetailid) + val id = compositeId def toUnsavedRow(purchaseorderdetailid: Defaulted[Int], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PurchaseorderdetailRowUnsaved = PurchaseorderdetailRowUnsaved(purchaseorderid, duedate, orderqty, productid, unitprice, receivedqty, rejectedqty, purchaseorderdetailid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala index 56a51f6848..6b409bcc93 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala @@ -69,6 +69,7 @@ case class PurchaseorderheaderRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = purchaseorderid def toUnsavedRow(purchaseorderid: Defaulted[PurchaseorderheaderId], revisionnumber: Defaulted[TypoShort] = Defaulted.Provided(this.revisionnumber), status: Defaulted[TypoShort] = Defaulted.Provided(this.status), orderdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.orderdate), subtotal: Defaulted[BigDecimal] = Defaulted.Provided(this.subtotal), taxamt: Defaulted[BigDecimal] = Defaulted.Provided(this.taxamt), freight: Defaulted[BigDecimal] = Defaulted.Provided(this.freight), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PurchaseorderheaderRowUnsaved = PurchaseorderheaderRowUnsaved(employeeid, vendorid, shipmethodid, shipdate, purchaseorderid, revisionnumber, status, orderdate, subtotal, taxamt, freight, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala index c28699660a..cf806d4ebe 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala @@ -45,6 +45,7 @@ case class ShipmethodRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = shipmethodid def toUnsavedRow(shipmethodid: Defaulted[ShipmethodId], shipbase: Defaulted[BigDecimal] = Defaulted.Provided(this.shipbase), shiprate: Defaulted[BigDecimal] = Defaulted.Provided(this.shiprate), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ShipmethodRowUnsaved = ShipmethodRowUnsaved(name, shipmethodid, shipbase, shiprate, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala index 3f05008ad9..8f26ddbe2f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala @@ -51,6 +51,7 @@ case class VendorRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(preferredvendorstatus: Defaulted[Flag] = Defaulted.Provided(this.preferredvendorstatus), activeflag: Defaulted[Flag] = Defaulted.Provided(this.activeflag), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): VendorRowUnsaved = VendorRowUnsaved(businessentityid, accountnumber, name, creditrating, purchasingwebserviceurl, preferredvendorstatus, activeflag, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala index dcb5869512..db46e41b94 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `sales.countryregioncurrency` */ -case class CountryregioncurrencyId(countryregioncode: CountryregionId, currencycode: CurrencyId) +case class CountryregioncurrencyId( + countryregioncode: CountryregionId, + currencycode: CurrencyId +) object CountryregioncurrencyId { implicit lazy val ordering: Ordering[CountryregioncurrencyId] = Ordering.by(x => (x.countryregioncode, x.currencycode)) implicit lazy val reads: Reads[CountryregioncurrencyId] = Reads[CountryregioncurrencyId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala index c4b1d093b1..68411c12c4 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala @@ -35,6 +35,7 @@ case class CountryregioncurrencyRow( modifieddate: TypoLocalDateTime ){ val compositeId: CountryregioncurrencyId = CountryregioncurrencyId(countryregioncode, currencycode) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CountryregioncurrencyRowUnsaved = CountryregioncurrencyRowUnsaved(countryregioncode, currencycode, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala index d5feb5231c..37baa7339f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala @@ -41,6 +41,7 @@ case class CreditcardRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = creditcardid def toUnsavedRow(creditcardid: Defaulted[/* user-picked */ CustomCreditcardId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CreditcardRowUnsaved = CreditcardRowUnsaved(cardtype, cardnumber, expmonth, expyear, creditcardid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala index 376ecf79e6..7a99ed90b4 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala @@ -31,6 +31,7 @@ case class CurrencyRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = currencycode def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CurrencyRowUnsaved = CurrencyRowUnsaved(currencycode, name, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala index c84669f19a..22bab09c8c 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala @@ -44,6 +44,7 @@ case class CurrencyrateRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = currencyrateid def toUnsavedRow(currencyrateid: Defaulted[CurrencyrateId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CurrencyrateRowUnsaved = CurrencyrateRowUnsaved(currencyratedate, fromcurrencycode, tocurrencycode, averagerate, endofdayrate, currencyrateid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala index 7f908deb2b..d7003be6b8 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala @@ -45,6 +45,7 @@ case class CustomerRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = customerid def toUnsavedRow(customerid: Defaulted[CustomerId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CustomerRowUnsaved = CustomerRowUnsaved(personid, storeid, territoryid, customerid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala index 9a33e98d4e..39e9c7fde5 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `sales.personcreditcard` */ -case class PersoncreditcardId(businessentityid: BusinessentityId, creditcardid: /* user-picked */ CustomCreditcardId) +case class PersoncreditcardId( + businessentityid: BusinessentityId, + creditcardid: /* user-picked */ CustomCreditcardId +) object PersoncreditcardId { implicit lazy val ordering: Ordering[PersoncreditcardId] = Ordering.by(x => (x.businessentityid, x.creditcardid)) implicit lazy val reads: Reads[PersoncreditcardId] = Reads[PersoncreditcardId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala index 846493349c..887fd8743a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala @@ -35,6 +35,7 @@ case class PersoncreditcardRow( modifieddate: TypoLocalDateTime ){ val compositeId: PersoncreditcardId = PersoncreditcardId(businessentityid, creditcardid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PersoncreditcardRowUnsaved = PersoncreditcardRowUnsaved(businessentityid, creditcardid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala index 18accf85f1..3fcb8ce6f1 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala @@ -16,6 +16,7 @@ import adventureworks.sales.salesorderheader.SalesorderheaderId import adventureworks.sales.salesorderheader.SalesorderheaderRow import adventureworks.sales.specialoffer.SpecialofferId import adventureworks.sales.specialofferproduct.SpecialofferproductFields +import adventureworks.sales.specialofferproduct.SpecialofferproductId import adventureworks.sales.specialofferproduct.SpecialofferproductRow import typo.dsl.ForeignKey import typo.dsl.Path @@ -52,6 +53,11 @@ trait SalesorderdetailFields { def compositeIdIn(compositeIds: Array[SalesorderdetailId]): SqlExpr[Boolean, Required] = new CompositeIn(compositeIds)(TuplePart(salesorderid)(_.salesorderid), TuplePart(salesorderdetailid)(_.salesorderdetailid)) + def extractSpecialofferproductIdIs(id: SpecialofferproductId): SqlExpr[Boolean, Required] = + specialofferid.isEqual(id.specialofferid).and(productid.isEqual(id.productid)) + def extractSpecialofferproductIdIn(ids: Array[SpecialofferproductId]): SqlExpr[Boolean, Required] = + new CompositeIn(ids)(TuplePart(specialofferid)(_.specialofferid), TuplePart(productid)(_.productid)) + } object SalesorderdetailFields { diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala index b6042d587d..7ac2604169 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `sales.salesorderdetail` */ -case class SalesorderdetailId(salesorderid: SalesorderheaderId, salesorderdetailid: Int) +case class SalesorderdetailId( + salesorderid: SalesorderheaderId, + salesorderdetailid: Int +) object SalesorderdetailId { implicit lazy val ordering: Ordering[SalesorderdetailId] = Ordering.by(x => (x.salesorderid, x.salesorderdetailid)) implicit lazy val reads: Reads[SalesorderdetailId] = Reads[SalesorderdetailId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala index a71d8ade2d..b4d9f23210 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala @@ -14,6 +14,7 @@ import adventureworks.customtypes.TypoUUID import adventureworks.production.product.ProductId import adventureworks.sales.salesorderheader.SalesorderheaderId import adventureworks.sales.specialoffer.SpecialofferId +import adventureworks.sales.specialofferproduct.SpecialofferproductId import anorm.Column import anorm.RowParser import anorm.Success @@ -60,6 +61,11 @@ case class SalesorderdetailRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderdetailId = SalesorderdetailId(salesorderid, salesorderdetailid) + val id = compositeId + val extractSpecialofferproductId: SpecialofferproductId = SpecialofferproductId( + specialofferid = specialofferid, + productid = productid + ) def toUnsavedRow(salesorderdetailid: Defaulted[Int], unitpricediscount: Defaulted[BigDecimal] = Defaulted.Provided(this.unitpricediscount), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesorderdetailRowUnsaved = SalesorderdetailRowUnsaved(salesorderid, carriertrackingnumber, orderqty, productid, specialofferid, unitprice, salesorderdetailid, unitpricediscount, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala index 87cb1002a6..e1e0ad8aa4 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala @@ -112,6 +112,7 @@ case class SalesorderheaderRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = salesorderid def toUnsavedRow(salesorderid: Defaulted[SalesorderheaderId], revisionnumber: Defaulted[TypoShort] = Defaulted.Provided(this.revisionnumber), orderdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.orderdate), status: Defaulted[TypoShort] = Defaulted.Provided(this.status), onlineorderflag: Defaulted[Flag] = Defaulted.Provided(this.onlineorderflag), subtotal: Defaulted[BigDecimal] = Defaulted.Provided(this.subtotal), taxamt: Defaulted[BigDecimal] = Defaulted.Provided(this.taxamt), freight: Defaulted[BigDecimal] = Defaulted.Provided(this.freight), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesorderheaderRowUnsaved = SalesorderheaderRowUnsaved(duedate, shipdate, purchaseordernumber, accountnumber, customerid, salespersonid, territoryid, billtoaddressid, shiptoaddressid, shipmethodid, creditcardid, creditcardapprovalcode, currencyrateid, totaldue, comment, salesorderid, revisionnumber, orderdate, status, onlineorderflag, subtotal, taxamt, freight, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala index 277d484bfb..e1a9dab57e 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `sales.salesorderheadersalesreason` */ -case class SalesorderheadersalesreasonId(salesorderid: SalesorderheaderId, salesreasonid: SalesreasonId) +case class SalesorderheadersalesreasonId( + salesorderid: SalesorderheaderId, + salesreasonid: SalesreasonId +) object SalesorderheadersalesreasonId { implicit lazy val ordering: Ordering[SalesorderheadersalesreasonId] = Ordering.by(x => (x.salesorderid, x.salesreasonid)) implicit lazy val reads: Reads[SalesorderheadersalesreasonId] = Reads[SalesorderheadersalesreasonId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala index d250b3bfe5..f0629c6472 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala @@ -35,6 +35,7 @@ case class SalesorderheadersalesreasonRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderheadersalesreasonId = SalesorderheadersalesreasonId(salesorderid, salesreasonid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesorderheadersalesreasonRowUnsaved = SalesorderheadersalesreasonRowUnsaved(salesorderid, salesreasonid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala index acd2b8f87a..fb89b15eab 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala @@ -58,6 +58,7 @@ case class SalespersonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(bonus: Defaulted[BigDecimal] = Defaulted.Provided(this.bonus), commissionpct: Defaulted[BigDecimal] = Defaulted.Provided(this.commissionpct), salesytd: Defaulted[BigDecimal] = Defaulted.Provided(this.salesytd), saleslastyear: Defaulted[BigDecimal] = Defaulted.Provided(this.saleslastyear), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalespersonRowUnsaved = SalespersonRowUnsaved(businessentityid, territoryid, salesquota, bonus, commissionpct, salesytd, saleslastyear, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala index ffc572a860..4ed9ddad8f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `sales.salespersonquotahistory` */ -case class SalespersonquotahistoryId(businessentityid: BusinessentityId, quotadate: TypoLocalDateTime) +case class SalespersonquotahistoryId( + businessentityid: BusinessentityId, + quotadate: TypoLocalDateTime +) object SalespersonquotahistoryId { implicit def ordering(implicit O0: Ordering[TypoLocalDateTime]): Ordering[SalespersonquotahistoryId] = Ordering.by(x => (x.businessentityid, x.quotadate)) implicit lazy val reads: Reads[SalespersonquotahistoryId] = Reads[SalespersonquotahistoryId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala index 204b0149da..4ec029517d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala @@ -41,6 +41,7 @@ case class SalespersonquotahistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalespersonquotahistoryId = SalespersonquotahistoryId(businessentityid, quotadate) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalespersonquotahistoryRowUnsaved = SalespersonquotahistoryRowUnsaved(businessentityid, quotadate, salesquota, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala index e5be6096de..5257714e96 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala @@ -34,6 +34,7 @@ case class SalesreasonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = salesreasonid def toUnsavedRow(salesreasonid: Defaulted[SalesreasonId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesreasonRowUnsaved = SalesreasonRowUnsaved(name, reasontype, salesreasonid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala index 3abb1d0765..0fadb96a20 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala @@ -48,6 +48,7 @@ case class SalestaxrateRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = salestaxrateid def toUnsavedRow(salestaxrateid: Defaulted[SalestaxrateId], taxrate: Defaulted[BigDecimal] = Defaulted.Provided(this.taxrate), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalestaxrateRowUnsaved = SalestaxrateRowUnsaved(stateprovinceid, taxtype, name, salestaxrateid, taxrate, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala index 80f9752e8f..8f3d63a2d5 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala @@ -59,6 +59,7 @@ case class SalesterritoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = territoryid def toUnsavedRow(territoryid: Defaulted[SalesterritoryId], salesytd: Defaulted[BigDecimal] = Defaulted.Provided(this.salesytd), saleslastyear: Defaulted[BigDecimal] = Defaulted.Provided(this.saleslastyear), costytd: Defaulted[BigDecimal] = Defaulted.Provided(this.costytd), costlastyear: Defaulted[BigDecimal] = Defaulted.Provided(this.costlastyear), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesterritoryRowUnsaved = SalesterritoryRowUnsaved(name, countryregioncode, group, territoryid, salesytd, saleslastyear, costytd, costlastyear, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala index 923894506e..28e5c272ca 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala @@ -19,7 +19,11 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `sales.salesterritoryhistory` */ -case class SalesterritoryhistoryId(businessentityid: BusinessentityId, startdate: TypoLocalDateTime, territoryid: SalesterritoryId) +case class SalesterritoryhistoryId( + businessentityid: BusinessentityId, + startdate: TypoLocalDateTime, + territoryid: SalesterritoryId +) object SalesterritoryhistoryId { implicit def ordering(implicit O0: Ordering[TypoLocalDateTime]): Ordering[SalesterritoryhistoryId] = Ordering.by(x => (x.businessentityid, x.startdate, x.territoryid)) implicit lazy val reads: Reads[SalesterritoryhistoryId] = Reads[SalesterritoryhistoryId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala index 6a76c5077f..99b1c69b6b 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala @@ -46,6 +46,7 @@ case class SalesterritoryhistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalesterritoryhistoryId = SalesterritoryhistoryId(businessentityid, startdate, territoryid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesterritoryhistoryRowUnsaved = SalesterritoryhistoryRowUnsaved(businessentityid, territoryid, startdate, enddate, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala index ba2458b707..404aebf89c 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala @@ -44,6 +44,7 @@ case class ShoppingcartitemRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = shoppingcartitemid def toUnsavedRow(shoppingcartitemid: Defaulted[ShoppingcartitemId], quantity: Defaulted[Int] = Defaulted.Provided(this.quantity), datecreated: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.datecreated), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ShoppingcartitemRowUnsaved = ShoppingcartitemRowUnsaved(shoppingcartid, productid, shoppingcartitemid, quantity, datecreated, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala index b07d4eb0b9..121ea83d93 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala @@ -57,6 +57,7 @@ case class SpecialofferRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = specialofferid def toUnsavedRow(specialofferid: Defaulted[SpecialofferId], discountpct: Defaulted[BigDecimal] = Defaulted.Provided(this.discountpct), minqty: Defaulted[Int] = Defaulted.Provided(this.minqty), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SpecialofferRowUnsaved = SpecialofferRowUnsaved(description, `type`, category, startdate, enddate, maxqty, specialofferid, discountpct, minqty, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala index a2845cd15f..eb21e7f312 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala @@ -18,7 +18,10 @@ import scala.collection.immutable.ListMap import scala.util.Try /** Type for the composite primary key of table `sales.specialofferproduct` */ -case class SpecialofferproductId(specialofferid: SpecialofferId, productid: ProductId) +case class SpecialofferproductId( + specialofferid: SpecialofferId, + productid: ProductId +) object SpecialofferproductId { implicit lazy val ordering: Ordering[SpecialofferproductId] = Ordering.by(x => (x.specialofferid, x.productid)) implicit lazy val reads: Reads[SpecialofferproductId] = Reads[SpecialofferproductId](json => JsResult.fromTry( diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala index 2909d8c89f..57d3cbb177 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala @@ -38,6 +38,7 @@ case class SpecialofferproductRow( modifieddate: TypoLocalDateTime ){ val compositeId: SpecialofferproductId = SpecialofferproductId(specialofferid, productid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SpecialofferproductRowUnsaved = SpecialofferproductRowUnsaved(specialofferid, productid, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala index ab6f1eb736..24c5cdece6 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala @@ -44,6 +44,7 @@ case class StoreRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): StoreRowUnsaved = StoreRowUnsaved(businessentityid, name, salespersonid, demographics, rowguid, modifieddate) } diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/testInsert.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/testInsert.scala index 522672eea9..4c2ed048d8 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/testInsert.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/testInsert.scala @@ -286,6 +286,7 @@ import adventureworks.sales.specialoffer.SpecialofferId import adventureworks.sales.specialoffer.SpecialofferRepoImpl import adventureworks.sales.specialoffer.SpecialofferRow import adventureworks.sales.specialoffer.SpecialofferRowUnsaved +import adventureworks.sales.specialofferproduct.SpecialofferproductId import adventureworks.sales.specialofferproduct.SpecialofferproductRepoImpl import adventureworks.sales.specialofferproduct.SpecialofferproductRow import adventureworks.sales.specialofferproduct.SpecialofferproductRowUnsaved @@ -309,13 +310,13 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): DepartmentRow = (new DepartmentRepoImpl).insert(new DepartmentRowUnsaved(name = name, groupname = groupname, departmentid = departmentid, modifieddate = modifieddate)) def humanresourcesEmployee(businessentityid: BusinessentityId, + birthdate: TypoLocalDate, + maritalstatus: /* bpchar, max 1 chars */ String, + gender: /* bpchar, max 1 chars */ String, + hiredate: TypoLocalDate, nationalidnumber: /* max 15 chars */ String = random.alphanumeric.take(15).mkString, loginid: /* max 256 chars */ String = random.alphanumeric.take(20).mkString, jobtitle: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, - birthdate: TypoLocalDate = TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong)), - maritalstatus: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, - gender: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, - hiredate: TypoLocalDate = TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong)), salariedflag: Defaulted[Flag] = Defaulted.UseDefault, vacationhours: Defaulted[TypoShort] = Defaulted.UseDefault, sickleavehours: Defaulted[TypoShort] = Defaulted.UseDefault, @@ -323,20 +324,20 @@ class TestInsert(random: Random) { rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, organizationnode: Defaulted[Option[String]] = Defaulted.UseDefault - )(implicit c: Connection): EmployeeRow = (new EmployeeRepoImpl).insert(new EmployeeRowUnsaved(businessentityid = businessentityid, nationalidnumber = nationalidnumber, loginid = loginid, jobtitle = jobtitle, birthdate = birthdate, maritalstatus = maritalstatus, gender = gender, hiredate = hiredate, salariedflag = salariedflag, vacationhours = vacationhours, sickleavehours = sickleavehours, currentflag = currentflag, rowguid = rowguid, modifieddate = modifieddate, organizationnode = organizationnode)) + )(implicit c: Connection): EmployeeRow = (new EmployeeRepoImpl).insert(new EmployeeRowUnsaved(businessentityid = businessentityid, birthdate = birthdate, maritalstatus = maritalstatus, gender = gender, hiredate = hiredate, nationalidnumber = nationalidnumber, loginid = loginid, jobtitle = jobtitle, salariedflag = salariedflag, vacationhours = vacationhours, sickleavehours = sickleavehours, currentflag = currentflag, rowguid = rowguid, modifieddate = modifieddate, organizationnode = organizationnode)) def humanresourcesEmployeedepartmenthistory(businessentityid: BusinessentityId, departmentid: DepartmentId, shiftid: ShiftId, - startdate: TypoLocalDate = TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong)), - enddate: Option[TypoLocalDate] = if (random.nextBoolean()) None else Some(TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong))), + startdate: TypoLocalDate, + enddate: Option[TypoLocalDate] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): EmployeedepartmenthistoryRow = (new EmployeedepartmenthistoryRepoImpl).insert(new EmployeedepartmenthistoryRowUnsaved(businessentityid = businessentityid, departmentid = departmentid, shiftid = shiftid, startdate = startdate, enddate = enddate, modifieddate = modifieddate)) def humanresourcesEmployeepayhistory(businessentityid: BusinessentityId, + rate: BigDecimal, + payfrequency: TypoShort, ratechangedate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - rate: BigDecimal = BigDecimal.decimal(random.nextDouble()), - payfrequency: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): EmployeepayhistoryRow = (new EmployeepayhistoryRepoImpl).insert(new EmployeepayhistoryRowUnsaved(businessentityid = businessentityid, ratechangedate = ratechangedate, rate = rate, payfrequency = payfrequency, modifieddate = modifieddate)) + )(implicit c: Connection): EmployeepayhistoryRow = (new EmployeepayhistoryRepoImpl).insert(new EmployeepayhistoryRowUnsaved(businessentityid = businessentityid, rate = rate, payfrequency = payfrequency, ratechangedate = ratechangedate, modifieddate = modifieddate)) def humanresourcesJobcandidate(businessentityid: Option[BusinessentityId] = None, resume: Option[TypoXml] = None, jobcandidateid: Defaulted[JobcandidateId] = Defaulted.UseDefault, @@ -400,8 +401,8 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): PasswordRow = (new PasswordRepoImpl).insert(new PasswordRowUnsaved(businessentityid = businessentityid, passwordhash = passwordhash, passwordsalt = passwordsalt, rowguid = rowguid, modifieddate = modifieddate)) def personPerson(businessentityid: BusinessentityId, + persontype: /* bpchar, max 2 chars */ String, firstname: /* user-picked */ FirstName, - persontype: /* bpchar, max 2 chars */ String = random.alphanumeric.take(2).mkString, title: Option[/* max 8 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(8).mkString), middlename: Option[Name] = if (random.nextBoolean()) None else Some(Name(random.alphanumeric.take(20).mkString)), lastname: Name = Name(random.alphanumeric.take(20).mkString), @@ -412,7 +413,7 @@ class TestInsert(random: Random) { emailpromotion: Defaulted[Int] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): PersonRow = (new PersonRepoImpl).insert(new PersonRowUnsaved(businessentityid = businessentityid, firstname = firstname, persontype = persontype, title = title, middlename = middlename, lastname = lastname, suffix = suffix, additionalcontactinfo = additionalcontactinfo, demographics = demographics, namestyle = namestyle, emailpromotion = emailpromotion, rowguid = rowguid, modifieddate = modifieddate)) + )(implicit c: Connection): PersonRow = (new PersonRepoImpl).insert(new PersonRowUnsaved(businessentityid = businessentityid, persontype = persontype, firstname = firstname, title = title, middlename = middlename, lastname = lastname, suffix = suffix, additionalcontactinfo = additionalcontactinfo, demographics = demographics, namestyle = namestyle, emailpromotion = emailpromotion, rowguid = rowguid, modifieddate = modifieddate)) def personPersonphone(businessentityid: BusinessentityId, phonenumbertypeid: PhonenumbertypeId, phonenumber: Phone = Phone(random.alphanumeric.take(20).mkString), @@ -433,24 +434,24 @@ class TestInsert(random: Random) { )(implicit c: Connection): StateprovinceRow = (new StateprovinceRepoImpl).insert(new StateprovinceRowUnsaved(countryregioncode = countryregioncode, territoryid = territoryid, stateprovincecode = stateprovincecode, name = name, stateprovinceid = stateprovinceid, isonlystateprovinceflag = isonlystateprovinceflag, rowguid = rowguid, modifieddate = modifieddate)) def productionBillofmaterials(componentid: ProductId, unitmeasurecode: UnitmeasureId, + bomlevel: TypoShort, productassemblyid: Option[ProductId] = None, - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - bomlevel: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), + enddate: Option[TypoLocalDateTime] = None, billofmaterialsid: Defaulted[Int] = Defaulted.UseDefault, startdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, perassemblyqty: Defaulted[BigDecimal] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): BillofmaterialsRow = (new BillofmaterialsRepoImpl).insert(new BillofmaterialsRowUnsaved(componentid = componentid, unitmeasurecode = unitmeasurecode, productassemblyid = productassemblyid, enddate = enddate, bomlevel = bomlevel, billofmaterialsid = billofmaterialsid, startdate = startdate, perassemblyqty = perassemblyqty, modifieddate = modifieddate)) + )(implicit c: Connection): BillofmaterialsRow = (new BillofmaterialsRepoImpl).insert(new BillofmaterialsRowUnsaved(componentid = componentid, unitmeasurecode = unitmeasurecode, bomlevel = bomlevel, productassemblyid = productassemblyid, enddate = enddate, billofmaterialsid = billofmaterialsid, startdate = startdate, perassemblyqty = perassemblyqty, modifieddate = modifieddate)) def productionCulture(cultureid: CultureId, name: Name = Name(random.alphanumeric.take(20).mkString), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): CultureRow = (new CultureRepoImpl).insert(new CultureRowUnsaved(cultureid = cultureid, name = name, modifieddate = modifieddate)) def productionDocument(owner: BusinessentityId, + status: TypoShort, title: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, filename: /* max 400 chars */ String = random.alphanumeric.take(20).mkString, fileextension: Option[/* max 8 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(8).mkString), revision: /* bpchar, max 5 chars */ String = random.alphanumeric.take(5).mkString, - status: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), documentsummary: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), document: Option[TypoBytea] = None, folderflag: Defaulted[Flag] = Defaulted.UseDefault, @@ -458,7 +459,7 @@ class TestInsert(random: Random) { rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, documentnode: Defaulted[DocumentId] = Defaulted.UseDefault - )(implicit c: Connection): DocumentRow = (new DocumentRepoImpl).insert(new DocumentRowUnsaved(owner = owner, title = title, filename = filename, fileextension = fileextension, revision = revision, status = status, documentsummary = documentsummary, document = document, folderflag = folderflag, changenumber = changenumber, rowguid = rowguid, modifieddate = modifieddate, documentnode = documentnode)) + )(implicit c: Connection): DocumentRow = (new DocumentRepoImpl).insert(new DocumentRowUnsaved(owner = owner, status = status, title = title, filename = filename, fileextension = fileextension, revision = revision, documentsummary = documentsummary, document = document, folderflag = folderflag, changenumber = changenumber, rowguid = rowguid, modifieddate = modifieddate, documentnode = documentnode)) def productionIllustration(diagram: Option[TypoXml] = None, illustrationid: Defaulted[IllustrationId] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault @@ -469,43 +470,43 @@ class TestInsert(random: Random) { availability: Defaulted[BigDecimal] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): LocationRow = (new LocationRepoImpl).insert(new LocationRowUnsaved(name = name, locationid = locationid, costrate = costrate, availability = availability, modifieddate = modifieddate)) - def productionProduct(name: Name = Name(random.alphanumeric.take(20).mkString), + def productionProduct(safetystocklevel: TypoShort, + reorderpoint: TypoShort, + standardcost: BigDecimal, + listprice: BigDecimal, + daystomanufacture: Int, + sellstartdate: TypoLocalDateTime, + name: Name = Name(random.alphanumeric.take(20).mkString), productnumber: /* max 25 chars */ String = random.alphanumeric.take(20).mkString, color: Option[/* max 15 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(15).mkString), - safetystocklevel: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - reorderpoint: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - standardcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), - listprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), size: Option[/* max 5 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(5).mkString), sizeunitmeasurecode: Option[UnitmeasureId] = None, weightunitmeasurecode: Option[UnitmeasureId] = None, - weight: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), - daystomanufacture: Int = random.nextInt(), - productline: Option[/* bpchar, max 2 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(2).mkString), - `class`: Option[/* bpchar, max 2 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(2).mkString), - style: Option[/* bpchar, max 2 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(2).mkString), + weight: Option[BigDecimal] = None, + productline: Option[/* bpchar, max 2 chars */ String] = None, + `class`: Option[/* bpchar, max 2 chars */ String] = None, + style: Option[/* bpchar, max 2 chars */ String] = None, productsubcategoryid: Option[ProductsubcategoryId] = None, productmodelid: Option[ProductmodelId] = None, - sellstartdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - sellenddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + sellenddate: Option[TypoLocalDateTime] = None, discontinueddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), productid: Defaulted[ProductId] = Defaulted.UseDefault, makeflag: Defaulted[Flag] = Defaulted.UseDefault, finishedgoodsflag: Defaulted[Flag] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): ProductRow = (new ProductRepoImpl).insert(new ProductRowUnsaved(name = name, productnumber = productnumber, color = color, safetystocklevel = safetystocklevel, reorderpoint = reorderpoint, standardcost = standardcost, listprice = listprice, size = size, sizeunitmeasurecode = sizeunitmeasurecode, weightunitmeasurecode = weightunitmeasurecode, weight = weight, daystomanufacture = daystomanufacture, productline = productline, `class` = `class`, style = style, productsubcategoryid = productsubcategoryid, productmodelid = productmodelid, sellstartdate = sellstartdate, sellenddate = sellenddate, discontinueddate = discontinueddate, productid = productid, makeflag = makeflag, finishedgoodsflag = finishedgoodsflag, rowguid = rowguid, modifieddate = modifieddate)) + )(implicit c: Connection): ProductRow = (new ProductRepoImpl).insert(new ProductRowUnsaved(safetystocklevel = safetystocklevel, reorderpoint = reorderpoint, standardcost = standardcost, listprice = listprice, daystomanufacture = daystomanufacture, sellstartdate = sellstartdate, name = name, productnumber = productnumber, color = color, size = size, sizeunitmeasurecode = sizeunitmeasurecode, weightunitmeasurecode = weightunitmeasurecode, weight = weight, productline = productline, `class` = `class`, style = style, productsubcategoryid = productsubcategoryid, productmodelid = productmodelid, sellenddate = sellenddate, discontinueddate = discontinueddate, productid = productid, makeflag = makeflag, finishedgoodsflag = finishedgoodsflag, rowguid = rowguid, modifieddate = modifieddate)) def productionProductcategory(name: Name = Name(random.alphanumeric.take(20).mkString), productcategoryid: Defaulted[ProductcategoryId] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): ProductcategoryRow = (new ProductcategoryRepoImpl).insert(new ProductcategoryRowUnsaved(name = name, productcategoryid = productcategoryid, rowguid = rowguid, modifieddate = modifieddate)) def productionProductcosthistory(productid: ProductId, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - standardcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), + startdate: TypoLocalDateTime, + standardcost: BigDecimal, + enddate: Option[TypoLocalDateTime] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): ProductcosthistoryRow = (new ProductcosthistoryRepoImpl).insert(new ProductcosthistoryRowUnsaved(productid = productid, startdate = startdate, enddate = enddate, standardcost = standardcost, modifieddate = modifieddate)) + )(implicit c: Connection): ProductcosthistoryRow = (new ProductcosthistoryRepoImpl).insert(new ProductcosthistoryRowUnsaved(productid = productid, startdate = startdate, standardcost = standardcost, enddate = enddate, modifieddate = modifieddate)) def productionProductdescription(description: /* max 400 chars */ String = random.alphanumeric.take(20).mkString, productdescriptionid: Defaulted[ProductdescriptionId] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, @@ -517,18 +518,18 @@ class TestInsert(random: Random) { )(implicit c: Connection): ProductdocumentRow = (new ProductdocumentRepoImpl).insert(new ProductdocumentRowUnsaved(productid = productid, modifieddate = modifieddate, documentnode = documentnode)) def productionProductinventory(productid: ProductId, locationid: LocationId, + bin: TypoShort, shelf: /* max 10 chars */ String = random.alphanumeric.take(10).mkString, - bin: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), quantity: Defaulted[TypoShort] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): ProductinventoryRow = (new ProductinventoryRepoImpl).insert(new ProductinventoryRowUnsaved(productid = productid, locationid = locationid, shelf = shelf, bin = bin, quantity = quantity, rowguid = rowguid, modifieddate = modifieddate)) + )(implicit c: Connection): ProductinventoryRow = (new ProductinventoryRepoImpl).insert(new ProductinventoryRowUnsaved(productid = productid, locationid = locationid, bin = bin, shelf = shelf, quantity = quantity, rowguid = rowguid, modifieddate = modifieddate)) def productionProductlistpricehistory(productid: ProductId, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - listprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), + startdate: TypoLocalDateTime, + listprice: BigDecimal, + enddate: Option[TypoLocalDateTime] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): ProductlistpricehistoryRow = (new ProductlistpricehistoryRepoImpl).insert(new ProductlistpricehistoryRowUnsaved(productid = productid, startdate = startdate, enddate = enddate, listprice = listprice, modifieddate = modifieddate)) + )(implicit c: Connection): ProductlistpricehistoryRow = (new ProductlistpricehistoryRepoImpl).insert(new ProductlistpricehistoryRowUnsaved(productid = productid, startdate = startdate, listprice = listprice, enddate = enddate, modifieddate = modifieddate)) def productionProductmodel(name: Name = Name(random.alphanumeric.take(20).mkString), catalogdescription: Option[TypoXml] = None, instructions: Option[TypoXml] = None, @@ -558,14 +559,14 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): ProductproductphotoRow = (new ProductproductphotoRepoImpl).insert(new ProductproductphotoRowUnsaved(productid = productid, productphotoid = productphotoid, primary = primary, modifieddate = modifieddate)) def productionProductreview(productid: ProductId, + rating: Int, reviewername: Name = Name(random.alphanumeric.take(20).mkString), emailaddress: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, - rating: Int = random.nextInt(), comments: Option[/* max 3850 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), productreviewid: Defaulted[ProductreviewId] = Defaulted.UseDefault, reviewdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): ProductreviewRow = (new ProductreviewRepoImpl).insert(new ProductreviewRowUnsaved(productid = productid, reviewername = reviewername, emailaddress = emailaddress, rating = rating, comments = comments, productreviewid = productreviewid, reviewdate = reviewdate, modifieddate = modifieddate)) + )(implicit c: Connection): ProductreviewRow = (new ProductreviewRepoImpl).insert(new ProductreviewRowUnsaved(productid = productid, rating = rating, reviewername = reviewername, emailaddress = emailaddress, comments = comments, productreviewid = productreviewid, reviewdate = reviewdate, modifieddate = modifieddate)) def productionProductsubcategory(productcategoryid: ProductcategoryId, name: Name = Name(random.alphanumeric.take(20).mkString), productsubcategoryid: Defaulted[ProductsubcategoryId] = Defaulted.UseDefault, @@ -577,34 +578,34 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): ScrapreasonRow = (new ScrapreasonRepoImpl).insert(new ScrapreasonRowUnsaved(name = name, scrapreasonid = scrapreasonid, modifieddate = modifieddate)) def productionTransactionhistory(productid: ProductId, + transactiontype: /* bpchar, max 1 chars */ String, referenceorderid: Int = random.nextInt(), - transactiontype: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, quantity: Int = random.nextInt(), actualcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), transactionid: Defaulted[TransactionhistoryId] = Defaulted.UseDefault, referenceorderlineid: Defaulted[Int] = Defaulted.UseDefault, transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): TransactionhistoryRow = (new TransactionhistoryRepoImpl).insert(new TransactionhistoryRowUnsaved(productid = productid, referenceorderid = referenceorderid, transactiontype = transactiontype, quantity = quantity, actualcost = actualcost, transactionid = transactionid, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) - def productionTransactionhistoryarchive(transactionid: TransactionhistoryarchiveId, + )(implicit c: Connection): TransactionhistoryRow = (new TransactionhistoryRepoImpl).insert(new TransactionhistoryRowUnsaved(productid = productid, transactiontype = transactiontype, referenceorderid = referenceorderid, quantity = quantity, actualcost = actualcost, transactionid = transactionid, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) + def productionTransactionhistoryarchive(transactiontype: /* bpchar, max 1 chars */ String, + transactionid: TransactionhistoryarchiveId = TransactionhistoryarchiveId(random.nextInt()), productid: Int = random.nextInt(), referenceorderid: Int = random.nextInt(), - transactiontype: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, quantity: Int = random.nextInt(), actualcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), referenceorderlineid: Defaulted[Int] = Defaulted.UseDefault, transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): TransactionhistoryarchiveRow = (new TransactionhistoryarchiveRepoImpl).insert(new TransactionhistoryarchiveRowUnsaved(transactionid = transactionid, productid = productid, referenceorderid = referenceorderid, transactiontype = transactiontype, quantity = quantity, actualcost = actualcost, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) + )(implicit c: Connection): TransactionhistoryarchiveRow = (new TransactionhistoryarchiveRepoImpl).insert(new TransactionhistoryarchiveRowUnsaved(transactiontype = transactiontype, transactionid = transactionid, productid = productid, referenceorderid = referenceorderid, quantity = quantity, actualcost = actualcost, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) def productionUnitmeasure(unitmeasurecode: UnitmeasureId, name: Name = Name(random.alphanumeric.take(20).mkString), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): UnitmeasureRow = (new UnitmeasureRepoImpl).insert(new UnitmeasureRowUnsaved(unitmeasurecode = unitmeasurecode, name = name, modifieddate = modifieddate)) def productionWorkorder(productid: ProductId, - orderqty: Int = random.nextInt(), - scrappedqty: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + orderqty: Int, + scrappedqty: TypoShort, + startdate: TypoLocalDateTime, + enddate: Option[TypoLocalDateTime] = None, duedate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), scrapreasonid: Option[ScrapreasonId] = None, workorderid: Defaulted[WorkorderId] = Defaulted.UseDefault, @@ -612,17 +613,17 @@ class TestInsert(random: Random) { )(implicit c: Connection): WorkorderRow = (new WorkorderRepoImpl).insert(new WorkorderRowUnsaved(productid = productid, orderqty = orderqty, scrappedqty = scrappedqty, startdate = startdate, enddate = enddate, duedate = duedate, scrapreasonid = scrapreasonid, workorderid = workorderid, modifieddate = modifieddate)) def productionWorkorderrouting(workorderid: WorkorderId, locationid: LocationId, + scheduledstartdate: TypoLocalDateTime, + scheduledenddate: TypoLocalDateTime, + plannedcost: BigDecimal, productid: Int = random.nextInt(), operationsequence: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - scheduledstartdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - scheduledenddate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - actualstartdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - actualenddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - actualresourcehrs: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), - plannedcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), - actualcost: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), + actualstartdate: Option[TypoLocalDateTime] = None, + actualenddate: Option[TypoLocalDateTime] = None, + actualresourcehrs: Option[BigDecimal] = None, + actualcost: Option[BigDecimal] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): WorkorderroutingRow = (new WorkorderroutingRepoImpl).insert(new WorkorderroutingRowUnsaved(workorderid = workorderid, locationid = locationid, productid = productid, operationsequence = operationsequence, scheduledstartdate = scheduledstartdate, scheduledenddate = scheduledenddate, actualstartdate = actualstartdate, actualenddate = actualenddate, actualresourcehrs = actualresourcehrs, plannedcost = plannedcost, actualcost = actualcost, modifieddate = modifieddate)) + )(implicit c: Connection): WorkorderroutingRow = (new WorkorderroutingRepoImpl).insert(new WorkorderroutingRowUnsaved(workorderid = workorderid, locationid = locationid, scheduledstartdate = scheduledstartdate, scheduledenddate = scheduledenddate, plannedcost = plannedcost, productid = productid, operationsequence = operationsequence, actualstartdate = actualstartdate, actualenddate = actualenddate, actualresourcehrs = actualresourcehrs, actualcost = actualcost, modifieddate = modifieddate)) def publicFlaff(code: ShortText = ShortText(random.alphanumeric.take(20).mkString), anotherCode: /* max 20 chars */ String = random.alphanumeric.take(20).mkString, someNumber: Int = random.nextInt(), @@ -679,7 +680,7 @@ class TestInsert(random: Random) { text: String = random.alphanumeric.take(20).mkString, time: TypoLocalTime = TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)), timestamp: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - timestampz: TypoInstant = TypoInstant(Instant.ofEpochMilli(random.nextLong())), + timestampz: TypoInstant = TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L))), timez: TypoOffsetTime = TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12))), varchar: String = random.alphanumeric.take(20).mkString, bpchares: Array[/* bpchar */ String] = Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString), @@ -697,7 +698,7 @@ class TestInsert(random: Random) { textes: Array[String] = Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString), timees: Array[TypoLocalTime] = Array.fill(random.nextInt(3))(TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), timestampes: Array[TypoLocalDateTime] = Array.fill(random.nextInt(3))(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - timestampzes: Array[TypoInstant] = Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(random.nextLong()))), + timestampzes: Array[TypoInstant] = Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L)))), timezes: Array[TypoOffsetTime] = Array.fill(random.nextInt(3))(TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12)))), varchares: Array[String] = Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString) )(implicit c: Connection): PgtestRow = (new PgtestRepoImpl).insert(new PgtestRow(box = box, bytea = bytea, circle = circle, hstore = hstore, inet = inet, int2vector = int2vector, interval = interval, json = json, jsonb = jsonb, line = line, lseg = lseg, money = money, path = path, point = point, polygon = polygon, uuid = uuid, vector = vector, xml = xml, boxes = boxes, circlees = circlees, inetes = inetes, int2vectores = int2vectores, intervales = intervales, jsones = jsones, jsonbes = jsonbes, linees = linees, lseges = lseges, moneyes = moneyes, pathes = pathes, pointes = pointes, polygones = polygones, uuides = uuides, xmles = xmles, bool = bool, bpchar = bpchar, char = char, date = date, float4 = float4, float8 = float8, int2 = int2, int4 = int4, int8 = int8, mydomain = mydomain, myenum = myenum, name = name, numeric = numeric, text = text, time = time, timestamp = timestamp, timestampz = timestampz, timez = timez, varchar = varchar, bpchares = bpchares, chares = chares, datees = datees, float4es = float4es, float8es = float8es, int2es = int2es, int4es = int4es, int8es = int8es, mydomaines = mydomaines, myenumes = myenumes, namees = namees, numerices = numerices, textes = textes, timees = timees, timestampes = timestampes, timestampzes = timestampzes, timezes = timezes, varchares = varchares)) @@ -732,7 +733,7 @@ class TestInsert(random: Random) { text: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), time: Option[TypoLocalTime] = if (random.nextBoolean()) None else Some(TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), timestamp: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - timestampz: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(random.nextLong()))), + timestampz: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L)))), timez: Option[TypoOffsetTime] = if (random.nextBoolean()) None else Some(TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12)))), uuid: Option[TypoUUID] = None, varchar: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), @@ -766,7 +767,7 @@ class TestInsert(random: Random) { textes: Option[Array[String]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString)), timees: Option[Array[TypoLocalTime]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), timestampes: Option[Array[TypoLocalDateTime]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))))), - timestampzes: Option[Array[TypoInstant]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(random.nextLong())))), + timestampzes: Option[Array[TypoInstant]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L))))), timezes: Option[Array[TypoOffsetTime]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12))))), uuides: Option[Array[TypoUUID]] = None, varchares: Option[Array[String]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString)), @@ -777,25 +778,25 @@ class TestInsert(random: Random) { name: String = random.alphanumeric.take(20).mkString, lastName: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), password: String = random.alphanumeric.take(20).mkString, - verifiedOn: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(random.nextLong()))), + verifiedOn: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L)))), createdAt: Defaulted[TypoInstant] = Defaulted.UseDefault )(implicit c: Connection): UsersRow = (new UsersRepoImpl).insert(new UsersRowUnsaved(userId = userId, email = email, name = name, lastName = lastName, password = password, verifiedOn = verifiedOn, createdAt = createdAt)) def purchasingProductvendor(productid: ProductId, businessentityid: BusinessentityId, + averageleadtime: Int, + standardprice: BigDecimal, + minorderqty: Int, + maxorderqty: Int, unitmeasurecode: UnitmeasureId, - averageleadtime: Int = random.nextInt(), - standardprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), - lastreceiptcost: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), + lastreceiptcost: Option[BigDecimal] = None, lastreceiptdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - minorderqty: Int = random.nextInt(), - maxorderqty: Int = random.nextInt(), - onorderqty: Option[Int] = if (random.nextBoolean()) None else Some(random.nextInt()), + onorderqty: Option[Int] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): ProductvendorRow = (new ProductvendorRepoImpl).insert(new ProductvendorRowUnsaved(productid = productid, businessentityid = businessentityid, unitmeasurecode = unitmeasurecode, averageleadtime = averageleadtime, standardprice = standardprice, lastreceiptcost = lastreceiptcost, lastreceiptdate = lastreceiptdate, minorderqty = minorderqty, maxorderqty = maxorderqty, onorderqty = onorderqty, modifieddate = modifieddate)) + )(implicit c: Connection): ProductvendorRow = (new ProductvendorRepoImpl).insert(new ProductvendorRowUnsaved(productid = productid, businessentityid = businessentityid, averageleadtime = averageleadtime, standardprice = standardprice, minorderqty = minorderqty, maxorderqty = maxorderqty, unitmeasurecode = unitmeasurecode, lastreceiptcost = lastreceiptcost, lastreceiptdate = lastreceiptdate, onorderqty = onorderqty, modifieddate = modifieddate)) def purchasingPurchaseorderheader(employeeid: BusinessentityId, vendorid: BusinessentityId, shipmethodid: ShipmethodId, - shipdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + shipdate: Option[TypoLocalDateTime] = None, purchaseorderid: Defaulted[PurchaseorderheaderId] = Defaulted.UseDefault, revisionnumber: Defaulted[TypoShort] = Defaulted.UseDefault, status: Defaulted[TypoShort] = Defaulted.UseDefault, @@ -813,14 +814,14 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): ShipmethodRow = (new ShipmethodRepoImpl).insert(new ShipmethodRowUnsaved(name = name, shipmethodid = shipmethodid, shipbase = shipbase, shiprate = shiprate, rowguid = rowguid, modifieddate = modifieddate)) def purchasingVendor(businessentityid: BusinessentityId, + creditrating: TypoShort, accountnumber: AccountNumber = AccountNumber(random.alphanumeric.take(20).mkString), name: Name = Name(random.alphanumeric.take(20).mkString), - creditrating: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), purchasingwebserviceurl: Option[/* max 1024 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), preferredvendorstatus: Defaulted[Flag] = Defaulted.UseDefault, activeflag: Defaulted[Flag] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): VendorRow = (new VendorRepoImpl).insert(new VendorRowUnsaved(businessentityid = businessentityid, accountnumber = accountnumber, name = name, creditrating = creditrating, purchasingwebserviceurl = purchasingwebserviceurl, preferredvendorstatus = preferredvendorstatus, activeflag = activeflag, modifieddate = modifieddate)) + )(implicit c: Connection): VendorRow = (new VendorRepoImpl).insert(new VendorRowUnsaved(businessentityid = businessentityid, creditrating = creditrating, accountnumber = accountnumber, name = name, purchasingwebserviceurl = purchasingwebserviceurl, preferredvendorstatus = preferredvendorstatus, activeflag = activeflag, modifieddate = modifieddate)) def salesCountryregioncurrency(countryregioncode: CountryregionId, currencycode: CurrencyId, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault @@ -855,23 +856,22 @@ class TestInsert(random: Random) { creditcardid: /* user-picked */ CustomCreditcardId, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): PersoncreditcardRow = (new PersoncreditcardRepoImpl).insert(new PersoncreditcardRowUnsaved(businessentityid = businessentityid, creditcardid = creditcardid, modifieddate = modifieddate)) - def salesSalesorderdetail(salesorderid: SalesorderheaderId, - productid: ProductId, - specialofferid: SpecialofferId, + def salesSalesorderdetail(SpecialofferproductId: SpecialofferproductId, + salesorderid: SalesorderheaderId, + orderqty: TypoShort, + unitprice: BigDecimal, carriertrackingnumber: Option[/* max 25 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), - orderqty: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - unitprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), salesorderdetailid: Defaulted[Int] = Defaulted.UseDefault, unitpricediscount: Defaulted[BigDecimal] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): SalesorderdetailRow = (new SalesorderdetailRepoImpl).insert(new SalesorderdetailRowUnsaved(salesorderid = salesorderid, productid = productid, specialofferid = specialofferid, carriertrackingnumber = carriertrackingnumber, orderqty = orderqty, unitprice = unitprice, salesorderdetailid = salesorderdetailid, unitpricediscount = unitpricediscount, rowguid = rowguid, modifieddate = modifieddate)) - def salesSalesorderheader(customerid: CustomerId, + )(implicit c: Connection): SalesorderdetailRow = (new SalesorderdetailRepoImpl).insert(new SalesorderdetailRowUnsaved(salesorderid = salesorderid, carriertrackingnumber = carriertrackingnumber, orderqty = orderqty, productid = SpecialofferproductId.productid, specialofferid = SpecialofferproductId.specialofferid, unitprice = unitprice, salesorderdetailid = salesorderdetailid, unitpricediscount = unitpricediscount, rowguid = rowguid, modifieddate = modifieddate)) + def salesSalesorderheader(duedate: TypoLocalDateTime, + customerid: CustomerId, billtoaddressid: AddressId, shiptoaddressid: AddressId, shipmethodid: ShipmethodId, - duedate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - shipdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + shipdate: Option[TypoLocalDateTime] = None, purchaseordernumber: Option[OrderNumber] = if (random.nextBoolean()) None else Some(OrderNumber(random.alphanumeric.take(20).mkString)), accountnumber: Option[AccountNumber] = if (random.nextBoolean()) None else Some(AccountNumber(random.alphanumeric.take(20).mkString)), salespersonid: Option[BusinessentityId] = None, @@ -891,14 +891,14 @@ class TestInsert(random: Random) { freight: Defaulted[BigDecimal] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): SalesorderheaderRow = (new SalesorderheaderRepoImpl).insert(new SalesorderheaderRowUnsaved(customerid = customerid, billtoaddressid = billtoaddressid, shiptoaddressid = shiptoaddressid, shipmethodid = shipmethodid, duedate = duedate, shipdate = shipdate, purchaseordernumber = purchaseordernumber, accountnumber = accountnumber, salespersonid = salespersonid, territoryid = territoryid, creditcardid = creditcardid, creditcardapprovalcode = creditcardapprovalcode, currencyrateid = currencyrateid, totaldue = totaldue, comment = comment, salesorderid = salesorderid, revisionnumber = revisionnumber, orderdate = orderdate, status = status, onlineorderflag = onlineorderflag, subtotal = subtotal, taxamt = taxamt, freight = freight, rowguid = rowguid, modifieddate = modifieddate)) + )(implicit c: Connection): SalesorderheaderRow = (new SalesorderheaderRepoImpl).insert(new SalesorderheaderRowUnsaved(duedate = duedate, customerid = customerid, billtoaddressid = billtoaddressid, shiptoaddressid = shiptoaddressid, shipmethodid = shipmethodid, shipdate = shipdate, purchaseordernumber = purchaseordernumber, accountnumber = accountnumber, salespersonid = salespersonid, territoryid = territoryid, creditcardid = creditcardid, creditcardapprovalcode = creditcardapprovalcode, currencyrateid = currencyrateid, totaldue = totaldue, comment = comment, salesorderid = salesorderid, revisionnumber = revisionnumber, orderdate = orderdate, status = status, onlineorderflag = onlineorderflag, subtotal = subtotal, taxamt = taxamt, freight = freight, rowguid = rowguid, modifieddate = modifieddate)) def salesSalesorderheadersalesreason(salesorderid: SalesorderheaderId, salesreasonid: SalesreasonId, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): SalesorderheadersalesreasonRow = (new SalesorderheadersalesreasonRepoImpl).insert(new SalesorderheadersalesreasonRowUnsaved(salesorderid = salesorderid, salesreasonid = salesreasonid, modifieddate = modifieddate)) def salesSalesperson(businessentityid: BusinessentityId, territoryid: Option[SalesterritoryId] = None, - salesquota: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), + salesquota: Option[BigDecimal] = None, bonus: Defaulted[BigDecimal] = Defaulted.UseDefault, commissionpct: Defaulted[BigDecimal] = Defaulted.UseDefault, salesytd: Defaulted[BigDecimal] = Defaulted.UseDefault, @@ -907,18 +907,18 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): SalespersonRow = (new SalespersonRepoImpl).insert(new SalespersonRowUnsaved(businessentityid = businessentityid, territoryid = territoryid, salesquota = salesquota, bonus = bonus, commissionpct = commissionpct, salesytd = salesytd, saleslastyear = saleslastyear, rowguid = rowguid, modifieddate = modifieddate)) def salesSalespersonquotahistory(businessentityid: BusinessentityId, + salesquota: BigDecimal, quotadate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - salesquota: BigDecimal = BigDecimal.decimal(random.nextDouble()), rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): SalespersonquotahistoryRow = (new SalespersonquotahistoryRepoImpl).insert(new SalespersonquotahistoryRowUnsaved(businessentityid = businessentityid, quotadate = quotadate, salesquota = salesquota, rowguid = rowguid, modifieddate = modifieddate)) + )(implicit c: Connection): SalespersonquotahistoryRow = (new SalespersonquotahistoryRepoImpl).insert(new SalespersonquotahistoryRowUnsaved(businessentityid = businessentityid, salesquota = salesquota, quotadate = quotadate, rowguid = rowguid, modifieddate = modifieddate)) def salesSalesreason(name: Name = Name(random.alphanumeric.take(20).mkString), reasontype: Name = Name(random.alphanumeric.take(20).mkString), salesreasonid: Defaulted[SalesreasonId] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): SalesreasonRow = (new SalesreasonRepoImpl).insert(new SalesreasonRowUnsaved(name = name, reasontype = reasontype, salesreasonid = salesreasonid, modifieddate = modifieddate)) def salesSalestaxrate(stateprovinceid: StateprovinceId, - taxtype: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), + taxtype: TypoShort, name: Name = Name(random.alphanumeric.take(20).mkString), salestaxrateid: Defaulted[SalestaxrateId] = Defaulted.UseDefault, taxrate: Defaulted[BigDecimal] = Defaulted.UseDefault, @@ -938,8 +938,8 @@ class TestInsert(random: Random) { )(implicit c: Connection): SalesterritoryRow = (new SalesterritoryRepoImpl).insert(new SalesterritoryRowUnsaved(countryregioncode = countryregioncode, name = name, group = group, territoryid = territoryid, salesytd = salesytd, saleslastyear = saleslastyear, costytd = costytd, costlastyear = costlastyear, rowguid = rowguid, modifieddate = modifieddate)) def salesSalesterritoryhistory(businessentityid: BusinessentityId, territoryid: SalesterritoryId, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + startdate: TypoLocalDateTime, + enddate: Option[TypoLocalDateTime] = None, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): SalesterritoryhistoryRow = (new SalesterritoryhistoryRepoImpl).insert(new SalesterritoryhistoryRowUnsaved(businessentityid = businessentityid, territoryid = territoryid, startdate = startdate, enddate = enddate, rowguid = rowguid, modifieddate = modifieddate)) @@ -950,18 +950,18 @@ class TestInsert(random: Random) { datecreated: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault )(implicit c: Connection): ShoppingcartitemRow = (new ShoppingcartitemRepoImpl).insert(new ShoppingcartitemRowUnsaved(productid = productid, shoppingcartid = shoppingcartid, shoppingcartitemid = shoppingcartitemid, quantity = quantity, datecreated = datecreated, modifieddate = modifieddate)) - def salesSpecialoffer(description: /* max 255 chars */ String = random.alphanumeric.take(20).mkString, + def salesSpecialoffer(startdate: TypoLocalDateTime, + enddate: TypoLocalDateTime, + description: /* max 255 chars */ String = random.alphanumeric.take(20).mkString, `type`: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, category: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - maxqty: Option[Int] = if (random.nextBoolean()) None else Some(random.nextInt()), + maxqty: Option[Int] = None, specialofferid: Defaulted[SpecialofferId] = Defaulted.UseDefault, discountpct: Defaulted[BigDecimal] = Defaulted.UseDefault, minqty: Defaulted[Int] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - )(implicit c: Connection): SpecialofferRow = (new SpecialofferRepoImpl).insert(new SpecialofferRowUnsaved(description = description, `type` = `type`, category = category, startdate = startdate, enddate = enddate, maxqty = maxqty, specialofferid = specialofferid, discountpct = discountpct, minqty = minqty, rowguid = rowguid, modifieddate = modifieddate)) + )(implicit c: Connection): SpecialofferRow = (new SpecialofferRepoImpl).insert(new SpecialofferRowUnsaved(startdate = startdate, enddate = enddate, description = description, `type` = `type`, category = category, maxqty = maxqty, specialofferid = specialofferid, discountpct = discountpct, minqty = minqty, rowguid = rowguid, modifieddate = modifieddate)) def salesSpecialofferproduct(specialofferid: SpecialofferId, productid: ProductId, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-anorm/src/scala/adventureworks/RecordTest.scala b/typo-tester-anorm/src/scala/adventureworks/RecordTest.scala index 42e3b3c35d..0501f7d806 100644 --- a/typo-tester-anorm/src/scala/adventureworks/RecordTest.scala +++ b/typo-tester-anorm/src/scala/adventureworks/RecordTest.scala @@ -16,9 +16,10 @@ class RecordTest extends AnyFunSuite with TypeCheckedTripleEquals { withConnection { implicit c => val testInsert = new TestInsert(new Random(0)) val businessentityRow = testInsert.personBusinessentity() - val personRow = testInsert.personPerson(businessentityRow.businessentityid, FirstName("a"), persontype = "EM") + val personRow = testInsert.personPerson(businessentityRow.businessentityid, persontype = "EM", FirstName("a")) testInsert.personEmailaddress(personRow.businessentityid, Some("a@b.c")): @nowarn - val employeeRow = testInsert.humanresourcesEmployee(personRow.businessentityid, gender = "M", maritalstatus = "M", hiredate = TypoLocalDate.apply("1997-01-01")) + val employeeRow = + testInsert.humanresourcesEmployee(personRow.businessentityid, gender = "M", maritalstatus = "M", birthdate = TypoLocalDate("1998-01-01"), hiredate = TypoLocalDate("1997-01-01")) testInsert.salesSalesperson(employeeRow.businessentityid): @nowarn personRowJoinSqlRepo() foreach println } diff --git a/typo-tester-anorm/src/scala/adventureworks/person/MultiRepoTest.scala b/typo-tester-anorm/src/scala/adventureworks/person/MultiRepoTest.scala index 7b653b1bd2..4a4d91689e 100644 --- a/typo-tester-anorm/src/scala/adventureworks/person/MultiRepoTest.scala +++ b/typo-tester-anorm/src/scala/adventureworks/person/MultiRepoTest.scala @@ -91,7 +91,7 @@ class PersonWithAddressesTest extends AnyFunSuite with TypeCheckedTripleEquals { // insert randomly generated rows (with a fixed seed) we base the test on val testInsert = new TestInsert(new Random(1)) val businessentityRow = testInsert.personBusinessentity() - val personRow = testInsert.personPerson(businessentityRow.businessentityid, FirstName("name"), persontype = "SC") + val personRow = testInsert.personPerson(businessentityRow.businessentityid, persontype = "SC", FirstName("name")) val countryregionRow = testInsert.personCountryregion(CountryregionId("NOR")) val salesterritoryRow = testInsert.salesSalesterritory(countryregionRow.countryregioncode) val stateprovinceRow = testInsert.personStateprovince(countryregionRow.countryregioncode, salesterritoryRow.territoryid) diff --git a/typo-tester-anorm/src/scala/adventureworks/production/product/CompositeIdsTest.scala b/typo-tester-anorm/src/scala/adventureworks/production/product/CompositeIdsTest.scala index e583e1ada3..f5d370ae4b 100644 --- a/typo-tester-anorm/src/scala/adventureworks/production/product/CompositeIdsTest.scala +++ b/typo-tester-anorm/src/scala/adventureworks/production/product/CompositeIdsTest.scala @@ -1,6 +1,6 @@ package adventureworks.production.product -import adventureworks.customtypes.{TypoLocalDateTime, TypoUUID, TypoXml} +import adventureworks.customtypes.{TypoLocalDateTime, TypoShort, TypoUUID, TypoXml} import adventureworks.person.businessentity.{BusinessentityId, BusinessentityRepo, BusinessentityRepoImpl, BusinessentityRepoMock, BusinessentityRow} import adventureworks.person.emailaddress.{EmailaddressRepo, EmailaddressRepoImpl, EmailaddressRepoMock, EmailaddressRow} import adventureworks.person.person.{PersonRepo, PersonRepoImpl, PersonRepoMock, PersonRow} @@ -31,6 +31,12 @@ class CompositeIdsTest extends AnyFunSuite with TypeCheckedTripleEquals { val productSubcategory = testInsert.productionProductsubcategory(productCategory.productcategoryid) val productModel = testInsert.productionProductmodel(catalogdescription = Some(new TypoXml("")), instructions = Some(new TypoXml(""))) val product = testInsert.productionProduct( + safetystocklevel = TypoShort(1), + reorderpoint = TypoShort(1), + standardcost = BigDecimal(1), + listprice = BigDecimal(1), + daystomanufacture = 10, + sellstartdate = TypoLocalDateTime.now, sizeunitmeasurecode = Some(unitmeasure.unitmeasurecode), weightunitmeasurecode = Some(unitmeasure.unitmeasurecode), `class` = Some("H "), @@ -40,9 +46,9 @@ class CompositeIdsTest extends AnyFunSuite with TypeCheckedTripleEquals { ) val now = TypoLocalDateTime.now - val ph1 = testInsert.productionProductcosthistory(product.productid, startdate = now, enddate = Some(now.map(_.plusDays(1)))) - val ph2 = testInsert.productionProductcosthistory(product.productid, startdate = now.map(_.plusDays(1)), enddate = Some(now.map(_.plusDays(2)))) - val ph3 = testInsert.productionProductcosthistory(product.productid, startdate = now.map(_.plusDays(2)), enddate = Some(now.map(_.plusDays(3)))) + val ph1 = testInsert.productionProductcosthistory(product.productid, standardcost = BigDecimal(1), startdate = now, enddate = Some(now.map(_.plusDays(1)))) + val ph2 = testInsert.productionProductcosthistory(product.productid, standardcost = BigDecimal(1), startdate = now.map(_.plusDays(1)), enddate = Some(now.map(_.plusDays(2)))) + val ph3 = testInsert.productionProductcosthistory(product.productid, standardcost = BigDecimal(1), startdate = now.map(_.plusDays(2)), enddate = Some(now.map(_.plusDays(3)))) List(ph1.compositeId, ph2.compositeId, ph3.compositeId) foreach println val wanted = Array(ph1.compositeId, ph2.compositeId, ph3.compositeId.copy(productid = ProductId(9999))) diff --git a/typo-tester-anorm/src/scala/adventureworks/production/product/ProductTest.scala b/typo-tester-anorm/src/scala/adventureworks/production/product/ProductTest.scala index 32b9a94c27..890088971b 100644 --- a/typo-tester-anorm/src/scala/adventureworks/production/product/ProductTest.scala +++ b/typo-tester-anorm/src/scala/adventureworks/production/product/ProductTest.scala @@ -33,6 +33,12 @@ class ProductTest extends AnyFunSuite with TypeCheckedTripleEquals { val productSubcategory = testInsert.productionProductsubcategory(productCategory.productcategoryid) val productModel = testInsert.productionProductmodel(catalogdescription = Some(new TypoXml("")), instructions = Some(new TypoXml(""))) val product = testInsert.productionProduct( + safetystocklevel = TypoShort(1), + reorderpoint = TypoShort(1), + standardcost = BigDecimal(1), + listprice = BigDecimal(1), + daystomanufacture = 10, + sellstartdate = TypoLocalDateTime.now, sizeunitmeasurecode = Some(unitmeasure.unitmeasurecode), weightunitmeasurecode = Some(unitmeasure.unitmeasurecode), `class` = Some("H "), diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala index 63392d2c4b..179b76cb64 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala @@ -31,6 +31,7 @@ case class DepartmentRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = departmentid def toUnsavedRow(departmentid: Defaulted[DepartmentId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): DepartmentRowUnsaved = DepartmentRowUnsaved(name, groupname, departmentid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala index f67cbc3b52..5b20dee8c4 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala @@ -69,6 +69,7 @@ case class EmployeeRow( Default: '/'::character varying */ organizationnode: Option[String] ){ + val id = businessentityid def toUnsavedRow(salariedflag: Defaulted[Flag] = Defaulted.Provided(this.salariedflag), vacationhours: Defaulted[TypoShort] = Defaulted.Provided(this.vacationhours), sickleavehours: Defaulted[TypoShort] = Defaulted.Provided(this.sickleavehours), currentflag: Defaulted[Flag] = Defaulted.Provided(this.currentflag), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate), organizationnode: Defaulted[Option[String]] = Defaulted.Provided(this.organizationnode)): EmployeeRowUnsaved = EmployeeRowUnsaved(businessentityid, nationalidnumber, loginid, jobtitle, birthdate, maritalstatus, gender, hiredate, salariedflag, vacationhours, sickleavehours, currentflag, rowguid, modifieddate, organizationnode) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala index 679f45a384..bceb8fcb34 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala @@ -15,7 +15,12 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `humanresources.employeedepartmenthistory` */ -case class EmployeedepartmenthistoryId(businessentityid: BusinessentityId, startdate: TypoLocalDate, departmentid: DepartmentId, shiftid: ShiftId) +case class EmployeedepartmenthistoryId( + businessentityid: BusinessentityId, + startdate: TypoLocalDate, + departmentid: DepartmentId, + shiftid: ShiftId +) object EmployeedepartmenthistoryId { implicit lazy val decoder: Decoder[EmployeedepartmenthistoryId] = Decoder.forProduct4[EmployeedepartmenthistoryId, BusinessentityId, TypoLocalDate, DepartmentId, ShiftId]("businessentityid", "startdate", "departmentid", "shiftid")(EmployeedepartmenthistoryId.apply)(BusinessentityId.decoder, TypoLocalDate.decoder, DepartmentId.decoder, ShiftId.decoder) implicit lazy val encoder: Encoder[EmployeedepartmenthistoryId] = Encoder.forProduct4[EmployeedepartmenthistoryId, BusinessentityId, TypoLocalDate, DepartmentId, ShiftId]("businessentityid", "startdate", "departmentid", "shiftid")(x => (x.businessentityid, x.startdate, x.departmentid, x.shiftid))(BusinessentityId.encoder, TypoLocalDate.encoder, DepartmentId.encoder, ShiftId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala index 4653029830..84bceb6f11 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala @@ -43,6 +43,7 @@ case class EmployeedepartmenthistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: EmployeedepartmenthistoryId = EmployeedepartmenthistoryId(businessentityid, startdate, departmentid, shiftid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): EmployeedepartmenthistoryRowUnsaved = EmployeedepartmenthistoryRowUnsaved(businessentityid, departmentid, shiftid, startdate, enddate, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala index da1266ea7c..014349ebd7 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `humanresources.employeepayhistory` */ -case class EmployeepayhistoryId(businessentityid: BusinessentityId, ratechangedate: TypoLocalDateTime) +case class EmployeepayhistoryId( + businessentityid: BusinessentityId, + ratechangedate: TypoLocalDateTime +) object EmployeepayhistoryId { implicit lazy val decoder: Decoder[EmployeepayhistoryId] = Decoder.forProduct2[EmployeepayhistoryId, BusinessentityId, TypoLocalDateTime]("businessentityid", "ratechangedate")(EmployeepayhistoryId.apply)(BusinessentityId.decoder, TypoLocalDateTime.decoder) implicit lazy val encoder: Encoder[EmployeepayhistoryId] = Encoder.forProduct2[EmployeepayhistoryId, BusinessentityId, TypoLocalDateTime]("businessentityid", "ratechangedate")(x => (x.businessentityid, x.ratechangedate))(BusinessentityId.encoder, TypoLocalDateTime.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala index 0072b1d913..9aee5dc5e0 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala @@ -38,6 +38,7 @@ case class EmployeepayhistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: EmployeepayhistoryId = EmployeepayhistoryId(businessentityid, ratechangedate) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): EmployeepayhistoryRowUnsaved = EmployeepayhistoryRowUnsaved(businessentityid, ratechangedate, rate, payfrequency, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala index 5f105583b2..7ac24bdf9c 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala @@ -33,6 +33,7 @@ case class JobcandidateRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = jobcandidateid def toUnsavedRow(jobcandidateid: Defaulted[JobcandidateId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): JobcandidateRowUnsaved = JobcandidateRowUnsaved(businessentityid, resume, jobcandidateid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala index 4bc26bdc0a..62f47349bd 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala @@ -34,6 +34,7 @@ case class ShiftRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = shiftid def toUnsavedRow(shiftid: Defaulted[ShiftId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ShiftRowUnsaved = ShiftRowUnsaved(name, starttime, endtime, shiftid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/address/AddressRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/address/AddressRow.scala index aa09765cd8..a9b561f1f0 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/address/AddressRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/address/AddressRow.scala @@ -45,6 +45,7 @@ case class AddressRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = addressid def toUnsavedRow(addressid: Defaulted[AddressId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): AddressRowUnsaved = AddressRowUnsaved(addressline1, addressline2, city, stateprovinceid, postalcode, spatiallocation, addressid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala index 1ba117a633..5b299747b8 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala @@ -32,6 +32,7 @@ case class AddresstypeRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = addresstypeid def toUnsavedRow(addresstypeid: Defaulted[AddresstypeId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): AddresstypeRowUnsaved = AddresstypeRowUnsaved(name, addresstypeid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala index f059310767..c85943b51b 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala @@ -29,6 +29,7 @@ case class BusinessentityRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(businessentityid: Defaulted[BusinessentityId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BusinessentityRowUnsaved = BusinessentityRowUnsaved(businessentityid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala index 66cdb7c8f3..2309815e78 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala @@ -14,7 +14,11 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `person.businessentityaddress` */ -case class BusinessentityaddressId(businessentityid: BusinessentityId, addressid: AddressId, addresstypeid: AddresstypeId) +case class BusinessentityaddressId( + businessentityid: BusinessentityId, + addressid: AddressId, + addresstypeid: AddresstypeId +) object BusinessentityaddressId { implicit lazy val decoder: Decoder[BusinessentityaddressId] = Decoder.forProduct3[BusinessentityaddressId, BusinessentityId, AddressId, AddresstypeId]("businessentityid", "addressid", "addresstypeid")(BusinessentityaddressId.apply)(BusinessentityId.decoder, AddressId.decoder, AddresstypeId.decoder) implicit lazy val encoder: Encoder[BusinessentityaddressId] = Encoder.forProduct3[BusinessentityaddressId, BusinessentityId, AddressId, AddresstypeId]("businessentityid", "addressid", "addresstypeid")(x => (x.businessentityid, x.addressid, x.addresstypeid))(BusinessentityId.encoder, AddressId.encoder, AddresstypeId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala index e906f73995..bc0366f0c9 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala @@ -39,6 +39,7 @@ case class BusinessentityaddressRow( modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentityaddressId = BusinessentityaddressId(businessentityid, addressid, addresstypeid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BusinessentityaddressRowUnsaved = BusinessentityaddressRowUnsaved(businessentityid, addressid, addresstypeid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala index 2331264aa9..6f2d52409d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala @@ -13,7 +13,11 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `person.businessentitycontact` */ -case class BusinessentitycontactId(businessentityid: BusinessentityId, personid: BusinessentityId, contacttypeid: ContacttypeId) +case class BusinessentitycontactId( + businessentityid: BusinessentityId, + personid: BusinessentityId, + contacttypeid: ContacttypeId +) object BusinessentitycontactId { implicit lazy val decoder: Decoder[BusinessentitycontactId] = Decoder.forProduct3[BusinessentitycontactId, BusinessentityId, BusinessentityId, ContacttypeId]("businessentityid", "personid", "contacttypeid")(BusinessentitycontactId.apply)(BusinessentityId.decoder, BusinessentityId.decoder, ContacttypeId.decoder) implicit lazy val encoder: Encoder[BusinessentitycontactId] = Encoder.forProduct3[BusinessentitycontactId, BusinessentityId, BusinessentityId, ContacttypeId]("businessentityid", "personid", "contacttypeid")(x => (x.businessentityid, x.personid, x.contacttypeid))(BusinessentityId.encoder, BusinessentityId.encoder, ContacttypeId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala index a476b3f5cd..d1abcff4c9 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala @@ -38,6 +38,7 @@ case class BusinessentitycontactRow( modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentitycontactId = BusinessentitycontactId(businessentityid, personid, contacttypeid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BusinessentitycontactRowUnsaved = BusinessentitycontactRowUnsaved(businessentityid, personid, contacttypeid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala index 9a17e823c5..a834a834db 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala @@ -29,6 +29,7 @@ case class ContacttypeRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = contacttypeid def toUnsavedRow(contacttypeid: Defaulted[ContacttypeId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ContacttypeRowUnsaved = ContacttypeRowUnsaved(name, contacttypeid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala index 649f50fc38..0a640016bc 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala @@ -28,6 +28,7 @@ case class CountryregionRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = countryregioncode def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CountryregionRowUnsaved = CountryregionRowUnsaved(countryregioncode, name, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala index 7e6740d98d..4af0cf0e15 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala @@ -12,7 +12,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `person.emailaddress` */ -case class EmailaddressId(businessentityid: BusinessentityId, emailaddressid: Int) +case class EmailaddressId( + businessentityid: BusinessentityId, + emailaddressid: Int +) object EmailaddressId { implicit lazy val decoder: Decoder[EmailaddressId] = Decoder.forProduct2[EmailaddressId, BusinessentityId, Int]("businessentityid", "emailaddressid")(EmailaddressId.apply)(BusinessentityId.decoder, Decoder.decodeInt) implicit lazy val encoder: Encoder[EmailaddressId] = Encoder.forProduct2[EmailaddressId, BusinessentityId, Int]("businessentityid", "emailaddressid")(x => (x.businessentityid, x.emailaddressid))(BusinessentityId.encoder, Encoder.encodeInt) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala index d3800f04c3..37f5c3206f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala @@ -37,6 +37,7 @@ case class EmailaddressRow( modifieddate: TypoLocalDateTime ){ val compositeId: EmailaddressId = EmailaddressId(businessentityid, emailaddressid) + val id = compositeId def toUnsavedRow(emailaddressid: Defaulted[Int], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): EmailaddressRowUnsaved = EmailaddressRowUnsaved(businessentityid, emailaddress, emailaddressid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala index c39a3ac7a7..20603b218d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala @@ -34,6 +34,7 @@ case class PasswordRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PasswordRowUnsaved = PasswordRowUnsaved(businessentityid, passwordhash, passwordsalt, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRow.scala index 7190f92118..77761b2782 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRow.scala @@ -59,6 +59,7 @@ case class PersonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(namestyle: Defaulted[NameStyle] = Defaulted.Provided(this.namestyle), emailpromotion: Defaulted[Int] = Defaulted.Provided(this.emailpromotion), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PersonRowUnsaved = PersonRowUnsaved(businessentityid, persontype, title, firstname, middlename, lastname, suffix, additionalcontactinfo, demographics, namestyle, emailpromotion, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala index 49a16e2ce7..bd1ccdf836 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala @@ -14,7 +14,11 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `person.personphone` */ -case class PersonphoneId(businessentityid: BusinessentityId, phonenumber: Phone, phonenumbertypeid: PhonenumbertypeId) +case class PersonphoneId( + businessentityid: BusinessentityId, + phonenumber: Phone, + phonenumbertypeid: PhonenumbertypeId +) object PersonphoneId { implicit lazy val decoder: Decoder[PersonphoneId] = Decoder.forProduct3[PersonphoneId, BusinessentityId, Phone, PhonenumbertypeId]("businessentityid", "phonenumber", "phonenumbertypeid")(PersonphoneId.apply)(BusinessentityId.decoder, Phone.decoder, PhonenumbertypeId.decoder) implicit lazy val encoder: Encoder[PersonphoneId] = Encoder.forProduct3[PersonphoneId, BusinessentityId, Phone, PhonenumbertypeId]("businessentityid", "phonenumber", "phonenumbertypeid")(x => (x.businessentityid, x.phonenumber, x.phonenumbertypeid))(BusinessentityId.encoder, Phone.encoder, PhonenumbertypeId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala index 7eb6fc42e6..e642cdbc73 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala @@ -35,6 +35,7 @@ case class PersonphoneRow( modifieddate: TypoLocalDateTime ){ val compositeId: PersonphoneId = PersonphoneId(businessentityid, phonenumber, phonenumbertypeid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PersonphoneRowUnsaved = PersonphoneRowUnsaved(businessentityid, phonenumber, phonenumbertypeid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala index 52a21a68e9..31373d96fc 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala @@ -29,6 +29,7 @@ case class PhonenumbertypeRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = phonenumbertypeid def toUnsavedRow(phonenumbertypeid: Defaulted[PhonenumbertypeId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PhonenumbertypeRowUnsaved = PhonenumbertypeRowUnsaved(name, phonenumbertypeid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala index c1be708564..de4c2f3189 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala @@ -47,6 +47,7 @@ case class StateprovinceRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = stateprovinceid def toUnsavedRow(stateprovinceid: Defaulted[StateprovinceId], isonlystateprovinceflag: Defaulted[Flag] = Defaulted.Provided(this.isonlystateprovinceflag), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): StateprovinceRowUnsaved = StateprovinceRowUnsaved(stateprovincecode, countryregioncode, name, territoryid, stateprovinceid, isonlystateprovinceflag, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala index 344a3bd2ce..e8429d3abf 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala @@ -57,6 +57,7 @@ case class BillofmaterialsRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = billofmaterialsid def toUnsavedRow(billofmaterialsid: Defaulted[Int], startdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.startdate), perassemblyqty: Defaulted[BigDecimal] = Defaulted.Provided(this.perassemblyqty), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BillofmaterialsRowUnsaved = BillofmaterialsRowUnsaved(productassemblyid, componentid, enddate, unitmeasurecode, bomlevel, billofmaterialsid, startdate, perassemblyqty, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala index bd4521557e..0849fe0607 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala @@ -28,6 +28,7 @@ case class CultureRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = cultureid def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CultureRowUnsaved = CultureRowUnsaved(cultureid, name, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala index b9110b59f5..8f15a5fcd7 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala @@ -59,6 +59,7 @@ case class DocumentRow( Default: '/'::character varying */ documentnode: DocumentId ){ + val id = documentnode def toUnsavedRow(documentnode: Defaulted[DocumentId], folderflag: Defaulted[Flag] = Defaulted.Provided(this.folderflag), changenumber: Defaulted[Int] = Defaulted.Provided(this.changenumber), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): DocumentRowUnsaved = DocumentRowUnsaved(title, owner, filename, fileextension, revision, status, documentsummary, document, folderflag, changenumber, rowguid, modifieddate, documentnode) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala index 5e715136dd..2587464740 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala @@ -29,6 +29,7 @@ case class IllustrationRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = illustrationid def toUnsavedRow(illustrationid: Defaulted[IllustrationId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): IllustrationRowUnsaved = IllustrationRowUnsaved(diagram, illustrationid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRow.scala index f039fd719a..efc3273e1f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRow.scala @@ -38,6 +38,7 @@ case class LocationRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = locationid def toUnsavedRow(locationid: Defaulted[LocationId], costrate: Defaulted[BigDecimal] = Defaulted.Provided(this.costrate), availability: Defaulted[BigDecimal] = Defaulted.Provided(this.availability), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): LocationRowUnsaved = LocationRowUnsaved(name, locationid, costrate, availability, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRow.scala index b99864ce7b..7ab660d0ec 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRow.scala @@ -101,6 +101,7 @@ case class ProductRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productid def toUnsavedRow(productid: Defaulted[ProductId], makeflag: Defaulted[Flag] = Defaulted.Provided(this.makeflag), finishedgoodsflag: Defaulted[Flag] = Defaulted.Provided(this.finishedgoodsflag), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductRowUnsaved = ProductRowUnsaved(name, productnumber, color, safetystocklevel, reorderpoint, standardcost, listprice, size, sizeunitmeasurecode, weightunitmeasurecode, weight, daystomanufacture, productline, `class`, style, productsubcategoryid, productmodelid, sellstartdate, sellenddate, discontinueddate, productid, makeflag, finishedgoodsflag, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala index 3d5b30e4df..1b79d0993f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala @@ -32,6 +32,7 @@ case class ProductcategoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productcategoryid def toUnsavedRow(productcategoryid: Defaulted[ProductcategoryId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductcategoryRowUnsaved = ProductcategoryRowUnsaved(name, productcategoryid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala index 2e58612260..857e50d97a 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `production.productcosthistory` */ -case class ProductcosthistoryId(productid: ProductId, startdate: TypoLocalDateTime) +case class ProductcosthistoryId( + productid: ProductId, + startdate: TypoLocalDateTime +) object ProductcosthistoryId { implicit lazy val decoder: Decoder[ProductcosthistoryId] = Decoder.forProduct2[ProductcosthistoryId, ProductId, TypoLocalDateTime]("productid", "startdate")(ProductcosthistoryId.apply)(ProductId.decoder, TypoLocalDateTime.decoder) implicit lazy val encoder: Encoder[ProductcosthistoryId] = Encoder.forProduct2[ProductcosthistoryId, ProductId, TypoLocalDateTime]("productid", "startdate")(x => (x.productid, x.startdate))(ProductId.encoder, TypoLocalDateTime.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala index 7fdb045824..92bfc4ff4d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala @@ -38,6 +38,7 @@ case class ProductcosthistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductcosthistoryId = ProductcosthistoryId(productid, startdate) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductcosthistoryRowUnsaved = ProductcosthistoryRowUnsaved(productid, startdate, enddate, standardcost, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala index 3c98dcf4cc..d6592e1811 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala @@ -32,6 +32,7 @@ case class ProductdescriptionRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productdescriptionid def toUnsavedRow(productdescriptionid: Defaulted[ProductdescriptionId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductdescriptionRowUnsaved = ProductdescriptionRowUnsaved(description, productdescriptionid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala index c585e2df70..c5b1c78535 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `production.productdocument` */ -case class ProductdocumentId(productid: ProductId, documentnode: DocumentId) +case class ProductdocumentId( + productid: ProductId, + documentnode: DocumentId +) object ProductdocumentId { implicit lazy val decoder: Decoder[ProductdocumentId] = Decoder.forProduct2[ProductdocumentId, ProductId, DocumentId]("productid", "documentnode")(ProductdocumentId.apply)(ProductId.decoder, DocumentId.decoder) implicit lazy val encoder: Encoder[ProductdocumentId] = Encoder.forProduct2[ProductdocumentId, ProductId, DocumentId]("productid", "documentnode")(x => (x.productid, x.documentnode))(ProductId.encoder, DocumentId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala index cbae8f850b..b81bec8c94 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala @@ -33,6 +33,7 @@ case class ProductdocumentRow( documentnode: DocumentId ){ val compositeId: ProductdocumentId = ProductdocumentId(productid, documentnode) + val id = compositeId def toUnsavedRow(documentnode: Defaulted[DocumentId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductdocumentRowUnsaved = ProductdocumentRowUnsaved(productid, modifieddate, documentnode) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala index 12049fcff1..fc964f3fc2 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `production.productinventory` */ -case class ProductinventoryId(productid: ProductId, locationid: LocationId) +case class ProductinventoryId( + productid: ProductId, + locationid: LocationId +) object ProductinventoryId { implicit lazy val decoder: Decoder[ProductinventoryId] = Decoder.forProduct2[ProductinventoryId, ProductId, LocationId]("productid", "locationid")(ProductinventoryId.apply)(ProductId.decoder, LocationId.decoder) implicit lazy val encoder: Encoder[ProductinventoryId] = Encoder.forProduct2[ProductinventoryId, ProductId, LocationId]("productid", "locationid")(x => (x.productid, x.locationid))(ProductId.encoder, LocationId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala index 9e063d6ba8..193540dcfc 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala @@ -45,6 +45,7 @@ case class ProductinventoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductinventoryId = ProductinventoryId(productid, locationid) + val id = compositeId def toUnsavedRow(quantity: Defaulted[TypoShort] = Defaulted.Provided(this.quantity), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductinventoryRowUnsaved = ProductinventoryRowUnsaved(productid, locationid, shelf, bin, quantity, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala index d0e523f3d1..b0412f3d60 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `production.productlistpricehistory` */ -case class ProductlistpricehistoryId(productid: ProductId, startdate: TypoLocalDateTime) +case class ProductlistpricehistoryId( + productid: ProductId, + startdate: TypoLocalDateTime +) object ProductlistpricehistoryId { implicit lazy val decoder: Decoder[ProductlistpricehistoryId] = Decoder.forProduct2[ProductlistpricehistoryId, ProductId, TypoLocalDateTime]("productid", "startdate")(ProductlistpricehistoryId.apply)(ProductId.decoder, TypoLocalDateTime.decoder) implicit lazy val encoder: Encoder[ProductlistpricehistoryId] = Encoder.forProduct2[ProductlistpricehistoryId, ProductId, TypoLocalDateTime]("productid", "startdate")(x => (x.productid, x.startdate))(ProductId.encoder, TypoLocalDateTime.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala index 12549f98b7..e8061f6d46 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala @@ -38,6 +38,7 @@ case class ProductlistpricehistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductlistpricehistoryId = ProductlistpricehistoryId(productid, startdate) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductlistpricehistoryRowUnsaved = ProductlistpricehistoryRowUnsaved(productid, startdate, enddate, listprice, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala index 0a51786e93..6efd3c5128 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala @@ -37,6 +37,7 @@ case class ProductmodelRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productmodelid def toUnsavedRow(productmodelid: Defaulted[ProductmodelId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductmodelRowUnsaved = ProductmodelRowUnsaved(name, catalogdescription, instructions, productmodelid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala index b98cde9d4b..0fdb081762 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `production.productmodelillustration` */ -case class ProductmodelillustrationId(productmodelid: ProductmodelId, illustrationid: IllustrationId) +case class ProductmodelillustrationId( + productmodelid: ProductmodelId, + illustrationid: IllustrationId +) object ProductmodelillustrationId { implicit lazy val decoder: Decoder[ProductmodelillustrationId] = Decoder.forProduct2[ProductmodelillustrationId, ProductmodelId, IllustrationId]("productmodelid", "illustrationid")(ProductmodelillustrationId.apply)(ProductmodelId.decoder, IllustrationId.decoder) implicit lazy val encoder: Encoder[ProductmodelillustrationId] = Encoder.forProduct2[ProductmodelillustrationId, ProductmodelId, IllustrationId]("productmodelid", "illustrationid")(x => (x.productmodelid, x.illustrationid))(ProductmodelId.encoder, IllustrationId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala index 6df7a4fd7c..882805de7a 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala @@ -32,6 +32,7 @@ case class ProductmodelillustrationRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelillustrationId = ProductmodelillustrationId(productmodelid, illustrationid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductmodelillustrationRowUnsaved = ProductmodelillustrationRowUnsaved(productmodelid, illustrationid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala index 232c2a6e7f..82aba2a970 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala @@ -14,7 +14,11 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `production.productmodelproductdescriptionculture` */ -case class ProductmodelproductdescriptioncultureId(productmodelid: ProductmodelId, productdescriptionid: ProductdescriptionId, cultureid: CultureId) +case class ProductmodelproductdescriptioncultureId( + productmodelid: ProductmodelId, + productdescriptionid: ProductdescriptionId, + cultureid: CultureId +) object ProductmodelproductdescriptioncultureId { implicit lazy val decoder: Decoder[ProductmodelproductdescriptioncultureId] = Decoder.forProduct3[ProductmodelproductdescriptioncultureId, ProductmodelId, ProductdescriptionId, CultureId]("productmodelid", "productdescriptionid", "cultureid")(ProductmodelproductdescriptioncultureId.apply)(ProductmodelId.decoder, ProductdescriptionId.decoder, CultureId.decoder) implicit lazy val encoder: Encoder[ProductmodelproductdescriptioncultureId] = Encoder.forProduct3[ProductmodelproductdescriptioncultureId, ProductmodelId, ProductdescriptionId, CultureId]("productmodelid", "productdescriptionid", "cultureid")(x => (x.productmodelid, x.productdescriptionid, x.cultureid))(ProductmodelId.encoder, ProductdescriptionId.encoder, CultureId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala index dda656f6bd..61ae5c5b9a 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala @@ -36,6 +36,7 @@ case class ProductmodelproductdescriptioncultureRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelproductdescriptioncultureId = ProductmodelproductdescriptioncultureId(productmodelid, productdescriptionid, cultureid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductmodelproductdescriptioncultureRowUnsaved = ProductmodelproductdescriptioncultureRowUnsaved(productmodelid, productdescriptionid, cultureid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala index b694b17161..f15fce4818 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala @@ -36,6 +36,7 @@ case class ProductphotoRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productphotoid def toUnsavedRow(productphotoid: Defaulted[ProductphotoId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductphotoRowUnsaved = ProductphotoRowUnsaved(thumbnailphoto, thumbnailphotofilename, largephoto, largephotofilename, productphotoid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala index 7e14546845..a718e06d7f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `production.productproductphoto` */ -case class ProductproductphotoId(productid: ProductId, productphotoid: ProductphotoId) +case class ProductproductphotoId( + productid: ProductId, + productphotoid: ProductphotoId +) object ProductproductphotoId { implicit lazy val decoder: Decoder[ProductproductphotoId] = Decoder.forProduct2[ProductproductphotoId, ProductId, ProductphotoId]("productid", "productphotoid")(ProductproductphotoId.apply)(ProductId.decoder, ProductphotoId.decoder) implicit lazy val encoder: Encoder[ProductproductphotoId] = Encoder.forProduct2[ProductproductphotoId, ProductId, ProductphotoId]("productid", "productphotoid")(x => (x.productid, x.productphotoid))(ProductId.encoder, ProductphotoId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala index 5993a66ce6..682bb79a80 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala @@ -36,6 +36,7 @@ case class ProductproductphotoRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductproductphotoId = ProductproductphotoId(productid, productphotoid) + val id = compositeId def toUnsavedRow(primary: Defaulted[Flag] = Defaulted.Provided(this.primary), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductproductphotoRowUnsaved = ProductproductphotoRowUnsaved(productid, productphotoid, primary, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala index 6153035382..990385733c 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala @@ -44,6 +44,7 @@ case class ProductreviewRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productreviewid def toUnsavedRow(productreviewid: Defaulted[ProductreviewId], reviewdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.reviewdate), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductreviewRowUnsaved = ProductreviewRowUnsaved(productid, reviewername, emailaddress, rating, comments, productreviewid, reviewdate, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala index b576ab950c..73c98d42ff 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala @@ -36,6 +36,7 @@ case class ProductsubcategoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productsubcategoryid def toUnsavedRow(productsubcategoryid: Defaulted[ProductsubcategoryId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductsubcategoryRowUnsaved = ProductsubcategoryRowUnsaved(productcategoryid, name, productsubcategoryid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala index 689b97d347..bed5313007 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala @@ -29,6 +29,7 @@ case class ScrapreasonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = scrapreasonid def toUnsavedRow(scrapreasonid: Defaulted[ScrapreasonId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ScrapreasonRowUnsaved = ScrapreasonRowUnsaved(name, scrapreasonid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala index 5e02e50971..c33f249610 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala @@ -46,6 +46,7 @@ case class TransactionhistoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = transactionid def toUnsavedRow(transactionid: Defaulted[TransactionhistoryId], referenceorderlineid: Defaulted[Int] = Defaulted.Provided(this.referenceorderlineid), transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.transactiondate), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): TransactionhistoryRowUnsaved = TransactionhistoryRowUnsaved(productid, referenceorderid, transactiontype, quantity, actualcost, transactionid, referenceorderlineid, transactiondate, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala index eb1130f4a3..a468b213a5 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala @@ -43,6 +43,7 @@ case class TransactionhistoryarchiveRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = transactionid def toUnsavedRow(referenceorderlineid: Defaulted[Int] = Defaulted.Provided(this.referenceorderlineid), transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.transactiondate), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): TransactionhistoryarchiveRowUnsaved = TransactionhistoryarchiveRowUnsaved(transactionid, productid, referenceorderid, transactiontype, quantity, actualcost, referenceorderlineid, transactiondate, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala index 2ba75d1c83..334faa1a85 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala @@ -28,6 +28,7 @@ case class UnitmeasureRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = unitmeasurecode def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): UnitmeasureRowUnsaved = UnitmeasureRowUnsaved(unitmeasurecode, name, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala index bc201d2b77..8507457113 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala @@ -50,6 +50,7 @@ case class WorkorderRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = workorderid def toUnsavedRow(workorderid: Defaulted[WorkorderId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): WorkorderRowUnsaved = WorkorderRowUnsaved(productid, orderqty, scrappedqty, startdate, enddate, duedate, scrapreasonid, workorderid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala index dafc9b697e..8e7dae8527 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala @@ -13,7 +13,11 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `production.workorderrouting` */ -case class WorkorderroutingId(workorderid: WorkorderId, productid: Int, operationsequence: TypoShort) +case class WorkorderroutingId( + workorderid: WorkorderId, + productid: Int, + operationsequence: TypoShort +) object WorkorderroutingId { implicit lazy val decoder: Decoder[WorkorderroutingId] = Decoder.forProduct3[WorkorderroutingId, WorkorderId, Int, TypoShort]("workorderid", "productid", "operationsequence")(WorkorderroutingId.apply)(WorkorderId.decoder, Decoder.decodeInt, TypoShort.decoder) implicit lazy val encoder: Encoder[WorkorderroutingId] = Encoder.forProduct3[WorkorderroutingId, WorkorderId, Int, TypoShort]("workorderid", "productid", "operationsequence")(x => (x.workorderid, x.productid, x.operationsequence))(WorkorderId.encoder, Encoder.encodeInt, TypoShort.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala index 796f479599..10de940063 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala @@ -59,6 +59,7 @@ case class WorkorderroutingRow( modifieddate: TypoLocalDateTime ){ val compositeId: WorkorderroutingId = WorkorderroutingId(workorderid, productid, operationsequence) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): WorkorderroutingRowUnsaved = WorkorderroutingRowUnsaved(workorderid, productid, operationsequence, locationid, scheduledstartdate, scheduledenddate, actualstartdate, actualenddate, actualresourcehrs, plannedcost, actualcost, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala index d949becae5..ef4a9ae41d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala @@ -11,7 +11,12 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `public.flaff` */ -case class FlaffId(code: ShortText, anotherCode: /* max 20 chars */ String, someNumber: Int, specifier: ShortText) +case class FlaffId( + code: ShortText, + anotherCode: /* max 20 chars */ String, + someNumber: Int, + specifier: ShortText +) object FlaffId { implicit lazy val decoder: Decoder[FlaffId] = Decoder.forProduct4[FlaffId, ShortText, /* max 20 chars */ String, Int, ShortText]("code", "another_code", "some_number", "specifier")(FlaffId.apply)(ShortText.decoder, Decoder.decodeString, Decoder.decodeInt, ShortText.decoder) implicit lazy val encoder: Encoder[FlaffId] = Encoder.forProduct4[FlaffId, ShortText, /* max 20 chars */ String, Int, ShortText]("code", "another_code", "some_number", "specifier")(x => (x.code, x.anotherCode, x.someNumber, x.specifier))(ShortText.encoder, Encoder.encodeString, Encoder.encodeInt, ShortText.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala index 24da59d61b..21172f45e1 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala @@ -29,6 +29,7 @@ case class FlaffRow( parentspecifier: Option[ShortText] ){ val compositeId: FlaffId = FlaffId(code, anotherCode, someNumber, specifier) + val id = compositeId } object FlaffRow { diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala index 6ae3d250a8..f3b51cef77 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala @@ -25,6 +25,7 @@ case class IdentityTestRow( defaultGenerated: Int, name: IdentityTestId ){ + val id = name def toUnsavedRow(defaultGenerated: Defaulted[Int] = Defaulted.Provided(this.defaultGenerated)): IdentityTestRowUnsaved = IdentityTestRowUnsaved(name, defaultGenerated) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/users/UsersRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/users/UsersRow.scala index de839dee07..6b7c7f5e2b 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/public/users/UsersRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/public/users/UsersRow.scala @@ -30,6 +30,7 @@ case class UsersRow( createdAt: TypoInstant, verifiedOn: Option[TypoInstant] ){ + val id = userId def toUnsavedRow(createdAt: Defaulted[TypoInstant] = Defaulted.Provided(this.createdAt)): UsersRowUnsaved = UsersRowUnsaved(userId, name, lastName, email, password, verifiedOn, createdAt) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala index 3ad071e6ef..49696b708f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `purchasing.productvendor` */ -case class ProductvendorId(productid: ProductId, businessentityid: BusinessentityId) +case class ProductvendorId( + productid: ProductId, + businessentityid: BusinessentityId +) object ProductvendorId { implicit lazy val decoder: Decoder[ProductvendorId] = Decoder.forProduct2[ProductvendorId, ProductId, BusinessentityId]("productid", "businessentityid")(ProductvendorId.apply)(ProductId.decoder, BusinessentityId.decoder) implicit lazy val encoder: Encoder[ProductvendorId] = Encoder.forProduct2[ProductvendorId, ProductId, BusinessentityId]("productid", "businessentityid")(x => (x.productid, x.businessentityid))(ProductId.encoder, BusinessentityId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala index a65492140e..7e7919972f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala @@ -57,6 +57,7 @@ case class ProductvendorRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductvendorId = ProductvendorId(productid, businessentityid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductvendorRowUnsaved = ProductvendorRowUnsaved(productid, businessentityid, averageleadtime, standardprice, lastreceiptcost, lastreceiptdate, minorderqty, maxorderqty, onorderqty, unitmeasurecode, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala index 7657b202d0..3cd970f989 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala @@ -12,7 +12,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `purchasing.purchaseorderdetail` */ -case class PurchaseorderdetailId(purchaseorderid: PurchaseorderheaderId, purchaseorderdetailid: Int) +case class PurchaseorderdetailId( + purchaseorderid: PurchaseorderheaderId, + purchaseorderdetailid: Int +) object PurchaseorderdetailId { implicit lazy val decoder: Decoder[PurchaseorderdetailId] = Decoder.forProduct2[PurchaseorderdetailId, PurchaseorderheaderId, Int]("purchaseorderid", "purchaseorderdetailid")(PurchaseorderdetailId.apply)(PurchaseorderheaderId.decoder, Decoder.decodeInt) implicit lazy val encoder: Encoder[PurchaseorderdetailId] = Encoder.forProduct2[PurchaseorderdetailId, PurchaseorderheaderId, Int]("purchaseorderid", "purchaseorderdetailid")(x => (x.purchaseorderid, x.purchaseorderdetailid))(PurchaseorderheaderId.encoder, Encoder.encodeInt) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala index df8169335d..a97e0fa6d8 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala @@ -51,6 +51,7 @@ case class PurchaseorderdetailRow( modifieddate: TypoLocalDateTime ){ val compositeId: PurchaseorderdetailId = PurchaseorderdetailId(purchaseorderid, purchaseorderdetailid) + val id = compositeId def toUnsavedRow(purchaseorderdetailid: Defaulted[Int], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PurchaseorderdetailRowUnsaved = PurchaseorderdetailRowUnsaved(purchaseorderid, duedate, orderqty, productid, unitprice, receivedqty, rejectedqty, purchaseorderdetailid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala index d3c5125114..df28d84b8a 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala @@ -65,6 +65,7 @@ case class PurchaseorderheaderRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = purchaseorderid def toUnsavedRow(purchaseorderid: Defaulted[PurchaseorderheaderId], revisionnumber: Defaulted[TypoShort] = Defaulted.Provided(this.revisionnumber), status: Defaulted[TypoShort] = Defaulted.Provided(this.status), orderdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.orderdate), subtotal: Defaulted[BigDecimal] = Defaulted.Provided(this.subtotal), taxamt: Defaulted[BigDecimal] = Defaulted.Provided(this.taxamt), freight: Defaulted[BigDecimal] = Defaulted.Provided(this.freight), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PurchaseorderheaderRowUnsaved = PurchaseorderheaderRowUnsaved(employeeid, vendorid, shipmethodid, shipdate, purchaseorderid, revisionnumber, status, orderdate, subtotal, taxamt, freight, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala index ef5fa9106f..df146d7da6 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala @@ -41,6 +41,7 @@ case class ShipmethodRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = shipmethodid def toUnsavedRow(shipmethodid: Defaulted[ShipmethodId], shipbase: Defaulted[BigDecimal] = Defaulted.Provided(this.shipbase), shiprate: Defaulted[BigDecimal] = Defaulted.Provided(this.shiprate), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ShipmethodRowUnsaved = ShipmethodRowUnsaved(name, shipmethodid, shipbase, shiprate, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala index 893bc76235..5cb3c9732e 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala @@ -47,6 +47,7 @@ case class VendorRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(preferredvendorstatus: Defaulted[Flag] = Defaulted.Provided(this.preferredvendorstatus), activeflag: Defaulted[Flag] = Defaulted.Provided(this.activeflag), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): VendorRowUnsaved = VendorRowUnsaved(businessentityid, accountnumber, name, creditrating, purchasingwebserviceurl, preferredvendorstatus, activeflag, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala index 24c1c8eca6..3deaefdb5d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `sales.countryregioncurrency` */ -case class CountryregioncurrencyId(countryregioncode: CountryregionId, currencycode: CurrencyId) +case class CountryregioncurrencyId( + countryregioncode: CountryregionId, + currencycode: CurrencyId +) object CountryregioncurrencyId { implicit lazy val decoder: Decoder[CountryregioncurrencyId] = Decoder.forProduct2[CountryregioncurrencyId, CountryregionId, CurrencyId]("countryregioncode", "currencycode")(CountryregioncurrencyId.apply)(CountryregionId.decoder, CurrencyId.decoder) implicit lazy val encoder: Encoder[CountryregioncurrencyId] = Encoder.forProduct2[CountryregioncurrencyId, CountryregionId, CurrencyId]("countryregioncode", "currencycode")(x => (x.countryregioncode, x.currencycode))(CountryregionId.encoder, CurrencyId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala index 5bf2156f38..dcd7215d4d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala @@ -32,6 +32,7 @@ case class CountryregioncurrencyRow( modifieddate: TypoLocalDateTime ){ val compositeId: CountryregioncurrencyId = CountryregioncurrencyId(countryregioncode, currencycode) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CountryregioncurrencyRowUnsaved = CountryregioncurrencyRowUnsaved(countryregioncode, currencycode, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala index bdbb21c667..60edaa9406 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala @@ -37,6 +37,7 @@ case class CreditcardRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = creditcardid def toUnsavedRow(creditcardid: Defaulted[/* user-picked */ CustomCreditcardId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CreditcardRowUnsaved = CreditcardRowUnsaved(cardtype, cardnumber, expmonth, expyear, creditcardid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala index 7c0dc48f43..286b6a7692 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala @@ -28,6 +28,7 @@ case class CurrencyRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = currencycode def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CurrencyRowUnsaved = CurrencyRowUnsaved(currencycode, name, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala index 1310040793..af99a66306 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala @@ -40,6 +40,7 @@ case class CurrencyrateRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = currencyrateid def toUnsavedRow(currencyrateid: Defaulted[CurrencyrateId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CurrencyrateRowUnsaved = CurrencyrateRowUnsaved(currencyratedate, fromcurrencycode, tocurrencycode, averagerate, endofdayrate, currencyrateid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala index f567c156d1..fa1714e210 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala @@ -40,6 +40,7 @@ case class CustomerRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = customerid def toUnsavedRow(customerid: Defaulted[CustomerId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CustomerRowUnsaved = CustomerRowUnsaved(personid, storeid, territoryid, customerid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala index 26e3c85f18..f0e0e31dd2 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `sales.personcreditcard` */ -case class PersoncreditcardId(businessentityid: BusinessentityId, creditcardid: /* user-picked */ CustomCreditcardId) +case class PersoncreditcardId( + businessentityid: BusinessentityId, + creditcardid: /* user-picked */ CustomCreditcardId +) object PersoncreditcardId { implicit lazy val decoder: Decoder[PersoncreditcardId] = Decoder.forProduct2[PersoncreditcardId, BusinessentityId, /* user-picked */ CustomCreditcardId]("businessentityid", "creditcardid")(PersoncreditcardId.apply)(BusinessentityId.decoder, CustomCreditcardId.decoder) implicit lazy val encoder: Encoder[PersoncreditcardId] = Encoder.forProduct2[PersoncreditcardId, BusinessentityId, /* user-picked */ CustomCreditcardId]("businessentityid", "creditcardid")(x => (x.businessentityid, x.creditcardid))(BusinessentityId.encoder, CustomCreditcardId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala index 43b5361520..21c36be43c 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala @@ -32,6 +32,7 @@ case class PersoncreditcardRow( modifieddate: TypoLocalDateTime ){ val compositeId: PersoncreditcardId = PersoncreditcardId(businessentityid, creditcardid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PersoncreditcardRowUnsaved = PersoncreditcardRowUnsaved(businessentityid, creditcardid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala index 18accf85f1..3fcb8ce6f1 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala @@ -16,6 +16,7 @@ import adventureworks.sales.salesorderheader.SalesorderheaderId import adventureworks.sales.salesorderheader.SalesorderheaderRow import adventureworks.sales.specialoffer.SpecialofferId import adventureworks.sales.specialofferproduct.SpecialofferproductFields +import adventureworks.sales.specialofferproduct.SpecialofferproductId import adventureworks.sales.specialofferproduct.SpecialofferproductRow import typo.dsl.ForeignKey import typo.dsl.Path @@ -52,6 +53,11 @@ trait SalesorderdetailFields { def compositeIdIn(compositeIds: Array[SalesorderdetailId]): SqlExpr[Boolean, Required] = new CompositeIn(compositeIds)(TuplePart(salesorderid)(_.salesorderid), TuplePart(salesorderdetailid)(_.salesorderdetailid)) + def extractSpecialofferproductIdIs(id: SpecialofferproductId): SqlExpr[Boolean, Required] = + specialofferid.isEqual(id.specialofferid).and(productid.isEqual(id.productid)) + def extractSpecialofferproductIdIn(ids: Array[SpecialofferproductId]): SqlExpr[Boolean, Required] = + new CompositeIn(ids)(TuplePart(specialofferid)(_.specialofferid), TuplePart(productid)(_.productid)) + } object SalesorderdetailFields { diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala index 9878161936..64fc610136 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala @@ -12,7 +12,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `sales.salesorderdetail` */ -case class SalesorderdetailId(salesorderid: SalesorderheaderId, salesorderdetailid: Int) +case class SalesorderdetailId( + salesorderid: SalesorderheaderId, + salesorderdetailid: Int +) object SalesorderdetailId { implicit lazy val decoder: Decoder[SalesorderdetailId] = Decoder.forProduct2[SalesorderdetailId, SalesorderheaderId, Int]("salesorderid", "salesorderdetailid")(SalesorderdetailId.apply)(SalesorderheaderId.decoder, Decoder.decodeInt) implicit lazy val encoder: Encoder[SalesorderdetailId] = Encoder.forProduct2[SalesorderdetailId, SalesorderheaderId, Int]("salesorderid", "salesorderdetailid")(x => (x.salesorderid, x.salesorderdetailid))(SalesorderheaderId.encoder, Encoder.encodeInt) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala index 68fea0d446..01b271263e 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala @@ -14,6 +14,7 @@ import adventureworks.customtypes.TypoUUID import adventureworks.production.product.ProductId import adventureworks.sales.salesorderheader.SalesorderheaderId import adventureworks.sales.specialoffer.SpecialofferId +import adventureworks.sales.specialofferproduct.SpecialofferproductId import doobie.enumerated.Nullability import doobie.postgres.Text import doobie.util.Read @@ -56,6 +57,11 @@ case class SalesorderdetailRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderdetailId = SalesorderdetailId(salesorderid, salesorderdetailid) + val id = compositeId + val extractSpecialofferproductId: SpecialofferproductId = SpecialofferproductId( + specialofferid = specialofferid, + productid = productid + ) def toUnsavedRow(salesorderdetailid: Defaulted[Int], unitpricediscount: Defaulted[BigDecimal] = Defaulted.Provided(this.unitpricediscount), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesorderdetailRowUnsaved = SalesorderdetailRowUnsaved(salesorderid, carriertrackingnumber, orderqty, productid, specialofferid, unitprice, salesorderdetailid, unitpricediscount, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala index 9187c87089..4ff377276c 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala @@ -112,6 +112,7 @@ case class SalesorderheaderRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = salesorderid def toUnsavedRow(salesorderid: Defaulted[SalesorderheaderId], revisionnumber: Defaulted[TypoShort] = Defaulted.Provided(this.revisionnumber), orderdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.orderdate), status: Defaulted[TypoShort] = Defaulted.Provided(this.status), onlineorderflag: Defaulted[Flag] = Defaulted.Provided(this.onlineorderflag), subtotal: Defaulted[BigDecimal] = Defaulted.Provided(this.subtotal), taxamt: Defaulted[BigDecimal] = Defaulted.Provided(this.taxamt), freight: Defaulted[BigDecimal] = Defaulted.Provided(this.freight), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesorderheaderRowUnsaved = SalesorderheaderRowUnsaved(duedate, shipdate, purchaseordernumber, accountnumber, customerid, salespersonid, territoryid, billtoaddressid, shiptoaddressid, shipmethodid, creditcardid, creditcardapprovalcode, currencyrateid, totaldue, comment, salesorderid, revisionnumber, orderdate, status, onlineorderflag, subtotal, taxamt, freight, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala index fc77bbf475..fa0875b05d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `sales.salesorderheadersalesreason` */ -case class SalesorderheadersalesreasonId(salesorderid: SalesorderheaderId, salesreasonid: SalesreasonId) +case class SalesorderheadersalesreasonId( + salesorderid: SalesorderheaderId, + salesreasonid: SalesreasonId +) object SalesorderheadersalesreasonId { implicit lazy val decoder: Decoder[SalesorderheadersalesreasonId] = Decoder.forProduct2[SalesorderheadersalesreasonId, SalesorderheaderId, SalesreasonId]("salesorderid", "salesreasonid")(SalesorderheadersalesreasonId.apply)(SalesorderheaderId.decoder, SalesreasonId.decoder) implicit lazy val encoder: Encoder[SalesorderheadersalesreasonId] = Encoder.forProduct2[SalesorderheadersalesreasonId, SalesorderheaderId, SalesreasonId]("salesorderid", "salesreasonid")(x => (x.salesorderid, x.salesreasonid))(SalesorderheaderId.encoder, SalesreasonId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala index c75d1c8b69..e146435aaf 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala @@ -32,6 +32,7 @@ case class SalesorderheadersalesreasonRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderheadersalesreasonId = SalesorderheadersalesreasonId(salesorderid, salesreasonid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesorderheadersalesreasonRowUnsaved = SalesorderheadersalesreasonRowUnsaved(salesorderid, salesreasonid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala index 562530f518..fbbf538e5b 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala @@ -54,6 +54,7 @@ case class SalespersonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(bonus: Defaulted[BigDecimal] = Defaulted.Provided(this.bonus), commissionpct: Defaulted[BigDecimal] = Defaulted.Provided(this.commissionpct), salesytd: Defaulted[BigDecimal] = Defaulted.Provided(this.salesytd), saleslastyear: Defaulted[BigDecimal] = Defaulted.Provided(this.saleslastyear), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalespersonRowUnsaved = SalespersonRowUnsaved(businessentityid, territoryid, salesquota, bonus, commissionpct, salesytd, saleslastyear, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala index c2d3b88f16..374462c89b 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `sales.salespersonquotahistory` */ -case class SalespersonquotahistoryId(businessentityid: BusinessentityId, quotadate: TypoLocalDateTime) +case class SalespersonquotahistoryId( + businessentityid: BusinessentityId, + quotadate: TypoLocalDateTime +) object SalespersonquotahistoryId { implicit lazy val decoder: Decoder[SalespersonquotahistoryId] = Decoder.forProduct2[SalespersonquotahistoryId, BusinessentityId, TypoLocalDateTime]("businessentityid", "quotadate")(SalespersonquotahistoryId.apply)(BusinessentityId.decoder, TypoLocalDateTime.decoder) implicit lazy val encoder: Encoder[SalespersonquotahistoryId] = Encoder.forProduct2[SalespersonquotahistoryId, BusinessentityId, TypoLocalDateTime]("businessentityid", "quotadate")(x => (x.businessentityid, x.quotadate))(BusinessentityId.encoder, TypoLocalDateTime.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala index 0166bfd09f..77368f15e3 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala @@ -37,6 +37,7 @@ case class SalespersonquotahistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalespersonquotahistoryId = SalespersonquotahistoryId(businessentityid, quotadate) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalespersonquotahistoryRowUnsaved = SalespersonquotahistoryRowUnsaved(businessentityid, quotadate, salesquota, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala index e70f8e7e13..2dfbce4a65 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala @@ -31,6 +31,7 @@ case class SalesreasonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = salesreasonid def toUnsavedRow(salesreasonid: Defaulted[SalesreasonId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesreasonRowUnsaved = SalesreasonRowUnsaved(name, reasontype, salesreasonid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala index fb35411934..4a97ac9ace 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala @@ -44,6 +44,7 @@ case class SalestaxrateRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = salestaxrateid def toUnsavedRow(salestaxrateid: Defaulted[SalestaxrateId], taxrate: Defaulted[BigDecimal] = Defaulted.Provided(this.taxrate), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalestaxrateRowUnsaved = SalestaxrateRowUnsaved(stateprovinceid, taxtype, name, salestaxrateid, taxrate, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala index 2de5b3289c..773d8db4bb 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala @@ -55,6 +55,7 @@ case class SalesterritoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = territoryid def toUnsavedRow(territoryid: Defaulted[SalesterritoryId], salesytd: Defaulted[BigDecimal] = Defaulted.Provided(this.salesytd), saleslastyear: Defaulted[BigDecimal] = Defaulted.Provided(this.saleslastyear), costytd: Defaulted[BigDecimal] = Defaulted.Provided(this.costytd), costlastyear: Defaulted[BigDecimal] = Defaulted.Provided(this.costlastyear), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesterritoryRowUnsaved = SalesterritoryRowUnsaved(name, countryregioncode, group, territoryid, salesytd, saleslastyear, costytd, costlastyear, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala index 751f244482..3a68df211a 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala @@ -14,7 +14,11 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `sales.salesterritoryhistory` */ -case class SalesterritoryhistoryId(businessentityid: BusinessentityId, startdate: TypoLocalDateTime, territoryid: SalesterritoryId) +case class SalesterritoryhistoryId( + businessentityid: BusinessentityId, + startdate: TypoLocalDateTime, + territoryid: SalesterritoryId +) object SalesterritoryhistoryId { implicit lazy val decoder: Decoder[SalesterritoryhistoryId] = Decoder.forProduct3[SalesterritoryhistoryId, BusinessentityId, TypoLocalDateTime, SalesterritoryId]("businessentityid", "startdate", "territoryid")(SalesterritoryhistoryId.apply)(BusinessentityId.decoder, TypoLocalDateTime.decoder, SalesterritoryId.decoder) implicit lazy val encoder: Encoder[SalesterritoryhistoryId] = Encoder.forProduct3[SalesterritoryhistoryId, BusinessentityId, TypoLocalDateTime, SalesterritoryId]("businessentityid", "startdate", "territoryid")(x => (x.businessentityid, x.startdate, x.territoryid))(BusinessentityId.encoder, TypoLocalDateTime.encoder, SalesterritoryId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala index 173cecf32f..d6a7f7041c 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala @@ -41,6 +41,7 @@ case class SalesterritoryhistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalesterritoryhistoryId = SalesterritoryhistoryId(businessentityid, startdate, territoryid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesterritoryhistoryRowUnsaved = SalesterritoryhistoryRowUnsaved(businessentityid, territoryid, startdate, enddate, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala index 2c36c6e736..babc2abdb2 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala @@ -40,6 +40,7 @@ case class ShoppingcartitemRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = shoppingcartitemid def toUnsavedRow(shoppingcartitemid: Defaulted[ShoppingcartitemId], quantity: Defaulted[Int] = Defaulted.Provided(this.quantity), datecreated: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.datecreated), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ShoppingcartitemRowUnsaved = ShoppingcartitemRowUnsaved(shoppingcartid, productid, shoppingcartitemid, quantity, datecreated, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala index c1b5f1376c..9a07cb5764 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala @@ -53,6 +53,7 @@ case class SpecialofferRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = specialofferid def toUnsavedRow(specialofferid: Defaulted[SpecialofferId], discountpct: Defaulted[BigDecimal] = Defaulted.Provided(this.discountpct), minqty: Defaulted[Int] = Defaulted.Provided(this.minqty), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SpecialofferRowUnsaved = SpecialofferRowUnsaved(description, `type`, category, startdate, enddate, maxqty, specialofferid, discountpct, minqty, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala index 45d215849f..2488b211d9 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala @@ -13,7 +13,10 @@ import io.circe.Decoder import io.circe.Encoder /** Type for the composite primary key of table `sales.specialofferproduct` */ -case class SpecialofferproductId(specialofferid: SpecialofferId, productid: ProductId) +case class SpecialofferproductId( + specialofferid: SpecialofferId, + productid: ProductId +) object SpecialofferproductId { implicit lazy val decoder: Decoder[SpecialofferproductId] = Decoder.forProduct2[SpecialofferproductId, SpecialofferId, ProductId]("specialofferid", "productid")(SpecialofferproductId.apply)(SpecialofferId.decoder, ProductId.decoder) implicit lazy val encoder: Encoder[SpecialofferproductId] = Encoder.forProduct2[SpecialofferproductId, SpecialofferId, ProductId]("specialofferid", "productid")(x => (x.specialofferid, x.productid))(SpecialofferId.encoder, ProductId.encoder) diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala index 3099954c63..e4a8cdebea 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala @@ -35,6 +35,7 @@ case class SpecialofferproductRow( modifieddate: TypoLocalDateTime ){ val compositeId: SpecialofferproductId = SpecialofferproductId(specialofferid, productid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SpecialofferproductRowUnsaved = SpecialofferproductRowUnsaved(specialofferid, productid, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala index 51fa4c8c63..394479923a 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala @@ -39,6 +39,7 @@ case class StoreRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): StoreRowUnsaved = StoreRowUnsaved(businessentityid, name, salespersonid, demographics, rowguid, modifieddate) } diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/testInsert.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/testInsert.scala index 688d79a6a3..3c3da77c7c 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/testInsert.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/testInsert.scala @@ -286,6 +286,7 @@ import adventureworks.sales.specialoffer.SpecialofferId import adventureworks.sales.specialoffer.SpecialofferRepoImpl import adventureworks.sales.specialoffer.SpecialofferRow import adventureworks.sales.specialoffer.SpecialofferRowUnsaved +import adventureworks.sales.specialofferproduct.SpecialofferproductId import adventureworks.sales.specialofferproduct.SpecialofferproductRepoImpl import adventureworks.sales.specialofferproduct.SpecialofferproductRow import adventureworks.sales.specialofferproduct.SpecialofferproductRowUnsaved @@ -309,13 +310,13 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[DepartmentRow] = (new DepartmentRepoImpl).insert(new DepartmentRowUnsaved(name = name, groupname = groupname, departmentid = departmentid, modifieddate = modifieddate)) def humanresourcesEmployee(businessentityid: BusinessentityId, + birthdate: TypoLocalDate, + maritalstatus: /* bpchar, max 1 chars */ String, + gender: /* bpchar, max 1 chars */ String, + hiredate: TypoLocalDate, nationalidnumber: /* max 15 chars */ String = random.alphanumeric.take(15).mkString, loginid: /* max 256 chars */ String = random.alphanumeric.take(20).mkString, jobtitle: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, - birthdate: TypoLocalDate = TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong)), - maritalstatus: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, - gender: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, - hiredate: TypoLocalDate = TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong)), salariedflag: Defaulted[Flag] = Defaulted.UseDefault, vacationhours: Defaulted[TypoShort] = Defaulted.UseDefault, sickleavehours: Defaulted[TypoShort] = Defaulted.UseDefault, @@ -323,20 +324,20 @@ class TestInsert(random: Random) { rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, organizationnode: Defaulted[Option[String]] = Defaulted.UseDefault - ): ConnectionIO[EmployeeRow] = (new EmployeeRepoImpl).insert(new EmployeeRowUnsaved(businessentityid = businessentityid, nationalidnumber = nationalidnumber, loginid = loginid, jobtitle = jobtitle, birthdate = birthdate, maritalstatus = maritalstatus, gender = gender, hiredate = hiredate, salariedflag = salariedflag, vacationhours = vacationhours, sickleavehours = sickleavehours, currentflag = currentflag, rowguid = rowguid, modifieddate = modifieddate, organizationnode = organizationnode)) + ): ConnectionIO[EmployeeRow] = (new EmployeeRepoImpl).insert(new EmployeeRowUnsaved(businessentityid = businessentityid, birthdate = birthdate, maritalstatus = maritalstatus, gender = gender, hiredate = hiredate, nationalidnumber = nationalidnumber, loginid = loginid, jobtitle = jobtitle, salariedflag = salariedflag, vacationhours = vacationhours, sickleavehours = sickleavehours, currentflag = currentflag, rowguid = rowguid, modifieddate = modifieddate, organizationnode = organizationnode)) def humanresourcesEmployeedepartmenthistory(businessentityid: BusinessentityId, departmentid: DepartmentId, shiftid: ShiftId, - startdate: TypoLocalDate = TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong)), - enddate: Option[TypoLocalDate] = if (random.nextBoolean()) None else Some(TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong))), + startdate: TypoLocalDate, + enddate: Option[TypoLocalDate] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[EmployeedepartmenthistoryRow] = (new EmployeedepartmenthistoryRepoImpl).insert(new EmployeedepartmenthistoryRowUnsaved(businessentityid = businessentityid, departmentid = departmentid, shiftid = shiftid, startdate = startdate, enddate = enddate, modifieddate = modifieddate)) def humanresourcesEmployeepayhistory(businessentityid: BusinessentityId, + rate: BigDecimal, + payfrequency: TypoShort, ratechangedate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - rate: BigDecimal = BigDecimal.decimal(random.nextDouble()), - payfrequency: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[EmployeepayhistoryRow] = (new EmployeepayhistoryRepoImpl).insert(new EmployeepayhistoryRowUnsaved(businessentityid = businessentityid, ratechangedate = ratechangedate, rate = rate, payfrequency = payfrequency, modifieddate = modifieddate)) + ): ConnectionIO[EmployeepayhistoryRow] = (new EmployeepayhistoryRepoImpl).insert(new EmployeepayhistoryRowUnsaved(businessentityid = businessentityid, rate = rate, payfrequency = payfrequency, ratechangedate = ratechangedate, modifieddate = modifieddate)) def humanresourcesJobcandidate(businessentityid: Option[BusinessentityId] = None, resume: Option[TypoXml] = None, jobcandidateid: Defaulted[JobcandidateId] = Defaulted.UseDefault, @@ -400,8 +401,8 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[PasswordRow] = (new PasswordRepoImpl).insert(new PasswordRowUnsaved(businessentityid = businessentityid, passwordhash = passwordhash, passwordsalt = passwordsalt, rowguid = rowguid, modifieddate = modifieddate)) def personPerson(businessentityid: BusinessentityId, + persontype: /* bpchar, max 2 chars */ String, firstname: /* user-picked */ FirstName, - persontype: /* bpchar, max 2 chars */ String = random.alphanumeric.take(2).mkString, title: Option[/* max 8 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(8).mkString), middlename: Option[Name] = if (random.nextBoolean()) None else Some(Name(random.alphanumeric.take(20).mkString)), lastname: Name = Name(random.alphanumeric.take(20).mkString), @@ -412,7 +413,7 @@ class TestInsert(random: Random) { emailpromotion: Defaulted[Int] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[PersonRow] = (new PersonRepoImpl).insert(new PersonRowUnsaved(businessentityid = businessentityid, firstname = firstname, persontype = persontype, title = title, middlename = middlename, lastname = lastname, suffix = suffix, additionalcontactinfo = additionalcontactinfo, demographics = demographics, namestyle = namestyle, emailpromotion = emailpromotion, rowguid = rowguid, modifieddate = modifieddate)) + ): ConnectionIO[PersonRow] = (new PersonRepoImpl).insert(new PersonRowUnsaved(businessentityid = businessentityid, persontype = persontype, firstname = firstname, title = title, middlename = middlename, lastname = lastname, suffix = suffix, additionalcontactinfo = additionalcontactinfo, demographics = demographics, namestyle = namestyle, emailpromotion = emailpromotion, rowguid = rowguid, modifieddate = modifieddate)) def personPersonphone(businessentityid: BusinessentityId, phonenumbertypeid: PhonenumbertypeId, phonenumber: Phone = Phone(random.alphanumeric.take(20).mkString), @@ -433,24 +434,24 @@ class TestInsert(random: Random) { ): ConnectionIO[StateprovinceRow] = (new StateprovinceRepoImpl).insert(new StateprovinceRowUnsaved(countryregioncode = countryregioncode, territoryid = territoryid, stateprovincecode = stateprovincecode, name = name, stateprovinceid = stateprovinceid, isonlystateprovinceflag = isonlystateprovinceflag, rowguid = rowguid, modifieddate = modifieddate)) def productionBillofmaterials(componentid: ProductId, unitmeasurecode: UnitmeasureId, + bomlevel: TypoShort, productassemblyid: Option[ProductId] = None, - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - bomlevel: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), + enddate: Option[TypoLocalDateTime] = None, billofmaterialsid: Defaulted[Int] = Defaulted.UseDefault, startdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, perassemblyqty: Defaulted[BigDecimal] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[BillofmaterialsRow] = (new BillofmaterialsRepoImpl).insert(new BillofmaterialsRowUnsaved(componentid = componentid, unitmeasurecode = unitmeasurecode, productassemblyid = productassemblyid, enddate = enddate, bomlevel = bomlevel, billofmaterialsid = billofmaterialsid, startdate = startdate, perassemblyqty = perassemblyqty, modifieddate = modifieddate)) + ): ConnectionIO[BillofmaterialsRow] = (new BillofmaterialsRepoImpl).insert(new BillofmaterialsRowUnsaved(componentid = componentid, unitmeasurecode = unitmeasurecode, bomlevel = bomlevel, productassemblyid = productassemblyid, enddate = enddate, billofmaterialsid = billofmaterialsid, startdate = startdate, perassemblyqty = perassemblyqty, modifieddate = modifieddate)) def productionCulture(cultureid: CultureId, name: Name = Name(random.alphanumeric.take(20).mkString), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[CultureRow] = (new CultureRepoImpl).insert(new CultureRowUnsaved(cultureid = cultureid, name = name, modifieddate = modifieddate)) def productionDocument(owner: BusinessentityId, + status: TypoShort, title: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, filename: /* max 400 chars */ String = random.alphanumeric.take(20).mkString, fileextension: Option[/* max 8 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(8).mkString), revision: /* bpchar, max 5 chars */ String = random.alphanumeric.take(5).mkString, - status: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), documentsummary: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), document: Option[TypoBytea] = None, folderflag: Defaulted[Flag] = Defaulted.UseDefault, @@ -458,7 +459,7 @@ class TestInsert(random: Random) { rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, documentnode: Defaulted[DocumentId] = Defaulted.UseDefault - ): ConnectionIO[DocumentRow] = (new DocumentRepoImpl).insert(new DocumentRowUnsaved(owner = owner, title = title, filename = filename, fileextension = fileextension, revision = revision, status = status, documentsummary = documentsummary, document = document, folderflag = folderflag, changenumber = changenumber, rowguid = rowguid, modifieddate = modifieddate, documentnode = documentnode)) + ): ConnectionIO[DocumentRow] = (new DocumentRepoImpl).insert(new DocumentRowUnsaved(owner = owner, status = status, title = title, filename = filename, fileextension = fileextension, revision = revision, documentsummary = documentsummary, document = document, folderflag = folderflag, changenumber = changenumber, rowguid = rowguid, modifieddate = modifieddate, documentnode = documentnode)) def productionIllustration(diagram: Option[TypoXml] = None, illustrationid: Defaulted[IllustrationId] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault @@ -469,43 +470,43 @@ class TestInsert(random: Random) { availability: Defaulted[BigDecimal] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[LocationRow] = (new LocationRepoImpl).insert(new LocationRowUnsaved(name = name, locationid = locationid, costrate = costrate, availability = availability, modifieddate = modifieddate)) - def productionProduct(name: Name = Name(random.alphanumeric.take(20).mkString), + def productionProduct(safetystocklevel: TypoShort, + reorderpoint: TypoShort, + standardcost: BigDecimal, + listprice: BigDecimal, + daystomanufacture: Int, + sellstartdate: TypoLocalDateTime, + name: Name = Name(random.alphanumeric.take(20).mkString), productnumber: /* max 25 chars */ String = random.alphanumeric.take(20).mkString, color: Option[/* max 15 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(15).mkString), - safetystocklevel: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - reorderpoint: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - standardcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), - listprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), size: Option[/* max 5 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(5).mkString), sizeunitmeasurecode: Option[UnitmeasureId] = None, weightunitmeasurecode: Option[UnitmeasureId] = None, - weight: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), - daystomanufacture: Int = random.nextInt(), - productline: Option[/* bpchar, max 2 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(2).mkString), - `class`: Option[/* bpchar, max 2 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(2).mkString), - style: Option[/* bpchar, max 2 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(2).mkString), + weight: Option[BigDecimal] = None, + productline: Option[/* bpchar, max 2 chars */ String] = None, + `class`: Option[/* bpchar, max 2 chars */ String] = None, + style: Option[/* bpchar, max 2 chars */ String] = None, productsubcategoryid: Option[ProductsubcategoryId] = None, productmodelid: Option[ProductmodelId] = None, - sellstartdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - sellenddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + sellenddate: Option[TypoLocalDateTime] = None, discontinueddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), productid: Defaulted[ProductId] = Defaulted.UseDefault, makeflag: Defaulted[Flag] = Defaulted.UseDefault, finishedgoodsflag: Defaulted[Flag] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[ProductRow] = (new ProductRepoImpl).insert(new ProductRowUnsaved(name = name, productnumber = productnumber, color = color, safetystocklevel = safetystocklevel, reorderpoint = reorderpoint, standardcost = standardcost, listprice = listprice, size = size, sizeunitmeasurecode = sizeunitmeasurecode, weightunitmeasurecode = weightunitmeasurecode, weight = weight, daystomanufacture = daystomanufacture, productline = productline, `class` = `class`, style = style, productsubcategoryid = productsubcategoryid, productmodelid = productmodelid, sellstartdate = sellstartdate, sellenddate = sellenddate, discontinueddate = discontinueddate, productid = productid, makeflag = makeflag, finishedgoodsflag = finishedgoodsflag, rowguid = rowguid, modifieddate = modifieddate)) + ): ConnectionIO[ProductRow] = (new ProductRepoImpl).insert(new ProductRowUnsaved(safetystocklevel = safetystocklevel, reorderpoint = reorderpoint, standardcost = standardcost, listprice = listprice, daystomanufacture = daystomanufacture, sellstartdate = sellstartdate, name = name, productnumber = productnumber, color = color, size = size, sizeunitmeasurecode = sizeunitmeasurecode, weightunitmeasurecode = weightunitmeasurecode, weight = weight, productline = productline, `class` = `class`, style = style, productsubcategoryid = productsubcategoryid, productmodelid = productmodelid, sellenddate = sellenddate, discontinueddate = discontinueddate, productid = productid, makeflag = makeflag, finishedgoodsflag = finishedgoodsflag, rowguid = rowguid, modifieddate = modifieddate)) def productionProductcategory(name: Name = Name(random.alphanumeric.take(20).mkString), productcategoryid: Defaulted[ProductcategoryId] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[ProductcategoryRow] = (new ProductcategoryRepoImpl).insert(new ProductcategoryRowUnsaved(name = name, productcategoryid = productcategoryid, rowguid = rowguid, modifieddate = modifieddate)) def productionProductcosthistory(productid: ProductId, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - standardcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), + startdate: TypoLocalDateTime, + standardcost: BigDecimal, + enddate: Option[TypoLocalDateTime] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[ProductcosthistoryRow] = (new ProductcosthistoryRepoImpl).insert(new ProductcosthistoryRowUnsaved(productid = productid, startdate = startdate, enddate = enddate, standardcost = standardcost, modifieddate = modifieddate)) + ): ConnectionIO[ProductcosthistoryRow] = (new ProductcosthistoryRepoImpl).insert(new ProductcosthistoryRowUnsaved(productid = productid, startdate = startdate, standardcost = standardcost, enddate = enddate, modifieddate = modifieddate)) def productionProductdescription(description: /* max 400 chars */ String = random.alphanumeric.take(20).mkString, productdescriptionid: Defaulted[ProductdescriptionId] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, @@ -517,18 +518,18 @@ class TestInsert(random: Random) { ): ConnectionIO[ProductdocumentRow] = (new ProductdocumentRepoImpl).insert(new ProductdocumentRowUnsaved(productid = productid, modifieddate = modifieddate, documentnode = documentnode)) def productionProductinventory(productid: ProductId, locationid: LocationId, + bin: TypoShort, shelf: /* max 10 chars */ String = random.alphanumeric.take(10).mkString, - bin: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), quantity: Defaulted[TypoShort] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[ProductinventoryRow] = (new ProductinventoryRepoImpl).insert(new ProductinventoryRowUnsaved(productid = productid, locationid = locationid, shelf = shelf, bin = bin, quantity = quantity, rowguid = rowguid, modifieddate = modifieddate)) + ): ConnectionIO[ProductinventoryRow] = (new ProductinventoryRepoImpl).insert(new ProductinventoryRowUnsaved(productid = productid, locationid = locationid, bin = bin, shelf = shelf, quantity = quantity, rowguid = rowguid, modifieddate = modifieddate)) def productionProductlistpricehistory(productid: ProductId, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - listprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), + startdate: TypoLocalDateTime, + listprice: BigDecimal, + enddate: Option[TypoLocalDateTime] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[ProductlistpricehistoryRow] = (new ProductlistpricehistoryRepoImpl).insert(new ProductlistpricehistoryRowUnsaved(productid = productid, startdate = startdate, enddate = enddate, listprice = listprice, modifieddate = modifieddate)) + ): ConnectionIO[ProductlistpricehistoryRow] = (new ProductlistpricehistoryRepoImpl).insert(new ProductlistpricehistoryRowUnsaved(productid = productid, startdate = startdate, listprice = listprice, enddate = enddate, modifieddate = modifieddate)) def productionProductmodel(name: Name = Name(random.alphanumeric.take(20).mkString), catalogdescription: Option[TypoXml] = None, instructions: Option[TypoXml] = None, @@ -558,14 +559,14 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[ProductproductphotoRow] = (new ProductproductphotoRepoImpl).insert(new ProductproductphotoRowUnsaved(productid = productid, productphotoid = productphotoid, primary = primary, modifieddate = modifieddate)) def productionProductreview(productid: ProductId, + rating: Int, reviewername: Name = Name(random.alphanumeric.take(20).mkString), emailaddress: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, - rating: Int = random.nextInt(), comments: Option[/* max 3850 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), productreviewid: Defaulted[ProductreviewId] = Defaulted.UseDefault, reviewdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[ProductreviewRow] = (new ProductreviewRepoImpl).insert(new ProductreviewRowUnsaved(productid = productid, reviewername = reviewername, emailaddress = emailaddress, rating = rating, comments = comments, productreviewid = productreviewid, reviewdate = reviewdate, modifieddate = modifieddate)) + ): ConnectionIO[ProductreviewRow] = (new ProductreviewRepoImpl).insert(new ProductreviewRowUnsaved(productid = productid, rating = rating, reviewername = reviewername, emailaddress = emailaddress, comments = comments, productreviewid = productreviewid, reviewdate = reviewdate, modifieddate = modifieddate)) def productionProductsubcategory(productcategoryid: ProductcategoryId, name: Name = Name(random.alphanumeric.take(20).mkString), productsubcategoryid: Defaulted[ProductsubcategoryId] = Defaulted.UseDefault, @@ -577,34 +578,34 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[ScrapreasonRow] = (new ScrapreasonRepoImpl).insert(new ScrapreasonRowUnsaved(name = name, scrapreasonid = scrapreasonid, modifieddate = modifieddate)) def productionTransactionhistory(productid: ProductId, + transactiontype: /* bpchar, max 1 chars */ String, referenceorderid: Int = random.nextInt(), - transactiontype: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, quantity: Int = random.nextInt(), actualcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), transactionid: Defaulted[TransactionhistoryId] = Defaulted.UseDefault, referenceorderlineid: Defaulted[Int] = Defaulted.UseDefault, transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[TransactionhistoryRow] = (new TransactionhistoryRepoImpl).insert(new TransactionhistoryRowUnsaved(productid = productid, referenceorderid = referenceorderid, transactiontype = transactiontype, quantity = quantity, actualcost = actualcost, transactionid = transactionid, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) - def productionTransactionhistoryarchive(transactionid: TransactionhistoryarchiveId, + ): ConnectionIO[TransactionhistoryRow] = (new TransactionhistoryRepoImpl).insert(new TransactionhistoryRowUnsaved(productid = productid, transactiontype = transactiontype, referenceorderid = referenceorderid, quantity = quantity, actualcost = actualcost, transactionid = transactionid, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) + def productionTransactionhistoryarchive(transactiontype: /* bpchar, max 1 chars */ String, + transactionid: TransactionhistoryarchiveId = TransactionhistoryarchiveId(random.nextInt()), productid: Int = random.nextInt(), referenceorderid: Int = random.nextInt(), - transactiontype: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, quantity: Int = random.nextInt(), actualcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), referenceorderlineid: Defaulted[Int] = Defaulted.UseDefault, transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[TransactionhistoryarchiveRow] = (new TransactionhistoryarchiveRepoImpl).insert(new TransactionhistoryarchiveRowUnsaved(transactionid = transactionid, productid = productid, referenceorderid = referenceorderid, transactiontype = transactiontype, quantity = quantity, actualcost = actualcost, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) + ): ConnectionIO[TransactionhistoryarchiveRow] = (new TransactionhistoryarchiveRepoImpl).insert(new TransactionhistoryarchiveRowUnsaved(transactiontype = transactiontype, transactionid = transactionid, productid = productid, referenceorderid = referenceorderid, quantity = quantity, actualcost = actualcost, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) def productionUnitmeasure(unitmeasurecode: UnitmeasureId, name: Name = Name(random.alphanumeric.take(20).mkString), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[UnitmeasureRow] = (new UnitmeasureRepoImpl).insert(new UnitmeasureRowUnsaved(unitmeasurecode = unitmeasurecode, name = name, modifieddate = modifieddate)) def productionWorkorder(productid: ProductId, - orderqty: Int = random.nextInt(), - scrappedqty: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + orderqty: Int, + scrappedqty: TypoShort, + startdate: TypoLocalDateTime, + enddate: Option[TypoLocalDateTime] = None, duedate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), scrapreasonid: Option[ScrapreasonId] = None, workorderid: Defaulted[WorkorderId] = Defaulted.UseDefault, @@ -612,17 +613,17 @@ class TestInsert(random: Random) { ): ConnectionIO[WorkorderRow] = (new WorkorderRepoImpl).insert(new WorkorderRowUnsaved(productid = productid, orderqty = orderqty, scrappedqty = scrappedqty, startdate = startdate, enddate = enddate, duedate = duedate, scrapreasonid = scrapreasonid, workorderid = workorderid, modifieddate = modifieddate)) def productionWorkorderrouting(workorderid: WorkorderId, locationid: LocationId, + scheduledstartdate: TypoLocalDateTime, + scheduledenddate: TypoLocalDateTime, + plannedcost: BigDecimal, productid: Int = random.nextInt(), operationsequence: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - scheduledstartdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - scheduledenddate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - actualstartdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - actualenddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - actualresourcehrs: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), - plannedcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), - actualcost: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), + actualstartdate: Option[TypoLocalDateTime] = None, + actualenddate: Option[TypoLocalDateTime] = None, + actualresourcehrs: Option[BigDecimal] = None, + actualcost: Option[BigDecimal] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[WorkorderroutingRow] = (new WorkorderroutingRepoImpl).insert(new WorkorderroutingRowUnsaved(workorderid = workorderid, locationid = locationid, productid = productid, operationsequence = operationsequence, scheduledstartdate = scheduledstartdate, scheduledenddate = scheduledenddate, actualstartdate = actualstartdate, actualenddate = actualenddate, actualresourcehrs = actualresourcehrs, plannedcost = plannedcost, actualcost = actualcost, modifieddate = modifieddate)) + ): ConnectionIO[WorkorderroutingRow] = (new WorkorderroutingRepoImpl).insert(new WorkorderroutingRowUnsaved(workorderid = workorderid, locationid = locationid, scheduledstartdate = scheduledstartdate, scheduledenddate = scheduledenddate, plannedcost = plannedcost, productid = productid, operationsequence = operationsequence, actualstartdate = actualstartdate, actualenddate = actualenddate, actualresourcehrs = actualresourcehrs, actualcost = actualcost, modifieddate = modifieddate)) def publicFlaff(code: ShortText = ShortText(random.alphanumeric.take(20).mkString), anotherCode: /* max 20 chars */ String = random.alphanumeric.take(20).mkString, someNumber: Int = random.nextInt(), @@ -679,7 +680,7 @@ class TestInsert(random: Random) { text: String = random.alphanumeric.take(20).mkString, time: TypoLocalTime = TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)), timestamp: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - timestampz: TypoInstant = TypoInstant(Instant.ofEpochMilli(random.nextLong())), + timestampz: TypoInstant = TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L))), timez: TypoOffsetTime = TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12))), varchar: String = random.alphanumeric.take(20).mkString, bpchares: Array[/* bpchar */ String] = Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString), @@ -697,7 +698,7 @@ class TestInsert(random: Random) { textes: Array[String] = Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString), timees: Array[TypoLocalTime] = Array.fill(random.nextInt(3))(TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), timestampes: Array[TypoLocalDateTime] = Array.fill(random.nextInt(3))(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - timestampzes: Array[TypoInstant] = Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(random.nextLong()))), + timestampzes: Array[TypoInstant] = Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L)))), timezes: Array[TypoOffsetTime] = Array.fill(random.nextInt(3))(TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12)))), varchares: Array[String] = Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString) ): ConnectionIO[PgtestRow] = (new PgtestRepoImpl).insert(new PgtestRow(box = box, bytea = bytea, circle = circle, hstore = hstore, inet = inet, int2vector = int2vector, interval = interval, json = json, jsonb = jsonb, line = line, lseg = lseg, money = money, path = path, point = point, polygon = polygon, uuid = uuid, vector = vector, xml = xml, boxes = boxes, circlees = circlees, inetes = inetes, int2vectores = int2vectores, intervales = intervales, jsones = jsones, jsonbes = jsonbes, linees = linees, lseges = lseges, moneyes = moneyes, pathes = pathes, pointes = pointes, polygones = polygones, uuides = uuides, xmles = xmles, bool = bool, bpchar = bpchar, char = char, date = date, float4 = float4, float8 = float8, int2 = int2, int4 = int4, int8 = int8, mydomain = mydomain, myenum = myenum, name = name, numeric = numeric, text = text, time = time, timestamp = timestamp, timestampz = timestampz, timez = timez, varchar = varchar, bpchares = bpchares, chares = chares, datees = datees, float4es = float4es, float8es = float8es, int2es = int2es, int4es = int4es, int8es = int8es, mydomaines = mydomaines, myenumes = myenumes, namees = namees, numerices = numerices, textes = textes, timees = timees, timestampes = timestampes, timestampzes = timestampzes, timezes = timezes, varchares = varchares)) @@ -732,7 +733,7 @@ class TestInsert(random: Random) { text: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), time: Option[TypoLocalTime] = if (random.nextBoolean()) None else Some(TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), timestamp: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - timestampz: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(random.nextLong()))), + timestampz: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L)))), timez: Option[TypoOffsetTime] = if (random.nextBoolean()) None else Some(TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12)))), uuid: Option[TypoUUID] = None, varchar: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), @@ -766,7 +767,7 @@ class TestInsert(random: Random) { textes: Option[Array[String]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString)), timees: Option[Array[TypoLocalTime]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), timestampes: Option[Array[TypoLocalDateTime]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))))), - timestampzes: Option[Array[TypoInstant]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(random.nextLong())))), + timestampzes: Option[Array[TypoInstant]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L))))), timezes: Option[Array[TypoOffsetTime]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12))))), uuides: Option[Array[TypoUUID]] = None, varchares: Option[Array[String]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString)), @@ -777,25 +778,25 @@ class TestInsert(random: Random) { name: String = random.alphanumeric.take(20).mkString, lastName: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), password: String = random.alphanumeric.take(20).mkString, - verifiedOn: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(random.nextLong()))), + verifiedOn: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L)))), createdAt: Defaulted[TypoInstant] = Defaulted.UseDefault ): ConnectionIO[UsersRow] = (new UsersRepoImpl).insert(new UsersRowUnsaved(userId = userId, email = email, name = name, lastName = lastName, password = password, verifiedOn = verifiedOn, createdAt = createdAt)) def purchasingProductvendor(productid: ProductId, businessentityid: BusinessentityId, + averageleadtime: Int, + standardprice: BigDecimal, + minorderqty: Int, + maxorderqty: Int, unitmeasurecode: UnitmeasureId, - averageleadtime: Int = random.nextInt(), - standardprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), - lastreceiptcost: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), + lastreceiptcost: Option[BigDecimal] = None, lastreceiptdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - minorderqty: Int = random.nextInt(), - maxorderqty: Int = random.nextInt(), - onorderqty: Option[Int] = if (random.nextBoolean()) None else Some(random.nextInt()), + onorderqty: Option[Int] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[ProductvendorRow] = (new ProductvendorRepoImpl).insert(new ProductvendorRowUnsaved(productid = productid, businessentityid = businessentityid, unitmeasurecode = unitmeasurecode, averageleadtime = averageleadtime, standardprice = standardprice, lastreceiptcost = lastreceiptcost, lastreceiptdate = lastreceiptdate, minorderqty = minorderqty, maxorderqty = maxorderqty, onorderqty = onorderqty, modifieddate = modifieddate)) + ): ConnectionIO[ProductvendorRow] = (new ProductvendorRepoImpl).insert(new ProductvendorRowUnsaved(productid = productid, businessentityid = businessentityid, averageleadtime = averageleadtime, standardprice = standardprice, minorderqty = minorderqty, maxorderqty = maxorderqty, unitmeasurecode = unitmeasurecode, lastreceiptcost = lastreceiptcost, lastreceiptdate = lastreceiptdate, onorderqty = onorderqty, modifieddate = modifieddate)) def purchasingPurchaseorderheader(employeeid: BusinessentityId, vendorid: BusinessentityId, shipmethodid: ShipmethodId, - shipdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + shipdate: Option[TypoLocalDateTime] = None, purchaseorderid: Defaulted[PurchaseorderheaderId] = Defaulted.UseDefault, revisionnumber: Defaulted[TypoShort] = Defaulted.UseDefault, status: Defaulted[TypoShort] = Defaulted.UseDefault, @@ -813,14 +814,14 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[ShipmethodRow] = (new ShipmethodRepoImpl).insert(new ShipmethodRowUnsaved(name = name, shipmethodid = shipmethodid, shipbase = shipbase, shiprate = shiprate, rowguid = rowguid, modifieddate = modifieddate)) def purchasingVendor(businessentityid: BusinessentityId, + creditrating: TypoShort, accountnumber: AccountNumber = AccountNumber(random.alphanumeric.take(20).mkString), name: Name = Name(random.alphanumeric.take(20).mkString), - creditrating: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), purchasingwebserviceurl: Option[/* max 1024 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), preferredvendorstatus: Defaulted[Flag] = Defaulted.UseDefault, activeflag: Defaulted[Flag] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[VendorRow] = (new VendorRepoImpl).insert(new VendorRowUnsaved(businessentityid = businessentityid, accountnumber = accountnumber, name = name, creditrating = creditrating, purchasingwebserviceurl = purchasingwebserviceurl, preferredvendorstatus = preferredvendorstatus, activeflag = activeflag, modifieddate = modifieddate)) + ): ConnectionIO[VendorRow] = (new VendorRepoImpl).insert(new VendorRowUnsaved(businessentityid = businessentityid, creditrating = creditrating, accountnumber = accountnumber, name = name, purchasingwebserviceurl = purchasingwebserviceurl, preferredvendorstatus = preferredvendorstatus, activeflag = activeflag, modifieddate = modifieddate)) def salesCountryregioncurrency(countryregioncode: CountryregionId, currencycode: CurrencyId, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault @@ -855,23 +856,22 @@ class TestInsert(random: Random) { creditcardid: /* user-picked */ CustomCreditcardId, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[PersoncreditcardRow] = (new PersoncreditcardRepoImpl).insert(new PersoncreditcardRowUnsaved(businessentityid = businessentityid, creditcardid = creditcardid, modifieddate = modifieddate)) - def salesSalesorderdetail(salesorderid: SalesorderheaderId, - productid: ProductId, - specialofferid: SpecialofferId, + def salesSalesorderdetail(SpecialofferproductId: SpecialofferproductId, + salesorderid: SalesorderheaderId, + orderqty: TypoShort, + unitprice: BigDecimal, carriertrackingnumber: Option[/* max 25 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), - orderqty: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - unitprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), salesorderdetailid: Defaulted[Int] = Defaulted.UseDefault, unitpricediscount: Defaulted[BigDecimal] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[SalesorderdetailRow] = (new SalesorderdetailRepoImpl).insert(new SalesorderdetailRowUnsaved(salesorderid = salesorderid, productid = productid, specialofferid = specialofferid, carriertrackingnumber = carriertrackingnumber, orderqty = orderqty, unitprice = unitprice, salesorderdetailid = salesorderdetailid, unitpricediscount = unitpricediscount, rowguid = rowguid, modifieddate = modifieddate)) - def salesSalesorderheader(customerid: CustomerId, + ): ConnectionIO[SalesorderdetailRow] = (new SalesorderdetailRepoImpl).insert(new SalesorderdetailRowUnsaved(salesorderid = salesorderid, carriertrackingnumber = carriertrackingnumber, orderqty = orderqty, productid = SpecialofferproductId.productid, specialofferid = SpecialofferproductId.specialofferid, unitprice = unitprice, salesorderdetailid = salesorderdetailid, unitpricediscount = unitpricediscount, rowguid = rowguid, modifieddate = modifieddate)) + def salesSalesorderheader(duedate: TypoLocalDateTime, + customerid: CustomerId, billtoaddressid: AddressId, shiptoaddressid: AddressId, shipmethodid: ShipmethodId, - duedate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - shipdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + shipdate: Option[TypoLocalDateTime] = None, purchaseordernumber: Option[OrderNumber] = if (random.nextBoolean()) None else Some(OrderNumber(random.alphanumeric.take(20).mkString)), accountnumber: Option[AccountNumber] = if (random.nextBoolean()) None else Some(AccountNumber(random.alphanumeric.take(20).mkString)), salespersonid: Option[BusinessentityId] = None, @@ -891,14 +891,14 @@ class TestInsert(random: Random) { freight: Defaulted[BigDecimal] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[SalesorderheaderRow] = (new SalesorderheaderRepoImpl).insert(new SalesorderheaderRowUnsaved(customerid = customerid, billtoaddressid = billtoaddressid, shiptoaddressid = shiptoaddressid, shipmethodid = shipmethodid, duedate = duedate, shipdate = shipdate, purchaseordernumber = purchaseordernumber, accountnumber = accountnumber, salespersonid = salespersonid, territoryid = territoryid, creditcardid = creditcardid, creditcardapprovalcode = creditcardapprovalcode, currencyrateid = currencyrateid, totaldue = totaldue, comment = comment, salesorderid = salesorderid, revisionnumber = revisionnumber, orderdate = orderdate, status = status, onlineorderflag = onlineorderflag, subtotal = subtotal, taxamt = taxamt, freight = freight, rowguid = rowguid, modifieddate = modifieddate)) + ): ConnectionIO[SalesorderheaderRow] = (new SalesorderheaderRepoImpl).insert(new SalesorderheaderRowUnsaved(duedate = duedate, customerid = customerid, billtoaddressid = billtoaddressid, shiptoaddressid = shiptoaddressid, shipmethodid = shipmethodid, shipdate = shipdate, purchaseordernumber = purchaseordernumber, accountnumber = accountnumber, salespersonid = salespersonid, territoryid = territoryid, creditcardid = creditcardid, creditcardapprovalcode = creditcardapprovalcode, currencyrateid = currencyrateid, totaldue = totaldue, comment = comment, salesorderid = salesorderid, revisionnumber = revisionnumber, orderdate = orderdate, status = status, onlineorderflag = onlineorderflag, subtotal = subtotal, taxamt = taxamt, freight = freight, rowguid = rowguid, modifieddate = modifieddate)) def salesSalesorderheadersalesreason(salesorderid: SalesorderheaderId, salesreasonid: SalesreasonId, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[SalesorderheadersalesreasonRow] = (new SalesorderheadersalesreasonRepoImpl).insert(new SalesorderheadersalesreasonRowUnsaved(salesorderid = salesorderid, salesreasonid = salesreasonid, modifieddate = modifieddate)) def salesSalesperson(businessentityid: BusinessentityId, territoryid: Option[SalesterritoryId] = None, - salesquota: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), + salesquota: Option[BigDecimal] = None, bonus: Defaulted[BigDecimal] = Defaulted.UseDefault, commissionpct: Defaulted[BigDecimal] = Defaulted.UseDefault, salesytd: Defaulted[BigDecimal] = Defaulted.UseDefault, @@ -907,18 +907,18 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[SalespersonRow] = (new SalespersonRepoImpl).insert(new SalespersonRowUnsaved(businessentityid = businessentityid, territoryid = territoryid, salesquota = salesquota, bonus = bonus, commissionpct = commissionpct, salesytd = salesytd, saleslastyear = saleslastyear, rowguid = rowguid, modifieddate = modifieddate)) def salesSalespersonquotahistory(businessentityid: BusinessentityId, + salesquota: BigDecimal, quotadate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - salesquota: BigDecimal = BigDecimal.decimal(random.nextDouble()), rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[SalespersonquotahistoryRow] = (new SalespersonquotahistoryRepoImpl).insert(new SalespersonquotahistoryRowUnsaved(businessentityid = businessentityid, quotadate = quotadate, salesquota = salesquota, rowguid = rowguid, modifieddate = modifieddate)) + ): ConnectionIO[SalespersonquotahistoryRow] = (new SalespersonquotahistoryRepoImpl).insert(new SalespersonquotahistoryRowUnsaved(businessentityid = businessentityid, salesquota = salesquota, quotadate = quotadate, rowguid = rowguid, modifieddate = modifieddate)) def salesSalesreason(name: Name = Name(random.alphanumeric.take(20).mkString), reasontype: Name = Name(random.alphanumeric.take(20).mkString), salesreasonid: Defaulted[SalesreasonId] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[SalesreasonRow] = (new SalesreasonRepoImpl).insert(new SalesreasonRowUnsaved(name = name, reasontype = reasontype, salesreasonid = salesreasonid, modifieddate = modifieddate)) def salesSalestaxrate(stateprovinceid: StateprovinceId, - taxtype: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), + taxtype: TypoShort, name: Name = Name(random.alphanumeric.take(20).mkString), salestaxrateid: Defaulted[SalestaxrateId] = Defaulted.UseDefault, taxrate: Defaulted[BigDecimal] = Defaulted.UseDefault, @@ -938,8 +938,8 @@ class TestInsert(random: Random) { ): ConnectionIO[SalesterritoryRow] = (new SalesterritoryRepoImpl).insert(new SalesterritoryRowUnsaved(countryregioncode = countryregioncode, name = name, group = group, territoryid = territoryid, salesytd = salesytd, saleslastyear = saleslastyear, costytd = costytd, costlastyear = costlastyear, rowguid = rowguid, modifieddate = modifieddate)) def salesSalesterritoryhistory(businessentityid: BusinessentityId, territoryid: SalesterritoryId, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + startdate: TypoLocalDateTime, + enddate: Option[TypoLocalDateTime] = None, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[SalesterritoryhistoryRow] = (new SalesterritoryhistoryRepoImpl).insert(new SalesterritoryhistoryRowUnsaved(businessentityid = businessentityid, territoryid = territoryid, startdate = startdate, enddate = enddate, rowguid = rowguid, modifieddate = modifieddate)) @@ -950,18 +950,18 @@ class TestInsert(random: Random) { datecreated: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ConnectionIO[ShoppingcartitemRow] = (new ShoppingcartitemRepoImpl).insert(new ShoppingcartitemRowUnsaved(productid = productid, shoppingcartid = shoppingcartid, shoppingcartitemid = shoppingcartitemid, quantity = quantity, datecreated = datecreated, modifieddate = modifieddate)) - def salesSpecialoffer(description: /* max 255 chars */ String = random.alphanumeric.take(20).mkString, + def salesSpecialoffer(startdate: TypoLocalDateTime, + enddate: TypoLocalDateTime, + description: /* max 255 chars */ String = random.alphanumeric.take(20).mkString, `type`: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, category: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - maxqty: Option[Int] = if (random.nextBoolean()) None else Some(random.nextInt()), + maxqty: Option[Int] = None, specialofferid: Defaulted[SpecialofferId] = Defaulted.UseDefault, discountpct: Defaulted[BigDecimal] = Defaulted.UseDefault, minqty: Defaulted[Int] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ConnectionIO[SpecialofferRow] = (new SpecialofferRepoImpl).insert(new SpecialofferRowUnsaved(description = description, `type` = `type`, category = category, startdate = startdate, enddate = enddate, maxqty = maxqty, specialofferid = specialofferid, discountpct = discountpct, minqty = minqty, rowguid = rowguid, modifieddate = modifieddate)) + ): ConnectionIO[SpecialofferRow] = (new SpecialofferRepoImpl).insert(new SpecialofferRowUnsaved(startdate = startdate, enddate = enddate, description = description, `type` = `type`, category = category, maxqty = maxqty, specialofferid = specialofferid, discountpct = discountpct, minqty = minqty, rowguid = rowguid, modifieddate = modifieddate)) def salesSpecialofferproduct(specialofferid: SpecialofferId, productid: ProductId, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/src/scala/adventureworks/production/product/CompositeIdsTest.scala b/typo-tester-doobie/src/scala/adventureworks/production/product/CompositeIdsTest.scala index 4eb7f7f072..8bac426697 100644 --- a/typo-tester-doobie/src/scala/adventureworks/production/product/CompositeIdsTest.scala +++ b/typo-tester-doobie/src/scala/adventureworks/production/product/CompositeIdsTest.scala @@ -1,6 +1,6 @@ package adventureworks.production.product -import adventureworks.customtypes.{TypoLocalDateTime, TypoUUID, TypoXml} +import adventureworks.customtypes.{TypoLocalDateTime, TypoShort, TypoUUID, TypoXml} import adventureworks.person.businessentity.{BusinessentityId, BusinessentityRepo, BusinessentityRepoImpl, BusinessentityRepoMock, BusinessentityRow} import adventureworks.person.emailaddress.{EmailaddressRepo, EmailaddressRepoImpl, EmailaddressRepoMock, EmailaddressRow} import adventureworks.person.person.{PersonRepo, PersonRepoImpl, PersonRepoMock, PersonRow} @@ -33,6 +33,12 @@ class CompositeIdsTest extends AnyFunSuite with TypeCheckedTripleEquals { productSubcategory <- testInsert.productionProductsubcategory(productCategory.productcategoryid) productModel <- testInsert.productionProductmodel(catalogdescription = Some(new TypoXml("")), instructions = Some(new TypoXml(""))) product <- testInsert.productionProduct( + safetystocklevel = TypoShort(1), + reorderpoint = TypoShort(1), + standardcost = BigDecimal(1), + listprice = BigDecimal(1), + daystomanufacture = 10, + sellstartdate = TypoLocalDateTime.now, sizeunitmeasurecode = Some(unitmeasure.unitmeasurecode), weightunitmeasurecode = Some(unitmeasure.unitmeasurecode), `class` = Some("H "), @@ -42,9 +48,9 @@ class CompositeIdsTest extends AnyFunSuite with TypeCheckedTripleEquals { ) now = TypoLocalDateTime.now - ph1 <- testInsert.productionProductcosthistory(product.productid, startdate = now, enddate = Some(now.map(_.plusDays(1)))) - ph2 <- testInsert.productionProductcosthistory(product.productid, startdate = now.map(_.plusDays(1)), enddate = Some(now.map(_.plusDays(2)))) - ph3 <- testInsert.productionProductcosthistory(product.productid, startdate = now.map(_.plusDays(2)), enddate = Some(now.map(_.plusDays(3)))) + ph1 <- testInsert.productionProductcosthistory(product.productid, standardcost = BigDecimal(1), startdate = now, enddate = Some(now.map(_.plusDays(1)))) + ph2 <- testInsert.productionProductcosthistory(product.productid, standardcost = BigDecimal(1), startdate = now.map(_.plusDays(1)), enddate = Some(now.map(_.plusDays(2)))) + ph3 <- testInsert.productionProductcosthistory(product.productid, standardcost = BigDecimal(1), startdate = now.map(_.plusDays(2)), enddate = Some(now.map(_.plusDays(3)))) wanted = Array(ph1.compositeId, ph2.compositeId, ph3.compositeId.copy(productid = ProductId(9999))) found <- repo.selectByIds(wanted).compile.toList _ <- delay(assert(found.map(_.compositeId).toSet === Set(ph1.compositeId, ph2.compositeId))) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala index ad452353c2..0d66763587 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/department/DepartmentRow.scala @@ -31,6 +31,7 @@ case class DepartmentRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = departmentid def toUnsavedRow(departmentid: Defaulted[DepartmentId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): DepartmentRowUnsaved = DepartmentRowUnsaved(name, groupname, departmentid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala index 2c7729432c..f8ba3ff2e8 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRow.scala @@ -68,6 +68,7 @@ case class EmployeeRow( Default: '/'::character varying */ organizationnode: Option[String] ){ + val id = businessentityid def toUnsavedRow(salariedflag: Defaulted[Flag] = Defaulted.Provided(this.salariedflag), vacationhours: Defaulted[TypoShort] = Defaulted.Provided(this.vacationhours), sickleavehours: Defaulted[TypoShort] = Defaulted.Provided(this.sickleavehours), currentflag: Defaulted[Flag] = Defaulted.Provided(this.currentflag), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate), organizationnode: Defaulted[Option[String]] = Defaulted.Provided(this.organizationnode)): EmployeeRowUnsaved = EmployeeRowUnsaved(businessentityid, nationalidnumber, loginid, jobtitle, birthdate, maritalstatus, gender, hiredate, salariedflag, vacationhours, sickleavehours, currentflag, rowguid, modifieddate, organizationnode) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala index 5d41dacb1e..0915c1234d 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryId.scala @@ -17,7 +17,12 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `humanresources.employeedepartmenthistory` */ -case class EmployeedepartmenthistoryId(businessentityid: BusinessentityId, startdate: TypoLocalDate, departmentid: DepartmentId, shiftid: ShiftId) +case class EmployeedepartmenthistoryId( + businessentityid: BusinessentityId, + startdate: TypoLocalDate, + departmentid: DepartmentId, + shiftid: ShiftId +) object EmployeedepartmenthistoryId { implicit lazy val jsonDecoder: JsonDecoder[EmployeedepartmenthistoryId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val businessentityid = jsonObj.get("businessentityid").toRight("Missing field 'businessentityid'").flatMap(_.as(BusinessentityId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala index 6d50615d7d..3c9a3e0ca8 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRow.scala @@ -43,6 +43,7 @@ case class EmployeedepartmenthistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: EmployeedepartmenthistoryId = EmployeedepartmenthistoryId(businessentityid, startdate, departmentid, shiftid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): EmployeedepartmenthistoryRowUnsaved = EmployeedepartmenthistoryRowUnsaved(businessentityid, departmentid, shiftid, startdate, enddate, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala index 01e3caa7c3..bc19109781 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `humanresources.employeepayhistory` */ -case class EmployeepayhistoryId(businessentityid: BusinessentityId, ratechangedate: TypoLocalDateTime) +case class EmployeepayhistoryId( + businessentityid: BusinessentityId, + ratechangedate: TypoLocalDateTime +) object EmployeepayhistoryId { implicit lazy val jsonDecoder: JsonDecoder[EmployeepayhistoryId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val businessentityid = jsonObj.get("businessentityid").toRight("Missing field 'businessentityid'").flatMap(_.as(BusinessentityId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala index 20646f9d38..def55a507f 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRow.scala @@ -37,6 +37,7 @@ case class EmployeepayhistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: EmployeepayhistoryId = EmployeepayhistoryId(businessentityid, ratechangedate) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): EmployeepayhistoryRowUnsaved = EmployeepayhistoryRowUnsaved(businessentityid, ratechangedate, rate, payfrequency, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala index 97d78ecee4..6c248dafbb 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/jobcandidate/JobcandidateRow.scala @@ -33,6 +33,7 @@ case class JobcandidateRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = jobcandidateid def toUnsavedRow(jobcandidateid: Defaulted[JobcandidateId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): JobcandidateRowUnsaved = JobcandidateRowUnsaved(businessentityid, resume, jobcandidateid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala index f9ab66c4cb..dcefa12bda 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/humanresources/shift/ShiftRow.scala @@ -34,6 +34,7 @@ case class ShiftRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = shiftid def toUnsavedRow(shiftid: Defaulted[ShiftId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ShiftRowUnsaved = ShiftRowUnsaved(name, starttime, endtime, shiftid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/address/AddressRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/address/AddressRow.scala index c83901528e..4fa1dc3d62 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/address/AddressRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/address/AddressRow.scala @@ -44,6 +44,7 @@ case class AddressRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = addressid def toUnsavedRow(addressid: Defaulted[AddressId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): AddressRowUnsaved = AddressRowUnsaved(addressline1, addressline2, city, stateprovinceid, postalcode, spatiallocation, addressid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala index c723e5a7b8..400229c5e1 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/addresstype/AddresstypeRow.scala @@ -32,6 +32,7 @@ case class AddresstypeRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = addresstypeid def toUnsavedRow(addresstypeid: Defaulted[AddresstypeId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): AddresstypeRowUnsaved = AddresstypeRowUnsaved(name, addresstypeid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala index 4a083baa29..b3118caefd 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentity/BusinessentityRow.scala @@ -29,6 +29,7 @@ case class BusinessentityRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(businessentityid: Defaulted[BusinessentityId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BusinessentityRowUnsaved = BusinessentityRowUnsaved(businessentityid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala index 8f24f1ae29..b053c2a29c 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressId.scala @@ -16,7 +16,11 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `person.businessentityaddress` */ -case class BusinessentityaddressId(businessentityid: BusinessentityId, addressid: AddressId, addresstypeid: AddresstypeId) +case class BusinessentityaddressId( + businessentityid: BusinessentityId, + addressid: AddressId, + addresstypeid: AddresstypeId +) object BusinessentityaddressId { implicit lazy val jsonDecoder: JsonDecoder[BusinessentityaddressId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val businessentityid = jsonObj.get("businessentityid").toRight("Missing field 'businessentityid'").flatMap(_.as(BusinessentityId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala index 036bf886fd..d65920e8ba 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentityaddress/BusinessentityaddressRow.scala @@ -39,6 +39,7 @@ case class BusinessentityaddressRow( modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentityaddressId = BusinessentityaddressId(businessentityid, addressid, addresstypeid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BusinessentityaddressRowUnsaved = BusinessentityaddressRowUnsaved(businessentityid, addressid, addresstypeid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala index a84fcc5a76..72e02d5e2b 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactId.scala @@ -15,7 +15,11 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `person.businessentitycontact` */ -case class BusinessentitycontactId(businessentityid: BusinessentityId, personid: BusinessentityId, contacttypeid: ContacttypeId) +case class BusinessentitycontactId( + businessentityid: BusinessentityId, + personid: BusinessentityId, + contacttypeid: ContacttypeId +) object BusinessentitycontactId { implicit lazy val jsonDecoder: JsonDecoder[BusinessentitycontactId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val businessentityid = jsonObj.get("businessentityid").toRight("Missing field 'businessentityid'").flatMap(_.as(BusinessentityId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala index 040f056323..e8b9676566 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/businessentitycontact/BusinessentitycontactRow.scala @@ -38,6 +38,7 @@ case class BusinessentitycontactRow( modifieddate: TypoLocalDateTime ){ val compositeId: BusinessentitycontactId = BusinessentitycontactId(businessentityid, personid, contacttypeid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BusinessentitycontactRowUnsaved = BusinessentitycontactRowUnsaved(businessentityid, personid, contacttypeid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala index e6c401b6f9..07c097cbe1 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/contacttype/ContacttypeRow.scala @@ -29,6 +29,7 @@ case class ContacttypeRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = contacttypeid def toUnsavedRow(contacttypeid: Defaulted[ContacttypeId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ContacttypeRowUnsaved = ContacttypeRowUnsaved(name, contacttypeid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala index 684d36e9c8..f904fb2742 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/countryregion/CountryregionRow.scala @@ -28,6 +28,7 @@ case class CountryregionRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = countryregioncode def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CountryregionRowUnsaved = CountryregionRowUnsaved(countryregioncode, name, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala index 300907e19c..dee205d32e 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressId.scala @@ -14,7 +14,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `person.emailaddress` */ -case class EmailaddressId(businessentityid: BusinessentityId, emailaddressid: Int) +case class EmailaddressId( + businessentityid: BusinessentityId, + emailaddressid: Int +) object EmailaddressId { implicit lazy val jsonDecoder: JsonDecoder[EmailaddressId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val businessentityid = jsonObj.get("businessentityid").toRight("Missing field 'businessentityid'").flatMap(_.as(BusinessentityId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala index 41c2ec7c8c..7c90c5671d 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/emailaddress/EmailaddressRow.scala @@ -36,6 +36,7 @@ case class EmailaddressRow( modifieddate: TypoLocalDateTime ){ val compositeId: EmailaddressId = EmailaddressId(businessentityid, emailaddressid) + val id = compositeId def toUnsavedRow(emailaddressid: Defaulted[Int], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): EmailaddressRowUnsaved = EmailaddressRowUnsaved(businessentityid, emailaddress, emailaddressid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala index 7b40fe8ab4..37c6a08fc6 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/password/PasswordRow.scala @@ -33,6 +33,7 @@ case class PasswordRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PasswordRowUnsaved = PasswordRowUnsaved(businessentityid, passwordhash, passwordsalt, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/person/PersonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/person/PersonRow.scala index 3ffd39a2cc..106ca275b6 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/person/PersonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/person/PersonRow.scala @@ -58,6 +58,7 @@ case class PersonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(namestyle: Defaulted[NameStyle] = Defaulted.Provided(this.namestyle), emailpromotion: Defaulted[Int] = Defaulted.Provided(this.emailpromotion), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PersonRowUnsaved = PersonRowUnsaved(businessentityid, persontype, title, firstname, middlename, lastname, suffix, additionalcontactinfo, demographics, namestyle, emailpromotion, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala index 934cd43021..d5b425c248 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneId.scala @@ -16,7 +16,11 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `person.personphone` */ -case class PersonphoneId(businessentityid: BusinessentityId, phonenumber: Phone, phonenumbertypeid: PhonenumbertypeId) +case class PersonphoneId( + businessentityid: BusinessentityId, + phonenumber: Phone, + phonenumbertypeid: PhonenumbertypeId +) object PersonphoneId { implicit lazy val jsonDecoder: JsonDecoder[PersonphoneId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val businessentityid = jsonObj.get("businessentityid").toRight("Missing field 'businessentityid'").flatMap(_.as(BusinessentityId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala index f0dc9f4912..68dd54ce61 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/personphone/PersonphoneRow.scala @@ -35,6 +35,7 @@ case class PersonphoneRow( modifieddate: TypoLocalDateTime ){ val compositeId: PersonphoneId = PersonphoneId(businessentityid, phonenumber, phonenumbertypeid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PersonphoneRowUnsaved = PersonphoneRowUnsaved(businessentityid, phonenumber, phonenumbertypeid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala index b3435ff72f..f0b535d7a5 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/phonenumbertype/PhonenumbertypeRow.scala @@ -29,6 +29,7 @@ case class PhonenumbertypeRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = phonenumbertypeid def toUnsavedRow(phonenumbertypeid: Defaulted[PhonenumbertypeId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PhonenumbertypeRowUnsaved = PhonenumbertypeRowUnsaved(name, phonenumbertypeid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala index 4d70eb4f1f..02687195b2 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/person/stateprovince/StateprovinceRow.scala @@ -46,6 +46,7 @@ case class StateprovinceRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = stateprovinceid def toUnsavedRow(stateprovinceid: Defaulted[StateprovinceId], isonlystateprovinceflag: Defaulted[Flag] = Defaulted.Provided(this.isonlystateprovinceflag), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): StateprovinceRowUnsaved = StateprovinceRowUnsaved(stateprovincecode, countryregioncode, name, territoryid, stateprovinceid, isonlystateprovinceflag, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala index 883fd86c6a..c5ac25aa02 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRow.scala @@ -56,6 +56,7 @@ case class BillofmaterialsRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = billofmaterialsid def toUnsavedRow(billofmaterialsid: Defaulted[Int], startdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.startdate), perassemblyqty: Defaulted[BigDecimal] = Defaulted.Provided(this.perassemblyqty), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): BillofmaterialsRowUnsaved = BillofmaterialsRowUnsaved(productassemblyid, componentid, enddate, unitmeasurecode, bomlevel, billofmaterialsid, startdate, perassemblyqty, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala index e512626e27..9b48e72839 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/culture/CultureRow.scala @@ -28,6 +28,7 @@ case class CultureRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = cultureid def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CultureRowUnsaved = CultureRowUnsaved(cultureid, name, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala index 47f414ce4f..9a9f5f31ed 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/document/DocumentRow.scala @@ -58,6 +58,7 @@ case class DocumentRow( Default: '/'::character varying */ documentnode: DocumentId ){ + val id = documentnode def toUnsavedRow(documentnode: Defaulted[DocumentId], folderflag: Defaulted[Flag] = Defaulted.Provided(this.folderflag), changenumber: Defaulted[Int] = Defaulted.Provided(this.changenumber), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): DocumentRowUnsaved = DocumentRowUnsaved(title, owner, filename, fileextension, revision, status, documentsummary, document, folderflag, changenumber, rowguid, modifieddate, documentnode) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala index ec202b2566..501fe5b350 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/illustration/IllustrationRow.scala @@ -29,6 +29,7 @@ case class IllustrationRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = illustrationid def toUnsavedRow(illustrationid: Defaulted[IllustrationId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): IllustrationRowUnsaved = IllustrationRowUnsaved(diagram, illustrationid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/location/LocationRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/location/LocationRow.scala index 72a5af678f..32cc1f9ea5 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/location/LocationRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/location/LocationRow.scala @@ -37,6 +37,7 @@ case class LocationRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = locationid def toUnsavedRow(locationid: Defaulted[LocationId], costrate: Defaulted[BigDecimal] = Defaulted.Provided(this.costrate), availability: Defaulted[BigDecimal] = Defaulted.Provided(this.availability), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): LocationRowUnsaved = LocationRowUnsaved(name, locationid, costrate, availability, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/product/ProductRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/product/ProductRow.scala index eea9da0012..45cde194ce 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/product/ProductRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/product/ProductRow.scala @@ -96,6 +96,7 @@ case class ProductRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productid def toUnsavedRow(productid: Defaulted[ProductId], makeflag: Defaulted[Flag] = Defaulted.Provided(this.makeflag), finishedgoodsflag: Defaulted[Flag] = Defaulted.Provided(this.finishedgoodsflag), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductRowUnsaved = ProductRowUnsaved(name, productnumber, color, safetystocklevel, reorderpoint, standardcost, listprice, size, sizeunitmeasurecode, weightunitmeasurecode, weight, daystomanufacture, productline, `class`, style, productsubcategoryid, productmodelid, sellstartdate, sellenddate, discontinueddate, productid, makeflag, finishedgoodsflag, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala index 28983957e8..a18181c1bf 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcategory/ProductcategoryRow.scala @@ -32,6 +32,7 @@ case class ProductcategoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productcategoryid def toUnsavedRow(productcategoryid: Defaulted[ProductcategoryId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductcategoryRowUnsaved = ProductcategoryRowUnsaved(name, productcategoryid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala index 2acd0fee81..730fd47904 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `production.productcosthistory` */ -case class ProductcosthistoryId(productid: ProductId, startdate: TypoLocalDateTime) +case class ProductcosthistoryId( + productid: ProductId, + startdate: TypoLocalDateTime +) object ProductcosthistoryId { implicit lazy val jsonDecoder: JsonDecoder[ProductcosthistoryId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val productid = jsonObj.get("productid").toRight("Missing field 'productid'").flatMap(_.as(ProductId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala index 9d30487375..70c9d535f4 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRow.scala @@ -37,6 +37,7 @@ case class ProductcosthistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductcosthistoryId = ProductcosthistoryId(productid, startdate) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductcosthistoryRowUnsaved = ProductcosthistoryRowUnsaved(productid, startdate, enddate, standardcost, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala index ad187f60cb..66f8a2b94c 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdescription/ProductdescriptionRow.scala @@ -31,6 +31,7 @@ case class ProductdescriptionRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productdescriptionid def toUnsavedRow(productdescriptionid: Defaulted[ProductdescriptionId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductdescriptionRowUnsaved = ProductdescriptionRowUnsaved(description, productdescriptionid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala index 21f187968b..e7394d5641 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `production.productdocument` */ -case class ProductdocumentId(productid: ProductId, documentnode: DocumentId) +case class ProductdocumentId( + productid: ProductId, + documentnode: DocumentId +) object ProductdocumentId { implicit lazy val jsonDecoder: JsonDecoder[ProductdocumentId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val productid = jsonObj.get("productid").toRight("Missing field 'productid'").flatMap(_.as(ProductId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala index 7d441a6afd..1a1e9e3f39 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productdocument/ProductdocumentRow.scala @@ -33,6 +33,7 @@ case class ProductdocumentRow( documentnode: DocumentId ){ val compositeId: ProductdocumentId = ProductdocumentId(productid, documentnode) + val id = compositeId def toUnsavedRow(documentnode: Defaulted[DocumentId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductdocumentRowUnsaved = ProductdocumentRowUnsaved(productid, modifieddate, documentnode) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala index 4216666167..8f0f6d0484 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `production.productinventory` */ -case class ProductinventoryId(productid: ProductId, locationid: LocationId) +case class ProductinventoryId( + productid: ProductId, + locationid: LocationId +) object ProductinventoryId { implicit lazy val jsonDecoder: JsonDecoder[ProductinventoryId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val productid = jsonObj.get("productid").toRight("Missing field 'productid'").flatMap(_.as(ProductId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala index f8d363b46f..e1e6ae52b9 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRow.scala @@ -44,6 +44,7 @@ case class ProductinventoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductinventoryId = ProductinventoryId(productid, locationid) + val id = compositeId def toUnsavedRow(quantity: Defaulted[TypoShort] = Defaulted.Provided(this.quantity), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductinventoryRowUnsaved = ProductinventoryRowUnsaved(productid, locationid, shelf, bin, quantity, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala index 961833d5d4..cf4295e525 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `production.productlistpricehistory` */ -case class ProductlistpricehistoryId(productid: ProductId, startdate: TypoLocalDateTime) +case class ProductlistpricehistoryId( + productid: ProductId, + startdate: TypoLocalDateTime +) object ProductlistpricehistoryId { implicit lazy val jsonDecoder: JsonDecoder[ProductlistpricehistoryId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val productid = jsonObj.get("productid").toRight("Missing field 'productid'").flatMap(_.as(ProductId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala index 14210667ba..4b5cf002f7 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRow.scala @@ -37,6 +37,7 @@ case class ProductlistpricehistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductlistpricehistoryId = ProductlistpricehistoryId(productid, startdate) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductlistpricehistoryRowUnsaved = ProductlistpricehistoryRowUnsaved(productid, startdate, enddate, listprice, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala index 0ce191d36b..26a205f941 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodel/ProductmodelRow.scala @@ -37,6 +37,7 @@ case class ProductmodelRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productmodelid def toUnsavedRow(productmodelid: Defaulted[ProductmodelId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductmodelRowUnsaved = ProductmodelRowUnsaved(name, catalogdescription, instructions, productmodelid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala index 678ac7f59e..b1a6202746 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `production.productmodelillustration` */ -case class ProductmodelillustrationId(productmodelid: ProductmodelId, illustrationid: IllustrationId) +case class ProductmodelillustrationId( + productmodelid: ProductmodelId, + illustrationid: IllustrationId +) object ProductmodelillustrationId { implicit lazy val jsonDecoder: JsonDecoder[ProductmodelillustrationId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val productmodelid = jsonObj.get("productmodelid").toRight("Missing field 'productmodelid'").flatMap(_.as(ProductmodelId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala index c58bdd0916..149e0dfa1b 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelillustration/ProductmodelillustrationRow.scala @@ -32,6 +32,7 @@ case class ProductmodelillustrationRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelillustrationId = ProductmodelillustrationId(productmodelid, illustrationid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductmodelillustrationRowUnsaved = ProductmodelillustrationRowUnsaved(productmodelid, illustrationid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala index 1cf04b4cd9..4724af671c 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureId.scala @@ -16,7 +16,11 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `production.productmodelproductdescriptionculture` */ -case class ProductmodelproductdescriptioncultureId(productmodelid: ProductmodelId, productdescriptionid: ProductdescriptionId, cultureid: CultureId) +case class ProductmodelproductdescriptioncultureId( + productmodelid: ProductmodelId, + productdescriptionid: ProductdescriptionId, + cultureid: CultureId +) object ProductmodelproductdescriptioncultureId { implicit lazy val jsonDecoder: JsonDecoder[ProductmodelproductdescriptioncultureId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val productmodelid = jsonObj.get("productmodelid").toRight("Missing field 'productmodelid'").flatMap(_.as(ProductmodelId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala index a4f83599ba..899cd00672 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productmodelproductdescriptionculture/ProductmodelproductdescriptioncultureRow.scala @@ -36,6 +36,7 @@ case class ProductmodelproductdescriptioncultureRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductmodelproductdescriptioncultureId = ProductmodelproductdescriptioncultureId(productmodelid, productdescriptionid, cultureid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductmodelproductdescriptioncultureRowUnsaved = ProductmodelproductdescriptioncultureRowUnsaved(productmodelid, productdescriptionid, cultureid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala index 6052cd9ca7..b50ad1bdea 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productphoto/ProductphotoRow.scala @@ -35,6 +35,7 @@ case class ProductphotoRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productphotoid def toUnsavedRow(productphotoid: Defaulted[ProductphotoId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductphotoRowUnsaved = ProductphotoRowUnsaved(thumbnailphoto, thumbnailphotofilename, largephoto, largephotofilename, productphotoid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala index 337f1bf816..612554c7ab 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `production.productproductphoto` */ -case class ProductproductphotoId(productid: ProductId, productphotoid: ProductphotoId) +case class ProductproductphotoId( + productid: ProductId, + productphotoid: ProductphotoId +) object ProductproductphotoId { implicit lazy val jsonDecoder: JsonDecoder[ProductproductphotoId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val productid = jsonObj.get("productid").toRight("Missing field 'productid'").flatMap(_.as(ProductId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala index 8b5b64c21e..7397568e22 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productproductphoto/ProductproductphotoRow.scala @@ -36,6 +36,7 @@ case class ProductproductphotoRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductproductphotoId = ProductproductphotoId(productid, productphotoid) + val id = compositeId def toUnsavedRow(primary: Defaulted[Flag] = Defaulted.Provided(this.primary), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductproductphotoRowUnsaved = ProductproductphotoRowUnsaved(productid, productphotoid, primary, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala index 66e85d357b..9a4232af68 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRow.scala @@ -43,6 +43,7 @@ case class ProductreviewRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productreviewid def toUnsavedRow(productreviewid: Defaulted[ProductreviewId], reviewdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.reviewdate), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductreviewRowUnsaved = ProductreviewRowUnsaved(productid, reviewername, emailaddress, rating, comments, productreviewid, reviewdate, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala index 2c7d0afc18..1f7bcd0bf8 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/productsubcategory/ProductsubcategoryRow.scala @@ -36,6 +36,7 @@ case class ProductsubcategoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = productsubcategoryid def toUnsavedRow(productsubcategoryid: Defaulted[ProductsubcategoryId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductsubcategoryRowUnsaved = ProductsubcategoryRowUnsaved(productcategoryid, name, productsubcategoryid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala index 156653f44b..127cb77abf 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/scrapreason/ScrapreasonRow.scala @@ -29,6 +29,7 @@ case class ScrapreasonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = scrapreasonid def toUnsavedRow(scrapreasonid: Defaulted[ScrapreasonId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ScrapreasonRowUnsaved = ScrapreasonRowUnsaved(name, scrapreasonid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala index 7673f26e1e..e1685725a7 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRow.scala @@ -45,6 +45,7 @@ case class TransactionhistoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = transactionid def toUnsavedRow(transactionid: Defaulted[TransactionhistoryId], referenceorderlineid: Defaulted[Int] = Defaulted.Provided(this.referenceorderlineid), transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.transactiondate), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): TransactionhistoryRowUnsaved = TransactionhistoryRowUnsaved(productid, referenceorderid, transactiontype, quantity, actualcost, transactionid, referenceorderlineid, transactiondate, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala index 6556f2d613..70838c5725 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRow.scala @@ -42,6 +42,7 @@ case class TransactionhistoryarchiveRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = transactionid def toUnsavedRow(referenceorderlineid: Defaulted[Int] = Defaulted.Provided(this.referenceorderlineid), transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.transactiondate), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): TransactionhistoryarchiveRowUnsaved = TransactionhistoryarchiveRowUnsaved(transactionid, productid, referenceorderid, transactiontype, quantity, actualcost, referenceorderlineid, transactiondate, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala index 7e22511baa..942c1cee6f 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/unitmeasure/UnitmeasureRow.scala @@ -28,6 +28,7 @@ case class UnitmeasureRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = unitmeasurecode def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): UnitmeasureRowUnsaved = UnitmeasureRowUnsaved(unitmeasurecode, name, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala index 61debb5dff..dec74328e2 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorder/WorkorderRow.scala @@ -49,6 +49,7 @@ case class WorkorderRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = workorderid def toUnsavedRow(workorderid: Defaulted[WorkorderId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): WorkorderRowUnsaved = WorkorderRowUnsaved(productid, orderqty, scrappedqty, startdate, enddate, duedate, scrapreasonid, workorderid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala index e6816dfeca..c4171cf56c 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingId.scala @@ -15,7 +15,11 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `production.workorderrouting` */ -case class WorkorderroutingId(workorderid: WorkorderId, productid: Int, operationsequence: TypoShort) +case class WorkorderroutingId( + workorderid: WorkorderId, + productid: Int, + operationsequence: TypoShort +) object WorkorderroutingId { implicit lazy val jsonDecoder: JsonDecoder[WorkorderroutingId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val workorderid = jsonObj.get("workorderid").toRight("Missing field 'workorderid'").flatMap(_.as(WorkorderId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala index cb8102ccd4..ce72f45325 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRow.scala @@ -58,6 +58,7 @@ case class WorkorderroutingRow( modifieddate: TypoLocalDateTime ){ val compositeId: WorkorderroutingId = WorkorderroutingId(workorderid, productid, operationsequence) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): WorkorderroutingRowUnsaved = WorkorderroutingRowUnsaved(workorderid, productid, operationsequence, locationid, scheduledstartdate, scheduledenddate, actualstartdate, actualenddate, actualresourcehrs, plannedcost, actualcost, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala index 8806bddb9d..e26fe4f62d 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/flaff/FlaffId.scala @@ -13,7 +13,12 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `public.flaff` */ -case class FlaffId(code: ShortText, anotherCode: /* max 20 chars */ String, someNumber: Int, specifier: ShortText) +case class FlaffId( + code: ShortText, + anotherCode: /* max 20 chars */ String, + someNumber: Int, + specifier: ShortText +) object FlaffId { implicit lazy val jsonDecoder: JsonDecoder[FlaffId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val code = jsonObj.get("code").toRight("Missing field 'code'").flatMap(_.as(ShortText.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala index b154804e76..4b07604d7e 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/flaff/FlaffRow.scala @@ -28,6 +28,7 @@ case class FlaffRow( parentspecifier: Option[ShortText] ){ val compositeId: FlaffId = FlaffId(code, anotherCode, someNumber, specifier) + val id = compositeId } object FlaffRow { diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala index c1188e74f8..ff8f7639be 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/identity_test/IdentityTestRow.scala @@ -24,6 +24,7 @@ case class IdentityTestRow( defaultGenerated: Int, name: IdentityTestId ){ + val id = name def toUnsavedRow(defaultGenerated: Defaulted[Int] = Defaulted.Provided(this.defaultGenerated)): IdentityTestRowUnsaved = IdentityTestRowUnsaved(name, defaultGenerated) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/users/UsersRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/users/UsersRow.scala index 29c66875db..e09ab58af8 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/users/UsersRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/public/users/UsersRow.scala @@ -29,6 +29,7 @@ case class UsersRow( createdAt: TypoInstant, verifiedOn: Option[TypoInstant] ){ + val id = userId def toUnsavedRow(createdAt: Defaulted[TypoInstant] = Defaulted.Provided(this.createdAt)): UsersRowUnsaved = UsersRowUnsaved(userId, name, lastName, email, password, verifiedOn, createdAt) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala index b1fd88a9df..6d8a183b03 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `purchasing.productvendor` */ -case class ProductvendorId(productid: ProductId, businessentityid: BusinessentityId) +case class ProductvendorId( + productid: ProductId, + businessentityid: BusinessentityId +) object ProductvendorId { implicit lazy val jsonDecoder: JsonDecoder[ProductvendorId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val productid = jsonObj.get("productid").toRight("Missing field 'productid'").flatMap(_.as(ProductId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala index f534045604..5de4d14bb9 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRow.scala @@ -56,6 +56,7 @@ case class ProductvendorRow( modifieddate: TypoLocalDateTime ){ val compositeId: ProductvendorId = ProductvendorId(productid, businessentityid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ProductvendorRowUnsaved = ProductvendorRowUnsaved(productid, businessentityid, averageleadtime, standardprice, lastreceiptcost, lastreceiptdate, minorderqty, maxorderqty, onorderqty, unitmeasurecode, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala index fecfca583c..8253a51248 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailId.scala @@ -14,7 +14,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `purchasing.purchaseorderdetail` */ -case class PurchaseorderdetailId(purchaseorderid: PurchaseorderheaderId, purchaseorderdetailid: Int) +case class PurchaseorderdetailId( + purchaseorderid: PurchaseorderheaderId, + purchaseorderdetailid: Int +) object PurchaseorderdetailId { implicit lazy val jsonDecoder: JsonDecoder[PurchaseorderdetailId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val purchaseorderid = jsonObj.get("purchaseorderid").toRight("Missing field 'purchaseorderid'").flatMap(_.as(PurchaseorderheaderId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala index 7d67f81f15..daca2afc70 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRow.scala @@ -50,6 +50,7 @@ case class PurchaseorderdetailRow( modifieddate: TypoLocalDateTime ){ val compositeId: PurchaseorderdetailId = PurchaseorderdetailId(purchaseorderid, purchaseorderdetailid) + val id = compositeId def toUnsavedRow(purchaseorderdetailid: Defaulted[Int], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PurchaseorderdetailRowUnsaved = PurchaseorderdetailRowUnsaved(purchaseorderid, duedate, orderqty, productid, unitprice, receivedqty, rejectedqty, purchaseorderdetailid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala index 0c8b25f233..9ad8d0824a 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRow.scala @@ -64,6 +64,7 @@ case class PurchaseorderheaderRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = purchaseorderid def toUnsavedRow(purchaseorderid: Defaulted[PurchaseorderheaderId], revisionnumber: Defaulted[TypoShort] = Defaulted.Provided(this.revisionnumber), status: Defaulted[TypoShort] = Defaulted.Provided(this.status), orderdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.orderdate), subtotal: Defaulted[BigDecimal] = Defaulted.Provided(this.subtotal), taxamt: Defaulted[BigDecimal] = Defaulted.Provided(this.taxamt), freight: Defaulted[BigDecimal] = Defaulted.Provided(this.freight), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PurchaseorderheaderRowUnsaved = PurchaseorderheaderRowUnsaved(employeeid, vendorid, shipmethodid, shipdate, purchaseorderid, revisionnumber, status, orderdate, subtotal, taxamt, freight, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala index 81e5feb8b1..3125fc5c17 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRow.scala @@ -40,6 +40,7 @@ case class ShipmethodRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = shipmethodid def toUnsavedRow(shipmethodid: Defaulted[ShipmethodId], shipbase: Defaulted[BigDecimal] = Defaulted.Provided(this.shipbase), shiprate: Defaulted[BigDecimal] = Defaulted.Provided(this.shiprate), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ShipmethodRowUnsaved = ShipmethodRowUnsaved(name, shipmethodid, shipbase, shiprate, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala index a2d18d04f3..f6dde1402b 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRow.scala @@ -46,6 +46,7 @@ case class VendorRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(preferredvendorstatus: Defaulted[Flag] = Defaulted.Provided(this.preferredvendorstatus), activeflag: Defaulted[Flag] = Defaulted.Provided(this.activeflag), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): VendorRowUnsaved = VendorRowUnsaved(businessentityid, accountnumber, name, creditrating, purchasingwebserviceurl, preferredvendorstatus, activeflag, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala index 1f7e7ec8ef..d7a704190e 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `sales.countryregioncurrency` */ -case class CountryregioncurrencyId(countryregioncode: CountryregionId, currencycode: CurrencyId) +case class CountryregioncurrencyId( + countryregioncode: CountryregionId, + currencycode: CurrencyId +) object CountryregioncurrencyId { implicit lazy val jsonDecoder: JsonDecoder[CountryregioncurrencyId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val countryregioncode = jsonObj.get("countryregioncode").toRight("Missing field 'countryregioncode'").flatMap(_.as(CountryregionId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala index f8432e9504..8ba722ef72 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/countryregioncurrency/CountryregioncurrencyRow.scala @@ -32,6 +32,7 @@ case class CountryregioncurrencyRow( modifieddate: TypoLocalDateTime ){ val compositeId: CountryregioncurrencyId = CountryregioncurrencyId(countryregioncode, currencycode) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CountryregioncurrencyRowUnsaved = CountryregioncurrencyRowUnsaved(countryregioncode, currencycode, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala index 62c0cc9f0d..c18502cc9d 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/creditcard/CreditcardRow.scala @@ -36,6 +36,7 @@ case class CreditcardRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = creditcardid def toUnsavedRow(creditcardid: Defaulted[/* user-picked */ CustomCreditcardId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CreditcardRowUnsaved = CreditcardRowUnsaved(cardtype, cardnumber, expmonth, expyear, creditcardid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala index cfcfcdb81e..978e6a9264 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currency/CurrencyRow.scala @@ -28,6 +28,7 @@ case class CurrencyRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = currencycode def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CurrencyRowUnsaved = CurrencyRowUnsaved(currencycode, name, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala index 8b2e925412..24b10e380e 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/currencyrate/CurrencyrateRow.scala @@ -39,6 +39,7 @@ case class CurrencyrateRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = currencyrateid def toUnsavedRow(currencyrateid: Defaulted[CurrencyrateId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CurrencyrateRowUnsaved = CurrencyrateRowUnsaved(currencyratedate, fromcurrencycode, tocurrencycode, averagerate, endofdayrate, currencyrateid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala index 520b60104e..596f606f0e 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/customer/CustomerRow.scala @@ -40,6 +40,7 @@ case class CustomerRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = customerid def toUnsavedRow(customerid: Defaulted[CustomerId], rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): CustomerRowUnsaved = CustomerRowUnsaved(personid, storeid, territoryid, customerid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala index a12d2bb352..ebbcd81e50 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `sales.personcreditcard` */ -case class PersoncreditcardId(businessentityid: BusinessentityId, creditcardid: /* user-picked */ CustomCreditcardId) +case class PersoncreditcardId( + businessentityid: BusinessentityId, + creditcardid: /* user-picked */ CustomCreditcardId +) object PersoncreditcardId { implicit lazy val jsonDecoder: JsonDecoder[PersoncreditcardId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val businessentityid = jsonObj.get("businessentityid").toRight("Missing field 'businessentityid'").flatMap(_.as(BusinessentityId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala index ec92c67e2b..a42cc69d4d 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/personcreditcard/PersoncreditcardRow.scala @@ -32,6 +32,7 @@ case class PersoncreditcardRow( modifieddate: TypoLocalDateTime ){ val compositeId: PersoncreditcardId = PersoncreditcardId(businessentityid, creditcardid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): PersoncreditcardRowUnsaved = PersoncreditcardRowUnsaved(businessentityid, creditcardid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala index 18accf85f1..3fcb8ce6f1 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailFields.scala @@ -16,6 +16,7 @@ import adventureworks.sales.salesorderheader.SalesorderheaderId import adventureworks.sales.salesorderheader.SalesorderheaderRow import adventureworks.sales.specialoffer.SpecialofferId import adventureworks.sales.specialofferproduct.SpecialofferproductFields +import adventureworks.sales.specialofferproduct.SpecialofferproductId import adventureworks.sales.specialofferproduct.SpecialofferproductRow import typo.dsl.ForeignKey import typo.dsl.Path @@ -52,6 +53,11 @@ trait SalesorderdetailFields { def compositeIdIn(compositeIds: Array[SalesorderdetailId]): SqlExpr[Boolean, Required] = new CompositeIn(compositeIds)(TuplePart(salesorderid)(_.salesorderid), TuplePart(salesorderdetailid)(_.salesorderdetailid)) + def extractSpecialofferproductIdIs(id: SpecialofferproductId): SqlExpr[Boolean, Required] = + specialofferid.isEqual(id.specialofferid).and(productid.isEqual(id.productid)) + def extractSpecialofferproductIdIn(ids: Array[SpecialofferproductId]): SqlExpr[Boolean, Required] = + new CompositeIn(ids)(TuplePart(specialofferid)(_.specialofferid), TuplePart(productid)(_.productid)) + } object SalesorderdetailFields { diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala index 2d76ef8ae2..d129e6ed9f 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailId.scala @@ -14,7 +14,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `sales.salesorderdetail` */ -case class SalesorderdetailId(salesorderid: SalesorderheaderId, salesorderdetailid: Int) +case class SalesorderdetailId( + salesorderid: SalesorderheaderId, + salesorderdetailid: Int +) object SalesorderdetailId { implicit lazy val jsonDecoder: JsonDecoder[SalesorderdetailId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val salesorderid = jsonObj.get("salesorderid").toRight("Missing field 'salesorderid'").flatMap(_.as(SalesorderheaderId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala index 888350c519..f33b342d3b 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRow.scala @@ -14,6 +14,7 @@ import adventureworks.customtypes.TypoUUID import adventureworks.production.product.ProductId import adventureworks.sales.salesorderheader.SalesorderheaderId import adventureworks.sales.specialoffer.SpecialofferId +import adventureworks.sales.specialofferproduct.SpecialofferproductId import java.sql.ResultSet import zio.jdbc.JdbcDecoder import zio.json.JsonDecoder @@ -55,6 +56,11 @@ case class SalesorderdetailRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderdetailId = SalesorderdetailId(salesorderid, salesorderdetailid) + val id = compositeId + val extractSpecialofferproductId: SpecialofferproductId = SpecialofferproductId( + specialofferid = specialofferid, + productid = productid + ) def toUnsavedRow(salesorderdetailid: Defaulted[Int], unitpricediscount: Defaulted[BigDecimal] = Defaulted.Provided(this.unitpricediscount), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesorderdetailRowUnsaved = SalesorderdetailRowUnsaved(salesorderid, carriertrackingnumber, orderqty, productid, specialofferid, unitprice, salesorderdetailid, unitpricediscount, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala index 02d65928dd..a2d820d221 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRow.scala @@ -107,6 +107,7 @@ case class SalesorderheaderRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = salesorderid def toUnsavedRow(salesorderid: Defaulted[SalesorderheaderId], revisionnumber: Defaulted[TypoShort] = Defaulted.Provided(this.revisionnumber), orderdate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.orderdate), status: Defaulted[TypoShort] = Defaulted.Provided(this.status), onlineorderflag: Defaulted[Flag] = Defaulted.Provided(this.onlineorderflag), subtotal: Defaulted[BigDecimal] = Defaulted.Provided(this.subtotal), taxamt: Defaulted[BigDecimal] = Defaulted.Provided(this.taxamt), freight: Defaulted[BigDecimal] = Defaulted.Provided(this.freight), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesorderheaderRowUnsaved = SalesorderheaderRowUnsaved(duedate, shipdate, purchaseordernumber, accountnumber, customerid, salespersonid, territoryid, billtoaddressid, shiptoaddressid, shipmethodid, creditcardid, creditcardapprovalcode, currencyrateid, totaldue, comment, salesorderid, revisionnumber, orderdate, status, onlineorderflag, subtotal, taxamt, freight, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala index 7e4b8f42c1..3215bb6bfe 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `sales.salesorderheadersalesreason` */ -case class SalesorderheadersalesreasonId(salesorderid: SalesorderheaderId, salesreasonid: SalesreasonId) +case class SalesorderheadersalesreasonId( + salesorderid: SalesorderheaderId, + salesreasonid: SalesreasonId +) object SalesorderheadersalesreasonId { implicit lazy val jsonDecoder: JsonDecoder[SalesorderheadersalesreasonId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val salesorderid = jsonObj.get("salesorderid").toRight("Missing field 'salesorderid'").flatMap(_.as(SalesorderheaderId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala index 71074209d8..0d22d9f64a 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesorderheadersalesreason/SalesorderheadersalesreasonRow.scala @@ -32,6 +32,7 @@ case class SalesorderheadersalesreasonRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalesorderheadersalesreasonId = SalesorderheadersalesreasonId(salesorderid, salesreasonid) + val id = compositeId def toUnsavedRow(modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesorderheadersalesreasonRowUnsaved = SalesorderheadersalesreasonRowUnsaved(salesorderid, salesreasonid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala index 705a0f419a..645cd1bfd6 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRow.scala @@ -53,6 +53,7 @@ case class SalespersonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(bonus: Defaulted[BigDecimal] = Defaulted.Provided(this.bonus), commissionpct: Defaulted[BigDecimal] = Defaulted.Provided(this.commissionpct), salesytd: Defaulted[BigDecimal] = Defaulted.Provided(this.salesytd), saleslastyear: Defaulted[BigDecimal] = Defaulted.Provided(this.saleslastyear), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalespersonRowUnsaved = SalespersonRowUnsaved(businessentityid, territoryid, salesquota, bonus, commissionpct, salesytd, saleslastyear, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala index 92da49d576..ca90badb81 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `sales.salespersonquotahistory` */ -case class SalespersonquotahistoryId(businessentityid: BusinessentityId, quotadate: TypoLocalDateTime) +case class SalespersonquotahistoryId( + businessentityid: BusinessentityId, + quotadate: TypoLocalDateTime +) object SalespersonquotahistoryId { implicit lazy val jsonDecoder: JsonDecoder[SalespersonquotahistoryId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val businessentityid = jsonObj.get("businessentityid").toRight("Missing field 'businessentityid'").flatMap(_.as(BusinessentityId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala index a94fb45206..4afd58826c 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRow.scala @@ -36,6 +36,7 @@ case class SalespersonquotahistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalespersonquotahistoryId = SalespersonquotahistoryId(businessentityid, quotadate) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalespersonquotahistoryRowUnsaved = SalespersonquotahistoryRowUnsaved(businessentityid, quotadate, salesquota, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala index c9358c3486..e6c113ddf2 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesreason/SalesreasonRow.scala @@ -31,6 +31,7 @@ case class SalesreasonRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = salesreasonid def toUnsavedRow(salesreasonid: Defaulted[SalesreasonId], modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesreasonRowUnsaved = SalesreasonRowUnsaved(name, reasontype, salesreasonid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala index 23837c1962..e58f1b9b53 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRow.scala @@ -43,6 +43,7 @@ case class SalestaxrateRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = salestaxrateid def toUnsavedRow(salestaxrateid: Defaulted[SalestaxrateId], taxrate: Defaulted[BigDecimal] = Defaulted.Provided(this.taxrate), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalestaxrateRowUnsaved = SalestaxrateRowUnsaved(stateprovinceid, taxtype, name, salestaxrateid, taxrate, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala index 49fa7e7832..4042300c92 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRow.scala @@ -54,6 +54,7 @@ case class SalesterritoryRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = territoryid def toUnsavedRow(territoryid: Defaulted[SalesterritoryId], salesytd: Defaulted[BigDecimal] = Defaulted.Provided(this.salesytd), saleslastyear: Defaulted[BigDecimal] = Defaulted.Provided(this.saleslastyear), costytd: Defaulted[BigDecimal] = Defaulted.Provided(this.costytd), costlastyear: Defaulted[BigDecimal] = Defaulted.Provided(this.costlastyear), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesterritoryRowUnsaved = SalesterritoryRowUnsaved(name, countryregioncode, group, territoryid, salesytd, saleslastyear, costytd, costlastyear, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala index 945403fb27..8692ca2317 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryId.scala @@ -16,7 +16,11 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `sales.salesterritoryhistory` */ -case class SalesterritoryhistoryId(businessentityid: BusinessentityId, startdate: TypoLocalDateTime, territoryid: SalesterritoryId) +case class SalesterritoryhistoryId( + businessentityid: BusinessentityId, + startdate: TypoLocalDateTime, + territoryid: SalesterritoryId +) object SalesterritoryhistoryId { implicit lazy val jsonDecoder: JsonDecoder[SalesterritoryhistoryId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val businessentityid = jsonObj.get("businessentityid").toRight("Missing field 'businessentityid'").flatMap(_.as(BusinessentityId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala index 3ecb98e057..fe031b73c9 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRow.scala @@ -41,6 +41,7 @@ case class SalesterritoryhistoryRow( modifieddate: TypoLocalDateTime ){ val compositeId: SalesterritoryhistoryId = SalesterritoryhistoryId(businessentityid, startdate, territoryid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SalesterritoryhistoryRowUnsaved = SalesterritoryhistoryRowUnsaved(businessentityid, territoryid, startdate, enddate, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala index 9721895e35..787927e8ff 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRow.scala @@ -39,6 +39,7 @@ case class ShoppingcartitemRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = shoppingcartitemid def toUnsavedRow(shoppingcartitemid: Defaulted[ShoppingcartitemId], quantity: Defaulted[Int] = Defaulted.Provided(this.quantity), datecreated: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.datecreated), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): ShoppingcartitemRowUnsaved = ShoppingcartitemRowUnsaved(shoppingcartid, productid, shoppingcartitemid, quantity, datecreated, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala index 8fc95dca45..860b72ef9e 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRow.scala @@ -52,6 +52,7 @@ case class SpecialofferRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = specialofferid def toUnsavedRow(specialofferid: Defaulted[SpecialofferId], discountpct: Defaulted[BigDecimal] = Defaulted.Provided(this.discountpct), minqty: Defaulted[Int] = Defaulted.Provided(this.minqty), rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SpecialofferRowUnsaved = SpecialofferRowUnsaved(description, `type`, category, startdate, enddate, maxqty, specialofferid, discountpct, minqty, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala index fc43205ae7..9dc65bb9ff 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductId.scala @@ -15,7 +15,10 @@ import zio.json.ast.Json import zio.json.internal.Write /** Type for the composite primary key of table `sales.specialofferproduct` */ -case class SpecialofferproductId(specialofferid: SpecialofferId, productid: ProductId) +case class SpecialofferproductId( + specialofferid: SpecialofferId, + productid: ProductId +) object SpecialofferproductId { implicit lazy val jsonDecoder: JsonDecoder[SpecialofferproductId] = JsonDecoder[Json.Obj].mapOrFail { jsonObj => val specialofferid = jsonObj.get("specialofferid").toRight("Missing field 'specialofferid'").flatMap(_.as(SpecialofferId.jsonDecoder)) diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala index 2abb0a936b..866355728a 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/specialofferproduct/SpecialofferproductRow.scala @@ -35,6 +35,7 @@ case class SpecialofferproductRow( modifieddate: TypoLocalDateTime ){ val compositeId: SpecialofferproductId = SpecialofferproductId(specialofferid, productid) + val id = compositeId def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): SpecialofferproductRowUnsaved = SpecialofferproductRowUnsaved(specialofferid, productid, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala index 878d5b8d5c..b184445052 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/sales/store/StoreRow.scala @@ -39,6 +39,7 @@ case class StoreRow( /** Default: now() */ modifieddate: TypoLocalDateTime ){ + val id = businessentityid def toUnsavedRow(rowguid: Defaulted[TypoUUID] = Defaulted.Provided(this.rowguid), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.Provided(this.modifieddate)): StoreRowUnsaved = StoreRowUnsaved(businessentityid, name, salespersonid, demographics, rowguid, modifieddate) } diff --git a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/testInsert.scala b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/testInsert.scala index 07c9fc0fc5..97a0bd3ff3 100644 --- a/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/testInsert.scala +++ b/typo-tester-zio-jdbc/generated-and-checked-in/adventureworks/testInsert.scala @@ -286,6 +286,7 @@ import adventureworks.sales.specialoffer.SpecialofferId import adventureworks.sales.specialoffer.SpecialofferRepoImpl import adventureworks.sales.specialoffer.SpecialofferRow import adventureworks.sales.specialoffer.SpecialofferRowUnsaved +import adventureworks.sales.specialofferproduct.SpecialofferproductId import adventureworks.sales.specialofferproduct.SpecialofferproductRepoImpl import adventureworks.sales.specialofferproduct.SpecialofferproductRow import adventureworks.sales.specialofferproduct.SpecialofferproductRowUnsaved @@ -310,13 +311,13 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, DepartmentRow] = (new DepartmentRepoImpl).insert(new DepartmentRowUnsaved(name = name, groupname = groupname, departmentid = departmentid, modifieddate = modifieddate)) def humanresourcesEmployee(businessentityid: BusinessentityId, + birthdate: TypoLocalDate, + maritalstatus: /* bpchar, max 1 chars */ String, + gender: /* bpchar, max 1 chars */ String, + hiredate: TypoLocalDate, nationalidnumber: /* max 15 chars */ String = random.alphanumeric.take(15).mkString, loginid: /* max 256 chars */ String = random.alphanumeric.take(20).mkString, jobtitle: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, - birthdate: TypoLocalDate = TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong)), - maritalstatus: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, - gender: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, - hiredate: TypoLocalDate = TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong)), salariedflag: Defaulted[Flag] = Defaulted.UseDefault, vacationhours: Defaulted[TypoShort] = Defaulted.UseDefault, sickleavehours: Defaulted[TypoShort] = Defaulted.UseDefault, @@ -324,20 +325,20 @@ class TestInsert(random: Random) { rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, organizationnode: Defaulted[Option[String]] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, EmployeeRow] = (new EmployeeRepoImpl).insert(new EmployeeRowUnsaved(businessentityid = businessentityid, nationalidnumber = nationalidnumber, loginid = loginid, jobtitle = jobtitle, birthdate = birthdate, maritalstatus = maritalstatus, gender = gender, hiredate = hiredate, salariedflag = salariedflag, vacationhours = vacationhours, sickleavehours = sickleavehours, currentflag = currentflag, rowguid = rowguid, modifieddate = modifieddate, organizationnode = organizationnode)) + ): ZIO[ZConnection, Throwable, EmployeeRow] = (new EmployeeRepoImpl).insert(new EmployeeRowUnsaved(businessentityid = businessentityid, birthdate = birthdate, maritalstatus = maritalstatus, gender = gender, hiredate = hiredate, nationalidnumber = nationalidnumber, loginid = loginid, jobtitle = jobtitle, salariedflag = salariedflag, vacationhours = vacationhours, sickleavehours = sickleavehours, currentflag = currentflag, rowguid = rowguid, modifieddate = modifieddate, organizationnode = organizationnode)) def humanresourcesEmployeedepartmenthistory(businessentityid: BusinessentityId, departmentid: DepartmentId, shiftid: ShiftId, - startdate: TypoLocalDate = TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong)), - enddate: Option[TypoLocalDate] = if (random.nextBoolean()) None else Some(TypoLocalDate(LocalDate.ofEpochDay(random.nextInt(30000).toLong))), + startdate: TypoLocalDate, + enddate: Option[TypoLocalDate] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, EmployeedepartmenthistoryRow] = (new EmployeedepartmenthistoryRepoImpl).insert(new EmployeedepartmenthistoryRowUnsaved(businessentityid = businessentityid, departmentid = departmentid, shiftid = shiftid, startdate = startdate, enddate = enddate, modifieddate = modifieddate)) def humanresourcesEmployeepayhistory(businessentityid: BusinessentityId, + rate: BigDecimal, + payfrequency: TypoShort, ratechangedate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - rate: BigDecimal = BigDecimal.decimal(random.nextDouble()), - payfrequency: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, EmployeepayhistoryRow] = (new EmployeepayhistoryRepoImpl).insert(new EmployeepayhistoryRowUnsaved(businessentityid = businessentityid, ratechangedate = ratechangedate, rate = rate, payfrequency = payfrequency, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, EmployeepayhistoryRow] = (new EmployeepayhistoryRepoImpl).insert(new EmployeepayhistoryRowUnsaved(businessentityid = businessentityid, rate = rate, payfrequency = payfrequency, ratechangedate = ratechangedate, modifieddate = modifieddate)) def humanresourcesJobcandidate(businessentityid: Option[BusinessentityId] = None, resume: Option[TypoXml] = None, jobcandidateid: Defaulted[JobcandidateId] = Defaulted.UseDefault, @@ -401,8 +402,8 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, PasswordRow] = (new PasswordRepoImpl).insert(new PasswordRowUnsaved(businessentityid = businessentityid, passwordhash = passwordhash, passwordsalt = passwordsalt, rowguid = rowguid, modifieddate = modifieddate)) def personPerson(businessentityid: BusinessentityId, + persontype: /* bpchar, max 2 chars */ String, firstname: /* user-picked */ FirstName, - persontype: /* bpchar, max 2 chars */ String = random.alphanumeric.take(2).mkString, title: Option[/* max 8 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(8).mkString), middlename: Option[Name] = if (random.nextBoolean()) None else Some(Name(random.alphanumeric.take(20).mkString)), lastname: Name = Name(random.alphanumeric.take(20).mkString), @@ -413,7 +414,7 @@ class TestInsert(random: Random) { emailpromotion: Defaulted[Int] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, PersonRow] = (new PersonRepoImpl).insert(new PersonRowUnsaved(businessentityid = businessentityid, firstname = firstname, persontype = persontype, title = title, middlename = middlename, lastname = lastname, suffix = suffix, additionalcontactinfo = additionalcontactinfo, demographics = demographics, namestyle = namestyle, emailpromotion = emailpromotion, rowguid = rowguid, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, PersonRow] = (new PersonRepoImpl).insert(new PersonRowUnsaved(businessentityid = businessentityid, persontype = persontype, firstname = firstname, title = title, middlename = middlename, lastname = lastname, suffix = suffix, additionalcontactinfo = additionalcontactinfo, demographics = demographics, namestyle = namestyle, emailpromotion = emailpromotion, rowguid = rowguid, modifieddate = modifieddate)) def personPersonphone(businessentityid: BusinessentityId, phonenumbertypeid: PhonenumbertypeId, phonenumber: Phone = Phone(random.alphanumeric.take(20).mkString), @@ -434,24 +435,24 @@ class TestInsert(random: Random) { ): ZIO[ZConnection, Throwable, StateprovinceRow] = (new StateprovinceRepoImpl).insert(new StateprovinceRowUnsaved(countryregioncode = countryregioncode, territoryid = territoryid, stateprovincecode = stateprovincecode, name = name, stateprovinceid = stateprovinceid, isonlystateprovinceflag = isonlystateprovinceflag, rowguid = rowguid, modifieddate = modifieddate)) def productionBillofmaterials(componentid: ProductId, unitmeasurecode: UnitmeasureId, + bomlevel: TypoShort, productassemblyid: Option[ProductId] = None, - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - bomlevel: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), + enddate: Option[TypoLocalDateTime] = None, billofmaterialsid: Defaulted[Int] = Defaulted.UseDefault, startdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, perassemblyqty: Defaulted[BigDecimal] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, BillofmaterialsRow] = (new BillofmaterialsRepoImpl).insert(new BillofmaterialsRowUnsaved(componentid = componentid, unitmeasurecode = unitmeasurecode, productassemblyid = productassemblyid, enddate = enddate, bomlevel = bomlevel, billofmaterialsid = billofmaterialsid, startdate = startdate, perassemblyqty = perassemblyqty, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, BillofmaterialsRow] = (new BillofmaterialsRepoImpl).insert(new BillofmaterialsRowUnsaved(componentid = componentid, unitmeasurecode = unitmeasurecode, bomlevel = bomlevel, productassemblyid = productassemblyid, enddate = enddate, billofmaterialsid = billofmaterialsid, startdate = startdate, perassemblyqty = perassemblyqty, modifieddate = modifieddate)) def productionCulture(cultureid: CultureId, name: Name = Name(random.alphanumeric.take(20).mkString), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, CultureRow] = (new CultureRepoImpl).insert(new CultureRowUnsaved(cultureid = cultureid, name = name, modifieddate = modifieddate)) def productionDocument(owner: BusinessentityId, + status: TypoShort, title: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, filename: /* max 400 chars */ String = random.alphanumeric.take(20).mkString, fileextension: Option[/* max 8 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(8).mkString), revision: /* bpchar, max 5 chars */ String = random.alphanumeric.take(5).mkString, - status: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), documentsummary: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), document: Option[TypoBytea] = None, folderflag: Defaulted[Flag] = Defaulted.UseDefault, @@ -459,7 +460,7 @@ class TestInsert(random: Random) { rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, documentnode: Defaulted[DocumentId] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, DocumentRow] = (new DocumentRepoImpl).insert(new DocumentRowUnsaved(owner = owner, title = title, filename = filename, fileextension = fileextension, revision = revision, status = status, documentsummary = documentsummary, document = document, folderflag = folderflag, changenumber = changenumber, rowguid = rowguid, modifieddate = modifieddate, documentnode = documentnode)) + ): ZIO[ZConnection, Throwable, DocumentRow] = (new DocumentRepoImpl).insert(new DocumentRowUnsaved(owner = owner, status = status, title = title, filename = filename, fileextension = fileextension, revision = revision, documentsummary = documentsummary, document = document, folderflag = folderflag, changenumber = changenumber, rowguid = rowguid, modifieddate = modifieddate, documentnode = documentnode)) def productionIllustration(diagram: Option[TypoXml] = None, illustrationid: Defaulted[IllustrationId] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault @@ -470,43 +471,43 @@ class TestInsert(random: Random) { availability: Defaulted[BigDecimal] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, LocationRow] = (new LocationRepoImpl).insert(new LocationRowUnsaved(name = name, locationid = locationid, costrate = costrate, availability = availability, modifieddate = modifieddate)) - def productionProduct(name: Name = Name(random.alphanumeric.take(20).mkString), + def productionProduct(safetystocklevel: TypoShort, + reorderpoint: TypoShort, + standardcost: BigDecimal, + listprice: BigDecimal, + daystomanufacture: Int, + sellstartdate: TypoLocalDateTime, + name: Name = Name(random.alphanumeric.take(20).mkString), productnumber: /* max 25 chars */ String = random.alphanumeric.take(20).mkString, color: Option[/* max 15 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(15).mkString), - safetystocklevel: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - reorderpoint: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - standardcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), - listprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), size: Option[/* max 5 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(5).mkString), sizeunitmeasurecode: Option[UnitmeasureId] = None, weightunitmeasurecode: Option[UnitmeasureId] = None, - weight: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), - daystomanufacture: Int = random.nextInt(), - productline: Option[/* bpchar, max 2 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(2).mkString), - `class`: Option[/* bpchar, max 2 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(2).mkString), - style: Option[/* bpchar, max 2 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(2).mkString), + weight: Option[BigDecimal] = None, + productline: Option[/* bpchar, max 2 chars */ String] = None, + `class`: Option[/* bpchar, max 2 chars */ String] = None, + style: Option[/* bpchar, max 2 chars */ String] = None, productsubcategoryid: Option[ProductsubcategoryId] = None, productmodelid: Option[ProductmodelId] = None, - sellstartdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - sellenddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + sellenddate: Option[TypoLocalDateTime] = None, discontinueddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), productid: Defaulted[ProductId] = Defaulted.UseDefault, makeflag: Defaulted[Flag] = Defaulted.UseDefault, finishedgoodsflag: Defaulted[Flag] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, ProductRow] = (new ProductRepoImpl).insert(new ProductRowUnsaved(name = name, productnumber = productnumber, color = color, safetystocklevel = safetystocklevel, reorderpoint = reorderpoint, standardcost = standardcost, listprice = listprice, size = size, sizeunitmeasurecode = sizeunitmeasurecode, weightunitmeasurecode = weightunitmeasurecode, weight = weight, daystomanufacture = daystomanufacture, productline = productline, `class` = `class`, style = style, productsubcategoryid = productsubcategoryid, productmodelid = productmodelid, sellstartdate = sellstartdate, sellenddate = sellenddate, discontinueddate = discontinueddate, productid = productid, makeflag = makeflag, finishedgoodsflag = finishedgoodsflag, rowguid = rowguid, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, ProductRow] = (new ProductRepoImpl).insert(new ProductRowUnsaved(safetystocklevel = safetystocklevel, reorderpoint = reorderpoint, standardcost = standardcost, listprice = listprice, daystomanufacture = daystomanufacture, sellstartdate = sellstartdate, name = name, productnumber = productnumber, color = color, size = size, sizeunitmeasurecode = sizeunitmeasurecode, weightunitmeasurecode = weightunitmeasurecode, weight = weight, productline = productline, `class` = `class`, style = style, productsubcategoryid = productsubcategoryid, productmodelid = productmodelid, sellenddate = sellenddate, discontinueddate = discontinueddate, productid = productid, makeflag = makeflag, finishedgoodsflag = finishedgoodsflag, rowguid = rowguid, modifieddate = modifieddate)) def productionProductcategory(name: Name = Name(random.alphanumeric.take(20).mkString), productcategoryid: Defaulted[ProductcategoryId] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, ProductcategoryRow] = (new ProductcategoryRepoImpl).insert(new ProductcategoryRowUnsaved(name = name, productcategoryid = productcategoryid, rowguid = rowguid, modifieddate = modifieddate)) def productionProductcosthistory(productid: ProductId, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - standardcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), + startdate: TypoLocalDateTime, + standardcost: BigDecimal, + enddate: Option[TypoLocalDateTime] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, ProductcosthistoryRow] = (new ProductcosthistoryRepoImpl).insert(new ProductcosthistoryRowUnsaved(productid = productid, startdate = startdate, enddate = enddate, standardcost = standardcost, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, ProductcosthistoryRow] = (new ProductcosthistoryRepoImpl).insert(new ProductcosthistoryRowUnsaved(productid = productid, startdate = startdate, standardcost = standardcost, enddate = enddate, modifieddate = modifieddate)) def productionProductdescription(description: /* max 400 chars */ String = random.alphanumeric.take(20).mkString, productdescriptionid: Defaulted[ProductdescriptionId] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, @@ -518,18 +519,18 @@ class TestInsert(random: Random) { ): ZIO[ZConnection, Throwable, ProductdocumentRow] = (new ProductdocumentRepoImpl).insert(new ProductdocumentRowUnsaved(productid = productid, modifieddate = modifieddate, documentnode = documentnode)) def productionProductinventory(productid: ProductId, locationid: LocationId, + bin: TypoShort, shelf: /* max 10 chars */ String = random.alphanumeric.take(10).mkString, - bin: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), quantity: Defaulted[TypoShort] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, ProductinventoryRow] = (new ProductinventoryRepoImpl).insert(new ProductinventoryRowUnsaved(productid = productid, locationid = locationid, shelf = shelf, bin = bin, quantity = quantity, rowguid = rowguid, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, ProductinventoryRow] = (new ProductinventoryRepoImpl).insert(new ProductinventoryRowUnsaved(productid = productid, locationid = locationid, bin = bin, shelf = shelf, quantity = quantity, rowguid = rowguid, modifieddate = modifieddate)) def productionProductlistpricehistory(productid: ProductId, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - listprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), + startdate: TypoLocalDateTime, + listprice: BigDecimal, + enddate: Option[TypoLocalDateTime] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, ProductlistpricehistoryRow] = (new ProductlistpricehistoryRepoImpl).insert(new ProductlistpricehistoryRowUnsaved(productid = productid, startdate = startdate, enddate = enddate, listprice = listprice, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, ProductlistpricehistoryRow] = (new ProductlistpricehistoryRepoImpl).insert(new ProductlistpricehistoryRowUnsaved(productid = productid, startdate = startdate, listprice = listprice, enddate = enddate, modifieddate = modifieddate)) def productionProductmodel(name: Name = Name(random.alphanumeric.take(20).mkString), catalogdescription: Option[TypoXml] = None, instructions: Option[TypoXml] = None, @@ -559,14 +560,14 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, ProductproductphotoRow] = (new ProductproductphotoRepoImpl).insert(new ProductproductphotoRowUnsaved(productid = productid, productphotoid = productphotoid, primary = primary, modifieddate = modifieddate)) def productionProductreview(productid: ProductId, + rating: Int, reviewername: Name = Name(random.alphanumeric.take(20).mkString), emailaddress: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, - rating: Int = random.nextInt(), comments: Option[/* max 3850 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), productreviewid: Defaulted[ProductreviewId] = Defaulted.UseDefault, reviewdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, ProductreviewRow] = (new ProductreviewRepoImpl).insert(new ProductreviewRowUnsaved(productid = productid, reviewername = reviewername, emailaddress = emailaddress, rating = rating, comments = comments, productreviewid = productreviewid, reviewdate = reviewdate, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, ProductreviewRow] = (new ProductreviewRepoImpl).insert(new ProductreviewRowUnsaved(productid = productid, rating = rating, reviewername = reviewername, emailaddress = emailaddress, comments = comments, productreviewid = productreviewid, reviewdate = reviewdate, modifieddate = modifieddate)) def productionProductsubcategory(productcategoryid: ProductcategoryId, name: Name = Name(random.alphanumeric.take(20).mkString), productsubcategoryid: Defaulted[ProductsubcategoryId] = Defaulted.UseDefault, @@ -578,34 +579,34 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, ScrapreasonRow] = (new ScrapreasonRepoImpl).insert(new ScrapreasonRowUnsaved(name = name, scrapreasonid = scrapreasonid, modifieddate = modifieddate)) def productionTransactionhistory(productid: ProductId, + transactiontype: /* bpchar, max 1 chars */ String, referenceorderid: Int = random.nextInt(), - transactiontype: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, quantity: Int = random.nextInt(), actualcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), transactionid: Defaulted[TransactionhistoryId] = Defaulted.UseDefault, referenceorderlineid: Defaulted[Int] = Defaulted.UseDefault, transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, TransactionhistoryRow] = (new TransactionhistoryRepoImpl).insert(new TransactionhistoryRowUnsaved(productid = productid, referenceorderid = referenceorderid, transactiontype = transactiontype, quantity = quantity, actualcost = actualcost, transactionid = transactionid, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) - def productionTransactionhistoryarchive(transactionid: TransactionhistoryarchiveId, + ): ZIO[ZConnection, Throwable, TransactionhistoryRow] = (new TransactionhistoryRepoImpl).insert(new TransactionhistoryRowUnsaved(productid = productid, transactiontype = transactiontype, referenceorderid = referenceorderid, quantity = quantity, actualcost = actualcost, transactionid = transactionid, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) + def productionTransactionhistoryarchive(transactiontype: /* bpchar, max 1 chars */ String, + transactionid: TransactionhistoryarchiveId = TransactionhistoryarchiveId(random.nextInt()), productid: Int = random.nextInt(), referenceorderid: Int = random.nextInt(), - transactiontype: /* bpchar, max 1 chars */ String = random.alphanumeric.take(1).mkString, quantity: Int = random.nextInt(), actualcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), referenceorderlineid: Defaulted[Int] = Defaulted.UseDefault, transactiondate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, TransactionhistoryarchiveRow] = (new TransactionhistoryarchiveRepoImpl).insert(new TransactionhistoryarchiveRowUnsaved(transactionid = transactionid, productid = productid, referenceorderid = referenceorderid, transactiontype = transactiontype, quantity = quantity, actualcost = actualcost, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, TransactionhistoryarchiveRow] = (new TransactionhistoryarchiveRepoImpl).insert(new TransactionhistoryarchiveRowUnsaved(transactiontype = transactiontype, transactionid = transactionid, productid = productid, referenceorderid = referenceorderid, quantity = quantity, actualcost = actualcost, referenceorderlineid = referenceorderlineid, transactiondate = transactiondate, modifieddate = modifieddate)) def productionUnitmeasure(unitmeasurecode: UnitmeasureId, name: Name = Name(random.alphanumeric.take(20).mkString), modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, UnitmeasureRow] = (new UnitmeasureRepoImpl).insert(new UnitmeasureRowUnsaved(unitmeasurecode = unitmeasurecode, name = name, modifieddate = modifieddate)) def productionWorkorder(productid: ProductId, - orderqty: Int = random.nextInt(), - scrappedqty: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + orderqty: Int, + scrappedqty: TypoShort, + startdate: TypoLocalDateTime, + enddate: Option[TypoLocalDateTime] = None, duedate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), scrapreasonid: Option[ScrapreasonId] = None, workorderid: Defaulted[WorkorderId] = Defaulted.UseDefault, @@ -613,17 +614,17 @@ class TestInsert(random: Random) { ): ZIO[ZConnection, Throwable, WorkorderRow] = (new WorkorderRepoImpl).insert(new WorkorderRowUnsaved(productid = productid, orderqty = orderqty, scrappedqty = scrappedqty, startdate = startdate, enddate = enddate, duedate = duedate, scrapreasonid = scrapreasonid, workorderid = workorderid, modifieddate = modifieddate)) def productionWorkorderrouting(workorderid: WorkorderId, locationid: LocationId, + scheduledstartdate: TypoLocalDateTime, + scheduledenddate: TypoLocalDateTime, + plannedcost: BigDecimal, productid: Int = random.nextInt(), operationsequence: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - scheduledstartdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - scheduledenddate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - actualstartdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - actualenddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - actualresourcehrs: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), - plannedcost: BigDecimal = BigDecimal.decimal(random.nextDouble()), - actualcost: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), + actualstartdate: Option[TypoLocalDateTime] = None, + actualenddate: Option[TypoLocalDateTime] = None, + actualresourcehrs: Option[BigDecimal] = None, + actualcost: Option[BigDecimal] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, WorkorderroutingRow] = (new WorkorderroutingRepoImpl).insert(new WorkorderroutingRowUnsaved(workorderid = workorderid, locationid = locationid, productid = productid, operationsequence = operationsequence, scheduledstartdate = scheduledstartdate, scheduledenddate = scheduledenddate, actualstartdate = actualstartdate, actualenddate = actualenddate, actualresourcehrs = actualresourcehrs, plannedcost = plannedcost, actualcost = actualcost, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, WorkorderroutingRow] = (new WorkorderroutingRepoImpl).insert(new WorkorderroutingRowUnsaved(workorderid = workorderid, locationid = locationid, scheduledstartdate = scheduledstartdate, scheduledenddate = scheduledenddate, plannedcost = plannedcost, productid = productid, operationsequence = operationsequence, actualstartdate = actualstartdate, actualenddate = actualenddate, actualresourcehrs = actualresourcehrs, actualcost = actualcost, modifieddate = modifieddate)) def publicFlaff(code: ShortText = ShortText(random.alphanumeric.take(20).mkString), anotherCode: /* max 20 chars */ String = random.alphanumeric.take(20).mkString, someNumber: Int = random.nextInt(), @@ -680,7 +681,7 @@ class TestInsert(random: Random) { text: String = random.alphanumeric.take(20).mkString, time: TypoLocalTime = TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)), timestamp: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - timestampz: TypoInstant = TypoInstant(Instant.ofEpochMilli(random.nextLong())), + timestampz: TypoInstant = TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L))), timez: TypoOffsetTime = TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12))), varchar: String = random.alphanumeric.take(20).mkString, bpchares: Array[/* bpchar */ String] = Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString), @@ -698,7 +699,7 @@ class TestInsert(random: Random) { textes: Array[String] = Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString), timees: Array[TypoLocalTime] = Array.fill(random.nextInt(3))(TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), timestampes: Array[TypoLocalDateTime] = Array.fill(random.nextInt(3))(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - timestampzes: Array[TypoInstant] = Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(random.nextLong()))), + timestampzes: Array[TypoInstant] = Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L)))), timezes: Array[TypoOffsetTime] = Array.fill(random.nextInt(3))(TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12)))), varchares: Array[String] = Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString) ): ZIO[ZConnection, Throwable, PgtestRow] = (new PgtestRepoImpl).insert(new PgtestRow(box = box, bytea = bytea, circle = circle, hstore = hstore, inet = inet, int2vector = int2vector, interval = interval, json = json, jsonb = jsonb, line = line, lseg = lseg, money = money, path = path, point = point, polygon = polygon, uuid = uuid, vector = vector, xml = xml, boxes = boxes, circlees = circlees, inetes = inetes, int2vectores = int2vectores, intervales = intervales, jsones = jsones, jsonbes = jsonbes, linees = linees, lseges = lseges, moneyes = moneyes, pathes = pathes, pointes = pointes, polygones = polygones, uuides = uuides, xmles = xmles, bool = bool, bpchar = bpchar, char = char, date = date, float4 = float4, float8 = float8, int2 = int2, int4 = int4, int8 = int8, mydomain = mydomain, myenum = myenum, name = name, numeric = numeric, text = text, time = time, timestamp = timestamp, timestampz = timestampz, timez = timez, varchar = varchar, bpchares = bpchares, chares = chares, datees = datees, float4es = float4es, float8es = float8es, int2es = int2es, int4es = int4es, int8es = int8es, mydomaines = mydomaines, myenumes = myenumes, namees = namees, numerices = numerices, textes = textes, timees = timees, timestampes = timestampes, timestampzes = timestampzes, timezes = timezes, varchares = varchares)) @@ -733,7 +734,7 @@ class TestInsert(random: Random) { text: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), time: Option[TypoLocalTime] = if (random.nextBoolean()) None else Some(TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), timestamp: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - timestampz: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(random.nextLong()))), + timestampz: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L)))), timez: Option[TypoOffsetTime] = if (random.nextBoolean()) None else Some(TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12)))), uuid: Option[TypoUUID] = None, varchar: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), @@ -767,7 +768,7 @@ class TestInsert(random: Random) { textes: Option[Array[String]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString)), timees: Option[Array[TypoLocalTime]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoLocalTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), timestampes: Option[Array[TypoLocalDateTime]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))))), - timestampzes: Option[Array[TypoInstant]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(random.nextLong())))), + timestampzes: Option[Array[TypoInstant]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L))))), timezes: Option[Array[TypoOffsetTime]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(TypoOffsetTime(LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong).atOffset(ZoneOffset.ofHours(random.nextInt(24) - 12))))), uuides: Option[Array[TypoUUID]] = None, varchares: Option[Array[String]] = if (random.nextBoolean()) None else Some(Array.fill(random.nextInt(3))(random.alphanumeric.take(20).mkString)), @@ -778,25 +779,25 @@ class TestInsert(random: Random) { name: String = random.alphanumeric.take(20).mkString, lastName: Option[String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), password: String = random.alphanumeric.take(20).mkString, - verifiedOn: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(random.nextLong()))), + verifiedOn: Option[TypoInstant] = if (random.nextBoolean()) None else Some(TypoInstant(Instant.ofEpochMilli(1000000000000L + random.nextLong(1000000000000L)))), createdAt: Defaulted[TypoInstant] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, UsersRow] = (new UsersRepoImpl).insert(new UsersRowUnsaved(userId = userId, email = email, name = name, lastName = lastName, password = password, verifiedOn = verifiedOn, createdAt = createdAt)) def purchasingProductvendor(productid: ProductId, businessentityid: BusinessentityId, + averageleadtime: Int, + standardprice: BigDecimal, + minorderqty: Int, + maxorderqty: Int, unitmeasurecode: UnitmeasureId, - averageleadtime: Int = random.nextInt(), - standardprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), - lastreceiptcost: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), + lastreceiptcost: Option[BigDecimal] = None, lastreceiptdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), - minorderqty: Int = random.nextInt(), - maxorderqty: Int = random.nextInt(), - onorderqty: Option[Int] = if (random.nextBoolean()) None else Some(random.nextInt()), + onorderqty: Option[Int] = None, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, ProductvendorRow] = (new ProductvendorRepoImpl).insert(new ProductvendorRowUnsaved(productid = productid, businessentityid = businessentityid, unitmeasurecode = unitmeasurecode, averageleadtime = averageleadtime, standardprice = standardprice, lastreceiptcost = lastreceiptcost, lastreceiptdate = lastreceiptdate, minorderqty = minorderqty, maxorderqty = maxorderqty, onorderqty = onorderqty, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, ProductvendorRow] = (new ProductvendorRepoImpl).insert(new ProductvendorRowUnsaved(productid = productid, businessentityid = businessentityid, averageleadtime = averageleadtime, standardprice = standardprice, minorderqty = minorderqty, maxorderqty = maxorderqty, unitmeasurecode = unitmeasurecode, lastreceiptcost = lastreceiptcost, lastreceiptdate = lastreceiptdate, onorderqty = onorderqty, modifieddate = modifieddate)) def purchasingPurchaseorderheader(employeeid: BusinessentityId, vendorid: BusinessentityId, shipmethodid: ShipmethodId, - shipdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + shipdate: Option[TypoLocalDateTime] = None, purchaseorderid: Defaulted[PurchaseorderheaderId] = Defaulted.UseDefault, revisionnumber: Defaulted[TypoShort] = Defaulted.UseDefault, status: Defaulted[TypoShort] = Defaulted.UseDefault, @@ -814,14 +815,14 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, ShipmethodRow] = (new ShipmethodRepoImpl).insert(new ShipmethodRowUnsaved(name = name, shipmethodid = shipmethodid, shipbase = shipbase, shiprate = shiprate, rowguid = rowguid, modifieddate = modifieddate)) def purchasingVendor(businessentityid: BusinessentityId, + creditrating: TypoShort, accountnumber: AccountNumber = AccountNumber(random.alphanumeric.take(20).mkString), name: Name = Name(random.alphanumeric.take(20).mkString), - creditrating: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), purchasingwebserviceurl: Option[/* max 1024 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), preferredvendorstatus: Defaulted[Flag] = Defaulted.UseDefault, activeflag: Defaulted[Flag] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, VendorRow] = (new VendorRepoImpl).insert(new VendorRowUnsaved(businessentityid = businessentityid, accountnumber = accountnumber, name = name, creditrating = creditrating, purchasingwebserviceurl = purchasingwebserviceurl, preferredvendorstatus = preferredvendorstatus, activeflag = activeflag, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, VendorRow] = (new VendorRepoImpl).insert(new VendorRowUnsaved(businessentityid = businessentityid, creditrating = creditrating, accountnumber = accountnumber, name = name, purchasingwebserviceurl = purchasingwebserviceurl, preferredvendorstatus = preferredvendorstatus, activeflag = activeflag, modifieddate = modifieddate)) def salesCountryregioncurrency(countryregioncode: CountryregionId, currencycode: CurrencyId, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault @@ -856,23 +857,22 @@ class TestInsert(random: Random) { creditcardid: /* user-picked */ CustomCreditcardId, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, PersoncreditcardRow] = (new PersoncreditcardRepoImpl).insert(new PersoncreditcardRowUnsaved(businessentityid = businessentityid, creditcardid = creditcardid, modifieddate = modifieddate)) - def salesSalesorderdetail(salesorderid: SalesorderheaderId, - productid: ProductId, - specialofferid: SpecialofferId, + def salesSalesorderdetail(SpecialofferproductId: SpecialofferproductId, + salesorderid: SalesorderheaderId, + orderqty: TypoShort, + unitprice: BigDecimal, carriertrackingnumber: Option[/* max 25 chars */ String] = if (random.nextBoolean()) None else Some(random.alphanumeric.take(20).mkString), - orderqty: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), - unitprice: BigDecimal = BigDecimal.decimal(random.nextDouble()), salesorderdetailid: Defaulted[Int] = Defaulted.UseDefault, unitpricediscount: Defaulted[BigDecimal] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, SalesorderdetailRow] = (new SalesorderdetailRepoImpl).insert(new SalesorderdetailRowUnsaved(salesorderid = salesorderid, productid = productid, specialofferid = specialofferid, carriertrackingnumber = carriertrackingnumber, orderqty = orderqty, unitprice = unitprice, salesorderdetailid = salesorderdetailid, unitpricediscount = unitpricediscount, rowguid = rowguid, modifieddate = modifieddate)) - def salesSalesorderheader(customerid: CustomerId, + ): ZIO[ZConnection, Throwable, SalesorderdetailRow] = (new SalesorderdetailRepoImpl).insert(new SalesorderdetailRowUnsaved(salesorderid = salesorderid, carriertrackingnumber = carriertrackingnumber, orderqty = orderqty, productid = SpecialofferproductId.productid, specialofferid = SpecialofferproductId.specialofferid, unitprice = unitprice, salesorderdetailid = salesorderdetailid, unitpricediscount = unitpricediscount, rowguid = rowguid, modifieddate = modifieddate)) + def salesSalesorderheader(duedate: TypoLocalDateTime, + customerid: CustomerId, billtoaddressid: AddressId, shiptoaddressid: AddressId, shipmethodid: ShipmethodId, - duedate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - shipdate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + shipdate: Option[TypoLocalDateTime] = None, purchaseordernumber: Option[OrderNumber] = if (random.nextBoolean()) None else Some(OrderNumber(random.alphanumeric.take(20).mkString)), accountnumber: Option[AccountNumber] = if (random.nextBoolean()) None else Some(AccountNumber(random.alphanumeric.take(20).mkString)), salespersonid: Option[BusinessentityId] = None, @@ -892,14 +892,14 @@ class TestInsert(random: Random) { freight: Defaulted[BigDecimal] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, SalesorderheaderRow] = (new SalesorderheaderRepoImpl).insert(new SalesorderheaderRowUnsaved(customerid = customerid, billtoaddressid = billtoaddressid, shiptoaddressid = shiptoaddressid, shipmethodid = shipmethodid, duedate = duedate, shipdate = shipdate, purchaseordernumber = purchaseordernumber, accountnumber = accountnumber, salespersonid = salespersonid, territoryid = territoryid, creditcardid = creditcardid, creditcardapprovalcode = creditcardapprovalcode, currencyrateid = currencyrateid, totaldue = totaldue, comment = comment, salesorderid = salesorderid, revisionnumber = revisionnumber, orderdate = orderdate, status = status, onlineorderflag = onlineorderflag, subtotal = subtotal, taxamt = taxamt, freight = freight, rowguid = rowguid, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, SalesorderheaderRow] = (new SalesorderheaderRepoImpl).insert(new SalesorderheaderRowUnsaved(duedate = duedate, customerid = customerid, billtoaddressid = billtoaddressid, shiptoaddressid = shiptoaddressid, shipmethodid = shipmethodid, shipdate = shipdate, purchaseordernumber = purchaseordernumber, accountnumber = accountnumber, salespersonid = salespersonid, territoryid = territoryid, creditcardid = creditcardid, creditcardapprovalcode = creditcardapprovalcode, currencyrateid = currencyrateid, totaldue = totaldue, comment = comment, salesorderid = salesorderid, revisionnumber = revisionnumber, orderdate = orderdate, status = status, onlineorderflag = onlineorderflag, subtotal = subtotal, taxamt = taxamt, freight = freight, rowguid = rowguid, modifieddate = modifieddate)) def salesSalesorderheadersalesreason(salesorderid: SalesorderheaderId, salesreasonid: SalesreasonId, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, SalesorderheadersalesreasonRow] = (new SalesorderheadersalesreasonRepoImpl).insert(new SalesorderheadersalesreasonRowUnsaved(salesorderid = salesorderid, salesreasonid = salesreasonid, modifieddate = modifieddate)) def salesSalesperson(businessentityid: BusinessentityId, territoryid: Option[SalesterritoryId] = None, - salesquota: Option[BigDecimal] = if (random.nextBoolean()) None else Some(BigDecimal.decimal(random.nextDouble())), + salesquota: Option[BigDecimal] = None, bonus: Defaulted[BigDecimal] = Defaulted.UseDefault, commissionpct: Defaulted[BigDecimal] = Defaulted.UseDefault, salesytd: Defaulted[BigDecimal] = Defaulted.UseDefault, @@ -908,18 +908,18 @@ class TestInsert(random: Random) { modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, SalespersonRow] = (new SalespersonRepoImpl).insert(new SalespersonRowUnsaved(businessentityid = businessentityid, territoryid = territoryid, salesquota = salesquota, bonus = bonus, commissionpct = commissionpct, salesytd = salesytd, saleslastyear = saleslastyear, rowguid = rowguid, modifieddate = modifieddate)) def salesSalespersonquotahistory(businessentityid: BusinessentityId, + salesquota: BigDecimal, quotadate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - salesquota: BigDecimal = BigDecimal.decimal(random.nextDouble()), rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, SalespersonquotahistoryRow] = (new SalespersonquotahistoryRepoImpl).insert(new SalespersonquotahistoryRowUnsaved(businessentityid = businessentityid, quotadate = quotadate, salesquota = salesquota, rowguid = rowguid, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, SalespersonquotahistoryRow] = (new SalespersonquotahistoryRepoImpl).insert(new SalespersonquotahistoryRowUnsaved(businessentityid = businessentityid, salesquota = salesquota, quotadate = quotadate, rowguid = rowguid, modifieddate = modifieddate)) def salesSalesreason(name: Name = Name(random.alphanumeric.take(20).mkString), reasontype: Name = Name(random.alphanumeric.take(20).mkString), salesreasonid: Defaulted[SalesreasonId] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, SalesreasonRow] = (new SalesreasonRepoImpl).insert(new SalesreasonRowUnsaved(name = name, reasontype = reasontype, salesreasonid = salesreasonid, modifieddate = modifieddate)) def salesSalestaxrate(stateprovinceid: StateprovinceId, - taxtype: TypoShort = TypoShort(random.nextInt(Short.MaxValue).toShort), + taxtype: TypoShort, name: Name = Name(random.alphanumeric.take(20).mkString), salestaxrateid: Defaulted[SalestaxrateId] = Defaulted.UseDefault, taxrate: Defaulted[BigDecimal] = Defaulted.UseDefault, @@ -939,8 +939,8 @@ class TestInsert(random: Random) { ): ZIO[ZConnection, Throwable, SalesterritoryRow] = (new SalesterritoryRepoImpl).insert(new SalesterritoryRowUnsaved(countryregioncode = countryregioncode, name = name, group = group, territoryid = territoryid, salesytd = salesytd, saleslastyear = saleslastyear, costytd = costytd, costlastyear = costlastyear, rowguid = rowguid, modifieddate = modifieddate)) def salesSalesterritoryhistory(businessentityid: BusinessentityId, territoryid: SalesterritoryId, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: Option[TypoLocalDateTime] = if (random.nextBoolean()) None else Some(TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong)))), + startdate: TypoLocalDateTime, + enddate: Option[TypoLocalDateTime] = None, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, SalesterritoryhistoryRow] = (new SalesterritoryhistoryRepoImpl).insert(new SalesterritoryhistoryRowUnsaved(businessentityid = businessentityid, territoryid = territoryid, startdate = startdate, enddate = enddate, rowguid = rowguid, modifieddate = modifieddate)) @@ -951,18 +951,18 @@ class TestInsert(random: Random) { datecreated: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault ): ZIO[ZConnection, Throwable, ShoppingcartitemRow] = (new ShoppingcartitemRepoImpl).insert(new ShoppingcartitemRowUnsaved(productid = productid, shoppingcartid = shoppingcartid, shoppingcartitemid = shoppingcartitemid, quantity = quantity, datecreated = datecreated, modifieddate = modifieddate)) - def salesSpecialoffer(description: /* max 255 chars */ String = random.alphanumeric.take(20).mkString, + def salesSpecialoffer(startdate: TypoLocalDateTime, + enddate: TypoLocalDateTime, + description: /* max 255 chars */ String = random.alphanumeric.take(20).mkString, `type`: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, category: /* max 50 chars */ String = random.alphanumeric.take(20).mkString, - startdate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - enddate: TypoLocalDateTime = TypoLocalDateTime(LocalDateTime.of(LocalDate.ofEpochDay(random.nextInt(30000).toLong), LocalTime.ofSecondOfDay(random.nextInt(24 * 60 * 60).toLong))), - maxqty: Option[Int] = if (random.nextBoolean()) None else Some(random.nextInt()), + maxqty: Option[Int] = None, specialofferid: Defaulted[SpecialofferId] = Defaulted.UseDefault, discountpct: Defaulted[BigDecimal] = Defaulted.UseDefault, minqty: Defaulted[Int] = Defaulted.UseDefault, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault - ): ZIO[ZConnection, Throwable, SpecialofferRow] = (new SpecialofferRepoImpl).insert(new SpecialofferRowUnsaved(description = description, `type` = `type`, category = category, startdate = startdate, enddate = enddate, maxqty = maxqty, specialofferid = specialofferid, discountpct = discountpct, minqty = minqty, rowguid = rowguid, modifieddate = modifieddate)) + ): ZIO[ZConnection, Throwable, SpecialofferRow] = (new SpecialofferRepoImpl).insert(new SpecialofferRowUnsaved(startdate = startdate, enddate = enddate, description = description, `type` = `type`, category = category, maxqty = maxqty, specialofferid = specialofferid, discountpct = discountpct, minqty = minqty, rowguid = rowguid, modifieddate = modifieddate)) def salesSpecialofferproduct(specialofferid: SpecialofferId, productid: ProductId, rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-zio-jdbc/src/scala/adventureworks/production/product/CompositeIdsTest.scala b/typo-tester-zio-jdbc/src/scala/adventureworks/production/product/CompositeIdsTest.scala index c30c32f81b..405a14a1e0 100644 --- a/typo-tester-zio-jdbc/src/scala/adventureworks/production/product/CompositeIdsTest.scala +++ b/typo-tester-zio-jdbc/src/scala/adventureworks/production/product/CompositeIdsTest.scala @@ -1,6 +1,6 @@ package adventureworks.production.product -import adventureworks.customtypes.{TypoLocalDateTime, TypoUUID, TypoXml} +import adventureworks.customtypes.{TypoLocalDateTime, TypoShort, TypoUUID, TypoXml} import adventureworks.person.businessentity.* import adventureworks.person.emailaddress.{EmailaddressRepo, EmailaddressRepoImpl, EmailaddressRepoMock, EmailaddressRow} import adventureworks.person.person.{PersonRepo, PersonRepoImpl, PersonRepoMock, PersonRow} @@ -33,6 +33,12 @@ class CompositeIdsTest extends AnyFunSuite with TypeCheckedTripleEquals { productSubcategory <- testInsert.productionProductsubcategory(productCategory.productcategoryid) productModel <- testInsert.productionProductmodel(catalogdescription = Some(new TypoXml("")), instructions = Some(new TypoXml(""))) product <- testInsert.productionProduct( + safetystocklevel = TypoShort(1), + reorderpoint = TypoShort(1), + standardcost = BigDecimal(1), + listprice = BigDecimal(1), + daystomanufacture = 10, + sellstartdate = TypoLocalDateTime.now, sizeunitmeasurecode = Some(unitmeasure.unitmeasurecode), weightunitmeasurecode = Some(unitmeasure.unitmeasurecode), `class` = Some("H "), @@ -42,9 +48,9 @@ class CompositeIdsTest extends AnyFunSuite with TypeCheckedTripleEquals { ) now = TypoLocalDateTime.now - ph1 <- testInsert.productionProductcosthistory(product.productid, startdate = now, enddate = Some(now.map(_.plusDays(1)))) - ph2 <- testInsert.productionProductcosthistory(product.productid, startdate = now.map(_.plusDays(1)), enddate = Some(now.map(_.plusDays(2)))) - ph3 <- testInsert.productionProductcosthistory(product.productid, startdate = now.map(_.plusDays(2)), enddate = Some(now.map(_.plusDays(3)))) + ph1 <- testInsert.productionProductcosthistory(product.productid, standardcost = BigDecimal(1), startdate = now, enddate = Some(now.map(_.plusDays(1)))) + ph2 <- testInsert.productionProductcosthistory(product.productid, standardcost = BigDecimal(1), startdate = now.map(_.plusDays(1)), enddate = Some(now.map(_.plusDays(2)))) + ph3 <- testInsert.productionProductcosthistory(product.productid, standardcost = BigDecimal(1), startdate = now.map(_.plusDays(2)), enddate = Some(now.map(_.plusDays(3)))) wanted = Array(ph1.compositeId, ph2.compositeId, ph3.compositeId.copy(productid = ProductId(9999))) found <- repo.selectByIds(wanted).runCollect _ <- ZIO.succeed(assert(found.map(_.compositeId).toSet === Set(ph1.compositeId, ph2.compositeId))) diff --git a/typo/src/scala/typo/NonEmptyList.scala b/typo/src/scala/typo/NonEmptyList.scala index 49f0f0e51f..cda209dbce 100644 --- a/typo/src/scala/typo/NonEmptyList.scala +++ b/typo/src/scala/typo/NonEmptyList.scala @@ -20,6 +20,12 @@ case class NonEmptyList[T](head: T, tail: List[T]) { val head :: tail = toList.sorted: @unchecked NonEmptyList(head, tail) } + def iterator: Iterator[T] = + Iterator(head) ++ tail.iterator + + def countWhere(f: T => Boolean): Int = + (if (f(head)) 1 else 0) + tail.count(f) + def zipWithIndex: NonEmptyList[(T, Int)] = NonEmptyList((head, 0), tail.zipWithIndex.map { case (t, i) => (t, i + 1) }) diff --git a/typo/src/scala/typo/db.scala b/typo/src/scala/typo/db.scala index e697b905e3..39b50f5be7 100644 --- a/typo/src/scala/typo/db.scala +++ b/typo/src/scala/typo/db.scala @@ -108,6 +108,7 @@ object db { constraints: List[Constraint], jsonDescription: DebugJson ) { + def isDefaulted = columnDefault.nonEmpty || identity.exists(_.`BY DEFAULT`) def name = parsedName.name } case class RelationName(schema: Option[String], name: String) { diff --git a/typo/src/scala/typo/internal/ComputedRowUnsaved.scala b/typo/src/scala/typo/internal/ComputedRowUnsaved.scala index 8a58ddeab4..e8ab80cb59 100644 --- a/typo/src/scala/typo/internal/ComputedRowUnsaved.scala +++ b/typo/src/scala/typo/internal/ComputedRowUnsaved.scala @@ -4,7 +4,7 @@ package internal object ComputedRowUnsaved { def apply(source: Source, cols: NonEmptyList[ComputedColumn], default: ComputedDefault, naming: Naming): Option[ComputedRowUnsaved] = { val (alwaysGenerated, notAlwaysGenerated) = cols.toList.partition(c => c.dbCol.identity.exists(_.ALWAYS)) - val (defaultCols, restCols) = notAlwaysGenerated.partition(c => c.dbCol.columnDefault.nonEmpty || c.dbCol.identity.exists(_.`BY DEFAULT`)) + val (defaultCols, restCols) = notAlwaysGenerated.partition(c => c.dbCol.isDefaulted) NonEmptyList.fromList(defaultCols).map { nonEmpty => val defaultCols = nonEmpty.map { col => diff --git a/typo/src/scala/typo/internal/ComputedTestInserts.scala b/typo/src/scala/typo/internal/ComputedTestInserts.scala index b21ca35ab2..66825ab7b3 100644 --- a/typo/src/scala/typo/internal/ComputedTestInserts.scala +++ b/typo/src/scala/typo/internal/ComputedTestInserts.scala @@ -8,18 +8,28 @@ case class ComputedTestInserts(tpe: sc.Type.Qualified, methods: List[ComputedTes object ComputedTestInserts { val random: sc.Ident = sc.Ident("random") def apply(projectName: String, options: InternalOptions, customTypes: CustomTypes, domains: List[ComputedDomain], enums: List[ComputedStringEnum], computedTables: Iterable[ComputedTable]) = { + val tablesByName: Map[db.RelationName, ComputedTable] = + computedTables.iterator.map(x => x.dbTable.name -> x).toMap val domainsByName: Map[sc.Type, ComputedDomain] = domains.iterator.map(x => x.tpe -> x).toMap val enumsByName: Map[sc.Type, ComputedStringEnum] = enums.iterator.map(x => x.tpe -> x).toMap + def defaultFor(table: ComputedTable, tpe: sc.Type, dbType: db.Type) = { def defaultLocalDate = code"${TypesJava.LocalDate}.ofEpochDay($random.nextInt(30000).toLong)" def defaultLocalTime = code"${TypesJava.LocalTime}.ofSecondOfDay($random.nextInt(24 * 60 * 60).toLong)" def defaultLocalDateTime = code"${TypesJava.LocalDateTime}.of($defaultLocalDate, $defaultLocalTime)" def defaultZoneOffset = code"${TypesJava.ZoneOffset}.ofHours($random.nextInt(24) - 12)" - def go(tpe: sc.Type, dbType: db.Type): Option[sc.Code] = + def go(tpe: sc.Type, dbType: db.Type, tableUnaryId: Option[IdComputed.Unary]): Option[sc.Code] = tpe match { + case tpe if tableUnaryId.exists(_.tpe == tpe) => + tableUnaryId.get match { + case x: IdComputed.UnaryNormal => go(x.underlying, x.col.dbCol.tpe, None).map(default => code"${x.tpe}($default)") + case x: IdComputed.UnaryInherited => go(x.underlying, x.col.dbCol.tpe, None).map(default => code"${x.tpe}($default)") + case x: IdComputed.UnaryNoIdType => go(x.underlying, x.col.dbCol.tpe, None) + case _: IdComputed.UnaryUserSpecified => None + } case TypesJava.String => val max: Int = Option(dbType) @@ -45,14 +55,14 @@ object ComputedTestInserts { case TypesScala.BigDecimal => Some(code"${TypesScala.BigDecimal}.decimal($random.nextDouble())") case TypesJava.UUID => Some(code"${TypesJava.UUID}.nameUUIDFromBytes{val bs = ${TypesScala.Array}.ofDim[${TypesScala.Byte}](16); $random.nextBytes(bs); bs}") case TypesScala.Optional(underlying) => - go(underlying, dbType) match { + go(underlying, dbType, tableUnaryId) match { case None => Some(TypesScala.None.code) case Some(default) => Some(code"if ($random.nextBoolean()) ${TypesScala.None} else ${TypesScala.Some}($default)") } case sc.Type.ArrayOf(underlying) => dbType match { case db.Type.Array(underlyingDb) => - go(underlying, underlyingDb).map { default => + go(underlying, underlyingDb, tableUnaryId).map { default => code"${TypesScala.Array}.fill(random.nextInt(3))($default)" } case _ => None @@ -69,45 +79,85 @@ object ComputedTestInserts { case customTypes.TypoOffsetTime.typoType => Some(code"${customTypes.TypoOffsetTime.typoType}($defaultLocalTime.atOffset($defaultZoneOffset))") case customTypes.TypoInstant.typoType => - Some(code"${customTypes.TypoInstant.typoType}(${TypesJava.Instant}.ofEpochMilli($random.nextLong()))") + // 2001-09-09T01:46:40Z -> 2033-05-18T03:33:20Z + Some(code"${customTypes.TypoInstant.typoType}(${TypesJava.Instant}.ofEpochMilli(1000000000000L + $random.nextLong(1000000000000L)))") case sc.Type.TApply(table.default.Defaulted, _) => Some(code"${table.default.Defaulted}.${table.default.UseDefault}") case tpe if domainsByName.contains(tpe) => - go(domainsByName(tpe).underlyingType, dbType).map(inner => code"$tpe($inner)") + go(domainsByName(tpe).underlyingType, dbType, tableUnaryId).map(inner => code"$tpe($inner)") case tpe if enumsByName.contains(tpe) => Some(code"$tpe.All($random.nextInt($tpe.All.length))") case _ => None } - go(sc.Type.base(tpe), dbType) + go(sc.Type.base(tpe), dbType, table.maybeId.collect { case x: IdComputed.Unary => x }) } new ComputedTestInserts( sc.Type.Qualified(options.pkg / sc.Ident(s"${Naming.titleCase(projectName)}TestInsert")), computedTables.collect { case table if !options.readonlyRepo.include(table.dbTable.name) => - val cols: NonEmptyList[ComputedColumn] = - table.maybeUnsavedRow match { - case Some(unsaved) => unsaved.allCols - case None => table.cols - } + val hasConstraints: Set[db.ColName] = + table.dbTable.cols.iterator.flatMap(_.constraints.flatMap(_.columns)).toSet - val params: List[sc.Param] = { - val asParams = cols.map { col => - val default = defaultFor(table, col.tpe, col.dbCol.tpe) - sc.Param(col.name, col.tpe, default) - } - val (requiredParams, optionalParams) = asParams.toList.partition(_.default.isEmpty) - requiredParams ++ optionalParams + FkAnalysis(tablesByName, table).createWithFkIdsUnsavedRowOrRow match { + case Some(colsFromFks) => + val valuesFromFk: List[(sc.Ident, sc.Code)] = + colsFromFks.allColumns.toList.map { col => + val expr: sc.Code = + colsFromFks.exprForColumn.get(col.name) match { + case Some(expr) => + if (col.dbCol.isDefaulted && col.dbCol.nullability != Nullability.NoNulls) + code"${table.default.Defaulted}.${table.default.Provided}(${TypesScala.Option}($expr))" + else if (col.dbCol.isDefaulted) + code"${table.default.Defaulted}.${table.default.Provided}($expr)" + else if (col.dbCol.nullability != Nullability.NoNulls) + code"${TypesScala.Option}(${expr})" + else + expr + + case None => col.name.code + } + + (col.name, expr) + } + val (requiredParams, optionalParams) = colsFromFks.remainingColumns + .map { col => + val default = if (hasConstraints(col.dbName) && !col.dbCol.isDefaulted) { + if (col.dbCol.nullability == Nullability.NoNulls) None else Some(TypesScala.None.code) + } else defaultFor(table, col.tpe, col.dbCol.tpe) + sc.Param(col.name, col.tpe, default) + } + .partition(_.default.isEmpty) + ComputedTestInserts.InsertMethod(table, colsFromFks.params ++ requiredParams ++ optionalParams, valuesFromFk) + case None => + val cols: List[ComputedColumn] = + table.maybeUnsavedRow match { + case Some(unsaved) => unsaved.allCols.toList + case None => table.cols.toList + } + val params: List[sc.Param] = { + val asParams = cols.map { col => + val default = if (hasConstraints(col.dbName) && !col.dbCol.isDefaulted) { + if (col.dbCol.nullability == Nullability.NoNulls) None else Some(TypesScala.None.code) + } else defaultFor(table, col.tpe, col.dbCol.tpe) + sc.Param(col.name, col.tpe, default) + } + val (requiredParams, optionalParams) = asParams.partition(_.default.isEmpty) + requiredParams ++ optionalParams + } + val values: List[(sc.Ident, sc.Code)] = + params.map(p => (p.name, p.name.code)) + + ComputedTestInserts.InsertMethod(table, params, values) } - ComputedTestInserts.InsertMethod(table, params) }.toList ) } - case class InsertMethod(table: ComputedTable, params: List[sc.Param]) { + case class InsertMethod(table: ComputedTable, params: List[sc.Param], values: List[(sc.Ident, sc.Code)]) { val name: sc.Ident = table.dbTable.name match { case db.RelationName(Some(schema), name) => sc.Ident(s"${Naming.camelCase(schema)}${Naming.titleCase(name)}") diff --git a/typo/src/scala/typo/internal/FkAnalysis.scala b/typo/src/scala/typo/internal/FkAnalysis.scala new file mode 100644 index 0000000000..57105058c8 --- /dev/null +++ b/typo/src/scala/typo/internal/FkAnalysis.scala @@ -0,0 +1,190 @@ +package typo +package internal + +import typo.internal.codegen.* + +class FkAnalysis(table: ComputedTable, candidateFks: List[FkAnalysis.CandidateFk]) { + lazy val createWithFkIdsRow: Option[FkAnalysis.CreateWithFkIds] = + FkAnalysis.CreateWithFkIds.compute(candidateFks, table.cols) + lazy val createWithFkIdsUnsavedRow: Option[FkAnalysis.CreateWithFkIds] = + table.maybeUnsavedRow.flatMap(unsaved => FkAnalysis.CreateWithFkIds.compute(candidateFks, unsaved.allCols)) + lazy val createWithFkIdsUnsavedRowOrRow: Option[FkAnalysis.CreateWithFkIds] = + createWithFkIdsUnsavedRow.orElse(createWithFkIdsRow) + + lazy val createWithFkIdsId: Option[FkAnalysis.CreateWithFkIds] = + table.maybeId match { + case Some(id: IdComputed.Composite) => FkAnalysis.CreateWithFkIds.compute(candidateFks, id.cols) + case _ => None + } + + lazy val extractFksIdsFromRow: List[FkAnalysis.ExtractFkId] = + FkAnalysis.ExtractFkId.compute(candidateFks, table.cols) + lazy val extractFksIdsFromId: List[FkAnalysis.ExtractFkId] = + table.maybeId match { + case Some(id: IdComputed.Composite) => FkAnalysis.ExtractFkId.compute(candidateFks, id.cols) + case _ => Nil + } + lazy val extractFksIdsFromRowNotId: List[FkAnalysis.ExtractFkId] = + extractFksIdsFromRow.filterNot(x => extractFksIdsFromId.exists(_.name == x.name)) +} + +object FkAnalysis { + def apply(tablesByName: Map[db.RelationName, ComputedTable], table: ComputedTable): FkAnalysis = + new FkAnalysis(table, CandidateFk.of(tablesByName, table.dbTable)) + + /** All columns in a table. some can be extracted from composite ID types from other tables, some need to specified + * @param byFks + * the columns which can be extracted from a composite ID type from another table + * @param remainingColumns + * those which can not be extracted from any of the composite fk types + */ + case class CreateWithFkIds(byFks: NonEmptyList[ColsFromFk], remainingColumns: List[ComputedColumn], allColumns: NonEmptyList[ComputedColumn]) { + + /** a given column may appear in more than one foreign key value extraction expression */ + lazy val exprsForColumn: Map[sc.Ident, List[sc.Code]] = + byFks.toList + .flatMap(colsFromFk => colsFromFk.colPairs.map { case (_, col) => (col.name, colsFromFk.expr(col.name)) }) + .groupMap { case (colName, _) => colName } { case (_, expr) => expr } + + /** reduce the potentially multiple values in [[exprsForColumn]] down to one expression, with `require` to assert that the others contain the same value */ + lazy val exprForColumn: Map[sc.Ident, sc.Code] = + exprsForColumn.map { case (colName, exprs) => + exprs match { + case Nil => sys.error("unexpected") + case List(expr) => (colName, expr) + case expr :: exprs => + val requires = exprs.map(e => code"""require($expr == $e, "${expr.render.lines.mkString("\n")} != ${e.render.lines.mkString("\n")}")""") + val finalExpr = code"""|{ + | ${requires.mkCode("\n")} + | $expr + |}""".stripMargin + (colName, finalExpr) + } + } + + /** parameters corresponding to all the foreign key types */ + lazy val params: List[sc.Param] = + byFks.map(_.param).toList + + /** if you create a method with these parameters, you get all the data. */ + lazy val allParams: List[sc.Param] = + params ++ remainingColumns.map(_.param) + + /** and this contains matching expressions for all the values in [[allParams]] */ + lazy val allExpr: List[(sc.Ident, sc.Code)] = + allColumns.toList.map { col => + val expr = exprForColumn.getOrElse(col.name, col.name.code) + (col.name, expr) + } + } + + object CreateWithFkIds { + + /** Compute a minimal set of composite FK IDs to cover maximum number of columns in table */ + def compute(candidateFks: List[CandidateFk], thisOriginalColumns: NonEmptyList[ComputedColumn]): Option[CreateWithFkIds] = { + // state + var remainingThisCols: List[ComputedColumn] = thisOriginalColumns.toList + var byFk = List.empty[(db.ForeignKey, ColsFromFk)] + + candidateFks + // consider longest first, plus disambiguate for consistency + .sortBy(candidate => (-candidate.thisFk.cols.countWhere(colName => thisOriginalColumns.exists(_.dbName == colName)), candidate.thisFk.constraintName)) + .foreach { candidateFk => + // check that all cols in fk are not covered by other fks we already consumed + remainingThisCols.partition(col => candidateFk.thisFk.cols.contains(col.dbName)) match { + case (consumedNewCols, rest) if consumedNewCols.nonEmpty => + val affectedThisCols = reshuffle(candidateFk, thisOriginalColumns) + byFk = (candidateFk.thisFk, ColsFromFk(candidateFk.otherId, affectedThisCols)) :: byFk + remainingThisCols = rest + case _ => () + } + } + + NonEmptyList.fromList(ColsFromFk.renamed(byFk)).map(x => CreateWithFkIds(x, remainingThisCols, thisOriginalColumns)) + } + } + + /** A composite ID type from another table, and the columns in this table which can be extracted¬ */ + case class ColsFromFk(otherCompositeId: IdComputed.Composite, thisColumns: List[ComputedColumn]) { + def param: sc.Param = + otherCompositeId.param + def withParamName(name: sc.Ident): ColsFromFk = + copy(otherCompositeId = otherCompositeId.copy(paramName = name)) + lazy val colPairs: List[(ComputedColumn, ComputedColumn)] = + otherCompositeId.cols.toList.zip(thisColumns) + lazy val expr: Map[sc.Ident, sc.Code] = + colPairs.map { case (fromId, col) => (col.name, code"${param.name}.${fromId.name}") }.toMap + } + + object ColsFromFk { + // one table may appear in more than one fk, give ugly name when they do + def renamed(byFk: List[(db.ForeignKey, ColsFromFk)]): List[ColsFromFk] = + byFk + .groupBy { case (_, colsFromFk) => colsFromFk.otherCompositeId.tpe.name } + .valuesIterator + .flatMap { + case List((_, colsFromFk)) => List(colsFromFk.withParamName(colsFromFk.otherCompositeId.tpe.name)) + case more => more.map { case (fk, colsFromFk) => colsFromFk.withParamName(sc.Ident(fk.constraintName.name)) } + } + .toList + .sortBy(_.otherCompositeId.paramName) + } + + /** A composite ID type from another table, and the columns in this table which can be extracted¬ */ + case class ExtractFkId(name: sc.Ident, otherCompositeIdType: sc.Type.Qualified, colPairs: List[(ComputedColumn, ComputedColumn)]) + + object ExtractFkId { + + /** compute a minimal set of composite foreign key ids to take as parameter in order to fill all values */ + def compute(candidateFks: List[CandidateFk], thisColumns: NonEmptyList[ComputedColumn]): List[ExtractFkId] = + candidateFks + // keep only those where all parts are among `thisOriginalColumns` as we need to produce the fk composite id types here + .filter(candidate => candidate.thisFk.cols.forall(colName => thisColumns.exists(_.dbName == colName))) + .groupBy(_.otherId.tpe.name) + .iterator + .flatMap { case (_, candidates) => + val useNiceName = candidates.length == 1 + candidates.flatMap { candidateFk => + val affectedThisCols = reshuffle(candidateFk, thisColumns) + + // we may have an optional value on our side, and a required value on the other side. in that case we cannot produce the row + // this catches a little bit too much, but should be close enough. + val typesExactMatch = affectedThisCols.zip(candidateFk.otherId.cols.toList).forall { case (one, two) => one.tpe == two.tpe } + + val colPairs: List[(ComputedColumn, ComputedColumn)] = + candidateFk.otherId.cols.toList.zip(affectedThisCols) + + if (typesExactMatch) { + val ident = if (useNiceName) candidateFk.otherId.tpe.name else sc.Ident(candidateFk.thisFk.constraintName.name) + Some(ExtractFkId(ident, candidateFk.otherId.tpe, colPairs)) + } else None + + } + } + .toList + // consider longest first, plus disambiguate for consistency + .sortBy(x => (-x.colPairs.length, x.name)) + } + + case class CandidateFk(thisFk: db.ForeignKey, otherTable: ComputedTable, otherId: IdComputed.Composite) + + object CandidateFk { + // fitting foreign keys + def of(tablesByName: Map[db.RelationName, ComputedTable], dbTable: db.Table): List[CandidateFk] = + for { + fk <- dbTable.foreignKeys + if fk.otherTable != dbTable.name + if fk.cols.length > 1 + otherTable <- tablesByName.get(fk.otherTable) + // we're only interested if pk matches, because that means we have a composite ID type to use + _ <- otherTable.dbTable.primaryKey.filter(pk => pk.colNames == fk.otherCols) + compositePk <- otherTable.maybeId.collect { case x: IdComputed.Composite => x.copy(paramName = sc.Ident(fk.constraintName.name)) } + } yield CandidateFk(fk, otherTable, compositePk) + } + + // pick out all columns included fk. fix ordering to account for different column names in the two relations + def reshuffle(candidateFk: CandidateFk, thisOriginalColumns: NonEmptyList[ComputedColumn]): List[ComputedColumn] = + thisOriginalColumns.toList + .filter(col => candidateFk.thisFk.cols.contains(col.dbName)) + .sortBy(thisCol => candidateFk.thisFk.cols.toList.indexWhere(_ == thisCol.dbCol.name)) +} diff --git a/typo/src/scala/typo/internal/codegen/DbLibAnorm.scala b/typo/src/scala/typo/internal/codegen/DbLibAnorm.scala index fedd5d583b..388c4886e9 100644 --- a/typo/src/scala/typo/internal/codegen/DbLibAnorm.scala +++ b/typo/src/scala/typo/internal/codegen/DbLibAnorm.scala @@ -603,7 +603,7 @@ class DbLibAnorm(pkg: sc.QIdent, inlineImplicits: Boolean, default: ComputedDefa x.params, List(sc.Param(sc.Ident("c"), TypesJava.Connection, None)), x.table.names.RowName, - code"(new ${x.table.names.RepoImplName}).insert(new ${x.cls}(${x.params.map(p => code"${p.name} = ${p.name}").mkCode(", ")}))" + code"(new ${x.table.names.RepoImplName}).insert(new ${x.cls}(${x.values.map { case (p, expr) => code"$p = $expr" }.mkCode(", ")}))" ) override val defaultedInstance: List[sc.Given] = diff --git a/typo/src/scala/typo/internal/codegen/DbLibDoobie.scala b/typo/src/scala/typo/internal/codegen/DbLibDoobie.scala index 080923f2ed..77ecc1485f 100644 --- a/typo/src/scala/typo/internal/codegen/DbLibDoobie.scala +++ b/typo/src/scala/typo/internal/codegen/DbLibDoobie.scala @@ -505,7 +505,7 @@ class DbLibDoobie(pkg: sc.QIdent, inlineImplicits: Boolean, default: ComputedDef x.params, Nil, ConnectionIO.of(x.table.names.RowName), - code"(new ${x.table.names.RepoImplName}).insert(new ${x.cls}(${x.params.map(p => code"${p.name} = ${p.name}").mkCode(", ")}))" + code"(new ${x.table.names.RepoImplName}).insert(new ${x.cls}(${x.values.map { case (p, expr) => code"$p = $expr" }.mkCode(", ")}))" ) override val defaultedInstance: List[sc.Given] = diff --git a/typo/src/scala/typo/internal/codegen/DbLibZioJdbc.scala b/typo/src/scala/typo/internal/codegen/DbLibZioJdbc.scala index a7354cc5b4..2a430cba6a 100644 --- a/typo/src/scala/typo/internal/codegen/DbLibZioJdbc.scala +++ b/typo/src/scala/typo/internal/codegen/DbLibZioJdbc.scala @@ -616,7 +616,7 @@ class DbLibZioJdbc(pkg: sc.QIdent, inlineImplicits: Boolean, dslEnabled: Boolean x.params, Nil, ZIO.of(ZConnection, Throwable, x.table.names.RowName), - code"(new ${x.table.names.RepoImplName}).insert(new ${x.cls}(${x.params.map(p => code"${p.name} = ${p.name}").mkCode(", ")}))" + code"(new ${x.table.names.RepoImplName}).insert(new ${x.cls}(${x.values.map { case (p, expr) => code"$p = $expr" }.mkCode(", ")}))" ) override val defaultedInstance: List[sc.Given] = diff --git a/typo/src/scala/typo/internal/codegen/FilesRelation.scala b/typo/src/scala/typo/internal/codegen/FilesRelation.scala index 132df61430..969901589c 100644 --- a/typo/src/scala/typo/internal/codegen/FilesRelation.scala +++ b/typo/src/scala/typo/internal/codegen/FilesRelation.scala @@ -4,13 +4,37 @@ package codegen import play.api.libs.json.Json -case class FilesRelation(naming: Naming, names: ComputedNames, maybeCols: Option[NonEmptyList[ComputedColumn]], options: InternalOptions, fks: List[db.ForeignKey]) { +case class FilesRelation( + naming: Naming, + names: ComputedNames, + maybeCols: Option[NonEmptyList[ComputedColumn]], + maybeFkAnalysis: Option[FkAnalysis], + options: InternalOptions, + fks: List[db.ForeignKey] +) { def RowFile(rowType: DbLib.RowType, comment: Option[String], maybeUnsavedRow: Option[(ComputedRowUnsaved, ComputedDefault)]): Option[sc.File] = maybeCols.map { cols => - val members = List[Option[sc.Code]]( + val members = List[Iterable[sc.Code]]( names.maybeId.collect { case x: IdComputed.Composite => code"""val ${x.paramName}: ${x.tpe} = ${x.tpe}(${x.cols.map(x => x.name.code).mkCode(", ")})""" }, + // id member which points to either `compositeId` val defined above or id column + if (maybeCols.exists(_.exists(_.name.value == "id"))) None + else + names.maybeId.collect { + case id: IdComputed.Unary => code"val id = ${id.col.name}" + case id: IdComputed.Composite => code"val id = ${id.paramName}" + }, + maybeFkAnalysis.toList.flatMap(_.extractFksIdsFromRowNotId).map { extractFkId => + val args = extractFkId.colPairs.map { case (inComposite, inId) => code"${inComposite.name} = ${inId.name}" } + + val body = + code"""|${extractFkId.otherCompositeIdType}( + | ${args.mkCode(",\n")} + |)""".stripMargin + + sc.Value(Nil, extractFkId.name.prepended("extract"), Nil, Nil, extractFkId.otherCompositeIdType, body) + }, maybeUnsavedRow.map { case (unsaved, defaults) => val (partOfId, rest) = unsaved.defaultCols.toList.partition { case (col, _) => names.isIdColumn(col.dbName) } val partOfIdParams = partOfId.map { case (col, tpe) => @@ -157,6 +181,27 @@ case class FilesRelation(naming: Naming, names: ComputedNames, maybeCols: Option case Source.SqlFile(_) => Nil } + val extractFkMember: List[sc.Code] = + maybeFkAnalysis.toList.flatMap(_.extractFksIdsFromRow).flatMap { x => + val predicateType = sc.Type.dsl.SqlExpr.of(TypesScala.Boolean, sc.Type.dsl.Required) + val is = { + val expr = x.colPairs + .map { case (otherCol, thisCol) => code"${thisCol.name}.isEqual(id.${otherCol.name})" } + .reduceLeft[sc.Code] { case (acc, current) => code"$acc.and($current)" } + code"""|def extract${x.name}Is(id: ${x.otherCompositeIdType}): $predicateType = + | $expr""".stripMargin + + } + val in = { + val parts = x.colPairs.map { case (otherCol, thisCol) => code"${sc.Type.dsl.CompositeTuplePart}(${thisCol.name})(_.${otherCol.name})" } + code"""|def extract${x.name}In(ids: ${sc.Type.ArrayOf(x.otherCompositeIdType)}): $predicateType = + | new ${sc.Type.dsl.CompositeIn}(ids)(${parts.mkCode(", ")}) + |""".stripMargin + } + + List(is, in) + + } val compositeIdMembers: List[sc.Code] = names.maybeId .collect { @@ -187,7 +232,7 @@ case class FilesRelation(naming: Naming, names: ComputedNames, maybeCols: Option val ImplName = sc.Ident("Impl") val str = code"""trait ${fieldsName.name} { - | ${(colMembers ++ fkMembers ++ compositeIdMembers).mkCode("\n")} + | ${(colMembers ++ fkMembers ++ compositeIdMembers ++ extractFkMember).mkCode("\n")} |} | |object ${fieldsName.name} { diff --git a/typo/src/scala/typo/internal/codegen/FilesSqlFile.scala b/typo/src/scala/typo/internal/codegen/FilesSqlFile.scala index ad9aa793a8..1c1b752904 100644 --- a/typo/src/scala/typo/internal/codegen/FilesSqlFile.scala +++ b/typo/src/scala/typo/internal/codegen/FilesSqlFile.scala @@ -5,7 +5,7 @@ package codegen import typo.internal.codegen.DbLib.RowType case class FilesSqlFile(script: ComputedSqlFile, naming: Naming, options: InternalOptions) { - val relation = FilesRelation(naming, script.names, script.maybeCols.toOption, options, fks = Nil) + val relation = FilesRelation(naming, script.names, script.maybeCols.toOption, None, options, fks = Nil) val all: List[sc.File] = List( relation.RowFile(RowType.Readable, comment = None, maybeUnsavedRow = None), relation.FieldsFile, diff --git a/typo/src/scala/typo/internal/codegen/FilesTable.scala b/typo/src/scala/typo/internal/codegen/FilesTable.scala index 7b75c048e7..f82e477a5a 100644 --- a/typo/src/scala/typo/internal/codegen/FilesTable.scala +++ b/typo/src/scala/typo/internal/codegen/FilesTable.scala @@ -5,8 +5,8 @@ package codegen import play.api.libs.json.Json import typo.internal.codegen.DbLib.RowType -case class FilesTable(table: ComputedTable, options: InternalOptions, genOrdering: GenOrdering) { - val relation = FilesRelation(table.naming, table.names, Some(table.cols), options, table.dbTable.foreignKeys) +case class FilesTable(table: ComputedTable, fkAnalysis: FkAnalysis, options: InternalOptions, genOrdering: GenOrdering) { + val relation = FilesRelation(table.naming, table.names, Some(table.cols), Some(fkAnalysis), options, table.dbTable.foreignKeys) val RowFile = relation.RowFile(RowType.ReadWriteable, table.dbTable.comment, maybeUnsavedRow = table.maybeUnsavedRow.map(u => (u, table.default))) val UnsavedRowFile: Option[sc.File] = @@ -136,7 +136,34 @@ case class FilesTable(table: ComputedTable, options: InternalOptions, genOrderin case _: IdComputed.UnaryUserSpecified | _: IdComputed.UnaryNoIdType | _: IdComputed.UnaryInherited => None - case id @ IdComputed.Composite(cols, qident, _) => + case id @ IdComputed.Composite(cols, tpe, _) => + val constructorMethod = fkAnalysis.createWithFkIdsId.map { colsFromFks => + val body = + code"""|${tpe.name}( + | ${colsFromFks.allExpr.map { case (colName, expr) => code"$colName = $expr" }.mkCode(",\n")} + |)""".stripMargin + + sc.Value(Nil, sc.Ident("from"), colsFromFks.allParams, Nil, tpe, body) + } + val instanceMethods: List[sc.Value] = + fkAnalysis.extractFksIdsFromId.map { colsToFk => + val args = colsToFk.colPairs.map { case (inComposite, inId) => code"${inComposite.name} = ${inId.name}" } + + val body = + code"""|${colsToFk.otherCompositeIdType}( + | ${args.mkCode(",\n")} + |)""".stripMargin + + sc.Value(Nil, colsToFk.name.prepended("extract"), Nil, Nil, colsToFk.otherCompositeIdType, body) + } + val renderedInstanceMethods = instanceMethods match { + case Nil => sc.Code.Empty + case nonEmpty => + code"""|{ + |${nonEmpty.map(_.code).mkCode("\n")} + |}""".stripMargin + } + val comments = scaladoc(s"Type for the composite primary key of table `${table.dbTable.name.value}`")(Nil) val instances = List( List(genOrdering.ordering(id.tpe, cols.map(cc => sc.Param(cc.param.name, cc.tpe, None)))), @@ -146,8 +173,10 @@ case class FilesTable(table: ComputedTable, options: InternalOptions, genOrderin sc.File( id.tpe, code"""|$comments - |case class ${qident.name}(${cols.map(_.param.code).mkCode(", ")}) - |${genObject(qident.value, instances)} + |case class ${tpe.name}( + | ${cols.map(_.param.code).mkCode(",\n")} + |)$renderedInstanceMethods + |${genObject(tpe.value, instances ++ constructorMethod)} |""".stripMargin, secondaryTypes = Nil, scope = Scope.Main diff --git a/typo/src/scala/typo/internal/codegen/FilesView.scala b/typo/src/scala/typo/internal/codegen/FilesView.scala index cae87befa0..b62f4ff8de 100644 --- a/typo/src/scala/typo/internal/codegen/FilesView.scala +++ b/typo/src/scala/typo/internal/codegen/FilesView.scala @@ -5,7 +5,7 @@ package codegen import typo.internal.codegen.DbLib.RowType case class FilesView(view: ComputedView, options: InternalOptions) { - val relation = FilesRelation(view.naming, view.names, Some(view.cols), options, fks = Nil) + val relation = FilesRelation(view.naming, view.names, Some(view.cols), None, options, fks = Nil) val all: List[sc.File] = List( relation.RowFile(RowType.Readable, view.view.comment, maybeUnsavedRow = None), relation.FieldsFile, diff --git a/typo/src/scala/typo/internal/generate.scala b/typo/src/scala/typo/internal/generate.scala index 3ddb3e2ea7..521b9794ca 100644 --- a/typo/src/scala/typo/internal/generate.scala +++ b/typo/src/scala/typo/internal/generate.scala @@ -86,14 +86,19 @@ object generate { // relations chosen by the selector and the sql files val computedRelations = computedLazyRelations.flatMap { case (_, lazyValue) => lazyValue.getIfEvaluated } + val computedRelationsByName: Map[db.RelationName, ComputedTable] = + computedRelations.iterator.collect { case x: ComputedTable => (x.dbTable.name, x) }.toMap + // yeah, sorry about the naming overload. this is a list of output files generated for each input sql file val sqlFileFiles: List[sc.File] = computedSqlFiles.flatMap(x => FilesSqlFile(x, naming, options).all) val relationFilesByName = computedRelations.flatMap { - case viewComputed: ComputedView => FilesView(viewComputed, options).all.map(x => (viewComputed.view.name, x)) - case tableComputed: ComputedTable => FilesTable(tableComputed, options, genOrdering).all.map(x => (tableComputed.dbTable.name, x)) - case _ => Nil + case viewComputed: ComputedView => FilesView(viewComputed, options).all.map(x => (viewComputed.view.name, x)) + case tableComputed: ComputedTable => + val fkAnalysis = FkAnalysis(computedRelationsByName, tableComputed) + FilesTable(tableComputed, fkAnalysis, options, genOrdering).all.map(x => (tableComputed.dbTable.name, x)) + case _ => Nil } val mostFiles: List[sc.File] = diff --git a/typo/src/scala/typo/sc.scala b/typo/src/scala/typo/sc.scala index 71967f29d0..41577714e4 100644 --- a/typo/src/scala/typo/sc.scala +++ b/typo/src/scala/typo/sc.scala @@ -14,6 +14,7 @@ object sc { case class Ident(value: String) extends Tree { def appended(suffix: String) = new Ident(value + suffix) + def prepended(prefix: String) = new Ident(prefix + value) } object Ident {