@a_team/prisma 1.0.18 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a_team/prisma",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "keywords": [],
5
5
  "scripts": {
6
6
  "generate": "npx prisma generate",
@@ -0,0 +1,24 @@
1
+ // npx ts-node playground/contract.ts
2
+
3
+ import { PrismaClient } from "@prisma/client";
4
+
5
+ const prisma = new PrismaClient();
6
+
7
+ async function main() {
8
+ const contract = await prisma.contract.findUnique({
9
+ where: { id: "66cf64d100e0d700127facdf" },
10
+ include: {
11
+ mission: true,
12
+ },
13
+ });
14
+ console.log(contract);
15
+ }
16
+
17
+ main()
18
+ .then(async () => {
19
+ await prisma.$disconnect();
20
+ })
21
+ .catch(async (e) => {
22
+ console.error(e);
23
+ await prisma.$disconnect();
24
+ });
@@ -0,0 +1,21 @@
1
+ // npx ts-node playground/contracts.ts
2
+
3
+ import { PrismaClient } from "@prisma/client";
4
+
5
+ const prisma = new PrismaClient();
6
+
7
+ async function main() {
8
+ const contracts = await prisma.contract.findMany({
9
+ take: 5,
10
+ });
11
+ console.log(contracts);
12
+ }
13
+
14
+ main()
15
+ .then(async () => {
16
+ await prisma.$disconnect();
17
+ })
18
+ .catch(async (e) => {
19
+ console.error(e);
20
+ await prisma.$disconnect();
21
+ });
@@ -0,0 +1,41 @@
1
+ model Contract {
2
+ id String @id @default(auto()) @map("_id") @db.ObjectId
3
+ status ContractStatus
4
+ type ContractType
5
+ downloadURL String
6
+ createdAt DateTime @db.Date
7
+ updatedAt DateTime @updatedAt @db.Date
8
+ parties ContractParty[]
9
+ missionId String? @map("mission") @db.ObjectId
10
+ mission Mission? @relation(fields: [missionId], references: [mid])
11
+ role String? @db.ObjectId
12
+ custom Boolean?
13
+
14
+ @@index([type, missionId, role, createdAt], map: "type_1_mission_1_role_1_createdAt_-1")
15
+ @@index([parties.user, status, createdAt], map: "parties.user_1_status_1_createdAt_1")
16
+ @@map("contracts")
17
+ }
18
+
19
+ enum ContractStatus {
20
+ Created
21
+ Completed
22
+ }
23
+
24
+ enum ContractType {
25
+ TermsOfService
26
+ MissionAgreement
27
+ }
28
+
29
+ type ContractParty {
30
+ type ContractPartyType
31
+ user String? @db.ObjectId
32
+ ip String?
33
+ signedAt DateTime? @db.Date
34
+ accountId String? @db.ObjectId
35
+ stripeClient String?
36
+ }
37
+
38
+ enum ContractPartyType {
39
+ BillingCustomer
40
+ MissionRole
41
+ }
@@ -166,6 +166,7 @@ model Mission {
166
166
  updatedAt DateTime? @db.Date
167
167
  videoURL String?
168
168
  website String?
169
+ contracts Contract[]
169
170
 
170
171
  @@unique([roles.id], map: "roles._id_1")
171
172
  @@map("missions")
@@ -48,6 +48,7 @@ type MissionSpecRole {
48
48
  customQuestions ClientRoleQuestion[]
49
49
  description String?
50
50
  isLead Boolean @default(false)
51
+ tags String[]
51
52
  locations String[]
52
53
  minimumCommitment Int?
53
54
  preferredSkills String[] @db.ObjectId