Revisión de código para subir a producción
This commit is contained in:
parent
9300868ce3
commit
56410d43e3
@ -55,7 +55,7 @@ export class Article extends AggregateRoot<IArticleProps> implements IArticle {
|
||||
return this._id;
|
||||
}
|
||||
|
||||
get catalog_name(): Slug {
|
||||
get catalog_name(): Name {
|
||||
return this.props.catalog_name;
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,32 @@
|
||||
import { RepositoryManager } from "@/contexts/common/domain";
|
||||
import { IContext } from "@/contexts/common/infrastructure";
|
||||
import { createSequelizeAdapter } from "@/contexts/common/infrastructure/sequelize";
|
||||
import { Dealer, IQuoteReferenceGeneratorService } from "../domain";
|
||||
|
||||
export interface ISalesContext extends IContext {
|
||||
services: {
|
||||
services?: {
|
||||
QuoteReferenceGeneratorService: IQuoteReferenceGeneratorService;
|
||||
};
|
||||
dealer?: Dealer;
|
||||
}
|
||||
|
||||
export class SalesContext {
|
||||
private static instance: SalesContext | null = null;
|
||||
|
||||
public static getInstance(): ISalesContext {
|
||||
if (!SalesContext.instance) {
|
||||
SalesContext.instance = new SalesContext({
|
||||
adapter: createSequelizeAdapter(),
|
||||
repositoryManager: RepositoryManager.getInstance(),
|
||||
});
|
||||
}
|
||||
|
||||
return SalesContext.instance.context;
|
||||
}
|
||||
|
||||
private context: ISalesContext;
|
||||
|
||||
private constructor(context: ISalesContext) {
|
||||
this.context = context;
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ export const UpdateQuotePresenter: IUpdateQuotePresenter = {
|
||||
status: quote.status.toString(),
|
||||
date: quote.date.toISO8601(),
|
||||
reference: quote.reference.toString(),
|
||||
customer_reference: quote.customerReference.toString(),
|
||||
customer_information: quote.customer.toString(),
|
||||
lang_code: quote.language.toString(),
|
||||
currency_code: quote.currency.toString(),
|
||||
|
||||
@ -70,7 +70,7 @@ class DealerMapper
|
||||
default_notes: source.additionalInfo.get("default_notes")?.toString() ?? "",
|
||||
default_legal_terms: source.additionalInfo.get("default_legal_terms")?.toString() ?? "",
|
||||
default_quote_validity: source.additionalInfo.get("default_quote_validity")?.toString() ?? "",
|
||||
default_tax: source.additionalInfo.get("default_tax")?.toString() ?? "",
|
||||
default_tax: Number(source.additionalInfo.get("default_tax") ?? 0),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
import { SalesContext } from "@/contexts/sales/infrastructure";
|
||||
import { registerDealerRepository } from "@/contexts/sales/infrastructure/Dealer.repository";
|
||||
import {
|
||||
initializeAdmin,
|
||||
initializeSampleDealer,
|
||||
initializeSampleUser,
|
||||
} from "@/contexts/users/application/userServices";
|
||||
import { UserContext } from "@/contexts/users/infrastructure/User.context";
|
||||
import { registerUserRepository } from "@/contexts/users/infrastructure/User.repository";
|
||||
|
||||
export const insertUsers = async () => {
|
||||
const context = UserContext.getInstance();
|
||||
const context = SalesContext.getInstance();
|
||||
|
||||
registerUserRepository(context);
|
||||
registerDealerRepository(context);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user