Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore) t1supplier and producer required for sourcing locations #1052

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -430,22 +430,22 @@ export class CreateScenarioInterventionDtoV2 {
newIndicatorCoefficients?: IndicatorCoefficientsDtoV2;

@IsUUID()
@IsOptional()
@ApiPropertyOptional({
@IsNotEmpty()
@ApiProperty({
description: `Id of the New Supplier`,
type: String,
example: 'bc5e4933-cd9a-4afc-bd53-56941b8adc111',
})
newT1SupplierId?: string;
newT1SupplierId!: string;

@IsUUID()
@IsOptional()
@ApiPropertyOptional({
@IsNotEmpty()
@ApiProperty({
description: `Id of the New Producer`,
type: String,
example: 'bc5e4933-cd9a-4afc-bd53-56941b8adc222',
})
newProducerId?: string;
newProducerId!: string;

@ValidateIf(
(dto: CreateScenarioInterventionDto) =>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class SourcingLocation extends TimestampedBaseEntity {
t1Supplier: Supplier;

@Index()
@Column({ nullable: true })
@Column()
t1SupplierId?: string;

@ManyToOne(
Expand All @@ -185,7 +185,7 @@ export class SourcingLocation extends TimestampedBaseEntity {
producer: Supplier;

@Index()
@Column({ nullable: true })
@Column()
producerId?: string;

@ManyToOne(
Expand Down
1 change: 1 addition & 0 deletions api/test/entity-mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ async function createSourcingLocation(
additionalData: Partial<SourcingLocation> = {},
): Promise<SourcingLocation> {
const material: Material = await createMaterial();

const defaultData: DeepPartial<SourcingLocation> = {
title: 'test sourcing location',
locationAddressInput: 'pqrst',
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ describe('Sourcing Data import', () => {
expect(businessUnitsRoots).toHaveLength(1);

const suppliers: Supplier[] = await supplierRepository.find();
expect(suppliers).toHaveLength(5);
expect(suppliers).toHaveLength(6);
const suppliersRoots: Supplier[] = await supplierRepository.findRoots();
expect(suppliersRoots).toHaveLength(4);
expect(suppliersRoots).toHaveLength(5);

const sourcingRecords: SourcingRecord[] =
await sourcingRecordRepository.find();
Expand Down