Refactor code structure for improved readability and maintainability
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-06 07:37:59 +02:00
parent e4f201ea36
commit 969dafdbc6
273 changed files with 11357 additions and 39 deletions
+6
View File
@@ -0,0 +1,6 @@
export declare class CreateIngredientDto {
productId: number;
quantity: number;
unit: string;
note?: string;
}
+34
View File
@@ -0,0 +1,34 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateIngredientDto = void 0;
const class_validator_1 = require("class-validator");
class CreateIngredientDto {
}
exports.CreateIngredientDto = CreateIngredientDto;
__decorate([
(0, class_validator_1.IsNumber)(),
__metadata("design:type", Number)
], CreateIngredientDto.prototype, "productId", void 0);
__decorate([
(0, class_validator_1.IsNumber)(),
__metadata("design:type", Number)
], CreateIngredientDto.prototype, "quantity", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateIngredientDto.prototype, "unit", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateIngredientDto.prototype, "note", void 0);
//# sourceMappingURL=create-ingredient.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"create-ingredient.dto.js","sourceRoot":"","sources":["../../../src/recipes/dto/create-ingredient.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiE;AAEjE,MAAa,mBAAmB;CAa/B;AAbD,kDAaC;AAXC;IADC,IAAA,0BAAQ,GAAE;;sDACO;AAGlB;IADC,IAAA,0BAAQ,GAAE;;qDACM;AAGjB;IADC,IAAA,0BAAQ,GAAE;;iDACE;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACG"}
@@ -0,0 +1,6 @@
export declare class CreateRecipeIngredientDto {
productId: number;
quantity: number;
unit: string;
note?: string;
}
@@ -0,0 +1,35 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateRecipeIngredientDto = void 0;
const class_validator_1 = require("class-validator");
class CreateRecipeIngredientDto {
}
exports.CreateRecipeIngredientDto = CreateRecipeIngredientDto;
__decorate([
(0, class_validator_1.IsInt)(),
__metadata("design:type", Number)
], CreateRecipeIngredientDto.prototype, "productId", void 0);
__decorate([
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(0),
__metadata("design:type", Number)
], CreateRecipeIngredientDto.prototype, "quantity", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeIngredientDto.prototype, "unit", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeIngredientDto.prototype, "note", void 0);
//# sourceMappingURL=create-recipe-ingredient.dto.js.map
@@ -0,0 +1 @@
{"version":3,"file":"create-recipe-ingredient.dto.js","sourceRoot":"","sources":["../../../src/recipes/dto/create-recipe-ingredient.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6E;AAE7E,MAAa,yBAAyB;CAcrC;AAdD,8DAcC;AAZC;IADC,IAAA,uBAAK,GAAE;;4DACW;AAInB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;;2DACW;AAGlB;IADC,IAAA,0BAAQ,GAAE;;uDACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACG"}
+21
View File
@@ -0,0 +1,21 @@
declare class CreateRecipeIngredientDto {
productId?: number;
rawName: string;
rawLine?: string;
quantity?: number;
unit?: string;
note?: string;
matchConfidence?: number;
matchSource?: string;
alternativeProductIds?: number[];
}
export declare class CreateRecipeDto {
name: string;
description?: string;
instructions?: string;
imageUrl?: string;
servings?: number;
isPublic?: boolean;
ingredients: CreateRecipeIngredientDto[];
}
export {};
+104
View File
@@ -0,0 +1,104 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateRecipeDto = void 0;
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
class CreateRecipeIngredientDto {
}
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsInt)(),
__metadata("design:type", Number)
], CreateRecipeIngredientDto.prototype, "productId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeIngredientDto.prototype, "rawName", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeIngredientDto.prototype, "rawLine", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(0),
__metadata("design:type", Number)
], CreateRecipeIngredientDto.prototype, "quantity", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeIngredientDto.prototype, "unit", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeIngredientDto.prototype, "note", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(0),
__metadata("design:type", Number)
], CreateRecipeIngredientDto.prototype, "matchConfidence", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeIngredientDto.prototype, "matchSource", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.IsInt)({ each: true }),
__metadata("design:type", Array)
], CreateRecipeIngredientDto.prototype, "alternativeProductIds", void 0);
class CreateRecipeDto {
}
exports.CreateRecipeDto = CreateRecipeDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeDto.prototype, "instructions", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateRecipeDto.prototype, "imageUrl", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsInt)(),
(0, class_validator_1.Min)(1),
__metadata("design:type", Number)
], CreateRecipeDto.prototype, "servings", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], CreateRecipeDto.prototype, "isPublic", void 0);
__decorate([
(0, class_validator_1.IsArray)(),
(0, class_validator_1.ArrayMinSize)(1),
(0, class_validator_1.ValidateNested)({ each: true }),
(0, class_transformer_1.Type)(() => CreateRecipeIngredientDto),
__metadata("design:type", Array)
], CreateRecipeDto.prototype, "ingredients", void 0);
//# sourceMappingURL=create-recipe.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"create-recipe.dto.js","sourceRoot":"","sources":["../../../src/recipes/dto/create-recipe.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAUyB;AACzB,yDAAyC;AAEzC,MAAM,yBAAyB;CAsC9B;AAnCC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;4DACW;AAGnB;IADC,IAAA,0BAAQ,GAAE;;0DACM;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0DACM;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;;2DACW;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACG;AAKd;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;;kEACkB;AAIzB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;8DACU;AAKrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,uBAAK,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;wEACW;AAGnC,MAAa,eAAe;CA8B3B;AA9BD,0CA8BC;AA5BC;IADC,IAAA,0BAAQ,GAAE;;6CACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACW;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACO;AAKlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;iDACW;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;iDACO;AAMnB;IAJC,IAAA,yBAAO,GAAE;IACT,IAAA,8BAAY,EAAC,CAAC,CAAC;IACf,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC;;oDACI"}
+3
View File
@@ -0,0 +1,3 @@
export declare class ParseMarkdownDto {
markdown: string;
}
+22
View File
@@ -0,0 +1,22 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParseMarkdownDto = void 0;
const class_validator_1 = require("class-validator");
class ParseMarkdownDto {
}
exports.ParseMarkdownDto = ParseMarkdownDto;
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.MinLength)(1),
__metadata("design:type", String)
], ParseMarkdownDto.prototype, "markdown", void 0);
//# sourceMappingURL=parse-markdown.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"parse-markdown.dto.js","sourceRoot":"","sources":["../../../src/recipes/dto/parse-markdown.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsD;AAEtD,MAAa,gBAAgB;CAI5B;AAJD,4CAIC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;kDACK"}
@@ -0,0 +1,3 @@
export declare class SetRecipeVisibilityDto {
isPublic: boolean;
}
+21
View File
@@ -0,0 +1,21 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SetRecipeVisibilityDto = void 0;
const class_validator_1 = require("class-validator");
class SetRecipeVisibilityDto {
}
exports.SetRecipeVisibilityDto = SetRecipeVisibilityDto;
__decorate([
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], SetRecipeVisibilityDto.prototype, "isPublic", void 0);
//# sourceMappingURL=set-recipe-visibility.dto.js.map
@@ -0,0 +1 @@
{"version":3,"file":"set-recipe-visibility.dto.js","sourceRoot":"","sources":["../../../src/recipes/dto/set-recipe-visibility.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4C;AAE5C,MAAa,sBAAsB;CAGlC;AAHD,wDAGC;AADC;IADC,IAAA,2BAAS,GAAE;;wDACO"}
+3
View File
@@ -0,0 +1,3 @@
export declare class ShareRecipeDto {
username: string;
}
+22
View File
@@ -0,0 +1,22 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShareRecipeDto = void 0;
const class_validator_1 = require("class-validator");
class ShareRecipeDto {
}
exports.ShareRecipeDto = ShareRecipeDto;
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.MinLength)(2),
__metadata("design:type", String)
], ShareRecipeDto.prototype, "username", void 0);
//# sourceMappingURL=share-recipe.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"share-recipe.dto.js","sourceRoot":"","sources":["../../../src/recipes/dto/share-recipe.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsD;AAEtD,MAAa,cAAc;CAI1B;AAJD,wCAIC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;gDACK"}