Skip to content

Commit

Permalink
feat: ecosystem ms setup (#105)
Browse files Browse the repository at this point in the history
* worked on the master table json file and .env sample refractoring

Signed-off-by: @nishad.shirsat <nishad.shirsat@ayanworks.com>

* merge dev branch to main (#77)

* fix: Changed the passkey approch

Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>

* feat/fix: Implemented Add passkey for existing users

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* feat:implemented add passke

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: login error message

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

---------

Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* Included credebl-master-table json file in the .gitignore

Signed-off-by: @nishad.shirsat <nishad.shirsat@ayanworks.com>

* Create ecosystem monorepo

Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>

* feat: Implemented ecosystem microservice

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* feat: changed controller name

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix:changed return message

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* setup ecosystem prisma schema

Signed-off-by: Nishad <nishad.shirsat@ayanworks.com>

---------

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>
Signed-off-by: @nishad.shirsat <nishad.shirsat@ayanworks.com>
Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
Signed-off-by: Nishad <nishad.shirsat@ayanworks.com>
Co-authored-by: Nishad Shirsat <103021375+nishad-ayanworks@users.noreply.github.com>
Co-authored-by: @nishad.shirsat <nishad.shirsat@ayanworks.com>
Co-authored-by: Shashank Kulkarni <44693969+KulkarniShashank@users.noreply.github.com>
Co-authored-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>
  • Loading branch information
5 people committed Oct 5, 2023
1 parent cc4b82c commit 0b5282b
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/ecosystem/src/ecosystem.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class EcosystemService {

// eslint-disable-next-line camelcase
async createEcosystem():Promise<string> {
return "test";
return "test ecosystem";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
-- CreateTable
CREATE TABLE "ecosystem_roles" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT NOT NULL,
"createDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"createdBy" INTEGER NOT NULL DEFAULT 1,
"lastChangedDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"lastChangedBy" INTEGER NOT NULL DEFAULT 1,
"deletedAt" TIMESTAMP(6),

CONSTRAINT "ecosystem_roles_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "ecosystem" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT NOT NULL,
"tags" TEXT NOT NULL,
"createDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"createdBy" INTEGER NOT NULL DEFAULT 1,
"lastChangedDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"lastChangedBy" INTEGER NOT NULL DEFAULT 1,
"deletedAt" TIMESTAMP(6),

CONSTRAINT "ecosystem_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "ecosystem_invitations" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"status" TEXT NOT NULL,
"ecosystemId" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"orgId" TEXT NOT NULL,
"createDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"createdBy" INTEGER NOT NULL DEFAULT 1,
"lastChangedDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"lastChangedBy" INTEGER NOT NULL DEFAULT 1,
"deletedAt" TIMESTAMP(6),

CONSTRAINT "ecosystem_invitations_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "ecosystem_users" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"ecosystemId" TEXT NOT NULL,
"createDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"createdBy" INTEGER NOT NULL DEFAULT 1,
"lastChangedDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"lastChangedBy" INTEGER NOT NULL DEFAULT 1,
"deletedAt" TIMESTAMP(6),

CONSTRAINT "ecosystem_users_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "ecosystem_orgs" (
"id" TEXT NOT NULL,
"orgId" TEXT NOT NULL,
"status" TEXT NOT NULL,
"ecosystemId" TEXT NOT NULL,
"ecosystemRoleId" INTEGER NOT NULL,
"createDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"createdBy" INTEGER NOT NULL DEFAULT 1,
"lastChangedDateTime" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"lastChangedBy" INTEGER NOT NULL DEFAULT 1,
"deletedAt" TIMESTAMP(6),

CONSTRAINT "ecosystem_orgs_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "ecosystem_roles_name_key" ON "ecosystem_roles"("name");

-- AddForeignKey
ALTER TABLE "ecosystem_invitations" ADD CONSTRAINT "ecosystem_invitations_ecosystemId_fkey" FOREIGN KEY ("ecosystemId") REFERENCES "ecosystem"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ecosystem_users" ADD CONSTRAINT "ecosystem_users_ecosystemId_fkey" FOREIGN KEY ("ecosystemId") REFERENCES "ecosystem"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ecosystem_orgs" ADD CONSTRAINT "ecosystem_orgs_ecosystemId_fkey" FOREIGN KEY ("ecosystemId") REFERENCES "ecosystem"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ecosystem_orgs" ADD CONSTRAINT "ecosystem_orgs_ecosystemRoleId_fkey" FOREIGN KEY ("ecosystemRoleId") REFERENCES "ecosystem_roles"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
71 changes: 71 additions & 0 deletions libs/prisma-service/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,74 @@ model presentations {
orgId Int
organisation organisation @relation(fields: [orgId], references: [id])
}

model ecosystem_roles {
id Int @id @default(autoincrement())
name String @unique
description String
ecosystemOrgs ecosystem_orgs[]
createDateTime DateTime @default(now()) @db.Timestamptz(6)
createdBy Int @default(1)
lastChangedDateTime DateTime @default(now()) @db.Timestamptz(6)
lastChangedBy Int @default(1)
deletedAt DateTime? @db.Timestamp(6)
}

model ecosystem {
id String @id @default(uuid())
name String
description String
tags String
ecosystemOrgs ecosystem_orgs[]
ecosystemUsers ecosystem_users[]
ecosystemInvitations ecosystem_invitations[]
createDateTime DateTime @default(now()) @db.Timestamptz(6)
createdBy Int @default(1)
lastChangedDateTime DateTime @default(now()) @db.Timestamptz(6)
lastChangedBy Int @default(1)
deletedAt DateTime? @db.Timestamp(6)
}

model ecosystem_invitations {
id String @id @default(uuid())
email String
status String
ecosystemId String
userId String
orgId String
ecosystem ecosystem @relation(fields: [ecosystemId], references: [id])
createDateTime DateTime @default(now()) @db.Timestamptz(6)
createdBy Int @default(1)
lastChangedDateTime DateTime @default(now()) @db.Timestamptz(6)
lastChangedBy Int @default(1)
deletedAt DateTime? @db.Timestamp(6)
}

model ecosystem_users {
id String @id @default(uuid()) // auto-increment
userId String
ecosystemId String
ecosystem ecosystem @relation(fields: [ecosystemId], references: [id])
createDateTime DateTime @default(now()) @db.Timestamptz(6)
createdBy Int @default(1)
lastChangedDateTime DateTime @default(now()) @db.Timestamptz(6)
lastChangedBy Int @default(1)
deletedAt DateTime? @db.Timestamp(6)
}

model ecosystem_orgs {
id String @id @default(uuid()) // auto-increment
orgId String
status String
ecosystemId String
ecosystemRoleId Int
ecosystem ecosystem @relation(fields: [ecosystemId], references: [id])
ecosystemRole ecosystem_roles @relation(fields: [ecosystemRoleId], references: [id])
createDateTime DateTime @default(now()) @db.Timestamptz(6)
createdBy Int @default(1)
lastChangedDateTime DateTime @default(now()) @db.Timestamptz(6)
lastChangedBy Int @default(1)
deletedAt DateTime? @db.Timestamp(6)
}

0 comments on commit 0b5282b

Please sign in to comment.