Skip to content

Commit 991a6cf

Browse files
JanJan
andauthored
CM-336: remove field payment poin as mandatory in payroll (#16)
Co-authored-by: Jan <[email protected]>
1 parent 7b7c2d1 commit 991a6cf

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

payroll/gql_mutations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PayrollStatusEnum(graphene.Enum):
3535

3636
name = graphene.String(required=True, max_length=255)
3737
benefit_plan_id = graphene.UUID(required=True)
38-
payment_point_id = graphene.UUID(required=True)
38+
payment_point_id = graphene.UUID(required=False)
3939
status = graphene.Field(PayrollStatusEnum, required=True)
4040
payment_method = graphene.String(required=True, max_length=255)
4141
included_unpaid = graphene.Boolean(required=True)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 3.2.21 on 2023-10-06 07:55
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
('payroll', '0008_historicalpaymentadaptorhistory_paymentadaptorhistory'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='payroll',
18+
name='payment_point',
19+
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='payroll.paymentpoint'),
20+
),
21+
]

payroll/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PaymentPoint(HistoryModel):
2323
class Payroll(HistoryBusinessModel):
2424
name = models.CharField(max_length=255, blank=False, null=False)
2525
benefit_plan = models.ForeignKey(BenefitPlan, on_delete=models.DO_NOTHING)
26-
payment_point = models.ForeignKey(PaymentPoint, on_delete=models.DO_NOTHING)
26+
payment_point = models.ForeignKey(PaymentPoint, on_delete=models.DO_NOTHING, null=True)
2727
status = models.CharField(
2828
max_length=100, choices=PayrollStatus.choices, default=PayrollStatus.CREATED, null=False
2929
)

0 commit comments

Comments
 (0)