Advanced Nest.js Backend Development Project - 21/05/2024 23:37 EDT
Budget: ₹600 – ₹1,500 INR
This is the variant table with these fields
CREATE TABLE public.variant (
id varchar(255) NOT NULL DEFAULT uuid_generate_v4(),
name_lang json NOT NULL DEFAULT '{}'::json,
data_area varchar(255) NULL,
description json NULL DEFAULT '{}'::json,
"type" bit(1) NULL,
active bool NULL,
created_by varchar(128) NOT NULL DEFAULT 'system'::character
varying,
created_on timestamp NOT NULL DEFAULT now(),
updated_by varchar(128) NOT NULL DEFAULT 'system'::character
varying,
updated_on timestamp NOT NULL DEFAULT now(),
CONSTRAINT category_pkey_1 PRIMARY KEY (id)
);
this is the variant data table with these fields
CREATE TABLE public.variant_data (
id varchar(255) NOT NULL DEFAULT uuid_generate_v4(),
name_lang json NOT NULL DEFAULT '{}'::json,
data_area varchar(255) NULL,
short_description json NOT NULL DEFAULT '{}'::json,
"type" bit(1) NULL,
active bool NULL,
created_by varchar(128) NOT NULL DEFAULT 'system'::character
varying,
created_on timestamp NOT NULL DEFAULT now(),
updated_by varchar(128) NOT NULL DEFAULT 'system'::character
varying,
updated_on timestamp NOT NULL DEFAULT now(),
code varchar NOT NULL,
hex varchar NULL,
variant_id varchar(255) NOT NULL,
parent_variant_id varchar(255) NULL,
long_description json NOT NULL DEFAULT '{}'::json,
approved_by varchar NOT NULL,
web_image varchar NULL,
mobile_image varchar NULL,
CONSTRAINT variant_data_variant_fk FOREIGN KEY (variant_id)
REFERENCES public.variant(id) ON DELETE RESTRICT
);
this is the sku with these fields
CREATE TABLE public.sku (
id varchar(255) NOT NULL DEFAULT uuid_generate_v4(),
name_lang json NOT NULL DEFAULT '{}'::json,
short_description json NULL DEFAULT '{}'::json,
active bool NULL,
created_by varchar(128) NOT NULL DEFAULT 'system'::character varying,
created_on timestamp NOT NULL DEFAULT now(),
modified_by varchar(128) NOT NULL DEFAULT 'system'::character varying,
modified_on timestamp NOT NULL DEFAULT now(),
code varchar NULL,
product_id varchar NULL,
variants_data varchar NULL,
long_description json NOT NULL DEFAULT '{}'::json,
approved_by varchar NULL,
web_image varchar NULL,
mobile_image varchar NULL,
CONSTRAINT sku_pk PRIMARY KEY (id)
);
what we want is we need to pass the id of variant in the variant data table as variant and
the id of data variant we need to pass it to sku id create CRUD APIS for three of these and
pass the relationships also
CREATE TABLE public.variant (
id varchar(255) NOT NULL DEFAULT uuid_generate_v4(),
name_lang json NOT NULL DEFAULT '{}'::json,
data_area varchar(255) NULL,
description json NULL DEFAULT '{}'::json,
"type" bit(1) NULL,
active bool NULL,
created_by varchar(128) NOT NULL DEFAULT 'system'::character
varying,
created_on timestamp NOT NULL DEFAULT now(),
updated_by varchar(128) NOT NULL DEFAULT 'system'::character
varying,
updated_on timestamp NOT NULL DEFAULT now(),
CONSTRAINT category_pkey_1 PRIMARY KEY (id)
);
this is the variant data table with these fields
CREATE TABLE public.variant_data (
id varchar(255) NOT NULL DEFAULT uuid_generate_v4(),
name_lang json NOT NULL DEFAULT '{}'::json,
data_area varchar(255) NULL,
short_description json NOT NULL DEFAULT '{}'::json,
"type" bit(1) NULL,
active bool NULL,
created_by varchar(128) NOT NULL DEFAULT 'system'::character
varying,
created_on timestamp NOT NULL DEFAULT now(),
updated_by varchar(128) NOT NULL DEFAULT 'system'::character
varying,
updated_on timestamp NOT NULL DEFAULT now(),
code varchar NOT NULL,
hex varchar NULL,
variant_id varchar(255) NOT NULL,
parent_variant_id varchar(255) NULL,
long_description json NOT NULL DEFAULT '{}'::json,
approved_by varchar NOT NULL,
web_image varchar NULL,
mobile_image varchar NULL,
CONSTRAINT variant_data_variant_fk FOREIGN KEY (variant_id)
REFERENCES public.variant(id) ON DELETE RESTRICT
);
this is the sku with these fields
CREATE TABLE public.sku (
id varchar(255) NOT NULL DEFAULT uuid_generate_v4(),
name_lang json NOT NULL DEFAULT '{}'::json,
short_description json NULL DEFAULT '{}'::json,
active bool NULL,
created_by varchar(128) NOT NULL DEFAULT 'system'::character varying,
created_on timestamp NOT NULL DEFAULT now(),
modified_by varchar(128) NOT NULL DEFAULT 'system'::character varying,
modified_on timestamp NOT NULL DEFAULT now(),
code varchar NULL,
product_id varchar NULL,
variants_data varchar NULL,
long_description json NOT NULL DEFAULT '{}'::json,
approved_by varchar NULL,
web_image varchar NULL,
mobile_image varchar NULL,
CONSTRAINT sku_pk PRIMARY KEY (id)
);
what we want is we need to pass the id of variant in the variant data table as variant and
the id of data variant we need to pass it to sku id create CRUD APIS for three of these and
pass the relationships also