From 862e3b46186d580870cab9e009949d9e11c7c60f Mon Sep 17 00:00:00 2001
From: nostrdev-com <support@nostrdev.com>
Date: Thu, 3 Apr 2025 10:31:29 +0300
Subject: [PATCH 1/6] chore: fixing pre-commit git hook

---
 .git-hooks/pre-commit | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit
index 31f6a12..ec280c3 100755
--- a/.git-hooks/pre-commit
+++ b/.git-hooks/pre-commit
@@ -11,7 +11,7 @@ if [[ "$BRANCH" =~ $REGEX ]]; then
 fi
 
 # Lint staged files
-npm run lint-staged
+npm run lint
 
 # Run license-checker
 npm run license-checker
\ No newline at end of file
-- 
2.43.0


From c274d0b3cd271a9ab2f658196e05637b9fafce6b Mon Sep 17 00:00:00 2001
From: nostrdev-com <support@nostrdev.com>
Date: Thu, 3 Apr 2025 10:32:49 +0300
Subject: [PATCH 2/6] chore: fixing pre-commit git hook

---
 .git-hooks/pre-commit | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit
index ec280c3..c1b19d5 100755
--- a/.git-hooks/pre-commit
+++ b/.git-hooks/pre-commit
@@ -11,7 +11,7 @@ if [[ "$BRANCH" =~ $REGEX ]]; then
 fi
 
 # Lint staged files
-npm run lint
+npm run build
 
 # Run license-checker
 npm run license-checker
\ No newline at end of file
-- 
2.43.0


From 990b81abe73a77c2bfb0d1af72e9bcb052f030b5 Mon Sep 17 00:00:00 2001
From: nostrdev-com <support@nostrdev.com>
Date: Thu, 3 Apr 2025 10:43:57 +0300
Subject: [PATCH 3/6] chore(scripts): added preinstall script

---
 package.json | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 96099ab..08640f6 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,8 @@
     "lint:fix": "eslint . --fix --ext ts --report-unused-disable-directives --max-warnings 0",
     "lint:staged": "eslint --fix --ext ts --report-unused-disable-directives --max-warnings 0",
     "lint-staged": "lint-staged",
-    "start:db": "docker compose -f mongo-docker-compose.yml up -d"
+    "start:db": "docker compose -f mongo-docker-compose.yml up -d",
+    "preinstall": "git config core.hooksPath .git-hooks"
   },
   "repository": {
     "type": "git",
-- 
2.43.0


From 87c510b9863c78a91f61294522cae1d17030d97c Mon Sep 17 00:00:00 2001
From: nostrdev-com <support@nostrdev.com>
Date: Thu, 3 Apr 2025 10:48:57 +0300
Subject: [PATCH 4/6] chore: fixing pre-commit git hook

---
 .git-hooks/pre-commit | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit
index c1b19d5..3ce5405 100755
--- a/.git-hooks/pre-commit
+++ b/.git-hooks/pre-commit
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+echo "*****pre-commit hook******"
+
 # Avoid commits to the master branch
 BRANCH=`git rev-parse --abbrev-ref HEAD`
 REGEX="^(master|main|staging|development)$"
-- 
2.43.0


From 11776c4f5c71f0e84de7ee94e57f3e57e2c56a8d Mon Sep 17 00:00:00 2001
From: nostrdev-com <support@nostrdev.com>
Date: Thu, 3 Apr 2025 10:54:17 +0300
Subject: [PATCH 5/6] chore(ci): added staging-pull-request workflow

---
 .git-hooks/pre-commit                      |  2 +-
 .gitea/workflows/staging-pull-request.yaml | 37 ++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 .gitea/workflows/staging-pull-request.yaml

diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit
index 3ce5405..194d529 100755
--- a/.git-hooks/pre-commit
+++ b/.git-hooks/pre-commit
@@ -13,7 +13,7 @@ if [[ "$BRANCH" =~ $REGEX ]]; then
 fi
 
 # Lint staged files
-npm run build
+npm run lint-staged
 
 # Run license-checker
 npm run license-checker
\ No newline at end of file
diff --git a/.gitea/workflows/staging-pull-request.yaml b/.gitea/workflows/staging-pull-request.yaml
new file mode 100644
index 0000000..8b9eece
--- /dev/null
+++ b/.gitea/workflows/staging-pull-request.yaml
@@ -0,0 +1,37 @@
+name: Open PR on Staging
+on:
+  pull_request:
+    types: [opened, edited, synchronize]
+    branches:
+      - staging
+
+jobs:
+  audit_and_check:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+
+      - name: Setup Node
+        uses: actions/setup-node@v2
+        with:
+          node-version: 20
+
+      - name: Audit
+        run: npm audit --omit=dev
+
+      - name: Install Dependencies
+        run: npm ci
+
+      - name: License check
+        run: npm run license-checker
+
+      - name: Lint check
+        run: npm run lint
+
+      - name: Formatter check
+        run: npm run formatter:check
+
+      - name: Create Build
+        run: npm run build
-- 
2.43.0


From 6b0730fd3d8adf6cc20c0d1607519a23352d1822 Mon Sep 17 00:00:00 2001
From: nostrdev-com <support@nostrdev.com>
Date: Thu, 3 Apr 2025 10:58:00 +0300
Subject: [PATCH 6/6] chore: fixed vintage type

---
 src/models/sake.ts   | 4 ++--
 src/models/spirit.ts | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/models/sake.ts b/src/models/sake.ts
index ec107ff..dfc1860 100644
--- a/src/models/sake.ts
+++ b/src/models/sake.ts
@@ -1,5 +1,5 @@
 import { ObjectId } from 'mongodb'
-import { SakeDesignation, SakeStarter, Vintage } from '../types'
+import { SakeDesignation, SakeStarter, VintageOptions } from '../types'
 import { Alpha2Code } from 'i18n-iso-countries'
 import { CurrencyCode } from 'currency-codes-ts/dist/types'
 
@@ -18,7 +18,7 @@ export class Sake {
     public yeastStrain: number,
     public alcohol: number, // alcohol percentage
     public standardDrinks100ml: number, // number representing an amount of standard drinks per bottle per 100ml
-    public vintage: Vintage, // year, nv (non-vintage) or mv (multi-vintage)
+    public vintage: number | VintageOptions, // year, nv (non-vintage) or mv (multi-vintage)
     public RRPamount: number, // 20
     public RRPcurrency: CurrencyCode, // USD
     public description: string, // detailed description of the product
diff --git a/src/models/spirit.ts b/src/models/spirit.ts
index 45c0d53..864457d 100644
--- a/src/models/spirit.ts
+++ b/src/models/spirit.ts
@@ -1,5 +1,5 @@
 import { ObjectId } from 'mongodb'
-import { SpiritType, SpiritVariant, Ingredient, Vintage } from '../types'
+import { SpiritType, SpiritVariant, Ingredient, VintageOptions } from '../types'
 import { Alpha2Code } from 'i18n-iso-countries'
 import { CurrencyCode } from 'currency-codes-ts/dist/types'
 
@@ -17,7 +17,7 @@ export class Spirit {
     public ingredients: Ingredient[], // an array of ingredients(flavouring)
     public alcohol: number, // alcohol percentage
     public standardDrinks100ml: number, // number representing an amount of standard drinks per bottle
-    public vintage: Vintage, // year, nv (non-vintage) or mv (multi-vintage)
+    public vintage: number | VintageOptions, // year, nv (non-vintage) or mv (multi-vintage)
     public RRPamount: number, // 20
     public RRPcurrency: CurrencyCode, // USD
     public description: string, // detailed description of the product
-- 
2.43.0